posthog-js 1.429.0 → 1.429.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +4 -4
package/dist/array.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){var t=["type"],e=["retriesPerformedSoFar"],i=["$set_once","$set"];function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},n.apply(null,arguments)}function s(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function o(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var o=t.apply(e,i);function a(t){s(o,r,n,a,l,"next",t)}function l(t){s(o,r,n,a,l,"throw",t)}a(void 0)})}}!function(s){var a="u">typeof window?window:void 0,l="u">typeof globalThis?globalThis:a,u=null==l?void 0:l.navigator,h=null==l?void 0:l.document,d=null==l?void 0:l.location,v=null==l?void 0:l.fetch,c=null!=l&&l.XMLHttpRequest&&"withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:void 0,f=null==l?void 0:l.AbortController,p=null==l?void 0:l.CompressionStream,g=null==u?void 0:u.userAgent;function m(){return!(!a||!1===a.navigator.onLine)}var y="undefined"!=typeof globalThis?globalThis:a;y&&"undefined"==typeof self&&(y.self=y),y&&"undefined"==typeof File&&(y.File=function(){});var b=null!=a?a:{},_="$people_distinct_id",w="distinct_id",k="$device_id",S="$device_model",x="__alias",C="__cmpns",T="$fbc",M="$fbc_persistence",I="__timers",E="$autocapture_disabled_server_side",R="$heatmaps_enabled_server_side",A="$exception_capture_enabled_server_side",P="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",O="$web_vitals_enabled_server_side",D="$dead_clicks_enabled_server_side",L="$product_tours_enabled_server_side",N="$logs_capture_enabled_server_side",q="$web_vitals_allowed_metrics",j="$session_recording_remote_config",B="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",U="$replay_override_linked_flag",W="$replay_override_url_trigger",V="$replay_override_event_trigger",G="$sesid",Z="$session_is_sampled",J="$session_past_minimum_duration",Q="$session_recording_url_trigger_activated_session",K="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",Y="$posthog_sr_group_url_trigger_",tt="$posthog_sr_group_sampling_",et="$debug_first_full_snapshot_timestamp",it="$sess_rec_flush_size",rt="$enabled_feature_flags",nt="$active_feature_flags",st="$early_access_features",ot="$feature_flag_details",at="$feature_flag_payloads",lt="$feature_flag_request_id",ut="$minimal_flag_called_events",ht="$override_feature_flags",dt="$override_feature_flag_payloads",vt="$stored_person_properties",ct="$stored_group_properties",ft="$groups",pt="$surveys",gt="$surveys_loaded_at",mt="$surveys_activated",yt="$surveys_activated_session",bt="$surveys_activated_timestamps",_t="ph_product_tours",wt="$product_tours_activated",kt="$product_tours_activated_session",St="$conversations_widget_session_id",xt="$conversations_ticket_id",Ct="$conversations_widget_state",Tt="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Et="$feature_flag_errors",Rt="$feature_flag_evaluated_at",At="$user_state",Pt="$client_session_props",Ft="$capture_rate_limit",Ot="$initial_campaign_params",$t="$initial_referrer_info",Dt="$initial_person_info",Lt="$epp",Nt="$posthog_cookieless",qt="$cookieless_mode",jt="$sdk_debug_extensions_init_method",Bt="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Ut="$sdk_debug_replay_linked_flag_trigger_status",Wt="$sdk_debug_replay_matched_recording_trigger_groups",Vt="$sdk_debug_replay_pending_trigger_conditions",Gt="$sdk_debug_replay_remote_trigger_matching_config",Zt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Qt="$sdk_debug_rrweb_attached",Kt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",Yt="PostHog loadExternalDependency extension not found.",te="anonymous",ee="identified",ie="identified_only",re="visibilitychange",ne="beforeunload",se="$pageview",oe="$pageleave",ae="$identify",le="$groupidentify",ue=function(t){return 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}({}),he=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),de="min_length",ve="max_length",ce=["$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"],fe=["token"];function pe(t,e){return-1!==t.indexOf(e)}var ge=function(t){return t.trim()},me=function(t){return t.replace(/^\$/,"")};function ye(t){var e,i=[];return null!==(e=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}}))&&void 0!==e?e:"null"}var be=Object.prototype,_e=be.hasOwnProperty,we=be.toString,ke=Array.isArray||function(t){return"[object Array]"===we.call(t)},Se=t=>"function"==typeof t,xe=t=>t===Object(t)&&!ke(t),Ce=t=>{if(xe(t)){for(var e in t)if(_e.call(t,e))return!1;return!0}return!1},Te=t=>void 0===t,Me=t=>"[object String]"==we.call(t),Ie=t=>Me(t)&&0===t.trim().length,Ee=t=>null===t,Re=t=>Te(t)||Ee(t),Ae=t=>"[object Number]"==we.call(t)&&t==t,Pe=t=>Ae(t)&&t>0,Fe=t=>"[object Boolean]"===we.call(t),Oe=t=>t instanceof FormData,$e=t=>pe(ce,t),De=t=>pe(fe,t);function Le(t){return null===t||"object"!=typeof t}function Ne(t,e){return{}.toString.call(t)==="[object "+e+"]"}function qe(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Be(t,Error)}}function je(t){return"u">typeof Event&&Be(t,Event)}function Be(t,e){try{return t instanceof e}catch(t){return!1}}var He=[!0,"true",1,"1","yes"],ze=t=>pe(He,t),Ue=[!1,"false",0,"0","no"],We=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","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"],Ve=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return We.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function Ge(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Ae(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Ge(null!=n?n:i,e,i,r))}var Ze=class{constructor(t){this.C={},this.I=t.I,this.R=Ge(t.bucketSize,0,100,t.A),this.O=Ge(t.refillRate,0,this.R,t.A),this.N=Ge(t.refillInterval,0,864e5,t.A)}F(t,e){var i=Math.floor((e-t.lastAccess)/this.N);i>0&&(t.tokens=Math.min(t.tokens+i*this.O,this.R),t.lastAccess=t.lastAccess+i*this.N)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.C[r];return n?this.F(n,i):this.C[r]=n={tokens:this.R,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},Je="Mobile",Qe="Android",Ke="Tablet",Xe="Android Tablet",Ye="iPad",ti="Apple Watch",ei="Safari",ii="BlackBerry",ri="Samsung Internet",ni="Chrome",si="Chrome iOS",oi="Internet Explorer",ai="Internet Explorer Mobile",li="Opera",ui="Microsoft Edge",hi="Firefox",di="Firefox iOS",vi="Nintendo",ci="PlayStation",fi="Xbox",pi="Android Mobile",gi="Mobile Safari",mi="Windows",yi="Windows Phone",bi="Nokia",_i="Ouya",wi="Generic "+Je.toLowerCase(),ki="Generic "+Ke.toLowerCase(),Si="Konqueror",xi="Oculus Browser",Ci="Vivaldi",Ti="Yandex",Mi="Whale",Ii="DuckDuckGo",Ei="Pale Moon",Ri="Waterfox",Ai="Brave",Pi="Claude",Fi="Codex",Oi="ChatGPT",$i="Google Search App",Di=new RegExp("Version/(\\d+(\\.\\d+)?)"),Li=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Ni=new RegExp(fi,"i"),qi=new RegExp("PlayStation \\w+","i"),ji=new RegExp("Nintendo \\w+","i"),Bi=new RegExp("BlackBerry|PlayBook|BB10","i"),Hi={"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"},zi=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Ai:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&pe(t,"GSA/")?$i:pe(t," OPR/")&&pe(t,"Mini")?"Opera Mini":pe(t," OPR/")?li:Bi.test(t)?ii:pe(t,"IEMobile")||pe(t,"WPDesktop")?ai:pe(t,"OculusBrowser")?xi:pe(t,"SamsungBrowser")?ri:pe(t,"Edge")||pe(t,"Edg/")?ui:pe(t,"Vivaldi/")?Ci:pe(t,"YaBrowser/")?Ti:pe(t,"Whale/")?Mi:pe(t,"DuckDuckGo/")||pe(t,"Ddg/")?Ii:pe(t,"Claude/")?Pi:pe(t,"Codex/")?Fi:pe(t,"ChatGPT/")?Oi:pe(t,"FBIOS")?"Facebook Mobile":pe(t,"UCWEB")||pe(t,"UCBrowser")?"UC Browser":pe(t,"CriOS")?si:pe(t,"CrMo")||pe(t,ni)?ni:pe(t,Qe)&&pe(t,ei)?pi:pe(t,"FxiOS")?di:pe(t.toLowerCase(),Si.toLowerCase())?Si:pe(t,"Brave/")?Ai:((t,e)=>e&&pe(e,"Apple")||function(t){return pe(t,ei)&&!pe(t,ni)&&!pe(t,Qe)}(t))(t,e)?pe(t,Je)?gi:ei:pe(t,"PaleMoon/")?Ei:pe(t,"Waterfox/")?Ri:pe(t,hi)?hi:pe(t,"MSIE")||pe(t,"Trident/")?oi:pe(t,"Gecko")?hi:"")},Ui={[ai]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[ui]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ni]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ei]:[Di],[gi]:[Di],[li]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Si]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ii]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Di],[pi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Pi]:[Li],[Fi]:[Li],[Oi]:[Li],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[$i]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Wi=function(t,e,i,r){var n=Ui[zi(t,e,i,r)];if(Te(n))return null;for(var s=0;n.length>s;s++){var o=t.match(n[s]);if(o)return parseFloat(o[o.length-2])}return null},Vi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[fi,t&&t[1]||""]],[new RegExp(vi,"i"),[vi,""]],[new RegExp(ci,"i"),[ci,""]],[Bi,[ii,""]],[new RegExp(mi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[yi,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Hi[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mi,r]}return[mi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Te(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Qe,[t[2],t[3],t[4]||"0"].join(".")]:[Qe,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Gi=function(t){for(var e=0;Vi.length>e;e++){var i=Vi[e],r=i[1],n=i[0].exec(t),s=n&&(Se(r)?r(n,t):r);if(s)return s}return["",""]},Zi=function(t){return ji.test(t)?vi:qi.test(t)?ci:Ni.test(t)?fi:new RegExp(_i,"i").test(t)?_i:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?yi:/iPad/.test(t)?Ye:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ti:Bi.test(t)?ii:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(bi,"i").test(t)?bi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Je).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Qe:Xe:new RegExp("(pda|Mobile)","i").test(t)?wi:new RegExp(Ke,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?ki:""},Ji=function(t,e){var i,r,n,s,o=Zi(t);return o===Ye||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===ki?Ke:o===vi||o===fi||o===ci||o===_i?"Console":o===ti?"Wearable":o?Je:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Je:Ke:"Desktop"},Qi=/\bFBAV\/(\d+(?:\.\d+)*)/i,Ki=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Qi],[/\bFBAN\/EMA\b/i,"Facebook Lite",Qi],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Qi],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Xi="[Truncated]",Yi="[Unserializable]";function tr(t){for(var e="",i=0;t.length>i;i++){var r=t.charCodeAt(i);if(55296>r||r>56319)e+=56320>r||r>57343?t[i]:"�";else{var n=t.charCodeAt(i+1);56320>n||n>57343?e+="�":(e+=t[i]+t[i+1],i++)}}return e}Date,Date;var er,ir,rr,nr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sr(t,e){return"string"==typeof(i=t)&&nr.test(i)?t:e();var i}function or(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function ar(t){return t?t.split("#")[0]:t}function lr(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function ur(t,e,i){return hr.apply(this,arguments)}function hr(){return(hr=o(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=lr(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function dr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return rr&&i.length===ir?rr:(ir=i.length,rr=i.reduce((i,r)=>{er||(er={});var n=er[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a,l=null==(a=s[o])?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,er[r]=[l,u];break}}return i},{}))}}var vr=class{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var e=this;return o(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&ke(i.stacktrace.frames)&&(i.stacktrace.frames=yield e.applyModifiers(i.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,r;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),n({},t,{cause:i,stack:r})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return o(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(r=e.handled)||void 0===r||r,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,n({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:dr(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return n({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function cr(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?"?":i,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Te(r)||(s.lineno=r),Te(n)||(s.colno=n),s}var fr=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:"?",i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},pr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mr=/\((\S*)(?::(\d+))(?::(\d+))\)/,yr=(t,e)=>{var i=pr.exec(t);if(i)return cr(e,i[1],"?",+i[2],+i[3]);var r=gr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=mr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=fr(r[1]||"?",r[2]);return cr(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},br=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_r=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=_r.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||"?",o=fr(s,n);return cr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},kr=/\(error: (.*)\)/;function Sr(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function xr(t){for(var e=1;10>=e;e++){var i=t.length-2*e;if(0>i)break;for(var r=!0,n=0;e>n;n++)if(!Sr(t[i+n],t[i+e+n])){r=!1;break}if(r){for(var s=0;e>s;s++)t[i+s]=t[i+e+s];return t.length=i+e,{start:i,length:e}}}}function Cr(t,e){var i=e.start+e.length,r=Mr(t,e);r&&t.splice(i+r===t.length?i:e.start,r)}function Tr(t,e){for(var i=e.start;i>0&&Sr(t[i-1],t[i-1+e.length]);)i--;return e.start-i}function Mr(t,e){for(var i=e.start+e.length,r=i;t.length>r&&Sr(t[r],t[r-e.length]);)r++;return r-i}function Ir(t,e){var i=e[0],r=t.length-(i?Tr(t,i):0);for(var n of e)r-=Mr(t,n);return r}function Er(t,e,i){for(var r=0;t.length>r;r++){var n=t[(e+r)%t.length],s=t[(i+r)%t.length];if(n!==s)return s>n}return!1}var Rr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Me(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return Ne(t,"DOMException")}isDOMError(t){return Ne(t,"DOMError")}},Ar=class{match(t){return qe(t)}coerce(t,e){var i,r=this.getStack(t),n=void 0===r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=r?r:null==(i=e.syntheticException)?void 0:i.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}},Pr=class{match(t){return!!Ne(t,"ErrorEvent")&&(null!=t.error||this.un(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return n({},r,{stack:null!==(i=this.ln(t))&&void 0!==i?i:r.stack,synthetic:!0})}un(t){return Me(t.message)&&t.message.length>0}ln(t){var e,i,r=t,n=null!==(e=r.lineno)&&void 0!==e?e:0,s=null!==(i=r.colno)&&void 0!==i?i:0;if(Me(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Fr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Or=class{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Fr);return r&&(e=r[1],i=r[2]),[e,i]}},$r=["fatal","error","warning","log","info","debug"];function Dr(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}var Lr=class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(je(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Me(e)&&!Ie(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Dr(t)}isSeverityLevel(t){return Me(t)&&!Ie(t)&&$r.indexOf(t)>=0}getStack(t){try{return Me(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Me(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(qe(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Nr=class{match(t){return je(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Dr(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},qr=class{match(t){return Le(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},jr=class{match(t){return Ne(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!je(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return Le(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},Br="$message",Hr="$timestamp",zr=new Set([Br,Hr]),Ur={enabled:!0,max_bytes:32768};function Wr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Ur.enabled,max_bytes:Gr(t.max_bytes,Ur.max_bytes)}:n({},Ur)}var Vr=class{constructor(t){this.ts=[],this.es=0,this.xn=Wr(t)}setConfig(t){this.xn=Wr(t),this.rs()}add(t){var e=function(t){var e;try{e=ye(t)}catch(t){return}try{var i=JSON.parse(e);if(!xe(i))return;var r=i,n=r[Br],s=r[Hr];if(!Me(n)||0===n.trim().length)return;if(!Me(s)&&!Ae(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.xn.max_bytes||(this.ts.push({step:e.step,bytes:i}),this.es+=i,this.rs())}}getAttachable(){return this.ts.map(t=>t.step)}clear(){this.ts=[],this.es=0}size(){return this.ts.length}rs(){for(;this.es>this.xn.max_bytes&&this.ts.length>0;){var t=this.ts.shift();t&&(this.es-=t.bytes)}}};function Gr(t,e){if(!Ae(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Zr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Jr(t){return"string"==typeof t||t}function Qr(t){return"string"==typeof t?t:void 0}var Kr,Xr=["$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"],Yr="NativeGzipValidationError",tn=t=>t.length>=2&&31===t[0]&&139===t[1],en=(t,e)=>t===he.GZipJS||e===he.GZipJS||"gzip"===e,rn=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),nn=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return rn(t)||e===Yr},sn=t=>{throw or(Yr,"Native gzip produced invalid output: "+t)},on=function(){var t=o(function*(t,e){18>t.size&&sn("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());tn(i)&&8===i[2]||sn("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Kr)return Kr;Kr=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Kr[t]=e>>>0}return Kr})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&sn("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&sn("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function an(t,e,i){return ln.apply(this,arguments)}function ln(){return ln=o(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),a=s.write(r).then(()=>s.close()).catch(function(){var t=o(function*(t){try{yield s.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),l=new Response(n.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield on(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),ln.apply(this,arguments)}var un={}.propertyIsEnumerable;function hn(t,e){try{return cn(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function dn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,Fe(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt("9223372036854775808");return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);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(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==e||e.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:tr(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Xi};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?tr(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return dn(a.call(t),e,i,r+1)}catch(t){}return ke(t)?{arrayValue:{values:vn(t,e,i,r+1)}}:{kvlistValue:{values:cn(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:tr(String(t))}}function vn(t,e,i,r){for(var n=[],s=Math.min(t.length,1e3),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(Re(a))continue;n.push(dn(a,e,i,r))}catch(t){n.push({stringValue:Yi})}return t.length>o&&n.push({stringValue:Xi}),n}function cn(t,e,i,r){var n=[];for(var s in t)if(un.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(Ee(o)||Te(o))continue;n.push({key:tr(s),value:dn(o,e,i,r)})}catch(t){n.push({key:tr(s),value:{stringValue:Yi}})}}return n}function fn(t,e,i){return n({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}var pn={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var gn={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}},mn=gn.info;function yn(t){try{return tr(String(t))}catch(t){return Yi}}function bn(t,e,i,r){var s,o=gn[t.level||"info"]||mn,a=o.text,l=o.number,u=(void 0===(s=Ae(r)?r:void 0)&&(s=Date.now()),String(s)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Re(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Re(e.lastActivityTimestamp)||(h.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(h["url.full"]=e.currentUrl),e.screenName&&(h["screen.name"]=e.screenName),e.appState&&(h["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(h.feature_flags=e.activeFeatureFlags);var d=n({},h),v=t.attributes;if(v){var c=[];try{c=Object.keys(v)}catch(t){c=[]}for(var f of c){var p=void 0;try{p=v[f]}catch(t){p=Yi}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:yn(t.body)},attributes:hn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Te(t.trace_flags)||(g.flags=t.trace_flags),g}function _n(t,e,i){return fn(t,e,i)}function wn(t,e,i,r){return{resourceLogs:[{resource:{attributes:hn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var kn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.xn=e,this.A=i,this.ns=r,this.ss=n,this.ls=s,this.us=o,this.hs=null,this.ds=0,this.vs=0,this.cs=0,this.fs=0,this.ps=0,this.gs=!1,this.ys=e.maxBufferSize,this.bs=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this._s=e.flushIntervalMs,this.ws=e.maxBatchRecordsPerPost,this.ks=e.rateCapWindowMs,this.Ss=e.maxLogsPerInterval}clearQueue(){this.vs++,this._instance.setPersistedProperty(ue.LogsQueue,[])}reset(){this.xs(),this.fs=0,this.ps=0,this.gs=!1,this.cs=0,this.ws=this.xn.maxBatchRecordsPerPost}onReconnect(){this.cs=0,this.Cs()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Ts(t);if(null!==r)if(r.body){if(this.Ms()){var n={record:bn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.ns(),this.A,null==e?void 0:e.occurredAtMs)};this.ss(()=>this.Is(n))}}else this.A.info("Log was rejected in beforeSend function")}}Ts(t){var e=this.xn.beforeSend;if(!e)return t;var i=ke(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for log:",t),null}return r}Ms(){if(void 0===this.Ss)return!0;var t=Date.now(),e=t-this.fs;return this.ks>e&&e>=0||(this.fs=t,this.ps=0,this.gs=!1),this.Ss>this.ps?(this.ps++,!0):(this.gs||(this.A.warn("captureLog dropping logs: exceeded "+this.Ss+" logs per "+this.ks+"ms"),this.gs=!0),!1)}flush(){var t=this;return o(function*(){if(!t._instance.isDisabled)return t.hs||(t.hs=t.Es().finally(()=>{t.hs=null})),t.hs})()}Es(){var t=this;return o(function*(){var e;t.xs();var i=null!==(e=t._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o,a=t.vs;t.ds=0;var l=Math.min(i.length,t.ws),u=i.slice(0,l),h=wn(u.map(t=>t.record),t.Rs(),null!==(s=t.us)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.As(h);if(t.vs!==a)return;if("too-large"===d.kind&&u.length>1)t.ws=Math.max(1,Math.floor(u.length/2)),t.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.ws);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.A.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.xn.maxBatchRecordsPerPost>t.ws&&(t.ws=Math.min(t.xn.maxBatchRecordsPerPost,t.ws+1)),yield t.Ps(u.length),i=null!==(o=t._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}Ps(t){var e=this;return o(function*(){var i,r=Math.max(0,t-e.ds),n=null!==(i=e._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(ue.LogsQueue,n.slice(r)),yield e.ls()})()}Rs(){return _n(this.xn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Is(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==e?e:[];this.bs>i.length||(i.shift(),this.ds++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(ue.LogsQueue,i),this.ys>i.length?this.Fs():this.Cs()}}Fs(t){void 0===t&&(t=this._s),this.Os||(this.Os=lr(()=>{this.Os=void 0,this.Cs()},t))}$s(){var t=Math.min(Math.max(0,this.cs-1),6);return this._s*Math.pow(2,t)}Ds(){var t=this._instance.getPersistedProperty(ue.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return o(function*(){e.xs();var i=e.flush().catch(()=>{});void 0!==t?yield ur(i,t):yield i})()}flushWithTimeout(t){var e=this;return o(function*(){var i=e.flush();yield ur(i,t,()=>{i.catch(()=>{})})})()}Cs(){this.flush().then(()=>{this.cs=0},t=>{this.cs++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Ds()&&this.Fs(this.$s())})}xs(){this.Os&&(clearTimeout(this.Os),this.Os=void 0)}},Sn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function xn(t){return String(t)+"000000"}function Cn(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map(t=>JSON.stringify(t)+":"+JSON.stringify(r[t])).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}var Tn=class{constructor(t,e,i){this._instance=t,this.xn=e,this.A=i,this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Bs=0}count(t,e,i){void 0===e&&(e=1),this.Hs({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Hs({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Hs({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,e=this.hs,i=function(){var i=o(function*(){e&&(yield e.catch(()=>{})),yield t.zs()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.hs===i&&(this.hs=null)});return this.hs=i,i}drainWindow(){if(0===this.Ls.size)return null;var t=this.Ls;return this.Ls=new Map,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Us(t)}reset(){this.Bs++,this.xs(),this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set}Hs(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Ts(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?n({},e.attributes):void 0,r=Cn(e.type,e.name,e.unit,i)}catch(t){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ls.get(r);if(!s){if(!this.Ws())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ls.set(r,s)}var o=this.qs.get(e.name);void 0===o?this.qs.set(e.name,e.type):o===e.type||this.js.has(e.name)||(this.js.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Vs(s,e.value),this.Fs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ws(){return this.xn.maxSeriesPerFlush>this.Ls.size||(this.Ns||(this.Ns=!0,this.A.warn("Metric series cap reached ("+this.xn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Vs(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Sn.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Sn)]+=1}}Ts(t){var e=this.xn.beforeSend;if(!e)return t;var i=ke(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for metric:",t),null}return r}Fs(){this.Os||(this.Os=lr(()=>{this.Os=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this.xn.flushIntervalMs))}xs(){this.Os&&(clearTimeout(this.Os),this.Os=void 0)}zs(){var t=this;return o(function*(){if(0!==t.Ls.size){var e=t.Ls;t.Ls=new Map,t.Ns=!1,t.qs=new Map,t.js=new Set;var i=t.Bs,r=yield t._instance.Gs(t.Us(e));if(i===t.Bs)switch(r.kind){case"ok":return;case"retry-later":return t.Zs(e),void t.Fs();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}})()}Us(t){return e=this.Js(t),i=function(t,e,i){return fn(t,e,i)}(this.xn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:hn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Js(t){var e=xn(Date.now()),i=new Map;for(var r of t.values()){var s,o=Cn(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=n({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=hn(null!==(s=r.attributes)&&void 0!==s?s:{},this.A),u=xn(r.windowStartMs);if("count"===r.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=r.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===r.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=r.last)&&void 0!==v?v:0};a.gauge.dataPoints.push(c)}else r.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Sn})}return Array.from(i.values())}Zs(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Ls.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Ws()&&this.Ls.set(n,s)}}};function Mn(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var In="0.8.2",En={DEBUG:!1,LIB_VERSION:In,LIB_NAME:"browser-common",JS_SDK_VERSION:In},Rn=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={q(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];a&&(En.DEBUG||a.POSTHOG_DEBUG||i)&&!Te(a.console)&&a.console&&("__rrweb_original__"in a.console[e]?a.console[e].__rrweb_original__:a.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>Rn(t+" "+e,i)};return r},An=Rn("[PostHog.js]"),Pn=An.createLogger;function Fn(t,e){ke(t)&&t.forEach(e)}function On(t,e){if(!Re(t))if(ke(t))t.forEach(e);else if(Oe(t))t.forEach((t,i)=>e(t,i));else for(var i in t)_e.call(t,i)&&e(t[i],i)}var $n=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Dn(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Ln=function(t){try{return t()}catch(t){return}},Nn=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){An.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),An.critical(t)}}},qn=function(t){var e={};return On(t,function(t,i){(Me(t)&&t.length>0||Ae(t))&&(e[i]=t)}),e};function jn(t){var e=n({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var Bn=["herokuapp.com","vercel.app","netlify.app"];function Hn(t){var e=null==t?void 0:t.hostname;if(!Me(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Bn)if(i===r)return!1;return!0}function zn(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Un(t){return"ph_toolbar_internal"===t.name}var Wn=["localhost","127.0.0.1"],Vn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>qe(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,jn(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return ye(t)}},Gn=t=>{var e=null==h?void 0:h.createElement("a");return Te(e)?null:(e.href=t,e)},Zn=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return On(t,function(t,e){Te(t)||Te(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)}),n.join(e)},Jn=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!ke(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){An.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Qn=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");ke(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},Kn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Xn=(t,e)=>t>=e&&m(),Yn=(t,e,i,r)=>{if(0===t){if(m()){var n=e+1;return n===i&&r(),n}return e}return 0};function ts(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Se(r))return e;try{var n=r(e);return Me(n)&&n?n:e}catch(t){return An.error("Error in get_current_url, falling back to window.location.href",t),e}}function es(t){var e,i=null==a||null==(e=a.location)?void 0:e.href;return Te(i)?void 0:ts(t,i)}function is(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function rs(t){return!!t&&1===t.nodeType}function ns(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ss(t){return!!t&&3===t.nodeType}function os(t){return!!t&&11===t.nodeType&&rs(t.host)}function as(t){return t?ge(t).split(/\s+/):[]}function ls(t,e){var i=es(e);return!!(i&&t&&t.some(t=>i.match(t)))}function us(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return as(e)}function hs(t){return Re(t)?null:ge(t).split(/(\s+)/).filter(t=>Ls(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ds(t){var e="";return Is(t)&&!Es(t)&&t.childNodes&&t.childNodes.length&&On(t.childNodes,function(t){var i;ss(t)&&t.textContent&&(e+=null!==(i=hs(t.textContent))&&void 0!==i?i:"")}),ge(e)}function vs(t){var e;return Te(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var cs=["a","button","form","input","select","textarea","label"];function fs(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}function ps(t,e){if(Te(e))return!0;var i,r=function(t){if(e.some(e=>fs(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function gs(t){var e=t.parentNode;return!(!e||!rs(e))&&e}var ms=[".ph-no-autocapture","[data-ph-no-autocapture]"],ys=["next","previous","prev",">","<"],bs=[...ys,"+","-","−","–"],_s=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ws=[".ph-no-deadclick",".ph-no-capture"],ks=[".ph-no-rageclick",".ph-no-capture"],Ss=["","text","search","email","password","url","tel","number"];function xs(t){return!(!t||!rs(t))&&(!!ns(t,"textarea")||(ns(t,"input")?pe(Ss,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}function Cs(t,e){if(!a||Ts(t))return!1;var i,r,n,s,o;if(Fe(e)?(i=!!e&&ks,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:ks,r=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&xs(t))return!1;var l=Ms(t,!1).targetElementList;return!function(t,e){if(!1===t||Te(t))return!1;var i;if(!0===t)i=ys;else{if(!ke(t))return!1;if(t.length>10)return An.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map(t=>t.toLowerCase())}return e.some(t=>{var e=t.safeText,r=t.ariaLabel;return i.some(t=>_s(e,t)||_s(r,t))})}(r,l.map(t=>{var e;return{safeText:ds(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!ps(l,i)}var Ts=t=>!t||ns(t,"html")||!rs(t),Ms=(t,e)=>{if(!a||Ts(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!ns(n,"body");)if(os(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=gs(n);if(!s)break;if(e||cs.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=a.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function Is(t){for(var e=new Set,i=0,r=t;r.parentNode&&!ns(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=us(r);if(pe(n,"ph-sensitive")||pe(n,"ph-no-capture"))return!1}if(pe(us(t),"ph-include"))return!0;var s=t.type||"";if(Me(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Me(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function Es(t){return!!(ns(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ns(t,"select")||ns(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Rs=new 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}))$"),As=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ps=[16,15,14,13],Fs=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Os=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),$s=/[0-9A-Za-z_]/;function Ds(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Ls(t,e){if(void 0===e&&(e=!0),Re(t))return!1;if(Me(t)){if(t=ge(t),e?Rs.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(As.lastIndex=0;e=As.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ps){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Rs.test(a)&&Ds(a))return!0}}}return!1}(t))return!1;if(e?Fs.test(t):function(t){var e;for(Os.lastIndex=0;e=Os.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&$s.test(i)&&$s.test(r)))return!0}return!1}(t))return!1}return!0}function Ns(t){var e=ds(t);return Ls(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&On(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=ds(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){An.error("[AutoCapture]",t)}}),e}function js(t){return t.replace(/"|\\"/g,'\\"')}function Bs(t){var e=t.attr__class;if(e)return ke(e)?e:as(e)}var Hs=1e6;function zs(t){var e;return Math.min(Hs,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Us={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Hs,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Ws=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Vs=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Gs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Zs=t=>{Re(t)||On(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ws.includes(e)||Gs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Js=["/s/","/e/","/i/"];function Qs(t,e,i,r){if(Re(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Me(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function Ks(t,e){if(Re(t))return t;var i=t;return Ls(i,!1)||(i="[SessionRecording] "+e+" body redacted"),On(Vs,t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i="[SessionRecording] "+e+" body redacted as might contain: "+t)}),i}var Xs=new WeakSet,Ys="disabled",to="sampled",eo="active",io="buffering",ro="paused",no="lazy_loading",so="rrweb_error",oo="trigger_activated",ao="trigger_pending",lo="trigger_disabled";function uo(t,e,i,r,n,s){return 0===e?lo:(null==t?void 0:t.get_property(i?r+i:n))===s?oo:ao}function ho(t,e,i){return e.some(e=>{var r;return"regex"===e.matching&&(null!==(r=null==i?void 0:i.get(e.url))&&void 0!==r?r:new RegExp(e.url)).test(t)})}function vo(t){return t.includes("trigger_activated")?oo:t.includes("trigger_pending")?ao:lo}function co(t){var e=new Set(t);switch(e.delete(lo),e.size){case 0:return lo;case 1:return Array.from(e)[0];default:return ao}}var fo=class{constructor(t){this.j=t}triggerStatus(t){return vo(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return vo(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},po=class{constructor(t){this.j=t}triggerStatus(t){return co(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return co(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},go=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return oo}stop(){}},mo=t=>"sessionRecording"in t,yo=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,i;this.B=(mo(t)?xe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(mo(t)?xe(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){An.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){An.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return uo(this._instance,this.B.length,this.V,Y,Q,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Jt]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=es(this._instance);if(!t)return!1;try{return ho(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=es(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=ho(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=es(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=ho(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===oo,l=ho(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},bo=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ut]:t}),t}triggerStatusNoSideEffects(){var t=ao;return Re(this.linkedFlag)&&(t=lo),this.linkedFlagSeen&&(t=oo),t}onConfig(t,e){var i;if(this.linkedFlag=(mo(t)?xe(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Re(this.linkedFlag)&&!this.linkedFlagSeen){var r=Me(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Me(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(xe(i)&&r in i){var o=i[r];s=Fe(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},_o=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(mo(t)?xe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return uo(this._instance,this.K.length,this.V,X,K,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[zt]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,i){if(0!==this.K.length){var r=this.X(i)===oo,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},wo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new yo(t,e.id),this.tt=new _o(t,e.id),this.et=new bo(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map(t=>t.name),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,i);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new fo(s):new po(s)}else this.rt=new go}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===ao).map(t=>t.label)}checkEventTriggerConditions(t,e,i){this.tt.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i,r="url"===t?Y+this.group.id:X+this.group.id;null==(i=this._instance.persistence)||i.register({[r]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function ko(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Ys;if(t.urlTriggerMatching.urlBlocked)return ro;var e=!0===t.isSampled,i=new fo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?to:"trigger_activated"===i?eo:"trigger_pending"===i?io:!1===t.isSampled?Ys:eo}function So(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Ys;if(t.urlTriggerMatching.urlBlocked)return ro;var e=new po([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==lo,r=Fe(t.isSampled);return i&&"trigger_pending"===e?io:i&&"trigger_disabled"===e||r&&!t.isSampled?Ys:!0===t.isSampled?to:eo}function xo(){var t=[];return function(e,i){if(xe(i)||ke(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Co(t){var e=JSON.stringify(t,xo());return e?new Blob([e]).size:0}function To(t){if(Ee(t))return 4;if(Te(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(ke(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Te(r)||Ee(r)?4:To(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Te(l)||(o||(s+=1),o=!1,s+=a.length+3+To(l))}return s;default:return 0}}function Mo(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var i=Math.floor(t.data.length/2),r=t.sizes.slice(0,i),n=t.sizes.slice(i);return[Mo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Mo({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var Io=Uint8Array,Eo=Uint16Array,Ro=Uint32Array,Ao=new Io([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]),Po=new Io([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]),Fo=new Io([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oo=function(t,e){for(var i=new Eo(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ro(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},$o=Oo(Ao,2),Do=$o[1];$o[0][28]=258,Do[258]=28;for(var Lo=Oo(Po,0)[1],No=new Eo(32768),qo=0;32768>qo;++qo){var jo=(43690&qo)>>>1|(21845&qo)<<1;No[qo]=((65280&(jo=(61680&(jo=(52428&jo)>>>2|(13107&jo)<<2))>>>4|(3855&jo)<<4))>>>8|(255&jo)<<8)>>>1}var Bo=function(t,e,i){for(var r=t.length,n=0,s=new Eo(e);r>n;++n)++s[t[n]-1];var o,a=new Eo(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Eo(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[No[d]>>>l]=u}else for(o=new Eo(r),n=0;r>n;++n)o[n]=No[a[t[n]-1]++]>>>15-t[n];return o},Ho=new Io(288);for(qo=0;144>qo;++qo)Ho[qo]=8;for(qo=144;256>qo;++qo)Ho[qo]=9;for(qo=256;280>qo;++qo)Ho[qo]=7;for(qo=280;288>qo;++qo)Ho[qo]=8;var zo=new Io(32);for(qo=0;32>qo;++qo)zo[qo]=5;var Uo=Bo(Ho,9,0),Wo=Bo(zo,5,0),Vo=function(t){return(t/8|0)+(7&t&&1)},Go=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Eo?Eo:t instanceof Ro?Ro:Io)(i-e);return r.set(t.subarray(e,i)),r},Zo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Jo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Qo=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Io(0),0];if(1==n){var o=new Io(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new Eo(v+1),f=Ko(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort(function(t,e){return c[e.s]-c[t.s]||t.f-e.f});n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Io(c),f]},Ko=function(t,e,i){return-1==t.s?Math.max(Ko(t.l,e,i+1),Ko(t.r,e,i+1)):e[t.s]=i},Xo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Eo(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Yo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},ta=function(t,e,i){var r=i.length,n=Vo(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},ea=function(t,e,i,r,n,s,o,a,l,u,h){Zo(e,h++,i),++n[256];for(var d=Qo(n,15),v=d[0],c=d[1],f=Qo(s,15),p=f[0],g=f[1],m=Xo(v),y=m[0],b=m[1],_=Xo(p),w=_[0],k=_[1],S=new Eo(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;w.length>x;++x)S[31&w[x]]++;for(var C=Qo(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Fo[I-1]];--I);var E,R,A,P,F=u+5<<3,O=Yo(n,Ho)+Yo(s,zo)+o,D=Yo(n,v)+Yo(s,p)+o+14+3*I+Yo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&D>=F)return ta(e,h,t.subarray(l,l+u));if(Zo(e,h,1+(O>D)),h+=2,O>D){E=Bo(v,c,0),R=v,A=Bo(p,g,0),P=p;var L=Bo(T,M,0);for(Zo(e,h,b-257),Zo(e,h+5,k-1),Zo(e,h+10,I-4),h+=14,x=0;I>x;++x)Zo(e,h+3*x,T[Fo[x]]);h+=3*I;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Zo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(Zo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=Uo,R=Ho,A=Wo,P=zo;for(x=0;a>x;++x)if(r[x]>255){var B;Jo(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Zo(e,h,r[x]>>>23&31),h+=Ao[B]);var H=31&r[x];Jo(e,h,A[H]),h+=P[H],H>3&&(Jo(e,h,r[x]>>>5&8191),h+=Po[H])}else Jo(e,h,E[r[x]]),h+=R[r[x]];return Jo(e,h,E[256]),h+R[256]},ia=new Ro([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ra=new Io(0),na=function(){for(var t=new Ro(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),sa=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function oa(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=na[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new Io(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=ta(l,u,t.subarray(h,d)):(l[h]=s,u=ta(l,u,t.subarray(h,o)))}else{for(var v=ia[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Eo(32768),m=new Eo(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ro(25e3),k=new Eo(288),S=new Eo(32),x=0,C=0,T=(h=0,0),M=0,I=0;o>h;++h){var E=_(h),R=32767&h,A=m[E];if(g[R]=A,m[E]=R,h>=M){var P=o-h;if((x>7e3||T>24576)&&P>423){u=ea(t,l,0,w,k,S,C,T,I,h-I,u),T=x=C=0,I=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,D=0,L=f,N=R-A&32767;if(P>2&&E==_(h-N))for(var q=Math.min(c,P)-1,j=Math.min(32767,h),B=Math.min(258,P);j>=N&&--L&&R!=A;){if(t[h+O]==t[h+O-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>O){if(O=H,D=N,H>q)break;var z=Math.min(N,H-2),U=0;for(F=0;z>F;++F){var W=h-N+F+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Do[O]<<18|Lo[D];var G=31&Do[O],Z=31&Lo[D];C+=Ao[G]+Po[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=ea(t,l,s,w,k,S,C,T,I,h-I,u),s||(u=ta(l,u,ra))}return Go(a,0,r+Vo(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a,!l)),h=u.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&sa(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(u,e),sa(u,h-8,i.d()),sa(u,h-4,r),u}function aa(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Io(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new Io(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Go(r,0,n)}function la(t,e){var i="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var r=0;t.length>r;){var n=t[r++];128>n||e?i+=String.fromCharCode(n):224>n?i+=String.fromCharCode((31&n)<<6|63&t[r++]):240>n?i+=String.fromCharCode((15&n)<<12|(63&t[r++])<<6|63&t[r++]):(n=((15&n)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}return i}var ua=class{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,i;this.nt[t]=!0;var r=this.ft(t);null==(e=(i=this.it).onBlockedNode)||e.call(i,t,r)}},this.yt=t=>{var e=this.ft(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var i=e.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[t,e]},this.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,i,r,n,s,o,a,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.bt(e);if(e.attributes){var r,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var o=s-e.attributes.length;o>0&&(null==(r=(n=this.it).onDroppedAttributeMutations)||r.call(n,o))}var a=this.bt(e);if(0!==a||i===a){if(this.kt)return t;this.ut();var l,u,h=To(t);return h>this.ht?(null==(l=(u=this.it).onDroppedOversizedMutation)||l.call(u,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new Ze({bucketSize:null!==(i=this.it.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.it.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.vt,A:An}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var o=this.it.resyncIntervalMs;this.xt=Ae(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}},ha=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Ae(t)&&isFinite(t)&&Math.floor(t)===t});var da=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,n){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>i||0>r||0>n||e>0xffffffffffff||i>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|i>>>8,s[7]=i,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}},va=class{generate(){var t=this.generateOrAbort();if(!Te(t))return t;this.Ct=0;var e=this.generateOrAbort();if(Te(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Ae(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.Tt++,this.Tt>4398046511103&&(this.Ct++,this.Mt())}return da.fromFieldsV7(this.Ct,Math.trunc(this.Tt/Math.pow(2,30)),this.Tt&Math.pow(2,30)-1,this.It.nextUint32())}Mt(){this.Tt=1024*this.It.nextUint32()+(1023&this.It.nextUint32())}constructor(){this.Ct=0,this.Tt=0,this.It=new pa}},ca=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};a&&!Te(a.crypto)&&crypto.getRandomValues&&(ca=t=>crypto.getRandomValues(t));var fa,pa=class{nextUint32(){return this.Rt.length>this.At||(ca(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},ga=()=>ma().toString(),ma=()=>(fa||(fa=new va)).generate(),ya="",ba=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var _a=null,wa={Et(){if(!Ee(_a))return _a;if(_a=!1,h)try{var t="__ph_cookie_support_"+ga();wa.Ot(t,"xyz"),_a='"xyz"'===ha(t),wa.Dt(t)}catch(t){_a=!1}return _a},Pt(t){An.error("cookieStore error: "+t)},Lt:ha,Nt(t){var e;try{e=JSON.parse(wa.Lt(t))||{}}catch(t){}return e},Ot(t,e,i,r,n){if(!h)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),ya)return ya;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+ga();!ya&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",ya=s)}return ya}(t);if(!i){var r=(t=>{var e=t.match(ba);return e?e[0]:""})(t);r!==i&&An.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&An.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},Dt(t,e){if(null!=h&&h.cookie)try{wa.Ot(t,"",-1,e)}catch(t){return}}},ka=null,Sa={Et(){if(!Ee(ka))return ka;var t=!0;if(Te(a))t=!1;else try{var e="__mplssupport__";Sa.Ot(e,"xyz"),'"xyz"'!==Sa.Lt(e)&&(t=!1),Sa.Dt(e)}catch(e){t=!1}return t||An.error("localStorage unsupported; falling back to cookie store"),ka=t,t},Pt(t){An.error("localStorage error: "+t)},Lt(t){try{return null==a?void 0:a.localStorage.getItem(t)}catch(t){Sa.Pt(t)}return null},Nt(t){try{return JSON.parse(Sa.Lt(t))||{}}catch(t){}return null},Ot(t,e){try{return null==a||a.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Sa.Pt(t)}return!1},Dt(t){try{null==a||a.localStorage.removeItem(t)}catch(t){Sa.Pt(t)}}},xa=[vt,nt,rt,ot,at,lt,Rt,Et,Mt],Ca=[k,w,G,Z,Lt,Dt,M,At],Ta=t=>t+"_cpm",Ma=["__proto__","constructor","prototype"],Ia=t=>{if(!xe(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Ma.indexOf(i)&&(e[i]=t[i])}),e},Ea=function(t,e){void 0===e&&(e=[]);var i={};return[...Ca,...e].forEach(e=>{var r=t[e];Te(r)||Ee(r)||""===r||(i[e]=r)}),i},Ra=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Aa=(t,e)=>({p:e,f:Ra(JSON.stringify(t))}),Pa=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=wa.Nt(Ta(t)),r=(null==i?void 0:i.f)===Ra(e)&&ke(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Fa=(t,e)=>e+"|"+(wa.Lt(Ta(t))||""),Oa={},$a={Et:()=>!0,Pt(t){An.error("memoryStorage error: "+t)},Lt:t=>t in Oa?Oa[t]:null,Nt:t=>t in Oa?Oa[t]:null,Ot:(t,e)=>(Oa[t]=e,!0),Dt(t){delete Oa[t]}},Da=null,La={Et(){if(!Ee(Da))return Da;if(Da=!0,Te(a))Da=!1;else try{var t="__support__";La.Ot(t,"xyz"),'"xyz"'!==La.Lt(t)&&(Da=!1),La.Dt(t)}catch(t){Da=!1}return Da},Pt(t){An.error("sessionStorage error: ",t)},Lt(t){try{return null==a?void 0:a.sessionStorage.getItem(t)}catch(t){La.Pt(t)}return null},Nt(t){try{return JSON.parse(La.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==a||a.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){La.Pt(t)}return!1},Dt(t){try{null==a||a.sessionStorage.removeItem(t)}catch(t){La.Pt(t)}}};En.DEBUG=!1,En.LIB_VERSION="1.429.0",En.LIB_NAME="web";var Na=En,qa=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ft=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(it,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ft(it);return xe(e=i)&&Me(e.sessionId)&&Ae(e.size)&&i.sessionId===t?i.size:0}};function ja(t,e){return function(t){for(var e=0,i=0;t.length>i;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;return Math.abs(e)}(t)%100<Ge(100*e,0,100,An)}function Ba(t){return"$survey_response_"+t}function Ha(t,e){if(!e)return null;var i=t[Ba(e)];return ke(i)?[...i]:i}function za(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Te(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=Ha(t,e.id);Te(s)||(r[n]=s)}}),n({$survey_questions:e.questions.map(e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:Ha(t,e.id)}})},t,r)}function Ua(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function Wa(t){return"string"==typeof t&&t.trim()?t.trim():null}function Va(t){return t.toLowerCase()}function Ga(t,e,i){if(!t||!e)return null;var r=Va(e),n=Object.keys(t).find(t=>Va(t)===r);if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find(t=>Va(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var Za=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ja(t,e,i){var r,s=Ga(t.translations,e,i),o=n({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];if(u)if(null==i||i.info("Applying survey-level translation for language: "+s),Te(u.name)||(o.name=u.name,a=!0),o.appearance){var h=n({},o.appearance);for(var d of Za){var v=u[d];Te(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return Za.some(e=>!Te(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,s=Ga(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=n({},t),l=!1;return Te(o.question)||(a.question=o.question,l=!0),Te(o.description)||(a.description=o.description,l=!0),Te(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Te(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Te(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Te(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return ke(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return s||(g=(null==(r=c.find(t=>t.matchedKey))?void 0:r.matchedKey)||null),p&&(o.questions=f,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||g:null}}function Qa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ka(t){var e;return Qa(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Xa=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Ya=t=>t.toLowerCase(),tl={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Xa(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Xa(e,t))),icontains:(t,e)=>e.map(Ya).some(e=>t.map(Ya).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Ya).every(e=>t.map(Ya).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{var i=parseFloat(e);return!isNaN(i)&&t.some(t=>i>parseFloat(t))}),lt:(t,e)=>e.some(e=>{var i=parseFloat(e);return!isNaN(i)&&t.some(t=>i<parseFloat(t))})};function el(t,e){return!t||Object.entries(t).every(t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(null==r)return!1;var n=tl[i.operator];return!!n&&n(i.values,[String(r)])})}function il(t,e,i){return Vn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var rl=new Set(["is_not","not_icontains","not_regex"]);function nl(t,e,i){return!t||0===t.length||t.every(t=>{var r,n=null==(r="person"===t.type?i:e)?void 0:r[t.key],s=t.operator||"exact";if(Te(n)||Ee(n))return rl.has(s);var o=tl[s];return!!o&&!Te(t.value)&&!Ee(t.value)&&o(ke(t.value)?t.value.map(String):[String(t.value)],ke(n)?n.map(String):[String(n)])})}var sl=Pn("[SessionRecording]");function ol(t,e){return e?t:"!"+t}function al(t,e){return t===e||t!=="!"+e&&null}var ll=class{constructor(t,e,i,r,n,s,o){this._instance=t,this.Y=e,this.tt=i,this.et=r,this.jt=n,this.Bt=s,this.Ht=o,this.$t=null,this.Ut=So}onRemoteConfig(t){this.$t=Ae(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.zt=new fo([this.tt,this.Y]),this.Ut=ko):(this.zt=new po([this.tt,this.Y]),this.Ut=So),this._instance.register_for_session({[Gt]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.Ht()})}getStatus(t){return this.Ut({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e,i=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Ae(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.tt.K.length&&Re(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){sl.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,i,r,n=this.$t;if(!Ae(n))return null==(i=this._instance.persistence)||i.unregister(Z),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Z),o=this._instance.get_property(H),a=al(s,t),l=Ae(o)&&o!==n,u=Te(o)&&s===t,h=l||u||!Fe(a),d=h?ja(t,n):a;h&&(d?this.jt("sampled"):sl.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Z]:ol(t,d),[H]:Ee(o)&&s===t?null:n})}ensureSamplingDecision(t){Ae(this.$t)&&(Fe(al(this._instance.get_property(Z),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(K),null==(e=this._instance.persistence)||e.unregister(Q),null==(i=this._instance.persistence)||i.unregister(Z),null==(r=this._instance.persistence)||r.unregister(H),null==(n=this._instance.persistence)||n.unregister(J)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.zt)?void 0:e.triggerStatus(t))===ao}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===ao).map(t=>t.label)}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},ul=class{constructor(t,e,i,r,n){this._instance=t,this.Y=e,this.jt=i,this.Vt=r,this.Ht=n,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[Gt]:"v2_trigger_groups",[Zt]:t.triggerGroups.length}),this.Y.onConfig(t)):sl.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Ys;if(t.urlTriggerMatching.urlBlocked)return ro;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Ys;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Te(l)?An.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?to:r?io:Ys}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Zt)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;Ae(r)&&(Ee(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,e=>{n.Kt(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Ht(e))},t)};for(var o of this.Zt)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.Wt=t(t=>{var i;if(this.Qt)return sl.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Wt)||i.call(this),void(this.Wt=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,n=>{if(r.Kt(i,t.properties)){var s=(i.group.conditions.events||[]).filter(e=>e.name===t.event),o=r._instance.get_property(vt);s.some(e=>!e.properties||0===e.properties.length||nl(e.properties,t.properties,o))&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Ht(n))}},e)};for(var s of this.Zt)n(s)}catch(t){sl.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(var e of this.Zt){var i,r=e.group,n=r.id,s=r.sampleRate,o=tt+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(xe(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Ae(c)&&c!==s,l=v===t&&Ae(c)&&c===s&&Fe(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!Fe(l),g=p?ja(t+n,s):l;p&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Gt.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Z),null==(e=this._instance.persistence)||e.unregister(H),null==(i=this._instance.persistence)||i.unregister(J),this.Zt)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(X+a),null==(s=this._instance.persistence)||s.unregister(Y+a),null==(o=this._instance.persistence)||o.unregister(tt+a)}}updateActiveTriggers(t){var e=[];for(var i of this.Zt){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.Gt.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Wt]:e})}hasPendingTriggers(t){for(var e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){var i=t.group.conditions.properties;return!i||0===i.length||nl(i,e,this._instance.get_property(vt))}Jt(t){var e=this;this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();var i=function(t){var i=new wo(e._instance,t,(i,r)=>{e.jt("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Ht()});e.Zt.push(i)};for(var r of t)i(r)}},hl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],dl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hl],vl="<masked>",cl=["li_fat_id"];function fl(t,e,i){if(!h)return{};var r,n=e?[...hl,...i||[]]:[],s=pl(Qn(h.URL,n,vl),t);return $n((r={},On(cl,function(t){var e=ha(t);r[t]=e||null}),r),s)}function pl(t,e){var i=dl.concat(e||[]),r={};return On(i,function(e){var i=Jn(t,e);r[e]=i||null}),r}function gl(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Ee(e)){r.$search_engine=e;var n=h?Jn(h.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function ml(){return navigator.language||navigator.userLanguage}var yl="$direct";function bl(){return(null==h?void 0:h.referrer)||yl}function _l(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...hl,...e||[]]:[],s=null==(r=i?ar(null==d?void 0:d.href):null==d?void 0:d.href)?void 0:r.substring(0,1e3);return{r:bl().substring(0,1e3),u:s?Qn(s,n,vl):void 0}}function wl(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?ar(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==yl?yl:null==(i=Gn(r))?void 0:i.host};if(s){o.$current_url=s;var a=Gn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,$n(o,pl(s))}return r&&$n(o,gl(r)),o}function kl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Sl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var xl=1e5,Cl=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Tl=[],Ml=()=>!1,Il="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),El="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Rl="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),Al="Accommodation AdministrativeArea Country Place State".split(" "),Pl={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:El,publisher:Rl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Tl},Offer:{seller:Rl},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:Rl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Rl,areaServed:Al,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Tl}},Fl=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),Pl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Pl.Event],[Rl,Pl.Organization],[Al,Pl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Pl.Product]];function Ol(t,e){return _e.call(t,e)?t[e]:void 0}function $l(t){var e=typeof t;return Ee(t)||"string"===e||"number"===e||"boolean"===e}function Dl(t,e){return e&&function(t){return Me(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function Ll(t,e){return ke(t)&&t.every($l)?t.map(t=>Dl(t,e)).filter(t=>!Te(t)):$l(t)?Dl(t,e):void 0}function Nl(t,e){if("string"==typeof t){var i=t.trim(),r=i.indexOf("#"),n=0>r?i:i.slice(r+1);if(!(!n||0>r&&(/^[a-z][a-z\d+.-]*:/i.test(i)||i.includes("/")||i.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function ql(t){if(_e.call(Pl,t))return Pl[t];for(var e of Fl){var i=e[1];if(e[0].includes(t))return i}}function jl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function Bl(t,e,i,r){if(ke(t)){var n=t.map(t=>Bl(t,e,i,r)).filter(t=>!Te(t));return n.length?n:void 0}return Hl(t,e,i,r)||void 0}function Hl(t,e,i,r){if(!xe(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Ol(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:ke(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&Cl.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!ql(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Il){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?Nl(Ol(t,l),e):Ll(Ol(t,l),i.maskUrl);Te(u)||jl(a,l,u)}for(var h of o){var d=ql(h);for(var v of Object.keys(d)){var c=Ol(t,v),f=d[v];if(!0===f){var p=Ll(c,i.maskUrl);Te(p)||jl(a,v,p)}else{var g=Bl(c,e,i,f);Te(g)||jl(a,v,g)}}}var m=Bl(Ol(t,"@graph"),e,i);return Te(m)||jl(a,"@graph",m),Object.keys(a).length?a:null}function zl(t,e,i){if(!xe(t))return null;var r=Ol(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var s=Hl(t,e,i);return s?n({"@context":"https://schema.org"},s):null}function Ul(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Wl(t,e,i){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!i&&t.matches(i)}catch(t){return!1}}function Vl(t,e,i){for(var r=t;r;){if(Wl(r,e,i))return!0;var n=r.parentNode;r=r.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function Gl(t){return Ul(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ul)}function Zl(t){return Te(t)?void 0:Math.round(t)}function Jl(t){return xe(t)?t.network_timing:t}var Ql,Kl,Xl=Pn("[SessionRecording]"),Yl=[1,2,3,4,5,6,7,12],tu=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function eu(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function iu(){var t;return null==(t=eu())?void 0:t.record}function ru(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,xo())}}function nu(t){return la(oa(aa(ru(t))),!0)}function su(t){return ou.apply(this,arguments)}function ou(){return(ou=o(function*(t){var e=yield an(ru(t),Na.DEBUG,{rethrow:!0});return la(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var au="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,lu=!1;function uu(t){return ke(t)&&0===t.length?Ql=null!=Ql?Ql:nu([]):nu(t)}function hu(t){return du.apply(this,arguments)}function du(){return(du=o(function*(t){return ke(t)&&0===t.length?Ql||(Kl=null!=Kl?Kl:su([]).then(t=>(Ql=t,t)).catch(t=>{throw Ql=void 0,Kl=void 0,t})):su(t)})).apply(this,arguments)}function vu(t){return au&&!lu&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function cu(t){return{event:t,size:To(t)}}function fu(t,e){return n({},t,{data:e,cv:"2024-10"})}function pu(t,e){return n({},t,{cv:"2024-10",data:n({},t.data,e)})}function gu(t){try{if(2===t.type)return cu(fu(t,nu(t.data)));if(3===t.type&&0===t.data.source)return cu(pu(t,{texts:uu(t.data.texts),attributes:uu(t.data.attributes),removes:uu(t.data.removes),adds:uu(t.data.adds)}));if(3===t.type&&8===t.data.source)return cu(pu(t,{adds:t.data.adds?nu(t.data.adds):void 0,removes:t.data.removes?nu(t.data.removes):void 0}))}catch(t){Xl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Co(t)}}function mu(){return mu=o(function*(t){try{if(2===t.type)return cu(fu(t,yield su(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([hu(t.data.texts),hu(t.data.attributes),hu(t.data.removes),hu(t.data.adds)]);return cu(pu(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var i=yield Promise.all([t.data.adds?su(t.data.adds):void 0,t.data.removes?su(t.data.removes):void 0]);return cu(pu(t,{adds:i[0],removes:i[1]}))}}catch(e){return nn(e)&&(lu=!0),Xl.error("could not compress event asynchronously - trying synchronous compression",e),gu(t)}return{event:t,size:Co(t)}}),mu.apply(this,arguments)}function yu(t,e){return 5===t.type&&t.data.tag===e}function bu(t){return yu(t,"sessionIdle")}function _u(t){return yu(t,"$session_ending")}function wu(t){return yu(t,"$session_starting")}var ku=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return al(this._instance.get_property(Z),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Ae(e)?e:null}get ie(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.se=!1,this.ue=Date.now(),this.le=!1,this.he=[],this.ce="unknown",this.de=0,this.ve=0,this.fe=0,this.pe=0,this.ge=!1,this.me=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=[],this.Re=void 0,this.Ae=void 0,this.Ee=!1,this.Oe=[],this.Le=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Wt=void 0,this.Fe=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,i)=>{var r,n,s,o;if(i&&(t!==this.Xt||e!==this.He)){var a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Xt,u=this.He;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue,flushed_size:null==(r=this.$e)?void 0:r.currentTrackedSize(l)}),null==(n=this._instance.persistence)||n.unregister(et),this._e=!1,null==(s=eu())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.Ue(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.ze(h)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue}),null==(o=this.ne)||o.makeSamplingDecisions(t)}},this.We=!1,this.Ve=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[J])===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;var i=null==(t=this.Rt.data[0])?void 0:t.timestamp,r=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return Ae(i)&&Ae(r)?r-i:null},this.Ge=()=>{var t,e,i=this.ie;if(!Ae(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Qe;return Ae(r)&&r>=0&&i>r}if(this.Ve())return!1;var n,s=this.Ze();return!!Ee(s)||i>s||(null==(n=this._instance.persistence)||n.register({[J]:this.Xt}),!1)},this.Je=()=>{"buffering"!==this.status?(this.ge&&this.me&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tr(!0)):this.er()},this.rr=()=>{this.Je()},this.ir=()=>{this.Vt("browser offline",{})},this.nr=()=>{this.Vt("browser online",{})},this.ar=()=>{null!=h&&h.visibilityState&&("visible"===h.visibilityState&&(this.Ke=!0),this.Vt("window "+h.visibilityState,{}))},this.Ke=null==e||e;var i=this.Yt.checkAndGetSessionAndWindowId(),r=i.windowId,n=i.sessionStartTimestamp;this.Xt=i.sessionId,this.He=r,this._sessionStartTimestamp=n,this.et=new bo(this._instance),this.Y=new yo(this._instance),this.tt=new _o(this._instance),this.Rt=this.er(),this.sr="ph_"+(this._instance.config.persistence_name||this._instance.config.token)+"_replay_pending_buffer",this.Yt.sessionTimeoutMs>this.te||Xl.warn("session_idle_threshold_ms ("+this.te+") is greater than the session timeout ("+this.Yt.sessionTimeoutMs+"). Session will never be detected as idle"),this.$e=new qa(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get ur(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.re)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return Te(d)&&Te(v)&&Te(c)&&Te(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}lr(){var t;if(!this.xe){var e=null==(t=this.re)?void 0:t.masking;if(!Re(e)){var i=this._instance.config.session_recording,r=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{var r=null==i?void 0:i[t],n=e[t];return!Te(r)&&r!==n});0!==r.length&&(this.xe=!0,Xl.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+r.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==i?void 0:i.maskAllInputs,maskTextSelector:null==i?void 0:i.maskTextSelector,blockSelector:null==i?void 0:i.blockSelector,maskAllElementAttributes:null==i?void 0:i.maskAllElementAttributes},project:e}))}}}get hr(){var t;return Ge(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Pn("canvas recording resolution scale"),1)}get cr(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.re)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Ge(h,0,12,Pn("canvas recording fps"),4),quality:Ge(d,0,1,Pn("canvas recording quality"),.4)}}get dr(){var t,e,i=!(null==(t=this.re)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:i}get vr(){var t,e,i,r=null==(t=this.re)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=Jl(this._instance.config.capture_performance),l=Jl(null==r?void 0:r.capturePerformance),u=!!(Fe(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}pr(){var t,e,i=[],r=null==(t=b.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.dr&&i.push(r());var s=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.vr&&Se(s))if(!Wn.includes(d.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Se(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,s={payloadSizeLimitBytes:Us.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Us.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Us.payloadHostDenyList]},o=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,u=(r=zs(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Qs(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Qs(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=Gn(t.name),s=0===e.indexOf("http")?null==(r=Gn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&Js.some(t=>0===o.indexOf(t))))return t}})((Zs((r=e).requestHeaders),Zs(r.responseHeaders),r),t.api_host,i));var r},d=Se(t.session_recording.maskNetworkRequestFn);return d&&Se(t.session_recording.maskCapturedNetworkRequestFn)&&An.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:n({},e,{name:null==i?void 0:i.url})}),s.maskRequestFn=Se(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=h(e);if(i){var r=i.isInitial?{name:"",entryType:i.entryType,startTime:i.startTime,duration:i.duration,endTime:i.endTime,timeOrigin:i.timeOrigin,timestamp:i.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i);return Re(n)&&r?(Xs.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Te(t))return t.requestBody=Ks(t.requestBody,"Request"),t.responseBody=Ks(t.responseBody,"Response"),t}(h(t)),n({},Us,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,o)))}else Xl.info("NetworkCapture not started because we are on localhost.");return i}gr(t){return this._instance.config.disable_capture_url_hashes?ar(t):t}mr(t,e){void 0===e&&(e=!1);var i=e?ar(t):this.gr(t),r=this._instance.config.mask_personal_data_properties?[...hl,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(Qn(i,r,vl))}yr(t){var e,i=this._instance.config.session_recording;if(i.maskCapturedNetworkRequestFn){var r,n=i.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}return i.maskNetworkRequestFn?null==(e=i.maskNetworkRequestFn({url:t}))?void 0:e.url:t}br(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Xl.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(tu(()=>iu().addCustomEvent(t,e)))}wr(){var t;return this.se&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.ce}kr(t){if(!this.wr())return!1;try{var e=iu();return!!e&&(e.addCustomEvent("$json_ld",t),this.wr())}catch(t){return!1}}_r(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.Sr)?void 0:e.scan(t)})}Cr(){try{if(this._instance.config.capture_pageview||!a)return;var t=new URL(a.location.href),e=this.mr(t.origin+t.pathname+t.search);this.Mr!==e&&(this.Mr=e,this.Vt("$url_changed",{href:e}))}catch(t){}}Tr(){if(this.he.length){var t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.br(t)})}}Bt(){return this.br(tu(()=>iu().takeFullSnapshot()))}get Ir(){var t,e,i;if(null!=(t=this.ne)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var r,n=null==(r=this._instance.config.session_recording)?void 0:r.trigger_pending_buffer_interval_millis;return Ae(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(i=this._instance.config.session_recording)?void 0:i.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Rr(){if(this.Ar&&clearInterval(this.Ar),!0!==this.ce){var t=this.Ir;t&&(this.Ar=setInterval(()=>{this.Bt()},t))}}Ht(t){"event"===t&&this.Er(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rr()}Or(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.Sr)||t.scan(),clearInterval(this.Ar),Xl.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Lr(){var t;this.Y.urlBlocked&&(null==(t=this.Sr)||t.scan(),this.Y.urlBlocked=!1,this.Bt(),this._r(),this.Rr(),this.Vt("recording resumed",{reason:"left blocked url"}),Xl.info("recording resumed"))}Dr(t,e){var i;if("event"===t&&this.Er(),!this.le&&null!=(i=this.ne)&&i.hasPendingTriggers(this.sessionId)){this.le=!0;try{var r,n,s="url"===t?Q:K;null==(r=this._instance.persistence)||r.register({[s]:this.sessionId}),null==(n=this.ne)||n.updateActiveTriggers(this.sessionId),this.Ht(),this.tr(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.le=!1}}}get isStarted(){return!!this.ae}get re(){var t=this._instance.get_property(j);if(t){var e;try{e=xe(t)?t:JSON.parse(t)}catch(t){return void Xl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>36e5)return Xl.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(r=this._instance.persistence)||r.unregister(j))}return e}}Pr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(t){var e,i,r=this.re;if(r){if(!this.isStarted){var n=!1!==this.ce&&!this.be;this.Xe(n?"no_interaction_since_recording_started":void 0),this.be=!1,this.me=n,this.ye=!1}this.Pe&&(this.Nr(),this.er());var s=this.Yt.checkAndGetSessionAndWindowId(),o=s.windowId,l=s.sessionStartTimestamp;this.Xt=s.sessionId,this.He=o,this._sessionStartTimestamp=l,this.Fr(),null==(e=this._instance.persistence)||e.unregister(et),null!=r&&r.endpoint&&(this.oe=null==r?void 0:r.endpoint),this.ne=2===(null==r?void 0:r.version)&&null!=r&&r.triggerGroups&&r.triggerGroups.length>0?new ul(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new ll(this._instance,this.Y,this.tt,this.et,this.jt.bind(this),this.Bt.bind(this),this.Ht.bind(this)),this.ne.onRemoteConfig(r),null==(i=this.Wt)||i.call(this),this.Wt=this.ne.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Dr(t,e)),this.Pr(z,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(z)}),this.Pr(U,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(U)}),this.Pr(V,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.Pr(W,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.ne.makeSamplingDecisions(this.sessionId),this.qr(),this.we||(zn(a,"beforeunload",this.Je),zn(a,"pagehide",this.rr),zn(a,"offline",this.ir),zn(a,"online",this.nr),zn(h,"visibilitychange",this.ar),!this.Fe&&Se(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&Se(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.Ue(),this.ce="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,i)=>{var r;null==(r=this.je)||r.call(this),this.je=void 0,this.Be(t,e,i)})}):Se(this.Yt.on)||Xl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Re(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.mr(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Xl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else Xl.info("remote config must be stored in persistence before recording can start")}jr(){var t,e,i,r,n,s;null==a||a.removeEventListener("beforeunload",this.Je),null==a||a.removeEventListener("pagehide",this.rr),null==a||a.removeEventListener("offline",this.ir),null==a||a.removeEventListener("online",this.nr),null==h||h.removeEventListener("visibilitychange",this.ar),clearInterval(this.Ar),this.Br(),null==(t=this.Ne)||t.call(this),this.Ne=void 0,null==(e=this.Wt)||e.call(this),this.Wt=void 0,null==(i=this.Fe)||i.call(this),this.Fe=void 0,null==(r=this.qe)||r.call(this),this.qe=void 0,null==(n=this.je)||n.call(this),this.je=void 0,null==(s=this.ne)||s.stop(),this.Hr(),this.Nr()}Nr(){this.De+=1,this.Oe=[],this.Le=0,this.$r=void 0,this.Pe=!1}Hr(){var t,e;null==(t=this.Ur)||t.stop(),this.he=[],null==(e=this.Sr)||e.stop(),this.Sr=void 0,this.se=!1;try{var i;null==(i=this.ae)||i.call(this)}catch(t){Xl.warn("could not stop rrweb",t)}this.ae=void 0}zr(){if(!this.$r||0===this.Le)return!1;if(this.Pe)return!0;this.Pe=!0,this.Wr=void 0;var t=this.De;return this.Br(),this.Hr(),this.$r.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.tr(),this.er(),this.Vr(),this.jr(),Xl.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),Xl.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.zr())return;this.tr(),this.er(),this.Vr(),this.jr(),Xl.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}ze(t){this.We=!0,this.ue=Date.now();try{var e;this.stop(),this.Zr=void 0,this.Gr=void 0,this.ve=0,this.fe=0,this.pe=0,null==(e=eu())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.me=!1}Xe(t,e){var i=(void 0===e?{}:e).preserveLogDedup,r=void 0!==i&&i;if(this.ge=!Te(t),this.Wr=t,Te(t))r||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,Xl.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}Er(){this.isStarted||(this.be=!0),this.ge&&(this.Xe(void 0),this.me=!1,this.ye&&(this.ye=!1,this.Bt()),this.Jr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,i=void 0!==e&&e;this.ge=!0,i&&(this.er(),this.Hr()),this.er(),this.jr(),this.er(),this.Vr(),Xl.info("discarded")}Kr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};"disabled"!==this.status?(this.Xr(t,r),this.Yr(s)):this.er()}ti(){try{this.ei()}catch(t){this.Se||(this.Se=!0,Xl.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=eu())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Gr&&(this.Gr=e,this.Zr&&this.Zr.durationMs>=e.durationMs||(this.Zr=e),500>e.durationMs||Xl.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Xr(t,e){2!==t.type?3===t.type&&(Te(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,Xl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Re=e}ri(t){t.counted&&t.generation===this.De&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,i){t.processed||t.generation!==this.De||(t.processed=!0,this.Kr(t.event,e,i,t.targetSessionId,t.targetWindowId))}ni(t){try{var e=t.event,i=Co(t.event);if(t.compressionEnabled)try{var r=gu(t.event);e=r.event,i=r.size}catch(t){Xl.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,i)}catch(t){Xl.error("could not capture queued compression event",t)}}finally{this.ri(t)}}Ye(){[...this.Oe].forEach(t=>{this.ni(t)})}oi(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.De,processed:!1,counted:!0};this.Oe.push(s),this.Le+=1;var a=function(){var i=o(function*(){try{if(s.processed)return;var i,r;try{var o=e?vu(t)?yield function(t){return mu.apply(this,arguments)}(t):gu(t):{event:t,size:Co(t)};i=o.event,r=o.size}catch(e){Xl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Co(t)}n.ii(s,i,r)}finally{n.ri(s)}});return function(){return i.apply(this,arguments)}}();this.$r=this.$r?this.$r.catch(()=>{}).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,o,l,u,h;if(this._instance.sessionManager&&(this.Tr(),t&&xe(t))){if(4===t.type){var d=this.mr(t.data.href);if(this.Mr=d,!d)return;t.data.href=d}else this.Cr();if(null==(e=this.ne)||e.checkUrlTriggers(this.sessionId,()=>this.Or(),()=>this.Lr(),(t,e)=>this.Dr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var v,c,f;2===t.type&&(null!=(v=eu())&&null!=v.wasMaxDepthReached&&v.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(c=this.Ur)||c.reset(),null==(f=this._instance.persistence)||f.register_once({[et]:t.timestamp},void 0));var p=2===t.type&&(null==(i=this.ne)?void 0:i.hasPendingTriggers(this.sessionId));p&&this.ai();var g=this.Ur?this.Ur.throttleMutations(t):t;if(g){var m=function(t){var e=t;if(e&&xe(e)&&6===e.type&&xe(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var i=[],r=0;e.data.payload.payload.length>r;r++)i.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=i,t}return t}(g),y=function(t){return _u(t)?t.data.payload:null}(m),b=function(t){return wu(t)?t.data.payload:null}(m),_=function(t){return bu(t)?t.data.payload:null}(m);y||b?null!=y&&y.lastActivityTimestamp&&(m.timestamp=y.lastActivityTimestamp):null!=_&&_.sessionId||this.si(m),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var w=null!==(r=null!==(n=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==_?void 0:_.sessionId)&&void 0!==r?r:this.Xt,k=null!==(o=null!==(l=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==l?l:null==_?void 0:_.windowId)&&void 0!==o?o:this.He;if(!0!==this.ce||function(t){return bu(t)||_u(t)||wu(t)}(m)){2===m.type&&(this.de=0),_&&(m.timestamp=_.lastActivityTimestamp+_.threshold);var S=this.se;this.se=!0,p?this._r(!0):S||this._r();var x=null===(h=this._instance.config.session_recording.compress_events)||void 0===h||h;if(5===m.type&&"$json_ld"===m.data.tag){var C;try{C=a?this.mr(a.location.href):void 0}catch(t){}m.data.href=C}if(this.Le>0||x&&vu(m))this.oi(m,x,w,k);else{var T=x?gu(m):{event:m,size:Co(m)};this.Kr(m,T.event,T.size,w,k)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(m)&&this.de++}else!0===this.ce&&this.de++}}}get status(){return this.ne?this.ne.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.re}):Ys}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.Bt(),this.Er(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Z]:this.sessionId,[H]:null}),this.Bt(),this.Er(),this.jt("sampling_overridden")}overrideTrigger(t){this.Dr(t),this.Er()}ui(){try{var t,e=null==a||null==(t=a.location)?void 0:t.href;if(!e)return;var i=this.mr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Br(){this.li&&(clearTimeout(this.li),this.li=void 0)}Jr(){this.li||(this.li=setTimeout(()=>{this.tr()},2e3))}hi(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!_u(t)&&!wu(t))}ci(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return Te(this.fi)||this._instance.register_for_session({[Vt]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Te(this.fi)||this._instance.register_for_session({[Vt]:[]}),void(this.fi=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.fi&&(this.fi=r,this._instance.register_for_session({[Vt]:e}),Xl.info("buffering: "+i))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&La.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,La.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=La.Nt(this.sr);La.Dt(this.sr),xe(t)&&ke(t.data)&&0!==t.data.length&&ke(t.sizes)&&t.sizes.length===t.data.length&&Ae(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}}tr(t){var e;if(void 0===t&&(t=!1),this.Br(),this.ge)return this.Rt;if(this.hi())return this.Rt.size>943718.4?this.er():(t&&this.mi(),this.Rt);var i=this.Rt;null==(e=this.ne)||e.ensureSamplingDecision(this.sessionId);var r=this.Ge(),n=this.status;if(this.di(n),"buffering"===n||"paused"===n||"disabled"===n||r)return!t||"active"!==n&&"sampled"!==n||this.mi(),this.Jr(),this.Rt;if(this.Rt!==i)return this.Rt;if(i.data.length>0){var s,o=this.ui();Mo(i).forEach(t=>{try{var e;null==(e=this.$e)||e.trackSize(t.sessionId,t.size),this.bi({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Na.LIB_NAME,$lib_version:Na.LIB_VERSION,$snapshot_host:o})}catch(t){Xl.warn("could not capture snapshot chunk - skipping it",t)}}),Te(this.yi)||(La.Dt(this.sr),this.yi=void 0),null==(s=this.ne)||s.onFlushComplete()}return this.er()}Yr(t){var e,i=2+((null==(e=this.Rt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Rt.sessionId!==r;if(n||!0!==this.ce&&!this.ge&&this.Rt.size+t.$snapshot_bytes+i>943718.4){var s=this.Xt;if(this.Rt=this.tr(),this.Xt!==s)return;n&&this.Rt.data.length>0&&(this.Rt=this.er()),this.Rt.sessionId=r,this.Rt.windowId=t.$window_id}this.ge&&(this.ye||this.Rt.size+t.$snapshot_bytes+i>943718.4)?this.ye||(this.ye=!0,this.Rt=this.er()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.ce||this.ge||this.Jr())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e,i=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1];return i?i.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.er();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.er():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}er(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}jt(t,e){this._instance.register_for_session({[Xt]:t}),Xl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",n({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==Yl.indexOf(null==(e=t.data)?void 0:e.source)}si(t){var e=this.wi(t);e||!0===this.ce||t.timestamp-this.ue>this.te&&(this.ce=!0,clearInterval(this.Ar),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.tr());var i=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp),r=i.windowId,n=i.sessionId,s=!1;if(e&&(this.ue=t.timestamp,this.ce)){var o="unknown"===this.ce;this.ce=!1,o||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}var a=this.Xt!==n,l=this.He!==r;if(this.He=r,this.Xt=n,a||l){var u=a&&!1!==this.ce;u&&(this.ce="unknown"),this.ze(u)}else if(e&&this.Er(),s){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.ne)?void 0:h.hasPendingTriggers(this.sessionId));this.de>0&&d&&this.Bt(),this._r(),this.Rr()}}Ue(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=null==(t=eu())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wr,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this.$e)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Ie,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:Zl(null==(i=this.Zr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Zl(null==(r=this.Zr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Zr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Zr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Zr)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==u?void 0:u.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==u?void 0:u.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==u?void 0:u.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Zl(null==u?void 0:u.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Zl(null==u?void 0:u.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Zl(null==(a=eu())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=eu())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[Qt]:!!this.ae,[Kt]:this.ke}}qr(){var t;if(!this.ae){this.ke=!0;var e,i,r,s,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},l=this._instance.config.session_recording;for(var u of Object.entries(l||{})){var d=u[0],v=u[1];if(d in o)if("maskInputOptions"===d)o.maskInputOptions=n({password:!0},v);else if("sampling"===d){var c=null!=v?v:{},f={};Te(c.mousemove)||(f.mousemove=c.mousemove),Te(c.mouseInteraction)||(f.mouseInteraction=c.mouseInteraction),o.sampling=f}else o[d]=v}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=n({},o.slimDOMOptions,{script:!0})),this.cr&&this.cr.enabled&&(o.recordCanvas=!0,o.sampling=n({},o.sampling,{canvas:this.cr.fps}),o.dataURLOptions={type:"image/webp",quality:this.cr.quality},o.canvasResolutionScale=this.hr,o.canvasMasking={configured:()=>{var t;return Se(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,i=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Se(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Me||(this.Me=!0,Xl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ur&&(o.maskAllInputs=null===(e=this.ur.maskAllInputs)||void 0===e||e,o.maskTextSelector=null!==(i=this.ur.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(r=this.ur.blockSelector)&&void 0!==r?r:void 0,o.maskAllElementAttributes=null!==(s=this.ur.maskAllElementAttributes)&&void 0!==s&&s),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Xl.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.lr();var p=iu();if(p){this.Ur=null!==(t=this.Ur)&&void 0!==t?t:new ua(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var i="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Xl.info(i,{node:e}),this.log("[SessionRecording] "+i,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Ir,onDroppedOversizedMutation:t=>{0===this.fe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.fe+=1,this.pe+=t},requestFullSnapshot:()=>this.Bt()});var g=this.pr();if(this.ae=p(n({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,Xl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.ae)return this.we=!0,void Xl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==l?void 0:l.captureJsonLd)&&h&&null!=a&&a.MutationObserver&&!this.Sr&&(this.Sr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=xl,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?Ml:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!Vl(r,e.blockClass,e.blockSelector)}}(t,i),a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Vl(t,e.blockClass,e.blockSelector)||Vl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e,i){if(void 0===e&&(e=Ml),!t||t.length>xl)return null;try{var r=JSON.parse(t),n={maskUrl:i,remainingNodes:2048,exceeded:!1},s=ke(r)?r.map(t=>zl(t,e,n)):zl(r,e,n);if(n.exceeded||Ee(s)||ke(s)&&(!s.length||s.some(Ee)))return null;var o=JSON.stringify(s);return o.length>2e4?null:[s,o]}catch(t){return null}}(e.text,o,i.maskUrl);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Ee(a))return void r.set(e,h);if(r.get(e)!==h){if(h.length>s)return void(s=0);i.emit(u)&&(r.set(e,h),s-=h.length)}}catch(t){return}};try{var l=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Gl(t))a(e)};for(var i of t)if("childList"===i.type)Ul(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&Ul(r)&&a(r)}else"attributes"===i.type&&Ul(i.target)&&a(i.target)}catch(t){return}});return l.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Gl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(h,a.MutationObserver,{maskUrl:t=>this.mr(t),attributeFilter:o.attributeFilter,blockClass:o.blockClass,blockSelector:o.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:o.maskAllElementAttributes,maskAttributeFn:o.maskAttributeFn,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wr()},emit:t=>this.kr(t)}),this.Y.isCurrentUrlBlocked()&&this.Sr.scan()),this.ue=Date.now(),this.ce=Fe(this.ce)?this.ce:"unknown",this.tryAddCustomEvent("$remote_config_received",this.re),this.Vt("$session_options",{sessionRecordingOptions:o,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}else Xl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}},Su=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),xu=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),Cu=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),Tu=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Mu=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Iu=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),Eu=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function Ru(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Au={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Pu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Fu={};function Ou(t){if(Fu[t])return Fu[t];var e=function(t){var e,i,r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(i=e.__symbol__)||void 0===i?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Au?Au[t]:void 0,n=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(i,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in Pu?Pu[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof i[t]&&(null===(e=i[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&o)return Fu[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Ru(t,"AppleWebKit")&&!Ru(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Fu[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var $u=Object.create(null);function Du(t,e,i){var r,n=$u[t],s=n[i];if(s)return s.call(e);var o=Ou(t),a=null===(r=Object.getOwnPropertyDescriptor(o,i))||void 0===r?void 0:r.get;return a?(n[i]=a,a.call(e)):e[i]}$u.Node=Object.create(null),$u.ShadowRoot=Object.create(null),$u.MutationObserver=Object.create(null),$u.Element=Object.create(null);var Lu,Nu={};function qu(t,e,i){var r=t+"."+String(i);if(Nu[r])return Nu[r].bind(e);var n=Ou(t)[i];return"function"!=typeof n?e[i]:(Nu[r]=n,n.bind(e))}function ju(){return Ou("MutationObserver").constructor}function Bu(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=t[e],o=i(r);o;){if(o.next===s)return void(o.next=n.next);o=i(r=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var Hu={childNodes:t=>Du("Node",t,"childNodes"),parentNode:t=>Du("Node",t,"parentNode"),parentElement:t=>Du("Node",t,"parentElement"),textContent:t=>Du("Node",t,"textContent"),isConnected(t){if(void 0===Lu){var e,i=null===(e=Object.getOwnPropertyDescriptor(Ou("Node"),"isConnected"))||void 0===e?void 0:e.get;Lu=(null==i?void 0:i.toString().includes("[native code]"))?i:null}return null==Lu?void 0:Lu.call(t)},contains:(t,e)=>qu("Node",t,"contains")(e),getRootNode:t=>qu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Du("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Du("Element",t,"shadowRoot"):null,querySelector:(t,e)=>qu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>qu("Element",t,"querySelectorAll")(e),mutationObserver:ju,patch:Bu};function zu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Uu=0;function Wu(){Uu+=1}function Vu(){return Uu}function Gu(t,e){return(e!==Uu||t>6e4)&&!0}var Zu=0,Ju=0,Qu=0,Ku={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Xu=null,Yu=null,th=[],eh=0,ih=0,rh={slowestBatchMs:0},nh={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function sh(t){(Zu+=1)>1||(Ku={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},th=[],eh=0,Yu=(t=>t&&t>0?t:null)(t),Ju=zu(),Qu=Uu)}function oh(){return 0===Zu?Xu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Zu-=1)>0?Ku:(Ku.durationMs=zu()-Ju,Ku.deferredStylesheetCount=eh,nh.deferredCount+=eh,Yu=null,Gu(Ku.durationMs,Qu)?Ku:Xu=Ku)}function ah(t,e,i){var r=t.length;if(i>=32)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=ah(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=ah(l,e,i+1))}}}catch(t){}}return r}function lh(t){if(0!==Zu){var e=ah(t,null,0);Ku.cssRuleCount+=e,ih>0&&(Ku.nonDeferrableCssRuleCount+=e)}}function uh(t){ih+=1;try{return t()}finally{ih-=1}}function hh(t){Zu>0&&(Ku.stylesheetMs+=t)}function dh(t){if(0===Zu||null===Yu)return!1;var e=Ku.cssRuleCount-Ku.nonDeferrableCssRuleCount;return e>=Yu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),ah(e,i,0)}catch(t){return 0}}(t)>Yu}function vh(){nh.failedCount+=1}function ch(t){t>0&&(nh.abandonedCount+=t)}function fh(t){return fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fh(t)}function ph(t,e,i){return(e=function(t){var e=function(t){if("object"!=fh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=fh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fh(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function gh(t){return t.nodeType===t.ELEMENT_NODE}function mh(t){var e=t&&"host"in t&&"mode"in t&&Hu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Hu.shadowRoot(e)===t)}function yh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function bh(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function _h(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}var wh=0;function kh(t){var e=0===wh,i=e?zu():0;wh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;lh(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),bh(Array.from(r,t=>Sh(t,n)).join(""))}catch(t){return null}finally{wh-=1,e&&hh(zu()-i)}}function Sh(t,e){if(Ch(t)){var i;try{i=kh(t.styleSheet)||_h(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return Bh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return Th(t)&&t.selectorText.includes(":")&&(n=xh(n)),e?Bh(n,e):n}function xh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Ch(t){return"styleSheet"in t}function Th(t){return"selectorText"in t}var Mh=/^-?[A-Za-z_][\w-]*$/,Ih=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Eh(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){try{var r;try{r=i||_h(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=Bh(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&Ch(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(!function(t,i){try{var r=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(Th(t)){if("number"==typeof e.type&&1!==e.type)return null;var i=e.style?e.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Mh.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?Mh.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Ih.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===r)return!1;var n=i.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Bh(r,n):r,fixColons:"sheet"===i.kind&&Th(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&Th(i)&&i.selectorText.includes(":")&&(s=xh(s)),t.parts.push(t.sheetHref?Bh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;lh(i);var r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);var s=Array.from(i);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){for(var i=[{sheet:e,rules:t,index:0}],r=function(){var t=i[i.length-1];if(t.index>=t.rules.length)return i.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Ch(e)||n.has(e))return 0;var r=null;try{r=e.styleSheet}catch(t){return n.set(e,null),0}if(!r||i.some(t=>t.sheet===r))return 0;try{var s=r.rules||r.cssRules;if(!s)return 0;lh(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=zu(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?xh(h):h}else u=bh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{hh(zu()-n)}return i},text:()=>i?r:null,remainingRules(){if(i)return 0;var t=0;for(var r of e)t+=r.rules.length-r.index;return t}}}var Rh=class{constructor(){ph(this,"idNodeMap",new Map),ph(this,"nodeMetaMap",new WeakMap)}getId(t){var e,i;return t&&null!==(e=null===(i=this.getMeta(t))||void 0===i?void 0:i.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),gh(t)){var i=Hu.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ah(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Ph(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Ph(t){return t.toLowerCase()}var Fh=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function Oh(t){var e=t.element,i=t.name,r=t.value,n=t.maskAttributeFn,s=t.isGenerated;return r?t.maskAllElementAttributes?void 0!==s&&s&&Fh.has(Ph(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var $h="__rrweb_original__";function Dh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ph(e):null}catch(t){return null}}var Lh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nh=/^(?:[a-z+]+:)?\/\//i,qh=/^www\..*/i,jh=/^(data:)([^,]*),(.*)/i;function Bh(t,e){return(t||"").replace(Lh,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Nh.test(l)||qh.test(l))return"url("+u+l+u+")";if(jh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"})}var Hh,zh,Uh=new Map,Wh=1,Vh=new RegExp("[^a-z0-9-_:]");function Gh(){return Wh++}var Zh=/^[^ \t\n\r\u000c]+/,Jh=/^[, \t\n\r\u000c]+/,Qh=new WeakMap;function Kh(t,e){return e&&""!==e.trim()?Xh(t,e):e}function Xh(t,e){var i=Qh.get(t);if(i||(i=t.createElement("a"),Qh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Yh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function td(t,e,i,r,n,s){if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o,a=null===(o=n.sheet)||void 0===o?void 0:o.href;if(a)return a}var l=Kh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=Uh.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(Uh.size>=10){var u=Uh.keys().next().value;void 0!==u&&Uh.delete(u)}return Uh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Yh(u,s)}if("image"===e)return Yh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Kh(t,r);return"image"===e&&h.startsWith("data:")?Yh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(Jh),e.length>i;){var s=r(Zh);if(","===s.slice(-1))s=Kh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Kh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?Bh(r,Xh(t)):"object"===e&&"data"===i?Kh(t,r):r:Kh(t,r)}function ed(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function id(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&id(Hu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&id(Hu.parentNode(t),e,i)}function rd(t,e,i,r){var n;if(gh(t)){if(!Hu.childNodes(n=t).length)return!1}else{if(null===Hu.parentElement(t))return!1;n=Hu.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(id(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function nd(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var sd=new Map;function od(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function ad(t){return null==t?"":t.toLowerCase()}var ld=!1,ud=!1;function hd(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,_=e.dataURLOptions,w=void 0===_?{}:_,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,M=e.onSerialize,I=e.onIframeLoad,E=e.iframeLoadTimeout,R=void 0===E?5e3:E,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,z=void 0===H?50:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return ud=!0,ld||(ld=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+z+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;U||(U=rd(t,o,a,void 0===U)),Zu>0&&(Ku.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,_=e.newlyAddedElement,w=void 0!==_&&_,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Eu.Document,childNodes:[],compatMode:t.compatMode}:{type:Eu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Eu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i=e.doc,r=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,o=e.maskInputFn,a=e.maskAllElementAttributes,l=void 0!==a&&a,u=e.maskAttributeFn,h=e.dataURLOptions,d=void 0===h?{}:h,v=e.inlineImages,c=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ph(t.tagName);return Vh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];ed(_,C.name)||(k[C.name]=td(i,_,Ph(C.name),C.value,t,d))}if("link"===_&&r&&!b){var T=t.sheet;if(!T){var M=function(t){return t.href}(t);M&&!(T=od(i,M))&&M.includes(".css")&&(T=od(i,window.location.origin+"/"+M.replace(window.location.href,"")))}var I=null;T&&(dh(T)?Zu>0&&(th.push(t),eh+=1):I=kh(T)),I&&(delete k.rel,delete k.href,k._cssText=I)}if("style"===_&&t.sheet&&!(t.innerText||Hu.textContent(t)||"").trim().length){var E=uh(()=>kh(t.sheet));E&&(k._cssText=E)}if("input"===_||"textarea"===_||"select"===_){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Ah({element:t,type:Dh(t),tagName:_,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===_&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===_&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===_&&c&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array(($h in n?n[$h]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var P=t.toDataURL(d.type,d.quality),F=i.createElement("canvas");F.width=t.width,F.height=t.height,P!==F.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var O,D,L=!1;if("img"===_&&v){Hh||(Hh=i.createElement("canvas"),zh=Hh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Oh({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,H=()=>{nd(N,"load",H);try{Hh.width=N.naturalWidth,Hh.height=N.naturalHeight,zh.drawImage(N,0,0);var t=Hh.toDataURL(d.type,d.quality);k.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?k.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H)}if("audio"===_||"video"===_){var z=k;z.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),b){var U,W,V,G=t.getBoundingClientRect(),Z=G.width,J=G.height,Q=G.left,K=G.top,X=null===(U=i.defaultView)||void 0===U?void 0:U.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:J+"px",rr_left:Math.floor(Q+((null===(W=i.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=i.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),X&&(k.rr_position=X.position||"static",w.add("rr_position"),X.transform&&"none"!==X.transform&&(k.rr_transform=X.transform,w.add("rr_transform")),X.display&&X.display.startsWith("inline")&&(k.rr_display=X.display,w.add("rr_display")))}if("iframe"!==_||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var Y of Object.entries(k)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(k[tt]=Oh({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(_)&&(O=!0)}catch(t){}return{type:Eu.Element,tagName:_,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:O}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=Hu.parentNode(t),o=s&&s.tagName,a=Hu.textContent(t),l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var h;if(t.nextSibling||t.previousSibling);else if(dh(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=kh(s.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(a=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}a=Bh(a,Xh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,Hu.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Eu.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Eu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Eu.Comment,textContent:Hu.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn:L,newlyAddedElement:q});if(!Z)return console.warn(t,"not serialized"),null;G=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===Eu.Comment)return!0;if(t.type===Eu.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e,i;try{i=new URL(t,window.location.href)}catch(t){return null}var r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ad(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ad(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ad(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ad(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ad(t.attributes.property).match(/^(og|twitter|fb):/)||ad(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ad(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(ad(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ad(t.attributes.name))||ad(t.attributes.property).match(/^article:/)||ad(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ad(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===Eu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Gh();var J=Object.assign(Z,{id:G});if(r.add(t,J),-2===G)return null;M&&M(t);var Q=!u;if(J.type===Eu.Element){Q=Q&&!J.needBlock,delete J.needBlock;var K=Hu.shadowRoot(t);K&&yh(K)&&(J.isShadowHost=!0)}if((J.type===Eu.Document||J.type===Eu.Element)&&Q){b.headWhitespace&&J.type===Eu.Element&&"head"===J.tagName&&(V=!1);var X={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z};if(J.type===Eu.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(Hu.childNodes(t))){var tt=hd(Y,X);tt&&J.childNodes.push(tt)}var et=null;if(gh(t)&&(et=Hu.shadowRoot(t)))for(var it of Array.from(Hu.childNodes(et))){var rt=hd(it,X);rt&&(yh(et)&&(rt.isShadow=!0),J.childNodes.push(rt))}}var nt=Hu.parentNode(t);if(nt&&mh(nt)&&yh(nt)&&(J.isShadow=!0),J.type===Eu.Element&&"iframe"===J.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),nd(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?nd(t,"load",o):(a=!0,nd(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(c),nd(t,"load",o)}}return t.addEventListener("load",o),()=>{nd(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&I){var i=hd(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z});i&&I(t,i)}},R);null==A||A(t,st)}return J.type===Eu.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,l,u){if(!sd.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,_=()=>{if(!g){g=!0;try{(()=>{if(P){var e=hd(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:I,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B,maxDepth:z});e&&P(t,e)}})()}finally{sd.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),sd.set(e,v)}}}(t,0,O),J}function dd(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var vd=class t{constructor(){ph(this,"parentElement",null),ph(this,"parentNode",null),ph(this,"ownerDocument",void 0),ph(this,"firstChild",null),ph(this,"lastChild",null),ph(this,"previousSibling",null),ph(this,"nextSibling",null),ph(this,"ELEMENT_NODE",1),ph(this,"TEXT_NODE",3),ph(this,"nodeType",void 0),ph(this,"nodeName",void 0),ph(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function cd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>fd(i,t,e,r)}function fd(t,e,i,r){pd(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function pd(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function gd(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var md="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",yd={map:{},getId(){return console.error(md),-1},getNode(){return console.error(md),null},removeNodeFromMap(){console.error(md)},has(){return console.error(md),!1},reset(){console.error(md)}};function bd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout(()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)},u))}}function _d(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout(()=>{try{i.set.call(this,t)}catch(t){}},0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>_d(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(yd=new Proxy(yd,{get(t,e,i){return"map"===e&&console.error(md),Reflect.get(t,e,i)}}));var wd=Date.now;function kd(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=Hu.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(i=s.body)||void 0===i?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null===(r=Hu.parentElement(s.body))||void 0===r?void 0:r.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function Sd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function xd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Cd(t){return t?t.nodeType===t.ELEMENT_NODE?t:Hu.parentElement(t):null}function Td(t,e,i,r){if(!t)return!1;var n=Cd(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(id(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function Md(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function Id(t,e){if(mh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Hu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Id(r,e))}function Ed(t){return Boolean(t.changedTouches)}function Rd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ad(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Pd(t){return!!t&&(t instanceof vd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Hu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wd=()=>(new Date).getTime());var Fd=class{constructor(){ph(this,"id",1),ph(this,"styleIDMap",new WeakMap),ph(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Od(t){var e,i=null;return"getRootNode"in t&&(null===(e=Hu.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Hu.host(Hu.getRootNode(t))&&(i=Hu.host(Hu.getRootNode(t))),i}function $d(t){var e=t.ownerDocument;if(!e)return!1;if(Hu.contains(e,t))return!0;var i=Hu.isConnected(t);return"boolean"==typeof i?i:function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Od(i);)i=e;return i}(t);return Hu.contains(e,i)}(t)}function Dd(t){return"__ln"in t}var Ld,Nd=class{constructor(){ph(this,"length",0),ph(this,"head",null),ph(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Dd(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Dd(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},qd=(t,e)=>t+"@"+e,jd=class{constructor(){ph(this,"frozen",!1),ph(this,"locked",!1),ph(this,"texts",[]),ph(this,"attributes",[]),ph(this,"attributeMap",new WeakMap),ph(this,"generatedAttributes",new WeakMap),ph(this,"removes",[]),ph(this,"mapRemoves",new Set),ph(this,"movedMap",{}),ph(this,"addedSet",new Set),ph(this,"movedSet",new Set),ph(this,"droppedSet",new Set),ph(this,"removesSubTreeCache",new Set),ph(this,"mutationCb",void 0),ph(this,"blockClass",void 0),ph(this,"blockSelector",void 0),ph(this,"maskTextClass",void 0),ph(this,"maskTextSelector",void 0),ph(this,"inlineStylesheet",void 0),ph(this,"maskInputOptions",void 0),ph(this,"maskTextFn",void 0),ph(this,"maskInputFn",void 0),ph(this,"maskAllElementAttributes",void 0),ph(this,"maskAttributeFn",void 0),ph(this,"keepIframeSrcFn",void 0),ph(this,"recordCanvas",void 0),ph(this,"canvasMaskingConfigured",void 0),ph(this,"inlineImages",void 0),ph(this,"slimDOMOptions",void 0),ph(this,"dataURLOptions",void 0),ph(this,"doc",void 0),ph(this,"mirror",void 0),ph(this,"iframeManager",void 0),ph(this,"stylesheetManager",void 0),ph(this,"shadowDomManager",void 0),ph(this,"canvasManager",void 0),ph(this,"processedNodeManager",void 0),ph(this,"unattachedDoc",void 0),ph(this,"canvasManagerReleased",!1),ph(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),ph(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=zu(),r=Vu();try{this.processBufferedMutations()}finally{t=zu()-i,e=r,Zu>0||Gu(t,null!=e?e:Uu)||t>rh.slowestBatchMs&&(rh.slowestBatchMs=t)}}}),ph(this,"processBufferedMutations",()=>{var t,e=[],i=new Set,r=new Nd,n=t=>{for(var e=t,i=-2;-2===i;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},s=s=>{var o=Hu.parentNode(s);if(o&&$d(s)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=mh(o)?this.mirror.getId(Od(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);null!=t||(t={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Rd(t,this.mirror)&&this.iframeManager.addIframe(t),Ad(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Pd(t)&&!Td(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Hu.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});var u=hd(s,t);u&&(e.push({parentId:a,nextId:l,node:u}),i.add(u.id))}};for(var o of this.mapRemoves)this.mapRemoves.delete(o),this.mirror.removeNodeFromMap(o);for(var a of this.movedSet)Hd(this.removesSubTreeCache,a)&&!this.movedSet.has(Hu.parentNode(a))||s(a);for(var l of this.addedSet)zd(this.droppedSet,l)||Hd(this.removesSubTreeCache,l)?zd(this.movedSet,l)?s(l):this.droppedSet.add(l):s(l);for(var u=null;r.length;){var h=null;if(u){var d=this.mirror.getId(Hu.parentNode(u.value)),v=n(u.value);-1!==d&&-1!==v&&(h=u)}if(!h)for(var c=r.tail;c;){var f=c;if(c=c.previous,f){var p=this.mirror.getId(Hu.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=Hu.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=Hu.host(g);if(-1!==this.mirror.getId(m)){h=f;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}u=h.previous,r.removeNode(h.value),s(h.value)}var y={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,i=Hu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,o=n[0],a=n[1];"string"!=typeof a&&null!==a||(e[o]=Oh({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&this.mutationCb(y)}),ph(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),ph(this,"genTextAreaValueMutation",t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var i=Array.from(Hu.childNodes(t),t=>Hu.textContent(t)||"").join("");e.attributes.value=Ah({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Dh(t),value:i,maskInputFn:this.maskInputFn})}),ph(this,"processMutation",t=>{if(!Md(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Hu.textContent(t.target);Td(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:rd(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Cd(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i,r=t.target,n=t.attributeName,s=null!==(i=t.attributeNamespace)&&void 0!==i?i:null,o=function(t,e,i){if(!i)return e;var r=t.getAttributeNodeNS(i,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===i)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===i)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===i)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(i);return n?n+":"+e:e}(r,n,s),a=s?r.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===o){var l=r,u=Dh(l);a=Ah({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(Td(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===r.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(a)&&r.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ed(r.tagName,o)){var v,c=td(this.doc,Ph(r.tagName),Ph(o),a,r,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(a)&&(o="rr_src"),h.attributes[o]=c,null===(v=this.generatedAttributes.get(t.target))||void 0===v||v.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=r.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";var _=this.generatedAttributes.get(t.target);_||this.generatedAttributes.set(t.target,_=new Set),_.add("rr_open_mode")}}break;case"childList":if(Td(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{var i=this.mirror.getId(e),r=mh(t.target)?this.mirror.getId(Hu.host(t.target)):this.mirror.getId(t.target);Td(t.target,this.blockClass,this.blockSelector,!1)||Md(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Bd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Id(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[qd(i,r)]?Bd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!mh(t.target)||!yh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Hu.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),ph(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Md(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[qd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!Td(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var r=Hu.childNodes(t),n=0,s=r.length;s>n;n++){var o=r[n];o&&this.genAdds(o)}if(Pd(t))for(var a=Hu.childNodes(Hu.shadowRoot(t)),l=0,u=a.length;u>l;l++){var h=a[l];h&&(this.processedNodeManager.add(h,this),this.genAdds(h,t))}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(var t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){for(var e=this.blockClass,i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(i&&(i.lastIndex=0),Td(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?Hu.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?Hu.host(r):null}return!1}};function Bd(t,e){for(var i=[e];i.length;){var r=i.pop();if(t.delete(r),r.nodeType!==r.TEXT_NODE)for(var n=Hu.childNodes(r),s=0,o=n.length;o>s;s++){var a=n[s];a&&i.push(a)}}}function Hd(t,e,i){return 0!==t.size&&function(t,e){var i=Hu.parentNode(e);return!!i&&t.has(i)}(t,e)}function zd(t,e){if(0===t.size)return!1;for(var i=Hu.parentNode(e);i;){if(t.has(i))return!0;i=Hu.parentNode(i)}return!1}var Ud=function(t,e){return void 0===e&&(e="rrweb"),Ld?function(){try{return t(...arguments)}catch(t){if(Ld&&!0===Ld(t,e))return;throw t}}:t},Wd=[];function Vd(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Gd(t,e){var i,r=new jd;r.init(t);try{i=new(ju())(Ud(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),Wd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Zd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Vd(t);if(o&&!Td(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=kd(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[cd("scroll",Ud(bd(Ud(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(cd("scrollend",Ud(l),i)),()=>u.forEach(t=>t())}function Jd(t,e){for(var i=Wd.length-1;i>=0;i--){var r=Wd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Wd.splice(i,1))}}}var Qd=["INPUT","TEXTAREA","SELECT"],Kd=new WeakMap;function Xd(t){return function t(e,i){if(iv("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||iv("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||iv("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||iv("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function Yd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function tv(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Hu.host(e));var o="#document"===e.nodeName?null===(i=e.defaultView)||void 0===i?void 0:i.Document:null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&a?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var i;e=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Ud(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function ev(t,e){void 0===e&&(e={});var i,r,s=t.doc.defaultView;if(!s)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var o=[],a=Ud(()=>{try{if(r)try{r.destroy(),r.reset()}finally{var e=Wd.indexOf(r);-1!==e&&Wd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{gd(o)}});try{if(t.recordDOM){var l=Gd(t,t.doc);i=l.observer,r=l.buffer}if(o.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=bd(Ud(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=Ud(bd(Ud(t=>{var e=Vd(t),i=Ed(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=wd()),l.push({x:r,y:o,id:n.getId(e),timeOffset:wd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?xu.Drag:t instanceof MouseEvent?xu.MouseMove:xu.TouchMove)}),o,{trailing:!1})),d=[cd("mousemove",h,r),cd("touchmove",h,r),cd("drag",h,r)];return Ud(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Cu).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Ph(t),l=(t=>i=>{var a=Vd(i);if(!Td(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Tu.Mouse;break;case"touch":l=Tu.Touch;break;case"pen":l=Tu.Pen}l===Tu.Touch&&(Cu[t]===Cu.MouseDown?u="TouchStart":Cu[t]===Cu.MouseUp&&(u="TouchEnd"))}else Ed(i)&&(l=Tu.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Tu.Touch||u.startsWith("Mouse")&&l===Tu.Mouse)&&(l=null)):Cu[t]===Cu.Click&&(l=h,h=null);var d=Ed(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;Ud(e)(n({type:Cu[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Cu[t]){case Cu.MouseDown:case Cu.MouseUp:a=a.replace("mouse","pointer");break;case Cu.TouchStart:case Cu.TouchEnd:return}u.push(cd(a,l,i))}),Ud(()=>{u.forEach(t=>t())})}(t)),o.push(Zd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return cd("resize",Ud(bd(Ud(()=>{var t=Sd(),e=xd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:s})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=Vd(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=Hu.parentElement(e)),e&&v&&Qd.indexOf(v)>=0&&!Td(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Dh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Ah({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach(t=>{if(t!==e){var i=t.value;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}})}}}function c(t,i){var s=Kd.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Kd.set(t,i);var o=r.getId(t);Ud(e)(n({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>cd(t,Ud(v),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>_d(t[0],t[1],{set(){Ud(v)({target:this,isTrusted:!1})}},!1,p))),Ud(()=>{gd(f)})}(t)),o.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=Ud(t=>bd(Ud(s=>{var o=Vd(s);if(o&&!Td(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}}),s.media||500)),l=[cd("play",a(Iu.Play),o),cd("pause",a(Iu.Pause),o),cd("seeked",a(Iu.Seeked),o),cd("volumechange",a(Iu.VolumeChange),o),cd("ratechange",a(Iu.RateChange),o)];return Ud(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var u=function(t){var e=new Map,i=new Set,r=!0,n=t=>{if(r)try{t()}catch(t){}},s=t=>{var i,r=e.get(t);if(r){for(;null===(i=r[0])||void 0===i?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(o))};try{d=t.setTimeout(f,5e3),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(o)))}},reset(){r=!1,i.forEach(e=>t.clearTimeout(e)),i.clear(),e.clear()}}}(s);o.push(u.reset),o.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,adds:[{rule:a,index:l}]})),l},"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,removes:[{index:a}]})),l},"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=Yd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,()=>i({id:d,styleId:v,replace:a}),()=>{var t=kh(e);null!==t&&i({id:d,styleId:v,replace:t})});try{u.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,replaceSync:a})),l},"host")}));var d={};rv("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(rv("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),rv("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),rv("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var v={};return Object.entries(d).forEach(t=>{var e=t[0],s=t[1];v[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(v[e].insertRule,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Yd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Xd(e),l];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Yd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Xd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),Ud(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach(t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule})})}(t,{win:s,mutationQueue:u})),o.push(tv(t,t.doc)),o.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Ud((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Yd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Xd(e.parentRule);a.queueMutation(c,()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m}))}return v},"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ud((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Yd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Xd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),Ud(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:s,mutationQueue:u})),t.collectFonts&&o.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=Bu(i.fonts,"add",function(t){return function(i){return setTimeout(Ud(()=>{var t=s.get(i);t&&(e(t),s.delete(i))}),0),t.apply(this,[i])}});return n.push(()=>{r.FontFace=o}),n.push(a),Ud(()=>{n.forEach(t=>t())})}(t))}for(var h of(o.push(function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Ud(()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Td(d,r,n,!0)||Td(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),cd("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Bu(i.customElements,"define",function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}}):()=>{}}(t)),t.plugins))o.push(h.observer(h.callback,s,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function iv(t){return void 0!==window[t]}function rv(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var nv=class{constructor(t){ph(this,"generateIdFn",void 0),ph(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ph(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,i,r))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,i))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},sv=class{constructor(t){ph(this,"iframes",new WeakMap),ph(this,"crossOriginIframeMap",new WeakMap),ph(this,"crossOriginIframeMirror",new nv(Gh)),ph(this,"crossOriginIframeStyleMirror",void 0),ph(this,"crossOriginIframeRootIdMap",new WeakMap),ph(this,"mirror",void 0),ph(this,"mutationCb",void 0),ph(this,"wrappedEmit",void 0),ph(this,"loadListener",void 0),ph(this,"pageHideListener",void 0),ph(this,"stylesheetManager",void 0),ph(this,"recordCrossOriginIframes",void 0),ph(this,"messageHandler",void 0),ph(this,"nestedIframeListeners",new Map),ph(this,"attachedWindows",new WeakMap),ph(this,"attachedDocuments",new WeakMap),ph(this,"attachedIframes",new Map),ph(this,"loadListenerDisposers",new WeakMap),ph(this,"iframeElementsById",new Map),ph(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new nv(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null===(r=this.attachedIframes.get(t))||void 0===r?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>pd(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{fd(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);pd(()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}pd(()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}}),null===(i=this.loadListener)||void 0===i||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case Su.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Su.IncrementalSnapshot,data:{source:xu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Su.Meta:case Su.Load:case Su.DomContentLoaded:return!1;case Su.Plugin:return e;case Su.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Su.IncrementalSnapshot:switch(e.data.source){case xu.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case xu.Drag:case xu.TouchMove:case xu.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case xu.ViewportResize:return!1;case xu.MediaInteraction:case xu.MouseInteraction:case xu.Scroll:case xu.CanvasMutation:case xu.Input:return this.replaceIds(e.data,t,["id"]),e;case xu.StyleSheetRule:case xu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case xu.Font:return e;case xu.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case xu.AdoptedStyleSheet:var r;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===Eu.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){var e=this.attachedIframes.get(t),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach(t=>{var e=this.nestedIframeListeners.get(t);e&&(fd(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(fd(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach(t=>{pd(()=>this.mirror.removeNodeFromMap(t))}),pd(()=>Jd(i,s)),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach((e,i)=>{this.mirror.has(i)||t.push(i)}),t.forEach(t=>this.removeIframeById(t))}}reattachIframes(){this.attachedIframes.forEach((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&fd(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{fd(e,"message",t)}),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(e=>t.add(e.element)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},ov=class{constructor(t){ph(this,"shadowDoms",new WeakSet),ph(this,"mutationCb",void 0),ph(this,"scrollCb",void 0),ph(this,"bypassOptions",void 0),ph(this,"mirror",void 0),ph(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,r;if(yh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(r=Hu.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=Gd(n({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Wd.indexOf(l);-1!==t&&Wd.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Zd(n({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(Hu.host(t))),this.restoreHandlers.push({doc:s,handler:tv({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:Bu(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=Hu.shadowRoot(this);return s&&$d(this)&&i.addShadowRoot(s,e),n}})})}reset(){this.restoreHandlers.forEach(t=>{var e=t.handler;try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}},av="skip-frame";function lv(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var uv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),dv=0;64>dv;dv++)hv[uv.charCodeAt(dv)]=dv;var vv=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=uv[i[e]>>2],n+=uv[(3&i[e])<<4|i[e+1]>>4],n+=uv[(15&i[e+1])<<2|i[e+2]>>6],n+=uv[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n},cv=new Map,fv=(t,e,i)=>{if(t&&(mv(t,e)||"object"==typeof t)){var r=function(t,e){var i=cv.get(t);return i||cv.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function pv(t,e,i,r){return t instanceof Array?t.map(t=>pv(t,e,i,r)):null===t?t:t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:vv(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[pv(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[pv(t.data,e,i,r),t.width,t.height]}:mv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:fv(t,e,i)}:t}var gv=(t,e,i,r)=>t.map(t=>pv(t,e,i,r)),mv=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(i.find(i=>t instanceof e[i]))},yv=["webgl","webgl2"];function bv(t){return"nodeType"in t}function _v(t,e,i,r){var s=[];try{if(r){var o=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return Bu(r.prototype,"configure",function(r){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||bv(o)&&Td(o,e,i,!0))return r.call(this,s);bv(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&s?n({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}})}(t,e,i);o&&s.push(o)}var a=Bu(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Td(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&yv.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function wv(t,e,i,r,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=Bu(t,l,function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(fv(d,s,this),this.canvas&&"tagName"in this.canvas&&!Td(this.canvas,r,n,!0)){var v={type:e,property:l,args:gv(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=_d(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!Td(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var kv='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Sv="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",kv],{type:"text/javascript;charset=utf-8"});function xv(t){var e;try{if(!(e=Sv&&(self.URL||self.webkitURL).createObjectURL(Sv)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(kv),{name:null==t?void 0:t.name})}}var Cv,Tv,Mv,Iv=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){ph(this,"pendingCanvasMutations",new Map),ph(this,"rafStamps",{latestId:0,invokeId:null}),ph(this,"mirror",void 0),ph(this,"mutationCb",void 0),ph(this,"resetObservers",void 0),ph(this,"frozen",!1),ph(this,"locked",!1),ph(this,"rafIdTimestamp",null),ph(this,"rafIdFlush",null),ph(this,"refCount",0),ph(this,"torndown",!1),ph(this,"resetFrameDedup",null),ph(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=_v(e,i,r,!0),h=new Map;try{a=new xv}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:Mu["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var v,c=1e3/t,f=0,p=t=>{var u,g;d||(f&&c>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Td(t,i,r,!0)||u.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),u).forEach(function(){var t=o(function*(t){var e=s.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i,r,o=t.getContext(t.__context);if(null==o||null===(i=o.isContextLost)||void 0===i?void 0:i.call(o))return void h.set(e,!1);!1===(null==o||null===(r=o.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&o.clear(o.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return av}if(void 0!==o){if(!Array.isArray(o)||!o.every(lv))return av;var a=i/n,l=r/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}})}}}(n.canvasMasking,t,v,c,u,d);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:e,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(p))};v=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=_v(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=Bu(e.CanvasRenderingContext2D.prototype,o,function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Td(this.canvas,i,r,!0)||setTimeout(()=>{var i=gv(l,e,this,n);t(this.canvas,{type:Mu["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=_d(e.CanvasRenderingContext2D.prototype,o,{set(e){Td(this.canvas,i,r,!0)||t(this.canvas,{type:Mu["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)if(a(l))continue;return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...wv(e.WebGLRenderingContext.prototype,Mu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...wv(e.WebGL2RenderingContext.prototype,Mu.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,i){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==i){var s=n.map(e=>r(e,t));this.mutationCb({id:i,type:n[0].type,commands:s}),this.pendingCanvasMutations.delete(e)}}}},Ev=class{constructor(t){var e;ph(this,"trackedLinkElements",new WeakSet),ph(this,"pendingDeferredSheets",new Set),ph(this,"mutationCb",void 0),ph(this,"adoptedStyleSheetCb",void 0),ph(this,"maskAllElementAttributes",void 0),ph(this,"maskAttributeFn",void 0),ph(this,"styleMirror",new Fd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=Eh(r))}catch(t){}if(!i||!r)return vh(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=zu(),d=Vu(),v=!0;try{if(s)return a=!0,vh(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(vh(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(vh(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),Gu(l=zu()-h,null!=(u=d)?u:Uu)||(nh.totalMs+=l,l>nh.slowestSliceMs&&(nh.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null===(i=this.beginDeferredLinkInlining(t,e))||void 0===i||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Oh({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var o=zu();try{uh(()=>{try{var e=t.rules||t.cssRules;e&&lh(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:Sh(e,t.href),index:i}))})})}finally{hh(zu()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),sd.forEach(t=>t.abort()),sd.clear()}trackStylesheetInLinkElement(t){}},Rv=class{constructor(){ph(this,"nodeMap",new WeakMap),ph(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},Av=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Pv,Fv=document.createElement("iframe");document.body.appendChild(Fv),Array.from=(null===(Pv=Fv.contentWindow)||void 0===Pv?void 0:Pv.Array.from)||Array.from,document.body.removeChild(Fv)}}catch(t){console.debug("Unable to override Array.from",t)}var Ov=new Rh,$v=new Set([xu.Mutation,xu.MediaInteraction,xu.StyleSheetRule,xu.CanvasMutation,xu.Font,xu.Log,xu.StyleDeclaration,xu.AdoptedStyleSheet]);function Dv(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Lv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,s=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,l=void 0===a?"rr-block":a,u=i.blockSelector,h=void 0===u?null:u,d=i.ignoreClass,v=void 0===d?"rr-ignore":d,c=i.ignoreSelector,f=void 0===c?null:c,p=i.maskTextClass,g=void 0===p?"rr-mask":p,m=i.maskTextSelector,y=void 0===m?null:m,b=i.inlineStylesheet,_=void 0===b||b,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,M=i.maskAllElementAttributes,I=void 0!==M&&M,E=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,F=void 0===P?{}:P,O=i.dataURLOptions,D=void 0===O?{}:O,L=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,z=void 0!==H&&H,U=i.recordCrossOriginIframes,W=void 0!==U&&U,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,J=void 0!==Z&&Z,Q=i.collectFonts,K=void 0!==Q&&Q,X=i.inlineImages,Y=void 0!==X&&X,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;Ld=i.errorHandler;var ot=n({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),Ov.reset();var ut,ht=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=dd(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var vt,ct,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return A&&!lt&&(t=A(t)),t};Cv=(t,e)=>{var i,n=t;if(n.timestamp=wd(),!(null===(i=Wd[0])||void 0===i?void 0:i.isFrozen())||n.type===Su.FullSnapshot||n.type===Su.IncrementalSnapshot&&$v.has(n.data.source)||Wd.forEach(t=>t.unfreeze()),at)null==r||r(gt(n),e);else if(lt){var a={type:"rrweb",event:gt(n),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(n.type===Su.FullSnapshot)ut=n,ft=0;else if(n.type===Su.IncrementalSnapshot){if(n.data.source===xu.Mutation&&n.data.isAttachIframe)return;ft++,(o&&ft>=o||s&&n.timestamp-ut.timestamp>s)&&Tv(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,i=new Set;if(t.adds.length>0)for(var r of t.adds){var s=Ov.getNode(r.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach(t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}}),null==ct||ct(),wt.cleanupDetachedIframes()}Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Mutation},t)})},yt=t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Scroll},t)}),bt=t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.CanvasMutation},t)}),_t=new Ev({mutationCb:mt,adoptedStyleSheetCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new sv({mirror:Ov,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:Cv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Ov,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Rv,xt=null==N?void 0:N.configured;Mv=new Iv({recordCanvas:z,mutationCb:bt,win:window,blockClass:l,blockSelector:h,mirror:Ov,sampling:F.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new ov({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:Mv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Ov});Tv=function(t){if(void 0===t&&(t=!1),B){sh(w);try{Cv({type:Su.Meta,data:{href:window.location.href,width:xd(),height:Sd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Wd.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Rh:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,b=i.canvasMaskingConfigured,_=i.maskAllInputs,w=void 0!==_&&_,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,M=i.slimDOM,I=i.dataURLOptions,E=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,q=i.maxDepth,j=i.inlineStylesheetBudgetRules,B=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,H=dd(void 0!==M&&M);sh(j);try{return hd(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{oh()}}(document,{mirror:Ov,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:dt,dataURLOptions:ot,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,onSerialize(t){Rd(t,Ov)&&wt.addIframe(t),Ad(t,Ov)&&_t.trackLinkElement(t),Pd(t)&&Ct.addShadowRoot(Hu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){_t.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=th,th=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Cv({type:Su.FullSnapshot,data:{node:r,initialOffset:kd(window)}},t),Wd.forEach(t=>t.unlock()),Mv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&pd(()=>{o=e.beginDeferredLinkInlining(i,Ov.getId(i))})},u=()=>{if(o){var t=o,e=!0;pd(()=>{e=t.advance(200)}),e&&(o=null)}},h=()=>{o||l(),u()},d=t=>{if(n=null,!r){var e=0;do{try{h()}catch(t){null==o||o.discard(),o=null,ch(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Dv(d):i())}};return n=Dv(d),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);ch(v),null==o||o.discard(),o=null}i()}}}}(i,_t,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,Ov.getId(document))}finally{oh()}var s}};try{var Tt=[];for(var Mt of(Tt.push(cd("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(cd(Mt,Wu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{pd(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)}),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=Ov.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var It=t=>{var e;return Ud(ev)({mutationCb:mt,mousemoveCb:(t,e)=>Cv({type:Su.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.ViewportResize},t)}),inputCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Input},t)}),mediaInteractionCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.MediaInteraction},t)}),styleSheetRuleCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.StyleSheetRule},t)}),styleDeclarationCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Font},t)}),selectionCb(t){Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Selection},t)})},customElementCb(t){Cv({type:Su.IncrementalSnapshot,data:n({source:xu.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,userTriggeredOnInput:J,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Ov,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Mv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==tt||null===(e=tt.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>Cv({type:Su.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Ov.getId(t),i=It(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}}),wt.addPageHideListener(t=>{var e=Ov.getId(t);null==vt||vt(e),Jd(t)});var Et=-1,Rt=t=>Cv({type:Su.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),At=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Ov.getId(s):-1;o!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Tv();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(cd("fullscreenchange",At)),Tt.push(cd("webkitfullscreenchange",At)),Tt.push(cd("mozfullscreenchange",At)),Tt.push(cd("MSFullscreenChange",At)),Av=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(cd("DOMContentLoaded",()=>{Cv({type:Su.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(cd("load",()=>{Cv({type:Su.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,gd(Tt),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Ov.reset(),Av=!1,Ld=void 0}}catch(t){console.warn(t)}}Lv.addCustomEvent=(t,e)=>{if(!Av)throw new Error("please add custom event after start recording");Cv({type:Su.Custom,data:{tag:t,payload:e}})},Lv.freezePage=()=>{Wd.forEach(t=>t.freeze())},Lv.takeFullSnapshot=t=>{if(!Av)throw new Error("please take full snapshot after start recording");Tv(t)},Lv.mirror=Ov,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Nv=Object.create(null);function qv(t){return qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qv(t)}function jv(t,e,i){return(e=function(t){var e=function(t){if("object"!=qv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=qv(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Nv.Node=Object.create(null),Nv.ShadowRoot=Object.create(null),Nv.MutationObserver=Object.create(null),Nv.Element=Object.create(null);var Bv=class{constructor(t){jv(this,"fileName",void 0),jv(this,"functionName",void 0),jv(this,"lineNumber",void 0),jv(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},Hv=/(^|@)\S+:\d+/,zv=/^\s*at .*(\S+:\d+|\(native\))/m,Uv=/^(eval@)?(\[native code])?$/,Wv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(zv)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(zv)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop());return new Bv({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Uv)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Bv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Bv({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Bv({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Bv({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(Hv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new Bv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function Vv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Gv(t){return Array.isArray(t)}function Zv(t){return"object"==typeof t&&null!==t&&!Gv(t)}function Jv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(Zv(t[i])&&Jv(t[i],e-1))return!0;return!1}function Qv(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Zv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||Zv(o)&&Jv(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Gv(u)?Vv(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Kv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Xv(t,e,i){var r,n=i?Object.assign({},Kv,i):Kv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message;t({level:"error",trace:Wv.parse(e.error).map(t=>t.toString()),payload:[Qv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[Qv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Qv("Uncaught (in promise)",n.stringifyOptions),Qv(e.reason,n.stringifyOptions)]),t({level:"error",trace:Wv.parse(i).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",h),l.push(()=>{e.removeEventListener("unhandledrejection",h)})}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach(t=>t())};function v(e,i){var r=this;return e[i]?function(e,s){try{if(!(s in e))return()=>{};var l=e[s],u={next:l},h=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=Wv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>Qv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Qv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return u.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:u}})),e[s]=h,()=>{if(e[s]!==h)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=e[s],r=t(i);r;){if(r.next===h)return void(r.next=u.next);r=t(i=r.next)}else e[s]=u.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Yv=t=>({name:"rrweb/console@1",observer:Xv,options:t}),tc=()=>{},ec=t=>{var e;if(Se(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function ic(t,e,i){try{if(!(e in t))return tc;var r={next:t[e]},n=i(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)});return Se(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e],s=ec(i);s;){if(s.next===n)return void(s.next=r.next);s=ec(i=s.next)}else t[e]=r.next}}catch(t){return tc}}function rc(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var nc=Pn("[Recorder]"),sc=t=>"navigation"===t.entryType,oc=t=>"resource"===t.entryType;function ac(t,e){return!!e&&(Fe(e)||e[t])}function lc(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var uc=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function hc(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find(t=>"content-type"===t.toLowerCase()),i=e&&r[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!lc(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(uc))return!1;if(Fe(i))return!0;if(ke(i))return n(i);var s=i[e];return Fe(s)?s:n(s)}function dc(t,e,i,r,n,s){return vc.apply(this,arguments)}function vc(){return vc=o(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(nc.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null):function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),t=>oc(t)&&t.initiatorType===e&&(Te(r)||t.startTime>=r)&&(Te(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),dc(t,e,i,r,n,s+1))}),vc.apply(this,arguments)}function cc(t){var e=t.body,i=t.options,r=t.url;if(Re(e))return null;var n=rc(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Me(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Oe(e))return Zn(e);if(xe(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var fc=t=>!Ee(t)&&("navigation"===t.entryType||"resource"===t.entryType);function pc(t){var e=t.entry,i=t.method,r=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(a||0)),c=[n({},e?e.toJSON():{name:u},{startTime:Te(a)?void 0:Math.round(a),endTime:Te(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:r,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(fc(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var gc=["video/","audio/"];function mc(t){return xe(t)&&Se(t.getReader)&&Se(t.tee)}var yc="[SessionReplay] Timeout while trying to read body",bc="[SessionReplay] Failed to read body";function _c(t){return bc+": "+t}function wc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function kc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(yc),500);try{t.clone().text().then(t=>e(t),t=>e(_c(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(bc)}})}(t);var i=zs(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(wc(i)):function(t,e){return new Promise(i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch(()=>{})}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout(()=>o(yc),500);try{a=t.clone()}catch(t){return void o(bc)}var u=a.body;if(mc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(bc)}var h=[],d=0;!function t(){r.read().then(i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(wc(e));d+=a.byteLength,h.push(a)}t()}},t=>o(_c(t)))}()}else try{a.text().then(t=>o(t),t=>o(_c(t)))}catch(t){o(bc)}})}(t,i)}function Sc(){return Sc=o(function*(t){var e=t.r,i=t.options,r=rc(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):kc(e,i)}),Sc.apply(this,arguments)}function xc(){return xc=o(function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=gc.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=rc(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Ee(r)?kc(e,i):Promise.resolve(r)}),xc.apply(this,arguments)}var Cc=null;function Tc(t,e,i){if(!("performance"in e))return()=>{};if(Cc)return nc.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Us,i):Us,s=e=>{var i=[],s=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!s){var n=r.maskRequestFn(t);e||(s=!n||(t=>!!t&&Xs.has(t))(n)),n&&i.push(n)}}),i.length>0&&t(n({},e,{requests:i}))},a=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>sc(t)||oc(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>pc({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>sc(t)||oc(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>pc({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>i.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:n}),()=>{r.disconnect()}}(s,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=ac("request",i.recordHeaders),n=ac("response",i.recordHeaders),s=ic(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(hc({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=cc({body:t,options:i,url:a})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)}),n&&(p.responseHeaders=r),hc({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=cc({body:d.response,options:i,url:a})),dc(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:pc({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){nc.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(s,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=ac("request",i.recordHeaders),n=ac("response",i.recordHeaders),s=ic(e,"fetch",s=>function(){var a=o(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return nc.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach((t,e)=>{c[e]=t}),r&&(v.requestHeaders=c),!mc(null==a?void 0:a.body)&&hc({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return Sc.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){nc.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=lc(o)?yield s(l):yield s(o,a),d=e.performance.now();try{var f={};u.headers.forEach((t,e)=>{f[e]=t}),n&&(v.responseHeaders=f),hc({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return xc.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){nc.error("Failed to record fetch response for network capture",t)}return u}finally{dc(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:pc({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{s()}}(s,e,r)),Cc=()=>{a(),l(),u(),Cc=null}}var Mc,Ic,Ec,Rc,Ac,Pc,Fc,Oc,$c,Dc,Lc,Nc,qc,jc,Bc,Hc=t=>({name:"rrweb/network@1",observer:Tc,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Yv,getRecordNetworkPlugin:Hc},b.__PosthogExtensions__.rrweb={record:Lv,version:"v2",wasMaxDepthReached:()=>ud,resetMaxDepthState(){ud=!1,ld=!1},getLastSnapshotCost:()=>Xu,getMutationCost:()=>n({},rh),resetSnapshotCostState(){Zu=0,Ju=0,Qu=0,Uu=0,Ku={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Xu=null,Yu=null,th=[],eh=0,ih=0,rh={slowestBatchMs:0},nh={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Lv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:Yv},b.getRecordNetworkPlugin=Hc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new ku(t,e);var zc,Uc,Wc,Vc,Gc={},Zc=[],Jc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qc=Array.isArray;function Kc(t,e){for(var i in e)t[i]=e[i];return t}function Xc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Yc(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Mc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return tf(t,o,r,n,null)}function tf(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Ec:n,__i:-1,__u:0};return null==n&&null!=Ic.vnode&&Ic.vnode(s),s}function ef(t){return t.children}function rf(t,e){this.props=t,this.context=e}function nf(t,e){if(null==e)return t.__?nf(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?nf(t):null}function sf(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Kc({},e);s.__v=e.__v+1,Ic.vnode&&Ic.vnode(s),pf(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?nf(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,mf(r,s,n),e.__e=e.__=null,s.__e!=i&&of(s)}}function of(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),of(t)}function af(t){(!t.__d&&(t.__d=!0)&&Rc.push(t)&&!lf.__r++||Ac!=Ic.debounceRendering)&&((Ac=Ic.debounceRendering)||Pc)(lf)}function lf(){try{for(var t,e=1;Rc.length;)Rc.length>e&&Rc.sort(Fc),t=Rc.shift(),e=Rc.length,sf(t)}finally{Rc.length=lf.__r=0}}function uf(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Zc,b=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=tf(null,o,null,null,null):Qc(o)?o=t.__k[s]=tf(ef,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=tf(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=df(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&!(2&a.__u)&&(a.__e==r&&(r=nf(a)),_f(a,a));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Gc,c.__i=d,g=pf(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&bf(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=hf(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function hf(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=hf(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=nf(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function df(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&!(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&!(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function vf(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Jc.test(e)?i:i+"px"}function cf(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||vf(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||vf(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Lc,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Dc]=r[Dc]:(i[Dc]=Nc,t.addEventListener(e,s?jc:qc,s)):t.removeEventListener(e,s?jc:qc,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function ff(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[$c])e[$c]=Nc++;else if(i[Dc]>e[$c])return;return i(Ic.event?Ic.event(e):e)}}}function pf(t,e,i,r,n,s,o,a,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=Ic.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new rf(y,_),v.constructor=C,v.render=wf),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Kc({},v.__s)),Kc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(t){t&&(t.__=e)}),Zc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,p,g)})}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=Ic.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Zc.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++k);v.state=v.__s,null!=v.getChildContext&&(r=Kc(Kc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===ef&&null==h.key?yf(h.props.children):h,a=uf(t,Qc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)Xc(s[x]);gf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||gf(e);Ic.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||Gc,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Ic.__m&&Ic.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Mc.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||cf(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:a&&"function"!=typeof c||g[u]===c||cf(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),uf("template"==e.type?t.content:t,Qc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&nf(i,0),a,l),null!=s)for(u=s.length;u--;)Xc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&cf(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&cf(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Ic.diffed)&&h(e),128&e.__u?void 0:a}function gf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(gf))}function mf(t,e,i){for(var r=0;i.length>r;r++)bf(i[r],i[++r],i[++r]);Ic.__c&&Ic.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){Ic.__e(t,e.__v)}})}function yf(t){return"object"!=typeof t||null==t||t.__b>0?t:Qc(t)?t.map(yf):void 0!==t.constructor?null:Kc({},t)}function bf(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Ic.__e(t,i)}}function _f(t,e,i){var r,n;if(Ic.unmount&&Ic.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||bf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Ic.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&_f(r[n],e,i||"function"!=typeof t.type);i||Xc(t.__e),t.__c=t.__=t.__e=void 0}function wf(t,e,i){return this.constructor(t,i)}function kf(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),Ic.__&&Ic.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],pf(e,t=(!r&&i||e).__k=Yc(ef,null,[t]),n||Gc,Gc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?Mc.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),mf(s,t,o),t.props.children=null}Mc=Zc.slice,Ic={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Ec=0,rf.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Kc({},this.state);"function"==typeof t&&(t=t(Kc({},i),this.props)),t&&Kc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),af(this))},rf.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),af(this))},rf.prototype.render=ef,Rc=[],Pc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fc=function(t,e){return t.__v.__b-e.__v.__b},lf.__r=0,Oc=Math.random().toString(8),$c="__d"+Oc,Dc="__a"+Oc,Lc=/(PointerCapture)$|Capture$/i,Nc=0,qc=ff(!1),jc=ff(!0),Bc=0;var Sf=0,xf=[],Cf=Ic,Tf=Cf.__b,Mf=Cf.__r,If=Cf.diffed,Ef=Cf.__c,Rf=Cf.unmount,Af=Cf.__;function Pf(t,e){Cf.__h&&Cf.__h(Uc,t,Sf||e),Sf=0;var i=Uc.__H||(Uc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Ff(t){return Sf=1,function(t,e){var i=Pf(zc++,2);if(i.t=t,!i.__c&&(i.__=[Uf(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Uc,!Uc.__f)){var r=function(t,e,r){if(!i.__c.__H)return!0;var s=!1,o=i.__c.props!==t;if(i.__c.__H.__.some(function(t){if(t.__N){s=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),n){var a=n.call(this,t,e,r);return s?a||o:a}return!s||o};Uc.__f=!0;var n=Uc.shouldComponentUpdate,s=Uc.componentWillUpdate;Uc.componentWillUpdate=function(t,e,i){if(this.__e){var o=n;n=void 0,r(t,e,i),n=o}s&&s.call(this,t,e,i)},Uc.shouldComponentUpdate=r}return i.__N||i.__}(Uf,t)}function Of(t,e){var i=Pf(zc++,3);!Cf.__s&&zf(i.__H,e)&&(i.__=t,i.u=e,Uc.__H.__h.push(i))}function $f(t){return Sf=5,Df(function(){return{current:t}},[])}function Df(t,e){var i=Pf(zc++,7);return zf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Lf(t){var e,i=Uc.context[t.__c],r=Pf(zc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(Uc)),i.props.value):t.__}function Nf(){for(var t;t=xf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Bf),e.__h.some(Hf),e.__h=[]}catch(i){e.__h=[],Cf.__e(i,t.__v)}}}Cf.__b=function(t){Uc=null,Tf&&Tf(t)},Cf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Af&&Af(t,e)},Cf.__r=function(t){Mf&&Mf(t),zc=0;var e=(Uc=t.__c).__H;e&&(Wc===Uc?(e.__h=[],Uc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Nf(),zc=0)),Wc=Uc},Cf.diffed=function(t){If&&If(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==xf.push(e)&&Vc===Cf.requestAnimationFrame||((Vc=Cf.requestAnimationFrame)||jf)(Nf)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Wc=Uc=null},Cf.__c=function(t,e){e.some(function(t){try{t.__h.some(Bf),t.__h=t.__h.filter(function(t){return!t.__||Hf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Cf.__e(i,t.__v)}}),Ef&&Ef(t,e)},Cf.unmount=function(t){Rf&&Rf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{Bf(t)}catch(t){e=t}}),i.__H=void 0,e&&Cf.__e(e,i.__v))};var qf="function"==typeof requestAnimationFrame;function jf(t){var e,i=function(){clearTimeout(r),qf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);qf&&(e=requestAnimationFrame(i))}function Bf(t){var e=Uc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Uc=e}function Hf(t){var e=Uc;t.__c=t.__(),Uc=e}function zf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function Uf(t,e){return"function"==typeof e?e(t):e}var Wf="gzip-js",Vf="base64",Gf="events",Zf="cancelEvents",Jf="tab",Qf="left",Kf="center",Xf="right",Yf="next_to_trigger",tp="popover",ep="widget",ip="external_survey",rp="open",np="multiple_choice",sp="single_choice",op="rating",ap="end",lp="always",up="survey shown",hp="survey dismissed",dp="survey sent",vp="$survey_id",cp="$survey_name",fp="$survey_iteration",pp="$survey_iteration_start_date",gp="$survey_partially_completed",mp="$survey_submission_id",yp="$survey_completed",bp="$survey_last_seen_date",_p="$survey_language",wp="popover";function kp(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Se(i.then)&&i.then(void 0,()=>{})}}}}var Sp=Pn("[Surveys]"),xp="PostHog is not capturing, so a survey response cannot be recorded";function Cp(t){return Se(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing()}function Tp(t){return!(!t.start_date||t.end_date)}function Mp(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Ip=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Ep=t=>Ip("seenSurvey_",t),Rp=t=>{try{var e=Ep(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Sp.error("Failed to persist survey seen state",t)}},Ap=[tp,ep,"api"],Pp={ignoreConditions:!1,ignoreDelay:!1,displayType:wp},Fp="logs",Op=Pn("[Stylesheet Loader]"),$p=a,Dp=h,Lp="#020617",Np={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Xf,widgetType:Jf,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Lp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},qp=[Kf,Qf,Xf];function jp(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Bp(t){var e;void 0===t&&(t=Np.backgroundColor),"#"===t[0]&&(e=jp(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=jp(i)),!e)return Lp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Lp:"white"}return Lp}var Hp=(t,e,i)=>{var r=ag(t),s=Dp.querySelector("."+r);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Dp.createElement("div");((t,e,i)=>{var r=n({},Np,i),s=t.style,o=!qp.includes(r.position)||e===ep&&(null==i?void 0:i.widgetType)===Jf;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),s.setProperty("--ph-survey-box-padding",r.boxPadding),s.setProperty("--ph-survey-max-width",r.maxWidth),s.setProperty("--ph-survey-z-index",r.zIndex),s.setProperty("--ph-survey-border-color",r.borderColor),o?(s.setProperty("--ph-survey-border-radius",r.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",r.backgroundColor),s.setProperty("--ph-survey-box-shadow",r.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Bp(r.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Bp(r.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Bp(r.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),s.setProperty("--ph-widget-color",r.widgetColor),s.setProperty("--ph-widget-text-color",Bp(r.widgetColor)),s.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||r.inputBackground;a||"white"!==r.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Bp(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",r.outlineColor)})(o,t.type,t.appearance),o.className=r;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Se(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Op.error("prepare_external_dependency_stylesheet returned null"),null)})(Dp,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return(i||Dp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},zp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;s?Cp(s)&&(Rp(i),s.capture(dp,n({[cp]:i.name,[vp]:i.id,[fp]:i.current_iteration,[pp]:i.current_iteration_start_date,[mp]:r,[yp]:o},l&&{[_p]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},za(e,i,u),a,{$set:{[Ua(i,"responded")]:!0}})),o&&($p.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),og(i),s.reloadFeatureFlags())):Sp.error("[survey sent] event not captured, PostHog instance not found.")},Up=(t,e,i)=>{return n({[cp]:t.name,[vp]:t.id,[fp]:t.current_iteration,[pp]:t.current_iteration_start_date,[gp]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Re(t)))},(null==e?void 0:e.surveyLanguage)&&{[_p]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[mp]:null==e?void 0:e.surveySubmissionId},za(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Wp=(t,e,i,r)=>{if(e){if(!i){var s=ng(t),o=s?s.surveyLanguage:r;e.capture(hp,n({},Up(t,s,e),o&&{[_p]:o},{$set:{[Ua(t,"dismissed")]:!0}})),og(t),Rp(t),$p.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Sp.error("[survey dismissed] event not captured, PostHog instance not found.")},Vp=(t,e)=>{if(e){var i=(t=>Ip("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ng(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture("survey abandoned",Up(t,r,e),{transport:"sendBeacon"})}}else Sp.error("[survey abandoned] event not captured, PostHog instance not found.")},Gp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Zp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,Jp=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Qp=(t,e)=>{var i;return(t=>t.questions.some(t=>{var e;return!(null==(e=t.branching)||!e.type)}))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map(t=>[t.id,t])),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Zp(t.questions,Gp(t.questions)):t.questions},Kp=t=>Ka(t)||sg(t),Xp=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach(function(t){t.__e=!0,af(t)})},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Bc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Yp=()=>Lf(Xp),tg=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=Kc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Mc.call(arguments,2):i),tf(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function eg(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=es(e);return!!s&&tl[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var ig=t=>Ip("inProgressSurvey_",t),rg=(t,e)=>{try{localStorage.setItem(ig(t),JSON.stringify(e))}catch(t){Sp.error("Error setting in-progress survey state in localStorage",t)}},ng=t=>{try{var e=localStorage.getItem(ig(t));if(e)return JSON.parse(e)}catch(t){Sp.error("Error getting in-progress survey state from localStorage",t)}return null},sg=t=>{var e=ng(t);return!Re(null==e?void 0:e.surveySubmissionId)},og=t=>{try{localStorage.removeItem(ig(t))}catch(t){Sp.error("Error clearing in-progress survey state from localStorage",t)}};function ag(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function lg(t,e,i){if(void 0===e&&(e=Xf),t===ip)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Qf:return{left:"30px"};case Kf:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===ep&&i===Jf?"60px":"30px"}}}var ug=0;function hg(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ug,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Ic.vnode&&Ic.vnode(u),u}var dg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),vg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),cg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),fg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),pg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),gg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:hg("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),mg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:hg("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),yg=hg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[hg("g",{"clip-path":"url(#clip0_2415_6911)",children:[hg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:hg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),hg("g",{mask:"url(#mask0_2415_6911)",children:[hg("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),hg("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),hg("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),hg("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),hg("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),hg("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),hg("defs",{children:hg("clipPath",{id:"clip0_2415_6911",children:hg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function bg(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return hg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",yg]})}function _g(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,l=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Lf(Xp).isPreviewMode,v=!!u&&!!h,c=!l&&hg("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==a||a.open(s)),d?null==o||o():n()},children:e});return hg("div",{className:"bottom-section",children:[v?hg("div",{className:"form-buttons form-buttons-with-back",children:[hg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&hg(bg,{urlParams:{utm_source:"survey-footer"}})]})}function wg(t){var e=t.question,i=t.forceDisableHtml;return hg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[hg(e.type===rp?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&tg({component:Yc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function kg(t){var e,i,r;return hg("button",{className:"form-cancel",onClick:t.onClick,disabled:Lf(Xp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,hg("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[hg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),hg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]}))})}var Sg=a;function xg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Lf(Xp).isPopup;return Of(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return zn(Sg,"keydown",t),()=>{Sg.removeEventListener("keydown",t)}},[o]),hg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&hg(kg,{onClick:()=>o()}),hg("h3",{className:"thank-you-message-header",children:e}),i&&tg({component:Yc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&hg(_g,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Cg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Lf(Xp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return hg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&hg(kg,{onClick:()=>u()}),e&&hg("h3",{className:"intro-screen-header",children:e}),i&&tg({component:Yc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),hg(_g,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var Tg=t=>ke(t)&&t.every(t=>Me(t));function Mg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Yp().isPreviewMode,d=$f(null),v=Ff(()=>Me(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Of(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Df(()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case de:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case ve:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=Mn(e.validation,de),b=Mn(e.validation,ve),_=Df(()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return hg(ef,{children:[hg("div",{className:"question-container",children:[hg(wg,{question:e,forceDisableHtml:i,htmlFor:g}),hg("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),_&&hg("div",{className:"validation-hint",children:_})]}),hg(_g,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Ig(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return hg(ef,{children:[hg("div",{className:"question-container",children:hg(wg,{question:e,forceDisableHtml:t.forceDisableHtml})}),hg(_g,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Eg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Ff(()=>Ae(l)?l:ke(l)&&l.length>0&&Ae(parseInt(l[0]))?parseInt(l[0]):Me(l)&&Ae(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Yp().isPreviewMode,y=t=>m?a(t):o(t);return hg(ef,{children:[hg("div",{className:"question-container",children:[hg(wg,{question:i,forceDisableHtml:r}),hg("div",{className:"rating-section",children:[hg("div",{className:"rating-options",children:["emoji"===i.display&&hg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=$g[i.scale])?void 0:e.map((t,e)=>hg("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e))}),"number"===i.display&&hg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Dg(i.scale).map((t,e)=>hg(Rg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&hg("div",{className:"rating-text",children:[hg("div",{children:i.lowerBoundLabel}),hg("div",{children:i.upperBoundLabel})]})]})]}),hg(_g,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ee(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Rg(t){var e=t.num,i=t.setActiveNumber;return hg("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function Ag(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=$f(null),v=Df(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Zp(e,Gp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Ff(()=>((t,e)=>Me(t)||Tg(t)?t:e===sp?null:[])(l,e.type)),f=c[0],p=c[1],g=Ff(()=>((t,e)=>{if(Me(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Tg(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],b=Yp().isPreviewMode,_=e.type===sp,w=e.type===np,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>n({},t,{isSelected:i,inputValue:i?t.inputValue:""})),_&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(_)return p(t),y(t=>n({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),b&&a(t)));w&&ke(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>n({},t,{inputValue:e})),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y(t=>n({},t,{isSelected:!1,inputValue:""})),_&&p(null))},T=()=>!(e.optional||!Ee(f)&&(!ke(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?ke(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return hg(ef,{children:[hg("div",{className:"question-container",children:[hg(wg,{question:e,forceDisableHtml:i}),hg("fieldset",{className:"multiple-choice-options limit-height",children:[hg("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:_?f===t:ke(f)&&f.includes(t);return hg("label",{className:n?"choice-option-open":"",children:[hg("div",{className:"response-choice",children:[hg("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),hg("span",{children:n?t+":":t})]}),n&&hg("input",{type:"text",ref:d,id:o,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)})]})]}),hg(_g,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var Pg=[1,2,3,4,5],Fg=[1,2,3,4,5,6,7],Og=[0,1,2,3,4,5,6,7,8,9,10],$g={2:[gg,mg],3:[cg,vg,dg],5:[fg,cg,vg,dg,pg]};function Dg(t){switch(t){case 5:default:return Pg;case 7:return Fg;case 10:return Og}}var Lg=Pn("[Surveys]");function Ng(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?ap:s;if(n.branching.type===ap)return ap;if("specific_question"===n.branching.type){if(Number.isInteger(n.branching.index))return n.branching.index}else if("response_based"===n.branching.type){if(n.type===sp){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===ap?ap:s}}else if(n.type===op){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===ap?ap:s}}return s}return Lg.warn("Falling back to next question index due to unexpected branching type"),s}var qg=Pn("[SurveyTranslations]");function jg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Wa(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?Wa(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Wa(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Se(t.get_property)?t.get_property(vt):void 0,locale:ml()},qg)}(e);if(!i)return qg.info("No user language detected"),{survey:t,language:null};var r=Ja(t,i,qg);return{survey:r.survey,language:r.matchedKey}}var Bg=a,Hg=h,zg="ph:show_survey_widget",Ug="PHWidgetSurveyClickListener";function Wg(t,e){try{var i=t.getBoundingClientRect(),r=Bg.innerHeight,n=Bg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:Np.zIndex}}catch(t){return Sp.warn("Failed to calculate trigger position:",t),null}}var Vg=class{constructor(t){var e=this;this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Map,this.Mi=new Set,this.Ti=null,this.Ii=!1,this.Ri=null,this.Ai=null,this.Ei=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(pt);if(t)for(var e of t)sg(e)&&Vp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var s,o,a,l,u,h=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==h&&h;if(Cp(e._posthog)){var v=e.Oi(t),c=v.survey,f=v.language;e.Ti=f,e.Ei=null,e.Li=i;var p=e.Di(c,i);e.Pi(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Ni(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.Fi(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===Yf&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=Hg.querySelector(p.appearance.widgetSelector);k&&(_=Wg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||Np.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=Hp(p,e._posthog).shadow;e.Ci.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.qi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Ei=C,0>=S)return e.Ii=!0,kf(hg(Kg,n({},C)),x);var T=()=>{if(!Cp(e._posthog)||!e.ji(p))return Sp.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.qi(p);(()=>{e.Ii=!0;var r=e.Oi(t),s=r.survey,o=r.language;e.Ti=o;var a=e.Di(s,i),l=n({},C,{survey:a,surveyLanguage:o});e.Ei=l,kf(hg(Kg,n({},l,{survey:n({},a,{appearance:n({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,I=Ae(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Bg.setTimeout(()=>{e.ki.delete(p.id),T()},E);e.ki.set(p.id,R)}}},this.Bi=t=>{var e,i=this.Oi(t),r=i.survey,n=i.language,s=Hp(r,this._posthog),o=s.shadow,a=s.isNewlyCreated;this.Ci.set(o,o.host),(null==(e=t.appearance)?void 0:e.widgetType)===Jf&&this.xi.set(t.id,t),a&&kf(hg(Yg,{posthog:this._posthog,survey:r,surveyLanguage:n},t.id),o)},this.Hi=t=>{var e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Ug),this.Si.delete(t),Sp.info("Removed click listener for survey "+t))},this.$i=t=>{this.Ui(t)||(this.zi(t),this.Hi(t.id))},this.Wi=t=>{this.Ui(t)||(this.zi(t),this.xi.delete(t.id))},this.Ui=t=>{try{var e;return!(null==(e=Hg.querySelector(ag(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Vi=(t,e)=>{var i=Hg.querySelector(e),r=this.Si.get(t.id);if(i){if(this.Bi(t),r){if(i===r.element)return;Sp.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Hi(t.id)}if(!i.hasAttribute(Ug)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Yf?Wg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Np.maxWidth)):{};Bg.dispatchEvent(new CustomEvent(zg,{detail:{surveyId:t.id,position:n}}))};zn(i,"click",n),i.setAttribute(Ug,"true"),this.Si.set(t.id,{element:i,listener:n,survey:t}),Sp.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.$i(t)},this.renderPopover=t=>{if(Cp(this._posthog)){var e=this.Oi(t),i=e.survey,r=e.language,n=Hp(i,this._posthog).shadow;this.Ci.set(n,n.host),kf(hg(Kg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.qi,surveyLanguage:r}),n)}},this.renderSurvey=(t,e,i)=>{var r;if(Cp(this._posthog)){var n=this.Oi(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.Zi(s,o,i)),kf(hg(Kg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.qi,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)}},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys(i=>{t(i.filter(t=>e.ji(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=Cp(e._posthog),r=t.filter(t=>i&&(t.type===tp||t.type===ep)),n=new Set(r.map(t=>t.id));for(var s of Array.from(e.ki.keys()))n.has(s)||e.cancelSurvey(s);var o=e.Gi(r),a=new Set,l=new Set;o.forEach(t=>{if(t.type===ep){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Jf)return l.add(t.id),void e.Bi(t);"selector"===(null==(r=t.appearance)?void 0:r.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Vi(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ee(e.Qi)&&t.type===tp&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.Si.forEach(t=>{var i=t.survey;a.has(i.id)||e.$i(i)}),e.xi.forEach((t,i)=>{l.has(i)||e.Wi(t)})},t)},this.Fi=t=>{Ee(this.Qi)||Sp.error("Survey "+this.Qi+" already in focus. Cannot add survey "+t.id+"."),this.Qi=t.id},this.qi=t=>{this.Qi!==t.id&&Sp.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Pi(t.id),this.Qi=null,this.Ti=null,this.Ii=!1,this.Ei=null,this.Li=void 0,this.zi(t)},this._posthog=t,this.Qi=null,this.Ri=()=>this.Ji(),zn(Bg,"languagechange",this.Ri),this.Ai=t.onFeatureFlags(()=>this.Ji())}Ji(){var t;if(!Ee(this.Qi)){var e=null==(t=this._posthog.get_property(pt))?void 0:t.find(t=>t.id===this.Qi);if(e){var i=this.Oi(e),r=i.survey,s=i.language;if(s!==this.Ti&&(this.Ti=s,this.Ii)){var o=this.Di(r,this.Li),a=Hp(o,this._posthog).shadow;kf(hg(Kg,n({},this.Ei,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.qi,surveyLanguage:s})),a)}}}}get Ki(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Di(t,e){return null!=e&&e.position||null!=e&&e.selector?n({},t,{appearance:n({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}Pi(t){var e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(Sp.info("Cancelled pending survey "+t),this.Pi(t),this.Qi===t&&(this.Qi=null,this.Ti=null,this.Ii=!1,this.Ei=null,this.Li=void 0))}setAutomaticDisplayDispose(t){this.Xi=t}dispose(){var t;null==(t=this.Xi)||t.call(this),this.Xi=void 0,this.Ri&&(Bg.removeEventListener("languagechange",this.Ri),this.Ri=null),this.Ai&&(this.Ai(),this.Ai=null),this.ki.forEach((t,e)=>this.Pi(e)),this.Si.forEach((t,e)=>this.Hi(e)),this.Ci.forEach((t,e)=>{kf(null,e),null==t||t.remove()}),this.Ci.clear(),this.xi.clear(),this.Qi=null}Gi(t){return t.sort((t,e)=>{var i,r,n=sg(t),s=sg(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===lp,a=e.schedule===lp;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}Oi(t){return jg(t,this._posthog)}Zi(t,e,i){if(this.Mi.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};for(var n of r.split("&")){var s=n.split("="),o=s[0],a=s[1];if(o&&!Te(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var d=parseInt(h[1],10);e[d]||(e[d]=[]),e[d].push(u)}}else i=!0}}return{params:e,autoSubmit:i}}(Bg.location.search).params;if(0===Object.keys(r).length)return!1;Sp.info("[Survey Prefill] Detected URL prefill parameters");var n=this.Yi(t,r,e);return!!n&&(this.tn(t,n,i,e),this.Mi.add(t.id),n.isSurveyCompleted)}tn(t,e,i,r){var n=e.responses,s=e.submissionId,o=e.isSurveyCompleted,a=e.skippedResponses;(Object.keys(a).length>0&&t.enable_partial_responses||o)&&zp({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Ni(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=ke(o)?o.map(String):[String(o)]}Sp.info("[Survey] Processing initial responses");var a=this.Yi(t,n,r);return!!a&&(this.tn(t,a,i,r),a.isSurveyCompleted)}Yi(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach((t,r)=>{if(e[r]&&t.id){var n=e[r],s=Ba(t.id);try{switch(t.type){case sp:if(!t.choices||0===t.choices.length)return void An.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void An.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case np:if(!t.choices||0===t.choices.length)return void An.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===a.length)return void An.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&An.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case op:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void An.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:An.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){An.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return Sp.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ga(),s=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=Ba(l.id);Te(i[u])||(n[u]=i[u])}s.push(r);var h=Ng(t,r,l.id?i[Ba(l.id)]:null);if(h===ap)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,Object.keys(e).map(t=>parseInt(t,10)),r),o=s.startQuestionIndex,a=s.skippedResponses,l=s.skippedIndices,u=o>=t.questions.length;return rg(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Jp(t.questions),visitedIndices:l,surveyLanguage:i}),Sp.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Sp.error("[Survey Prefill] Error handling prefill:",t),null}}en(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Ki,r=!(null==i||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),r&&n}rn(t){return!t.conditions||eg(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!g)return!1;var s=Ji(g,{userAgentDataPlatform:null==u||null==(i=u.userAgentData)?void 0:i.platform,maxTouchPoints:null==u?void 0:u.maxTouchPoints,screenWidth:null==a||null==(r=a.screen)?void 0:r.width,screenHeight:null==a||null==(n=a.screen)?void 0:n.height,devicePixelRatio:null==a?void 0:a.devicePixelRatio});return tl[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Dp||!Dp.querySelector(t.conditions.selector))}(t)}nn(t){var e;return Kp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.Ki)&&e.hasLoadedFlags?{satisfied:this.en(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!Tp(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Ap.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.en(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.en(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.nn(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=Math.abs((new Date).getTime()-i.getTime());return Math.ceil(r/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,Sa.Lt("lastSeenSurveyDate"))?(t=>!!Sa.Lt(Ep(t))&&!Kp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyCaptureEligibility(){return Cp(this._posthog)?{eligible:!0}:{eligible:!1,reason:xp}}checkSurveyDisplayEligibility(t){var e=this.checkSurveyCaptureEligibility();return e.eligible?this.checkSurveyEligibility(t):e}checkSurveyRenderability(t){var e=this.checkSurveyDisplayEligibility(t);return e.eligible&&!this.an(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}an(t){var e;return!Qa(t)&&!Mp(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}sn(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every(t=>{var e=t.value;return!t.key||!e||this.en(e)})}ji(t){return this.checkSurveyEligibility(t).eligible&&this.rn(t)&&this.an(t)&&this.sn(t)}zi(t){try{var e=Hg.querySelector(ag(t,!0));null!=e&&e.shadowRoot&&(kf(null,e.shadowRoot),this.Ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Sp.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Fi,removeSurveyFromFocus:this.qi,surveyInFocus:this.Qi,surveyTimeouts:this.ki,handleWidget:this.Bi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Vi,sortSurveysByAppearanceDelay:this.Gi,checkFlags:this.sn.bind(this),isSurveyFeatureFlagEnabled:this.en.bind(this),onLanguageChange:this.Ji.bind(this),currentLanguage:this.Ti,surveyIsRendered:this.Ii}}};function Gg(t,e){if(Hg&&Bg){var i,r=new Vg(t);if(t.config.disable_surveys_automatic_display)return Sp.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Sp.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Te(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Te(i)||(clearInterval(i),i=void 0)};n();var o=()=>{Hg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return zn(Hg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),Hg.removeEventListener("visibilitychange",o)}),r}}function Zg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Of(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===ep,s=eg(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===Jf&&i;if(!s)return Sp.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(Sp.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};zn(Bg,"popstate",i),zn(Bg,"hashchange",i);var s=Bg.history.pushState,l=Bg.history.replaceState;return Bg.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},Bg.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{Bg.removeEventListener("popstate",i),Bg.removeEventListener("hashchange",i),Bg.history.pushState=s,Bg.history.replaceState=l}}},[o,e,r,n,a])}var Jg=200;function Qg(t){switch(void 0===t&&(t="right"),t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Kg(t){var e,i,r,s,o,a,l,u,h,d,v,c,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,_=t.removeSurveyFromFocus,w=void 0===_?()=>{}:_,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,M=void 0===T?()=>{}:T,I=t.onPopupSurveyDismissed,E=void 0===I?()=>{}:I,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,D=t.surveyLanguage,L=$f(null),N=Number.isInteger(b),q=function(t,e,i,r,s,o,a,l,u){var h=Ff(r||0===i||t.type===ip),d=h[0],v=h[1],c=Ff(!1),f=c[0],p=c[1],g=$f(!1),m=()=>{var e=()=>{o&&s(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Jg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Of(()=>{if(e){if(!r){var s,o=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&(s&&clearTimeout(s),s=setTimeout(m,5e3))}},a=()=>{if(eg(t,e)){v(!0),Bg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(up,n({[cp]:t.name,[vp]:t.id,[fp]:t.current_iteration,[pp]:t.current_iteration_start_date},u&&{[_p]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};zn(Bg,"PHSurveyClosed",y),zn(Bg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Te(h)&&a(),()=>{Te(h)||clearTimeout(h),Te(s)||clearTimeout(s),Bg.removeEventListener("PHSurveyClosed",y),Bg.removeEventListener("PHSurveySent",o)}}}else Sp.error("usePopupVisibility hook called without a PostHog instance.")},[]),Zg({survey:t,removeSurveyFromFocus:s,setSurveyVisible:v,isPreviewMode:r,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithAnimation:m}}(f,g,null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,w,S,L,O,D),j=q.isPopupVisible,B=q.hidePopupWithAnimation,H=q.isSurveySent||b===f.questions.length||!0===F,z=Ff(!1),U=z[0],W=z[1],V=Df(()=>!!ng(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===b:!(null==(s=f.appearance)||!s.displayIntroScreen)&&G&&!U&&!V,J=Df(()=>{var t,e=(null==(t=ng(f))?void 0:t.surveySubmissionId)||ga();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){D?Wp(f,g,N,D):Wp(f,g,N),E()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:P,surveyLanguage:D}},[N,b,S,g,f,E,C,M,P,D]);return j?hg(Xp.Provider,{value:J,children:hg("div",{className:"ph-survey",style:n({},lg(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:H?hg(xg,{header:(null==(l=f.appearance)?void 0:l.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||Np,onClose(){B(),A()}}):Z?hg(Cg,{header:(null==(d=f.appearance)?void 0:d.introScreenHeader)||"",description:(null==(v=f.appearance)?void 0:v.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(c=f.appearance)?void 0:c.introScreenDescriptionContentType,appearance:f.appearance||Np,onStart:()=>W(!0)}):hg(Xg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Xg(t){var e,i,r=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Df(()=>{var t=ng(r);if(!t)return null;var e=Ae(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(og(r),null)},[r]),l=Ff(()=>(null!=a&&a.responses&&Sp.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Ff(!1),v=d[0],c=d[1],f=Lf(Xp),p=f.previewPageIndex,g=f.onPopupSurveyDismissed,m=f.isPopup,y=f.onPreviewSubmit,b=f.onPreviewBack,_=f.surveySubmissionId,w=f.isPreviewMode,k=f.properties,S=f.surveyLanguage,x=Ff(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Ae(t)&&t>=0&&r.questions.length>t?t:0;return Ae(p)&&p>=0?p:e}),C=x[0],T=x[1],M=Ff(()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&r.questions.length>t)}),I=M[0],E=M[1],R=Ff(()=>{var t,e;return null!==(t=null==(e=ng(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),A=R[0],P=R[1],F=Df(()=>Jp(Qp(r,a)),[r.id,a]),O=Df(()=>{if(!F||new Set(F).size!==F.length)return Qp(r,a);var t=new Map(r.questions.map(t=>[t.id,t])),e=F.map(e=>t.get(e)).filter(t=>!!t);return e.length===F.length?e:r.questions},[F,r.questions,r,a]);Of(()=>{!w||Te(p)||0>p||T(p)},[p,w]);var D=!(null==(e=r.appearance)||!e.allowGoBack)&&(w?(null!=p?p:0)>0:I.length>0),L=O.at(C);return L?hg("form",{className:"survey-form",name:"surveyForm",children:[m&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&hg(kg,{onClick(){g()}}),hg("div",{className:"survey-box","data-question-index":C,children:[v&&hg("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),tm({question:L,forceDisableHtml:s,displayQuestionIndex:C,appearance:r.appearance||Np,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(Cp(o))if(c(!1),s){var a=Ba(s),l=n({},u,{[a]:e});h(l);var d=O[i],v=null!=d&&d.id?n({},A,{[d.id]:d.question}):A;P(v);var f=Ng(r,i,e),p=f===ap,g=[...I,i];if(p||(E(g),T(f),rg(r,{surveySubmissionId:_,responses:l,lastQuestionIndex:f,questionOrder:Jp(O),visitedIndices:g,surveyLanguage:S,questionSnapshots:v})),r.enable_partial_responses||p){var m=new Set(g.map(t=>{var e;return null==(e=O[t])?void 0:e.id}).filter(t=>!!t).map(t=>Ba(t)));zp({responses:Object.fromEntries(Object.entries(l).filter(t=>m.has(t[0]))),survey:r,surveySubmissionId:_,isSurveyCompleted:p,posthog:o,properties:k,surveyLanguage:S,questionSnapshots:v})}}else Sp.error("onNextButtonClick called without a questionId.");else c(!0);else Sp.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:C,questionId:L.id}),onPreviewSubmit:y,initialValue:L.id?u[Ba(L.id)]:void 0,canGoBack:D,onBack(){if(w)b();else if(0!==I.length){var t=I[I.length-1],e=I.slice(0,-1);E(e),T(t),rg(r,{surveySubmissionId:_,responses:u,lastQuestionIndex:t,questionOrder:Jp(O),visitedIndices:e,surveyLanguage:S,questionSnapshots:A})}}})]})]}):null}function Yg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Ff(!0),f=c[0],p=c[1],g=Ff(!1),m=g[0],y=g[1],b=Ff({}),_=b[0],w=b[1],k=$f(void 0),S=()=>{(m||!h||d||Cp(h))&&y(!m)};if(Of(()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Sp.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return zn(Bg,zg,e),()=>{Te(k.current)||(clearTimeout(k.current),k.current=void 0),Bg.removeEventListener(zg,e)}}}else Sp.error("FeedbackWidget called without a PostHog instance.")},[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),Zg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==lp&&p(!1),Te(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return hg(ef,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&hg("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:S,disabled:d,style:Qg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&hg(Kg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var tm=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,s=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){s(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case rp:return Yc(Mg,n({},o,{question:e,key:e.id}));case"link":return Yc(Ig,n({},o,{question:e,key:e.id}));case op:return Yc(Eg,n({},o,{question:e,key:e.id}));case sp:case np:return Yc(Ag,n({},o,{question:e,key:e.id}));default:return Sp.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=Gg,b.extendPostHogWithSurveys=Gg;var em=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},im=1e4,rm=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),nm=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return rm(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return rm(e,JSON.stringify(t.slice(0,n)),i)},sm=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,om=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},am=(t,e,i)=>{if(!i.truncated)if(xe(t)){if(i.seen.has(t))return void om(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(am(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else om(e,t,i)},lm=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!sm(t))return!n||rm(e,"null",i);if(Ee(t)||(t=>{try{return Ae(t)||Fe(t)}catch(t){return!1}})(t))return rm(e,JSON.stringify(t),i);if("string"==typeof t)return nm(t,e,i);if(!xe(t)&&!ke(t))return rm(e,JSON.stringify(t),i);if(r.has(t))return nm("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Se(o))return lm(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return nm(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return rm(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return lm(l,e,i,r,n,s)}if(ke(t)){if(!rm(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!rm(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!lm(d,e,i,r,!0))return!1}return rm(e,"]",i)}if(!rm(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{am(f,c,s)}catch(t){}if(sm(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!rm(e,p,i))return!1;var b=e.length,_=lm(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return rm(e,"}",i)},um=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=xe(t[0])?{result:{},keysRemaining:50,sizeRemaining:im,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||rm(i," ",r))&&lm(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}},hm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},dm=t=>"canCapture"in t,vm=t=>dm(t)?t.canCapture?t.getExtension(Fp):void 0:t.is_capturing()?t.logs:void 0;b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:b.location.host},s=!1,o=function(t){var o=b.console[t];i.push(ic(b.console,t,i=>{var a=(i=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{var h=e;if(l.length>0&&!s&&h){var d=vm(h);if(d){s=!0,o=!0;var v=um(l,im),c=v.body,f=v.attributes,p=n({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(dm(t))e.captureConsoleLog(i);else{var r=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var i=Number(e[1]),r=Number(e[2]);if(i>=392&&419>=i)return 410===i?r>4?r>10?void 0:"de":"le":418===i?r>3?r>10?r>14?r>17?void 0:"vi":"ci":"ui":"he":419===i?r>2?void 0:"vi":410>i?"le":"he"}})(t.version),n=r?e[r]:void 0;Se(n)&&n.call(e,i)}})(h,d,{level:hm[t],body:c,attributes:n({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(s=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=em(o),a}))};for(var a of Object.keys(hm))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=vm(t);if(i)for(var r of e)try{var s=um(r.args,im);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:hm[r.level],body:s.body,attributes:n({"log.source":"console."+r.level,host:b.location.host},s.truncated?{body_truncated:"true"}:{},s.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var cm=t=>qe(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),fm=Pn("[Error tracking]"),pm="webkit-masked-url:",gm=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],mm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",pm],ym=["__firefox__","__gCrWeb"];function bm(){return new vr([new Rr,new jr,new Pr,new Ar,new Nr,new Lr,new Or,new qr],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var s=[],o=e.split("\n"),a=Math.min(o.length,r+1e3),l=[],u=r;a>u;u++){var h=o[u];if(1024>=h.length){var d=kr.test(h)?h.replace(kr,"$1"):h;if(!d.match(/\S*Error: /)){for(var v of i){var c=v(d,t);if(c){s.push(c);var f=xr(s);if(f){for(var p=l.length-1;p>=0;p--){var g=l[p];if(f.start>=g.start+g.length)break;l.pop()}l.push(f)}break}}if(Ir(s,l)>=50)break}}}var m=[...l].sort((t,e)=>e.start-t.start),y=m[m.length-1];if(y){var b=Tr(s,y);for(var _ of(s.splice(y.start-b,b),m))_.start-=b}for(var w of m)Cr(s,w);return l.some(t=>0===t.start&&s.length===t.length)&&function(t){for(var e=t.map(t=>t.function+"|"+t.filename+"|"+t.lineno+"|"+t.colno+"|"+t.module),i=0,r=1;e.length>r;r++)Er(e,r,i)&&(i=r);t.push(...t.splice(0,i))}(s),function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return n({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(s)}}("web:javascript",yr,wr))}var _m=Pn("[ExceptionAutocapture]"),wm=bm(),km=(t,e)=>{try{return t()}catch(t){return e}},Sm=(t,e)=>km(()=>t(e()),void 0),xm=t=>km(()=>Se(t)&&Se(t.call),!1),Cm=(t,e)=>km(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Tm=(t,e,i)=>{km(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),km(()=>{t[e]=i},void 0)},Mm=t=>{var e=a;e||_m.info("window not available, cannot wrap onerror");var i=km(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];return Sm(t,()=>wm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Me(e)&&Me(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}})),!!xm(i)&&null!==(e=i(...n))&&void 0!==e&&e},Cm(e,"onerror"),()=>Tm(e,"onerror",i)},Im=function(t,e){void 0===e&&(e=!1);var i=a;i||_m.info("window not available, cannot wrap onUnhandledRejection");var r=km(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return Sm(t,()=>wm.buildFromUnknown(i,{mechanism:{handled:!1}})),xm(r)?null!==(n=r(i))&&void 0!==n&&n:e},Cm(i,"onunhandledrejection"),()=>Tm(i,"onunhandledrejection",r)},Em={wrapOnError:Mm,wrapUnhandledRejection:Im,wrapConsoleError(t){var e=console;e||_m.info("console not available, cannot wrap console.error");var i=km(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];Sm(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return wm.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),xm(i)&&i(...r)},Cm(e,"error"),()=>Tm(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=Em,b.posthogErrorWrappingFunctions=Em;var Rm=(t,e)=>{if(Se(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Ee(i)&&"object"==typeof i&&ke(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){_m.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){_m.error("Failed to capture exception for a legacy client",t)}};Mm(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),Im(n,!0)}};b.extendPostHogWithExceptionAutoCapture=Rm,b.extendPostHogWithExceptionAutocapture=Rm;var Am="X-POSTHOG-SESSION-ID",Pm="X-POSTHOG-WINDOW-ID",Fm="X-POSTHOG-DISTINCT-ID",Om=[Am,Pm,Fm],$m=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Dm=(t,e)=>({}.hasOwnProperty.call(t,e)),Lm=t=>"object"==typeof t&&!Ee(t)||Se(t),Nm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),qm=t=>{try{var e;return Nm(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==a||null==(e=a.location)?void 0:e.href).toString()}catch(t){return}},jm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(ke(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Am,a.sessionId),n.set(Pm,l),o=!0}var u=(t=>Se(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(Fm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var Bm={_patchFetch:(t,e,i)=>ic(a,"fetch",r=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=qm(s);if(u)if(Nm(s)){var h=new Request(s,o);jm(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Lm(o)?o.headers:void 0);if(jm(t,e,i,u,d)){var v=((t,e)=>{if(Te(t)||Ee(t))return{headers:e};if(Lm(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(i);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),r}return new Proxy({headers:e},{get:(t,e)=>Dm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Dm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),$m.forEach(t=>{t in i&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&$m.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?n({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[s,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>ic(a.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=qm(s);d&&jm(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return Om.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=Bm,b.postHogTracingHeadersPatchFns=Bm,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});var Hm=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}},zm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Um=t=>{if("loading"===document.readyState)return"loading";var e=zm();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Wm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Vm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Wm(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},Gm=new WeakMap;function Zm(t,e){var i=Gm.get(e);return i||Gm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Jm,Qm=-1,Km=()=>Qm,Xm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Qm=e.timeStamp,t(e))},!0)},Ym=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},ty=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},ey=()=>{var t,e;return null!==(t=null==(e=zm())?void 0:e.activationStart)&&void 0!==t?t:0},iy=-1,ry=new Set,ny=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,sy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ry)e();isFinite(iy)||(iy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",sy,!0))}},oy=function(t){if(void 0===t&&(t=!1),t&&(iy=1/0),0>iy){var e,i,r=ey();iy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:ny(),addEventListener("visibilitychange",sy,!0),addEventListener("prerenderingchange",sy,!0),Xm(()=>{setTimeout(()=>{iy=ny()})})}return{get firstHiddenTime(){return iy},onHidden(t){ry.add(t)}}},ay=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=zm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Km()?a&&(document.prerendering||ey()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},ly=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},uy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},hy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},dy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},vy=class{constructor(){this.u=void 0}},cy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},fy=[1800,3e3],py=function(t,e){void 0===e&&(e={});var i=uy(e);cy(()=>{var r,n=Zm(e,vy),s=oy(),o=ay("FCP"),a=ly(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-ey(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Ym(t,o,fy,e.reportAllChanges),Xm(i=>{o=ay("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Km()),r=Ym(t,o,fy,e.reportAllChanges),ty(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&ly(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&hy(n.u,i),o=ay("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Ym(t,o,fy,e.reportAllChanges))(!0)})},e)})},gy=[.1,.25],my=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],yy=function(t,e){void 0===e&&(e={});var i=Zm(e=Object.assign({},e),Hm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=my(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Vm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=oy();py(dy(()=>{var r,n=ay("CLS",0),s=Zm(e,Hm),o=(i,o,a,l,u)=>{n=ay("CLS",0,i,o,a,l,u),s.o=0,r=Ym(t,n,gy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];uy(e)&&h.push("soft-navigation");var d=ly(h,u);d&&(r=Ym(t,n,gy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Xm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Km()),ty(r)}),setTimeout(r))}))}(e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null!=n&&null!=(i=n.sources)&&i.length){var s=my(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Um(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},by=function(t,e){void 0===e&&(e={});var i=Zm(e=Object.assign({},e),vy);uy(e)&&(i.u=new Map),py(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Um(Km())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=zm(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:Um(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))},e)},_y=0,wy=1/0,ky=0,Sy=t=>{for(var e of t)e.interactionId&&(wy=Math.min(wy,e.interactionId),ky=Math.max(ky,e.interactionId),_y=ky?(ky-wy)/7+1:0)},xy=()=>{var t;return Jm?_y:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Cy=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return xy()-this.h}D(){this.h=xy(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.p.get(t.interactionId);if(r||10>this.v.length||t.duration>i.k){var n;if(r?t.duration>r.k?(r.entries=[t],r.k=t.duration):t.duration===r.k&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.p.set((r={id:t.interactionId,entries:[t],k:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var s of this.v.splice(10))this.p.delete(s.id);null==(n=this.M)||n.call(this,r)}}}},Ty=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=dy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},My=[200,500],Iy=function(t,e){void 0===e&&(e={});var i=Zm(e=Object.assign({},e),Cy),r=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Ty(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=s.length-10;s=s.filter((i,r)=>r>=e||t.has(i));var n=new Set;for(var l of s)for(var h of v(l.startTime,l.processingEnd))n.add(h);r=r.filter(t=>t.startTime>o||n.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||s.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&a.set(t,i),h()},i.M=t=>{if(!l.get(t)){var i,r=null==(i=t.entries.find(t=>t.target))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Vm(r);l.set(t,s)}else{var o,a=null==(o=t.entries.find(t=>t.targetSelector))?void 0:o.targetSelector;a&&l.set(t,a)}}};var v=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};ly(["long-animation-frame"],t=>{r=r.concat(t),h()},e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=oy();cy(()=>{var r;"interactionCount"in performance||Jm||(Jm=ly(["event"],Sy,{durationThreshold:0}));var s,o=ay("INP"),a=Zm(e,Cy),l=(i,r,n,l,u)=>{a.D(),o=ay("INP",-1,i,r,n,l,u),s=Ym(t,o,My,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Ty(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];uy(e)&&v.push("soft-navigation");var c=ly(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Ym(t,o,My,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Xm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Km())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Um(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=Math.max(n.processingStart,r.startTime),o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),d=v(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:l.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-u,loadState:Um(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+o>c.startTime?"input-delay":i+o+a>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))},e)},Ey=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],Ry=50,Ay=[];ly(["resource"],t=>{for(var e of t)Ay.push(e),Ay.length>Ry&&Ay.shift()});var Py=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(Ry=e.resourceBufferSize);var i=Zm(e,Ey),r=new WeakMap;uy(e)&&(i.u=new Map),i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Vm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=uy(e);cy(()=>{var n,s=oy(),o=ay("LCP"),a=Zm(e,Ey),l=(r,a,l,u,h)=>{o=ay("LCP",-1,r,a,l,u,h),n=Ym(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=oy(!0))},u=t=>{a.u&&t.navigationId&&hy(a.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-ey(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=ly(d,h);if(v){n=Ym(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Ty(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});Xm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Km()),n=Ym(t,o,$,e.reportAllChanges),ty(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})}(e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(Ay.findLast(t=>t.name===d.url)||performance.getEntriesByType("resource").findLast(t=>t.name===d.url));e.target=r.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(s=null==(o=h=zm())?void 0:o.activationStart)&&void 0!==s?s:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(c=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=n({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},Fy=-1,Oy=()=>Fy,$y=t=>{addEventListener("pageshow",e=>{e.persisted&&(Fy=e.timeStamp,t(e))},!0)},Dy=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Ly=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Ny=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},qy=()=>{var t,e;return null!==(t=null==(e=Ny())?void 0:e.activationStart)&&void 0!==t?t:0},jy=-1,By=new Set,Hy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of By)e();isFinite(jy)||(jy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",zy,!0))}},Uy=function(t){if(void 0===t&&(t=!1),t&&(jy=1/0),0>jy){var e,i,r=qy();jy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:Hy(),addEventListener("visibilitychange",zy,!0),addEventListener("prerenderingchange",zy,!0),$y(()=>{setTimeout(()=>{jy=Hy()})})}return{get firstHiddenTime(){return jy},onHidden(t){By.add(t)}}},Wy=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Ny(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Oy()?a&&(document.prerendering||qy()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Vy=new WeakMap;function Gy(t,e){var i=Vy.get(e);return i||Vy.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Zy,Jy=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}},Qy=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},Ky=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Xy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Yy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},tb=class{constructor(){this.l=void 0}},eb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ib=[1800,3e3],rb=function(t,e){void 0===e&&(e={});var i=Ky(e);eb(()=>{var r,n=Gy(e,tb),s=Uy(),o=Wy("FCP"),a=Qy(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-qy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Dy(t,o,ib,e.reportAllChanges),$y(i=>{o=Wy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Oy()),r=Dy(t,o,ib,e.reportAllChanges),Ly(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Qy(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Xy(n.l,i),o=Wy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Dy(t,o,ib,e.reportAllChanges))(!0)})},e)})},nb=[.1,.25],sb=function(t,e){void 0===e&&(e={});var i=Uy();rb(Yy(()=>{var r,n=Wy("CLS",0),s=Gy(e,Jy),o=(i,o,a,l,u)=>{n=Wy("CLS",0,i,o,a,l,u),s.i=0,r=Dy(t,n,nb,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];Ky(e)&&h.push("soft-navigation");var d=Qy(h,u);d&&(r=Dy(t,n,nb,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),$y(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Oy()),Ly(r)}),setTimeout(r))}))},ob=0,ab=1/0,lb=0,ub=t=>{for(var e of t)e.interactionId&&(ab=Math.min(ab,e.interactionId),lb=Math.max(lb,e.interactionId),ob=lb?(lb-ab)/7+1:0)},hb=()=>{var t;return Zy?ob:null!==(t=performance.interactionCount)&&void 0!==t?t:0},db=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return hb()-this.u}M(){this.u=hb(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var s of this.v.splice(10))this.m.delete(s.id);null==(n=this.T)||n.call(this,r)}}}},vb=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Yy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},cb=[200,500],fb=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Uy();eb(()=>{var r;"interactionCount"in performance||Zy||(Zy=Qy(["event"],ub,{durationThreshold:0}));var s,o=Wy("INP"),a=Gy(e,db),l=(i,r,n,l,u)=>{a.M(),o=Wy("INP",-1,i,r,n,l,u),s=Dy(t,o,cb,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),vb(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Ky(e)&&v.push("soft-navigation");var c=Qy(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Dy(t,o,cb,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),$y(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Oy())}))})}},pb=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},gb=[2500,4e3],mb=function(t,e){void 0===e&&(e={});var i=!1,r=Ky(e);eb(()=>{var n,s=Uy(),o=Wy("LCP"),a=Gy(e,pb),l=(r,a,l,u,h)=>{o=Wy("LCP",-1,r,a,l,u,h),n=Dy(t,o,gb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Uy(!0))},u=t=>{a.l&&t.navigationId&&Xy(a.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-qy(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Qy(d,h);if(v){n=Dy(t,o,gb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;vb(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});$y(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Oy()),n=Dy(t,o,gb,e.reportAllChanges),Ly(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},yb={onLCP:Py,onCLS:yy,onFCP:by,onINP:Iy,withoutAttribution:{onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=yb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=yb,b.postHogWebVitalsCallbacks=yb;var bb={onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=bb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=bb,b.postHogWebVitalsCallbacks=bb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>bb;var _b={onLCP:Py,onCLS:yy,onFCP:by,onINP:Iy,withoutAttribution:{onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=_b,b.__PosthogExtensions__.postHogWebVitalsCallbacks=_b,b.postHogWebVitalsCallbacks=_b;var wb={onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=wb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=wb,b.postHogWebVitalsCallbacks=wb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>wb;var kb=class{constructor(t){this.disabled=!1===t;var e=xe(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}},Sb="$copy_autocapture",xb=Pn("[AutoCapture]");function Cb(t,e){return e.length>t?e.slice(0,t)+"...":e}function Tb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!rs(e));return e}function Mb(t,e){var i,r,s=e.e,o=e.maskAllElementAttributes,l=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!rs(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!ns(f,"body")&&1e3>v.length;)if(os(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!rs(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===s.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>ns(t,"button")||ns(t,"a")):-1;g>0&&(l=l||v.slice(0,g+1).some(t=>!Is(t)||Es(t)));var m,y,b,_=[],w={},k=!1,S=!1;if(On(v,t=>{var e=Is(t);if(ns(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Ls(i))&&(d?ar(i):i)}pe(us(t),"ph-no-capture")&&(S=!0),_.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};cs.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Cb(1024,Ns(t)):Cb(1024,ds(t)));var a=us(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),On(t.attributes,function(i){var s;if((!Es(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Ls(i.value)&&(!Me(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=as(a).join(" ")),o["attr__"+i.name]=Cb(1024,"href"===i.name&&n?ar(a):a)}});for(var l=1,u=1,h=t;h=Tb(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,l,u,d)),On(function(t){if(!Is(t))return{};var e={};return On(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Ls(r)&&(e[i]=r)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=v[g],_.splice(0,g)),l||(_[0].$el_text=ns(t,"a")||ns(t,"button")?Ns(t):ds(t)),k){var x,C;_[0].attr__href=k;var T=null==(x=Gn(k))?void 0:x.host,M=null==a||null==(C=a.location)?void 0:C.host;T&&M&&T!==M&&(m=k)}return{props:$n((y=s.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:_},{$elements_chain:(b=_,ke(b)?function(t){return t.map(t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var o=n({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Dn(o).sort((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0])).forEach(t=>{var e=t[1];return a[js(t[0].toString())]=js(e.toString())}),(r+=":")+Dn(a).map(t=>t[0]+'="'+t[1]+'"').join("")}).join(";")}(function(t){return t.map(t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Bs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dn(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(b)):"")},null!=(i=_[0])&&i.$el_text?{$el_text:null==(r=_[0])?void 0:r.$el_text}:{},m&&"click"===s.type?{$external_click_url:m}:{},w),target:t}}var Ib=class{Qs(){this.Ks=void 0,clearTimeout(this.Xs),this.Xs=void 0}Ys(t){var e;if(!Is(t))return!0;for(var i,r=null!==(e=this.so().css_selector_ignorelist)&&void 0!==e?e:ms,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=us(t);if(pe(e,"ph-no-capture")||pe(e,"ph-sensitive")||Es(t)||r.some(e=>fs(t,e)))return{v:!0};var i=s.parentNode;s=os(i)?i.host:i&&rs(i)?i:null};s;)if(i=o())return i.v;return!1}oo(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Ks;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.Qs():"pointerup"===t.type&&(e.released=!0,this.Xs=setTimeout(()=>this.Qs(),0)))}else{var i;this.Qs();var r=vs(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&rs(r)&&(this.Ks={target:r,excluded:this.Ys(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.ao)?void 0:i.distinctId})}else this.Qs()}lo(t){var e,i=this.Ks;this.Qs();var r=vs(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.ao)?void 0:e.distinctId)&&t.pointerId===i.id&&(t.detail>0||"touch"===t.pointerType||"pen"===t.pointerType)&&0===t.button&&5>=Math.abs(t.clientX-i.x)&&5>=Math.abs(t.clientY-i.y)&&r&&(ns(r,"html")||ns(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.so().css_selector_ignorelist)&&void 0!==n?n:ms;return[r,null==h?void 0:h.documentElement,null==h?void 0:h.body].some(t=>{if(!t)return!1;var e=us(t);return pe(e,"ph-no-capture")||pe(e,"ph-sensitive")||!Is(t)||Es(t)||s.some(e=>fs(t,e))})?null:i.target}}constructor(t){this.uo=t,this.name="autocapture",this.ho=!1,this.do=null,this.vo=!1,this.co=!1,this.xn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.fo=!1,this.uo.refresh(this.xn),this.rageclicks=new kb(this.xn.rageclick),this.po=null}setup(t){this.mo(),this.ao=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.fo?e.dispose():(this.yo=e,this.startIfEnabled())}dispose(){var t;this.fo||(this.fo=!0,this.ao=void 0,null==(t=this.yo)||t.dispose(),this.yo=void 0,this.bo())}so(){return this.uo.refresh(this.xn),this.xn}mo(){var t,e;return this.so(),this.xn.url_allowlist=null==(t=this.xn.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this.xn.url_ignorelist=null==(e=this.xn.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this.xn}_o(){if(this.isBrowserSupported()){if(a&&h){var t=this.wo=t=>{t=t||(null==a?void 0:a.event);try{if("blur"===t.type)return void this.Qs();if(0===t.type.indexOf("pointer"))return void this.oo(t);var e="click"===t.type?this.lo(t):void 0;if(Ee(e))return;this.ko(t,"$autocapture",e)}catch(t){xb.error("Failed to capture event",t)}};if(zn(a,"blur",t),zn(h,"submit",t,{capture:!0}),zn(h,"change",t,{capture:!0}),zn(h,"click",t,{capture:!0}),On(["pointerdown","pointermove","pointerup","pointercancel"],e=>{zn(h,e,t,{capture:!0})}),this.so().capture_copied_text){var e=this.So=t=>{t=t||(null==a?void 0:a.event);try{this.ko(t,Sb)}catch(t){xb.error("Failed to capture clipboard event",t)}};zn(h,"copy",e,{capture:!0}),zn(h,"cut",e,{capture:!0}),zn(h,"paste",e,{capture:!0})}}}else xb.info("Disabling Automatic Event Collection because this browser is not supported")}bo(){this.Qs(),this.wo&&(null==a||a.removeEventListener("blur",this.wo),On(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==h||h.removeEventListener(t,this.wo,!0)}),null==h||h.removeEventListener("submit",this.wo,!0),null==h||h.removeEventListener("change",this.wo,!0),null==h||h.removeEventListener("click",this.wo,!0),this.wo=void 0),this.So&&(null==h||h.removeEventListener("copy",this.So,!0),null==h||h.removeEventListener("cut",this.So,!0),null==h||h.removeEventListener("paste",this.So,!0),this.So=void 0),this.ho=!1}startIfEnabled(){this.isEnabled||this.Qs(),!this.fo&&this.ao&&this.isEnabled&&!this.ho&&(this._o(),this.ho=!0)}onRemoteConfig(t){if(!this.fo)if(this.vo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.co=e.elementsChainAsString);var i,r=e.autocapture_opt_out;Fe(r)&&(null==(i=this.ao)||i.kv.set(E,r),this.do=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.po=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.po)||i.forEach(i=>{var n;null==h||null==(n=h.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||pe(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.fo)return!1;var i=null==(t=this.ao)?void 0:t.kv.get(E),r=this.do,n=this.so();if(!n.remoteRequestsDisabled&&!this.vo)return!1;var s=n.remoteRequestsDisabled&&!this.vo;if(Ee(r)&&!Fe(i)&&!s)return!1;var o=null!==(e=this.do)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ko(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||vs(t);ss(r)&&(r=r.parentNode||null);var s,o=this.mo();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Cs(r,o.rageclick)&&this.ko(t,"$rageclick",i);var l=e===Sb,u=l?n({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!a||Ts(t))return!1;if(null!=i&&i.url_allowlist&&!ls(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&ls(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var l=i.dom_event_allowlist;if(l&&!l.some(t=>e.type===t))return!1}var u=Ms(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Te(i))return!0;var r,n=function(t){if(i.some(e=>t.tagName.toLowerCase()===e))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(d,i))return!1;if(!ps(d,null==i?void 0:i.css_selector_allowlist))return!1;if(ps(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:ms))return!1;try{var v=a.getComputedStyle(t);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(cs.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,l,l?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=Mb(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.co,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),v=d.props;if(d.explicitNoCapture)return!1;var c=this.getElementSelectors(r,d.target);if(c&&c.length>0&&(v.$element_selectors=c),e===Sb){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==a||null==(p=a.getSelection())?void 0:p.toString(),y=hs(m);if(!y)return!1;v.$selected_content=y,v.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}v.$copy_type=f}return null==(h=this.ao)||h.capture(e,v).catch(t=>xb.error("Failed to capture event",t)),!0}}else this.Qs()}isBrowserSupported(){return Se(null==h?void 0:h.querySelectorAll)}},Eb={};function Rb(t,e){var i=vs(t);return i?n({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Ab(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Pb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Fb="canvas,video,audio,embed,object";function Ob(t,e){return Ae(t)&&t>=e}function $b(t,e){return void 0===e&&(e=1e3),t>=0&&e>t?t:void 0}function Db(t,e,i){return void 0===i&&(i=1e3),Ae(e)?$b(t-e,i):void 0}var Lb=class{hn(t){var e,i,r,n,s,o,a,l,u=this.cn((null==t?void 0:t.__onCapture)||this.dn.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this.vn=!1,this.fn=[],this.pn=0,this.cn=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.gn=()=>{clearTimeout(this.mn),this.mn=void 0,this.yn=void 0},this.bn=t=>{if(this.gn(),0===t.button){var e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},i=null==h?void 0:h.getSelection();e.selectionInitiallyRelated="Range"===(null==i?void 0:i.type)&&this.wn(i,e),this.yn=e}},this.kn=t=>{Ee(t.relatedTarget)&&this.gn()},this._n=t=>{var e=this.yn,i=t;if(e&&0===i.button&&t.isTrusted===e.trusted){var r=t.composedPath();for(var n of e.path)if(rs(n)&&-1!==r.indexOf(n)){e.clickTarget=n;break}e.clickDetail=i.detail,this.mn=b.setTimeout(this.gn,0)}},this.Sn=t=>{var e=t,i=Rb(e,{type:"click"}),r=this.yn;i&&r&&0===e.button&&e.detail>0&&e.detail===r.clickDetail&&t.isTrusted===r.trusted&&i.node===r.clickTarget&&(i.selectionChangedDuringGesture=r.selectionChanged&&this.xn.selection_change_threshold_ms>0,this.gn()),Ee(i)||this.Cn(i)||this.Mn(i),this.Tn()},this.In=()=>{var t=Date.now();this.Rn=t,t%50==0&&this.fn.forEach(e=>{Te(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.An=t=>{var e=null==h?void 0:h.getSelection(),i=this.vn;this.vn="Range"===(null==e?void 0:e.type);for(var r=null==e?void 0:e.focusNode,n=r&&(rs(r)?r:r.parentElement),s=null==h?void 0:h.activeElement,o=s;null!=(a=o)&&null!=(a=a.shadowRoot)&&a.activeElement;){var a;o=o.shadowRoot.activeElement}var l=xs(vs(t))||xs(null!=n?n:null)||xs(null!=o?o:null),u="Caret"===(null==e?void 0:e.type)&&o&&!o.shadowRoot&&r&&r!==s&&r.contains(null!=s?s:null);if(i||this.vn||l||u){var d=Date.now();this.En=d;var v=this.yn;if(v&&(i||this.vn||l)){var c,f=vs(t);xs(f)?c=f:"Caret"===(null==e?void 0:e.type)&&(xs(null!=o?o:null)||u?c=o:l&&(c=n));var p=c?this.On(c,v):e&&(r||e.anchorNode)?this.wn(e,v):i&&!this.vn&&v.selectionInitiallyRelated;v.selectionChanged=v.selectionChanged||p}this.fn.forEach(t=>{var e=d-t.timestamp;0>e||!Te(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})}},this.ar=()=>{"hidden"===(null==h?void 0:h.visibilityState)&&this.gn();var t=Date.now();this.Ln=t,this.Dn("visibilityChangedDelayMs",t)},this.Pn=()=>{var t=Date.now();this.Nn=t,this.Dn("focusChangedDelayMs",t)},this.Fn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.qn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.jn=()=>{this.qn=void 0},this.Bn=t=>{var e,i=this.qn;if(this.qn=void 0,!Te(i)&&this.xn.max_dead_swipes_per_page_load>this.pn){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,o=n.clientY-i.y,a=s*s+o*o,l=this.xn.swipe_threshold_px;if(a>=l*l&&![this.Rn,this.Hn,this.En].some(t=>Ae(t)&&t>=i.timestamp)){var u;if(this.$n()&&(null!==(u=null==h||null==h.elementsFromPoint?void 0:h.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(Fb)))return;var d=Rb(r,{type:"swipe",swipeDirection:Ab(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ee(d)||this.Cn(d)||this.Mn(d),this.Tn()}}}},this.xn=this.hn(e),this._onCapture=this.xn.__onCapture}start(t){this.Un(),this.zn(),this.Wn(),this.Vn(),this.Zn(),this.Gn(t),this.xn.capture_dead_swipes&&this.Qn()}Gn(t){if(!this.Jn){var e=function(t){return function(t,e){var i=Eb[t];if(i)return i;var r=e[t];if((t=>Se(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==a||!a.Zone))return Eb[t]=r.bind(e);var n=e.document;if(n&&Se(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var l,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return pe(t,"AppleWebKit")&&!pe(t,"Chrome")}(null!==(l=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){An.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var d;!o&&null!=(d=s)&&d.parentNode&&s.parentNode.removeChild(s)}}return r&&Se(r)?Eb[t]=r.bind(e):r}("MutationObserver",t)}(b);this.Jn=new e(t=>{this.Kn(t)}),this.Jn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Jn)||t.disconnect(),this.Jn=void 0,b.removeEventListener("click",this.Sn),b.removeEventListener("mousedown",this.bn,{capture:!0}),b.removeEventListener("mouseup",this._n,{capture:!0}),b.removeEventListener("mouseout",this.kn,{capture:!0}),b.removeEventListener("dragstart",this.gn,{capture:!0}),b.removeEventListener("pointercancel",this.gn,{capture:!0}),b.removeEventListener("blur",this.gn),this.gn(),b.removeEventListener("scroll",this.In,{capture:!0}),null==h||h.removeEventListener("selectionchange",this.An),b.removeEventListener("touchstart",this.Fn,{capture:!0}),b.removeEventListener("touchend",this.Bn,{capture:!0}),b.removeEventListener("touchcancel",this.jn,{capture:!0}),null==h||h.removeEventListener("visibilitychange",this.ar),b.removeEventListener("blur",this.Pn),b.removeEventListener("focus",this.Pn),this.qn=void 0}Kn(t){this.Hn=Date.now()}Un(){zn(b,"click",this.Sn),zn(b,"mousedown",this.bn,{capture:!0}),zn(b,"mouseup",this._n,{capture:!0}),zn(b,"mouseout",this.kn,{capture:!0}),zn(b,"dragstart",this.gn,{capture:!0}),zn(b,"pointercancel",this.gn,{capture:!0}),zn(b,"blur",this.gn)}Mn(t){t.selectionChangedDelayMs=Db(t.timestamp,this.En,this.xn.selection_change_threshold_ms),t.visibilityChangedDelayMs=Db(t.timestamp,this.Ln),t.focusChangedDelayMs=Db(t.timestamp,this.Nn),this.fn.push(t)}Tn(){this.fn.length&&Te(this.Xn)&&(this.Xn=b.setTimeout(()=>{this.Yn()},1e3))}zn(){zn(b,"scroll",this.In,{capture:!0})}Wn(){var t;this.vn="Range"===(null==h||null==(t=h.getSelection())?void 0:t.type),zn(h,"selectionchange",this.An)}On(t,e){for(var i=e.path[0];t;){if(-1!==e.path.indexOf(t)||rs(i)&&i.contains(t))return!0;t=t.getRootNode().host}return!1}wn(t,e){var i=e.path[0],r=t.rangeCount>0?t.getRangeAt(0):void 0;if(r&&rs(i)&&r.startContainer.getRootNode()===i.getRootNode()){var n;if(!r.collapsed)return r.intersectsNode(i);var s=rs(r.startContainer)&&null!==(n=r.startContainer.childNodes[r.startOffset])&&void 0!==n?n:r.startContainer;return this.On(s,e)}return this.On(t.focusNode,e)||this.On(t.anchorNode,e)}Vn(){zn(h,"visibilitychange",this.ar)}Zn(){zn(b,"blur",this.Pn),zn(b,"focus",this.Pn)}Dn(t,e){this.fn.forEach(i=>{var r=$b(e-i.timestamp);Ae(r)&&(Te(i[t])||i[t]>r)&&(i[t]=r)})}Qn(){zn(b,"touchstart",this.Fn,{capture:!0,passive:!0}),zn(b,"touchend",this.Bn,{capture:!0,passive:!0}),zn(b,"touchcancel",this.jn,{capture:!0,passive:!0})}$n(){var t=Te(this.eo)||Ae(this.Hn)&&this.Hn>this.eo;return(Te(this.ro)||t)&&(this.eo=Date.now(),this.ro=!(null==h||!h.querySelector(Fb))),!!this.ro}Cn(t){return!t||("swipe"===t.type?this.io(t):this.no(t))}io(t){return!(!is(t.node)&&!this.fn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!ns(t.node,"html")&&rs(t.node)&&function(t,e){var i;if(!a||Ts(t))return!1;var r=Fe(e)?ws:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ws;return!ps(Ms(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.xn.css_selector_ignorelist}))}no(t){return!(this.xn.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.io(t)||(i=t.node,!(!a||Ts(i))&&Ms(i,!1).targetElementList.some(t=>ns(t,"a")));var e,i}Yn(){if(this.fn.length){clearTimeout(this.Xn),this.Xn=void 0;var t=this.fn;for(var e of(this.fn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Hn&&this.Hn>=e.timestamp?this.Hn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp;var r=Ob(e.scrollDelayMs,this.xn.scroll_threshold_ms),n=Ob(e.selectionChangedDelayMs,this.xn.selection_change_threshold_ms),s=Ob(e.mutationDelayMs,this.xn.mutation_threshold_ms),o=Ob(e.absoluteDelayMs,1.1*this.xn.mutation_threshold_ms),a=Ae(e.scrollDelayMs)&&this.xn.scroll_threshold_ms>e.scrollDelayMs,l=Ae(e.mutationDelayMs)&&this.xn.mutation_threshold_ms>e.mutationDelayMs,u=e.selectionChangedDuringGesture||Ae(e.selectionChangedDelayMs)&&this.xn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Ae(e.visibilityChangedDelayMs),d=Ae(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=Pb(e);if("$dead_swipe"===v){if(this.pn>=this.xn.max_dead_swipes_per_page_load)continue;this.pn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Hn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.xn.mutation_threshold_ms>e.absoluteDelayMs&&this.fn.push(e)}this.Tn()}}dn(t,e){var i=Pb(t);this.instance.capture(i,n({},e,Mb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.xn.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lb(t,e);var Nb=Pn("[ExternalScriptsLoader]"),qb=t=>{var e=null==h?void 0:h.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},jb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Nb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=qb(e);if(r){if(r.__posthog_loading_callback_fired)return i();var n=r.__posthog_loading_error;return n?i(n):(r.addEventListener("load",t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)}),void r.addEventListener("error",t=>{r.__posthog_loading_error=t,i(t)}))}var s=()=>{if(!h)return i("document not found");if(qb(e))return jb(t,e,i);var r=h.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>{r.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)h.head.appendChild(r);else{var n,s=h.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):h.body.appendChild(r)}};null!=h&&h.body?s():null==h||h.addEventListener("DOMContentLoaded",s)},Bb={},Hb=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=Bb[n];if("fallback"===r&&s){if(qb(s))return void jb(t,s,i);delete Bb[n]}jb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=Hb(t,e);Bb[n]=a;var l=qb(n);null==l||null==(o=l.parentNode)||o.removeChild(l),jb(t,a,i)}else i(void 0,s)}:i)}else jb(t,Hb(t,e),i)}else jb(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{jb(t,t.requestRouter.endpointFor("api",e),i)};var zb=class{constructor(t){this._instance=t}get xn(){return this._instance.config}get consent(){return this.xo()?0:this.Co}isOptedOut(){return"always"===this.xn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.xn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.xn.opt_out_capturing_by_default}optInOut(t){this.To.Ot(this.Mo,t?1:0,this.xn.cookie_expiration,this.xn.cross_subdomain_cookie,this.xn.secure_cookie)}reset(){this.To.Dt(this.Mo,this.xn.cross_subdomain_cookie)}get Mo(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get Co(){var t=this.To.Lt(this.Mo);return ze(t)?1:pe(Ue,t)?0:-1}get To(){var t=this.xn.opt_out_capturing_persistence_type,e="localStorage"===t?Sa:wa,i=e.Et()?e:$a;if(!this.Io||this.Io!==i){this.Io=i;var r="localStorage"===t?wa:Sa;r.Lt(this.Mo)&&(this.Io.Lt(this.Mo)||this.optInOut(ze(r.Lt(this.Mo))),r.Dt(this.Mo,this.xn.cross_subdomain_cookie))}return this.Io}xo(){return!!this.xn.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,b.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(t=>ze(t))}},Ub=Pn("[Dead Clicks]"),Wb=()=>!0,Vb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(D)),r=t.instance.config.capture_dead_clicks;return Fe(r)?r:!!xe(r)||i},Gb=class{get lazyLoadedDeadClicksAutocapture(){return this.Eo}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[D]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ro(()=>{this.Ao()}):this.stop()}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",e=>{e?Ub.error("failed to load script",e):t()})}Ao(){var t;if(h){if(!this.Eo&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=xe(this.instance.config.capture_dead_clicks)?n({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Eo=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Eo.start(h),Ub.info("starting...")}}else Ub.error("`document` not found. Cannot start.")}stop(){this.Eo&&(this.Eo.stop(),this.Eo=void 0,Ub.info("stopping..."))}},Zb=Pn("[SegmentIntegration]");function Jb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();var s,o=(t=>Se(t.register))(s=r)?{analytics:s}:s,a=o.analytics,l=o.filterProperties;!function(t,e,i,r){var n=e=>{var n=()=>e.anonymousId()||ga();t.config.get_device_id=n,r&&e.id()&&(t.register({distinct_id:e.id(),$device_id:n()}),t.persistence.set_property(At,ee)),i(r?void 0:e.anonymousId()||void 0)},s=e.user();"then"in s&&Se(s.then)?s.then(n):n(s)}(t,a,i=>{a.register(function(t,e,i){var r=(void 0===i?{}:i).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Zb.warn("This browser does not have Promise support, and can not use the segment integration");var s=(i,s)=>{if(!s)return i;var o=!!e&&i.event.anonymousId===e&&!i.event.userId;o||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Zb.info("No userId set, resetting PostHog"),t.reset()),o||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Zb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var a=t.calculateEventProperties(s,i.event.properties);if(!Re(r)){var l=i.event.properties||{},u={};for(var h of Object.keys(a))_e.call(l,h)||(u[h]=a[h]);var d=((t,e)=>{var i=ke(t)?t:[t],r=n({},e);for(var s of i)try{if(r=s(r),Re(r))return null}catch(t){return Zb.error("Error in Segment filterProperties:",t),null}return r})(r,u);if(Re(d))return i;a=d}return i.event.properties=Object.assign({},a,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return s(t,t.event.event)},page(t){return s(t,se)},identify(t){return s(t,ae)},screen(t){return s(t,"$screen")}}}(t,i,{filterProperties:l})).then(()=>{e()},t=>{Zb.error("Failed to register the Segment integration",t),e()})},i)}var Qb="posthog-js";function Kb(t,e){var i=void 0===e?{}:e,r=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,v,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map(t=>n({},t,{stacktrace:t.stacktrace?n({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>n({},t,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return r&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var Xb=class{constructor(t,e,i,r,n,s){this.name=Qb,this.setupOnce=function(o){o(Kb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},Yb=class{constructor(t){this.Po=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(An.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Fo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Oo()}Oo(){var t;this.$o=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Po)}destroy(){var t;null==(t=this.$o)||t.call(this),this.$o=void 0}doPageView(t,e){var i,r=this.Do(t,e);return this.Fo={pathname:null!==(i=null==a?void 0:a.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Do(t,null==(e=this.Fo)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Fo)?void 0:t.pageViewId}}Do(t,e){var i=this.Fo;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Te(s)||Te(o)||Te(a)||Te(l)||Te(u)||Te(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Ge(o/s,0,1,An):1,v=s>1?Ge(a/s,0,1,An):1,c=l>1?Ge(u/l,0,1,An):1,f=l>1?Ge(h/l,0,1,An):1;r=$n(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},t_=["flags","surveys"],e_={[_]:{exposure:"hidden"},[x]:{exposure:"hidden"},[C]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[E]:{exposure:"event"},[R]:{exposure:"hidden"},[N]:{exposure:"hidden"},[A]:{exposure:"event"},[P]:{exposure:"hidden"},[F]:{exposure:"event"},[O]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"hidden"},[q]:{exposure:"event"},[j]:{exposure:"hidden"},[B]:{exposure:"hidden"},[G]:{exposure:"hidden"},[Z]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Ee(t)},[J]:{exposure:"event"},[Q]:{exposure:"event"},[K]:{exposure:"event"},[et]:{exposure:"event"},[it]:{exposure:"hidden"},[rt]:{exposure:"hidden",storageGroup:"flags"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden"},[ot]:{exposure:"hidden",storageGroup:"flags"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ut]:{exposure:"hidden",storageGroup:"flags"},[ht]:{exposure:"hidden"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[pt]:{exposure:"hidden",storageGroup:"surveys"},[gt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[mt]:{exposure:"event"},[yt]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[_t]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"event"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[ft]:{exposure:"event"},[Et]:{exposure:"hidden"},[Rt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[At]:{exposure:"hidden"},[Pt]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[z]:{exposure:"event"},[U]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[jt]:{exposure:"event"},[Bt]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Ut]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},i_=[[X,{exposure:"hidden"}],[Y,{exposure:"hidden"}],[tt,{exposure:"hidden"}]],r_=t=>{var e=e_[t];if(e)return e;for(var i of i_){var r=i[1];if(0===t.indexOf(i[0]))return r}},n_={flags:Rt,surveys:gt},s_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],o_=t=>t+"_cookie_identity_change_pending",a_=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},l_="main",u_=[rt,nt,ot,at,lt,Rt,ut,vt],h_=t=>-1!==u_.indexOf(t),d_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},v_=t=>{if(!t)return{};var e=JSON.parse(t);return xe(e)?e:{}},c_=(t,e)=>{On(t,(i,r)=>{var n=r_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},f_=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.Lo={},this.No=!1,this.qo=!1,this.jo=!1,this.Bo=!1,this.Ho=!1,this.zo=new Map,this.Uo=!1,this.Wo=!1,this.Vo=!1,this.Go=!1,this.Zo=new Set,this.xn=t,this.Jo=i,this.props={},this.Qo=void 0,this.Ko=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.To=this.Xo(t),this.jo=this.Yo(t),this.load(),this.ta(),t.debug&&An.info("Persistence loaded",t.persistence,n({},this.props)),this.update_config(t,t,e),this.save(),a){var r=()=>this.flush();zn(a,"beforeunload",r,{capture:!1}),zn(a,"pagehide",r,{capture:!1}),this.ea=t=>{if(this.No&&(!t.storageArea||t.storageArea===(null==a?void 0:a.localStorage))&&t.key)if(t.key!==this.Ko){if(this.jo){var e=t_.find(e=>t.key===this.ia(e));e&&this.ra(t.key,e)}}else this.ra(t.key,l_)},zn(a,"storage",this.ea)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.zo.get(e);if(h_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.na(e,n)}else this.na(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Zo.add(t),()=>this.Zo.delete(t)}destroy(){this.ea&&a&&(a.removeEventListener("storage",this.ea),this.ea=void 0),this.Zo.clear()}ra(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,n;try{if(n=Sa.Lt(t),Ee(n)){var s=this.sa(e);return s.storageValue=null,e!==l_&&(s.persisted=!1),!1}r=v_(n)}catch(t){return!1}var o=e===l_?r:Sa.Nt(this.Ko);if(o&&this.oa(o))return!1;var a=this.aa(r,e,i);return e===l_&&this.jo&&!d_(this.la().main,r)||this.ua(r,e,!0,n),a}oa(t){var e=this.props[w],i=t[w];return!Te(e)&&!Te(i)&&e!==i}ua(t,e,i,r){var n=this.sa(e);n.storageValue=r,e!==l_&&(n.persisted=i);try{n.fingerprint=this.ha(t,e)}catch(t){n.fingerprint=void 0}}aa(t,e,i){var r=!1;return u_.forEach(i=>{var n,s=null==(n=r_(i))?void 0:n.storageGroup;if(!(e===l_&&this.jo&&s||e!==l_&&s!==e)){var o=i in t,a=this.da(i,o?t[i]:void 0),l=this.zo.has(i)?i in this.props:o;l===i in this.props&&d_(a,this.props[i])||(l?this.va(i,a,!1):this.ca(i,!1),r=!0)}}),r&&i&&this.Zo.forEach(t=>t()),r}fa(){if(!this.No)return!1;try{this.Vo=!1;var t,e=Sa.Lt(this.Ko),i=this.sa(l_),r=!1,n=!1;if(e!==i.storageValue)if(Ee(e))i.storageValue=null;else{if(t=v_(e),this.Vo=!this.Wo&&this.oa(t),this.Vo)return!1;n=this.aa(t,l_,!1),!this.jo||d_(this.la().main,t)?this.ua(t,l_,!0,e):i.storageValue=e,r=!0}return this.jo&&t_.forEach(e=>{var i=Sa.Lt(this.ia(e)),s=this.sa(e),o=t||{},a=r&&u_.some(t=>{var i;return(null==(i=r_(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Ee(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.aa(o,e,!1)||n));var l=v_(i);n=this.aa(l,e,!1)||n,this.ua(l,e,!0,i)}}),n}catch(t){return!1}}na(t,e){this.zo.set(t,e);var i=r_(t);null!=i&&i.volatile||(this.sa((this.jo?null==i?void 0:i.storageGroup:void 0)||l_).fingerprint=void 0,this.pa(t))}ga(){u_.forEach(t=>this.zo.set(t,!0))}ta(){if(this.No)try{var t=Sa.Lt(this.Ko),e=v_(t);this.sa(l_).storageValue=t,u_.forEach(t=>{var i,r=this.jo?null==(i=r_(t))?void 0:i.storageGroup:void 0,n=r?Sa.Lt(this.ia(r)):null;if(r){var s=this.sa(r);s.storageValue=n,s.persisted=!Ee(n)}var o=r&&!Ee(n)?v_(n):e;t in this.props?this.ma(t,o[t],this.props[t]):t in o&&this.na(t,!0)})}catch(t){}}da(t,e){var i=this.zo.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(ke(e)?e:[]),s=new Set(ke(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=xe(e)?n({},e):{},a=xe(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}ma(t,e,i){if(h_(t)){var r=this.zo.get(t);if(!0!==r){var n=e;if(this.No)try{var s,o=this.jo?null==(s=r_(t))?void 0:s.storageGroup:void 0,a=o?this.ia(o):this.Ko;n=v_(Sa.Lt(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Te(e)&&!ke(e)||!Te(n)&&!ke(n)||!ke(i))return void this.na(t,!0);var u=new Set(e||[]),h=new Set(n||[]),d=new Set(i);new Set([...u,...d]).forEach(t=>{u.has(t)!==d.has(t)&&l.add(t)}),l.forEach(t=>{h.has(t)===d.has(t)&&l.delete(t)})}else{if(!xe(i))return void(d_(n,i)?this.zo.delete(t):this.na(t,!0));if(!Te(e)&&!xe(e)||Te(e)&&Ce(i)&&Te(n))return void this.na(t,!0);var v=xe(e)?e:{},c=xe(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&d_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&d_(c[t],i[t])&&l.delete(t)})}l.size?this.na(t,l):this.zo.delete(t)}}}ya(){var t,e=null==(t=this.xn)?void 0:t.persistence_save_debounce_ms;return Ae(e)&&e>0?e:0}ba(t){if(this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase())if(t)try{var e=Ea(t,this.xn.cookie_persisted_properties||[]),i=Aa(e,this.xn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=wa.Lt(this.Ko)||void 0;n&&Fa(this.Ko,n)===r&&(this._a=r,this.wa=n)}catch(t){}else try{var s=wa.Lt(this.Ko)||void 0;this._a=s?Fa(this.Ko,s):void 0,this.wa=s}catch(t){}}syncCookieProperties(){return this.ka(this.xn)}ka(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.Ho||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=wa.Lt(this.Ko)||void 0}catch(t){}if(!i||i===this.wa)return!1;var r,n=Fa(this.Ko,i);try{r=Ia(JSON.parse(i))}catch(t){return!1}if((wa.Lt(this.Ko)||void 0)!==i)return!1;this._a=n,this.wa=i;var s=Pa(this.Ko,i),o=[...Ca,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Te(e)||Ee(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Ce(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[w],d=u[At],v=$n({},u);[...Ca,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(s.isValid||-1===Ca.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=$n(v,r),u_.forEach(t=>{var e=t in this.props;t in u===e&&d_(u[t],this.props[t])||(e?this.ma(t,u[t],this.props[t]):this.na(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.va(At,te);var c=this.props[w],f=this.props[At];return!l||c===h&&f===d||(this.Wo=!0,this.Bo=!0,La.Ot(o_(this.Ko),!0),this.ca(vt),this.ca(nt),this.ca(rt),this.ca(ot),this.ca(at),this.ca(lt),this.ca(Rt),this.ca(Et),this.ca(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Te(h)||c===h)||(c_(this.props,r),this.ca(ct)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.ca(x)),!0}consumeCookieIdentityChange(){var t=o_(this.Ko),e=this.Bo||!!La.Lt(t);return this.Bo=!1,e&&La.Dt(t),e}Sa(t){return void 0===t&&(t=!1),!(this.Ho||this.gi&&!t||!this.xn.cookieWinsOnConflict||"localstorage+cookie"!==this.xn.persistence.toLowerCase()||(this.Ho=!0,0))}xa(){this.Ho&&(Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0),delete this.Lo[l_],this.Ta(!0))}Ma(t){if(void 0===t&&(t=!0),this.Ho)try{t?this.xa():Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0)}finally{this.Ho=!1}}isDisabled(){return!!this.gi}Xo(t){-1===s_.indexOf(t.persistence.toLowerCase())&&(An.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Ca,...t];return n({},Sa,{Nt(t){try{var r,n={};try{r=wa.Lt(t)||void 0,n=r?Ia(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(Sa.Lt(t)||"{}");if(e){var a=Pa(t,r),l=[...Ca,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Ee(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var d,v=o[w],c=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";i.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=o[t];(a.isValid||-1===Ca.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[At]=te),!h||("distinct_id"in u?u[w]:o[w])===v&&("$user_state"in u?u[At]:o[At])===c||(xa.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[w]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[ft],delete o[ct]),delete o.__alias)}s=$n(o,u)}else s=$n(n,o);return Sa.Ot(t,s),s}catch(t){}return null},Ot(i,r,n,s,o,a){var l=Sa.Ot(i,r,void 0,void 0,a);try{var u=Ea(r,t);if(Object.keys(u).length){if(e){var h=Ta(i),d=Aa(u,t);if(wa.Ot(h,d,n,s,o,a),wa.Lt(h)!==JSON.stringify(d)){wa.Dt(h,s);var v=Ea(r);return wa.Ot(i,v,n,s,o,a),l}}wa.Ot(i,u,n,s,o,a)}}catch(t){Sa.Pt(t)}return l},Dt(t,e){try{null==a||a.localStorage.removeItem(t),wa.Dt(t,e),wa.Dt(Ta(t),e)}catch(t){Sa.Pt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,s=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&Sa.Et()?(e=Sa,s=!0):"localstorage+cookie"===o&&i.Et()?(e=i,s=!0,r=!0):"sessionstorage"===o&&La.Et()?e=La:"memory"===o?e=$a:"cookie"===o&&wa.Et()?(e=wa,r=!0):i.Et()?(e=i,s=!0,r=!0):wa.Et()?(e=wa,r=!0):e=$a,this.No=s,this.qo=r,e}ia(t){return this.Ko+"__"+t}Yo(t){return this.No&&!!t.split_storage}properties(){var t={};return On(this.props,(e,i)=>{var r=r_(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}}),t}load(t){if(void 0===t&&(t=!1),!this.gi||t){var e=this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase(),i=e?Sa.Nt(this.Ko):null,r={};if(e)try{On(r=Ia(wa.Nt(this.Ko)),(t,e)=>{(Te(t)||Ee(t)||""===t)&&delete r[e]})}catch(t){}var n=this.To.Nt(this.Ko);if(n&&(this.props=$n({},n)),this.jo&&this.Ia(),e&&n){var s,o,a=null==i?void 0:i[w],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[w],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.Bo=!0,La.Ot(o_(this.Ko),!0);var d=$n({},this.props);xa.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Te(a)||u===a)||(c_(d,r),delete d[ct]),this.props=d;var v=new Set;xa.forEach(t=>{var e,i=null==(e=r_(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};On(this.props,(i,r)=>{var n;(null==(n=r_(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Ce(e)?(Sa.Dt(this.ia(t)),this.Lo[t]={}):Sa.Ot(this.ia(t),e)&&(this.Lo[t]={persisted:!0,fingerprint:this.ha(e,t)})})}}La.Lt(o_(this.Ko))&&(this.Bo=!0)}}Ia(){for(var t of t_){var e=Sa.Nt(this.ia(t));if(e&&!Ce(e)){var i=this.sa(t);i.persisted=!0,this.Ea(t)||(i.fingerprint=this.ha(e,t)),this.Ra(t,e)||$n(this.props,e)}}}Ea(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=r_(e))?void 0:i.storageGroup)===t})}Ra(t,e){var i=n_[t];if(!i)return!1;var r=e[i],n=this.props[i];return Ae(r)&&Ae(n)&&n>r}refreshKey(t){var e;if(!(this.gi||"$fbc_persistence"===t&&this.Go)){var i=this.jo?null==(e=r_(t))?void 0:e.storageGroup:void 0,r=i?Sa.Nt(this.ia(i)):this.To.Nt(this.Ko);if(r&&t in r)this.va(t,r[t],!1);else{if(i){var n=this.To.Nt(this.Ko);if(n&&t in n)return void this.va(t,n[t],!1)}this.ca(t,!1)}}}save(){if(!this.gi){var t=this.ya();t>0?Te(this.Ca)&&(this.Ca=setTimeout(()=>{this.Ca=void 0,this.Ta()},t)):this.Ta()}}flush(){Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0,this.Ta())}Ta(t){if(void 0===t&&(t=!1),!(this.gi||this.Ho&&!t)){t||(this.syncCookieProperties(),this.Go||this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.Uo;e||(this.Vo=!1);var i=!!e&&this.fa();if(this.Vo)this.xn.debug&&An.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.jo)return this.Aa(),void(i&&this.Zo.forEach(t=>t()));var r=this.Pa(this.To,this.Ko,this.props,l_);"written"===r&&this.ba(this.props),"failed"!==r&&(this.zo.clear(),this.Wo=!1,this.Go=!1),i&&this.Zo.forEach(t=>t())}}}Aa(){var t=this,e=this.la(),i=e.main,r=e.groups,n=this.Pa(this.To,this.Ko,i,l_);"written"===n&&this.ba(i),"failed"!==n&&(this.Wo=!1,this.Go=!1,u_.forEach(t=>{var e;null!=(e=r_(t))&&e.storageGroup||this.zo.delete(t)}));var s=function(e){var i,n=r[e];if(Ce(n)&&(null==(i=t.Lo[e])||!i.persisted))return u_.forEach(i=>{var r;(null==(r=r_(i))?void 0:r.storageGroup)===e&&t.zo.delete(i)}),1;var s=t.Pa(Sa,t.ia(e),n,e);"failed"!==s&&u_.forEach(i=>{var r=r_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.zo.delete(i)})};for(var o of t_)if(s(o))continue}la(){var t={},e={flags:{},surveys:{}};return On(this.props,(i,r)=>{var n,s=null==(n=r_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}ha(t,e){if(e===l_)return JSON.stringify(t)+"|"+this.Fa+"|"+this.Oa+"|"+this.$a;var i={};return On(t,(t,e)=>{var r;i[e]=null!=(r=r_(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}Pa(t,e,i,r){var n,s=this.sa(r);if(r!==l_&&!s.dirty&&!Te(s.fingerprint))return"skipped";try{if((n=this.ha(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.Ot(e,i,this.Fa,this.Oa,this.$a,this.xn.debug)?(s.dirty=!1,r!==l_&&(s.persisted=!0),Te(n)||(s.fingerprint=n),this.No&&(s.storageValue=Sa.Lt(e)),"written"):(this.xn.debug&&An.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.ga(),Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0),this.To.Dt(this.Ko,!1),this.To.Dt(this.Ko,!0),!i&&this.Jo)for(var r of t_)Sa.Dt(this.ia(r));i?delete this.Lo[l_]:this.Lo={},this._a=void 0,this.wa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(xe(t)){this.syncCookieProperties(),Te(e)&&(e="None"),this.Fa=Te(i)?this.Da:i;var r=!1;if(On(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.va(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(xe(t)){this.syncCookieProperties(),this.Fa=Te(e)?this.Da:e;var i=!1;if(On(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||xe(e)||ke(e))&&(this.va(r,e),i=!0)}),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.ca(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.Qo){var e=fl(this.xn.custom_campaign_params,this.xn.mask_personal_data_properties,this.xn.custom_personal_data_properties),i=!Ce(qn(e));return i&&this.register(e),this.Qo=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==h?void 0:h.referrer)?gl(t):{})}update_referrer_info(){var t;this.register_once({$referrer:bl(),$referring_domain:null!=h&&h.referrer&&(null==(t=Gn(h.referrer))?void 0:t.host)||yl},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=_l(this.xn.mask_personal_data_properties,this.xn.custom_personal_data_properties,this.xn.disable_capture_url_hashes);this.register_once({[Dt]:this.qo?{r:a_(t.r),u:t.u?a_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};On([$t,Ot],e=>{var i=this.props[e];i&&On(i,function(e,i){t["$initial_"+me(i)]=e})});var e=this.props[Dt];return e&&$n(t,function(t,e){void 0===e&&(e=!1);var i=wl(t,e),r={};return On(i,function(t,e){r["$initial_"+me(e)]=t}),r}(e,this.xn.disable_capture_url_hashes)),t}safe_merge(t){return On(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,i){var r=t.persistence!==e.persistence,s=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every((t,e)=>t===r[e])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=r||s,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.gi&&!l;l||this.ka(e,u),this.xn=t,!l&&(r||s||a)&&(this._a=void 0,this.wa=void 0,this.ka(n({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Xo(t):this.To;this.La();var d=this.Yo(t),v=o||d!==this.jo,c=!l&&(v||t.cross_subdomain_cookie!==this.Oa||t.secure_cookie!==this.$a)&&this.Sa(u);this.Uo=v;try{if(this.Da=this.Fa=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var f=this.props;this.clear(),this.To=h,this.jo=d,this.props=f,this.save()}else a&&(this.To=h,l||(delete this.Lo[l_],this.Ta()))}finally{this.Uo=!1,c&&this.Ma()}}La(){var t=this.props[Dt];if(this.qo&&xe(t)&&"string"==typeof t.r){var e=a_(t.r),i="string"==typeof t.u?a_(t.u):t.u;e===t.r&&i===t.u||this.va(Dt,n({},t,{r:e,u:i}))}}set_disabled(t){this.gi=t,this.gi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Oa&&(this.Oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.$a&&(this.$a=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.va(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Te(i)||(delete e[t],this.va(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.va(t,e),this.save()}va(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||n===e||(this.Wo=!0),"$fbc_persistence"!==t||d_(n,e)||(this.Go=!0),this.ma(t,n,e),null!=(r=r_(t))&&r.volatile||this.pa(t))}ca(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(h_(t)&&this.na(t,!0),"$fbc_persistence"===t&&(this.Go=!0),this.pa(t))}pa(t){var e,i=null==(e=r_(t))?void 0:e.storageGroup;i&&(this.sa(i).dirty=!0)}sa(t){return this.Lo[t]||(this.Lo[t]={})}},p_=Pn("[RateLimiter]"),g_=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach(t=>{p_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void p_.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(Ae(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Na(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}qa(t){var e=this.instance.config.property_denylist;return!ke(e)||!e.includes(t)}ja(){var t;if(this.qa("$current_url")&&this.qa("$pathname")&&null!=d&&d.pathname)return""+(null!==(t=d.origin)&&void 0!==t?t:"")+d.pathname}Na(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ja(),o=this.qa("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}},m_=Pn("[RemoteConfig]"),y_=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Ba(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Ha(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return m_.info("Using preloaded remote config",this.remoteConfig),void this.za(this.remoteConfig);if(this._instance.Ua())return void m_.warn("Remote config is disabled. Falling back to local config.");this.Ba(t=>{if(!t)return m_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ha(t=>{this.za(t.json,t)});this.za(t)})}catch(t){m_.error("Error loading remote config",t),this.za()}}za(t,e){!t&&e&&(0===e.statusCode?e.error||m_.warn("Failed to fetch remote config from PostHog."):m_.error("Failed to fetch remote config from PostHog."));try{this._instance.za(t?{ok:!0,config:t}:{ok:!1})}catch(t){m_.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){m_.error("Error loading feature flags",t)}}},b_=!!c||!!v,__="text/plain",w_=!1,k_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},S_=function(t,e,i){var r;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=n({},e),u=null!==(r=null==a?void 0:a.split("&").map(t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s}))&&void 0!==r?r:[],h=Zn(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},x_=t=>{if(t.Wa)return t.Wa;var e=t.data,i=t.compression;if(e){if(i===Wf){var r=oa(aa(Vn(e)),{mtime:0});return{contentType:__,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Vf){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Vn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(Vn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=Vn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},C_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:S_(t.url,{compression:Vf}),encodedBody:x_(n({},t,{compression:Vf,Wa:void 0}))}:{url:k_(t.url,"compression"),encodedBody:x_(n({},t,{compression:void 0,Wa:void 0}))};try{e=x_(t)}catch(e){if(en(t.compression,Jn(t.url,"compression")))return An.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&en(t.compression,Jn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?tn(new Uint8Array(i)):ArrayBuffer.isView(i)&&tn(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(w_=!0,r()):{url:t.url,encodedBody:e}},T_=t=>{try{return C_(t)}catch(e){return An.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},M_=function(){var t=o(function*(t){var e=yield an(Vn(t.data),Na.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return n({},t,{Wa:{contentType:__,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),I_=/Failed to fetch|NetworkError|Load failed/i,E_=t=>"TypeError"===(null==t?void 0:t.name)&&I_.test((null==t?void 0:t.message)||""),R_=t=>{var e=T_(t);if(e){var i=new c,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;On(t.headers,function(t,e){i.setRequestHeader(e,t)}),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(o)}},A_=t=>{var e=T_(t);if(e){var i=e.url,r=e.encodedBody,s=null!=r?r:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;On(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var h=null,d=!1;if(f){var c=new f;h={signal:c.signal,timeout:setTimeout(()=>{var e;d=!0,c.abort(or("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var p=e=>{d&&"AbortError"===(null==e?void 0:e.name)||E_(e)?An.warn(e):An.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;v(i,n({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Va&&52428.8>(l||0),body:a,signal:null==(g=h)?void 0:g.signal},t.fetchOptions)).then(e=>e.text().then(i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){An.error(t)}null==t.callback||t.callback(r)})).catch(p).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),p(t)}}},P_=t=>{try{var e,i=C_(t),r=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var h=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(u.sendBeacon(r,h))return;var d=ke(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(ke(d)&&d.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(d.length/2),f=e=>ke(t.data)?e:n({},t.data,{batch:e});return P_(n({},t,{data:f(d.slice(0,c))})),void P_(n({},t,{data:f(d.slice(c))}))}An.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(v?"fetch":"XHR")),v?A_(n({},t,{Va:!0})):R_(t)}catch(t){An.warn("Beacon send failed",t)}},F_=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return S_(i===Wf?k_(t,"compression"):t,n({},s?{[s]:Date.now().toString()}:{},i===Wf?{}:{compression:i}))},O_=[];v&&O_.push({transport:"fetch",method:A_}),c&&O_.push({transport:"XHR",method:R_}),null!=u&&u.sendBeacon&&O_.push({transport:"sendBeacon",method:P_});var $_=class{constructor(t,e){this.Ga=!0,this.Za=[],this.Ja=Ge((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,An.createLogger("flush interval"),3e3),this.Qa=t}enqueue(t){this.Za.push(t),this.Ka||this.Xa()}unload(){this.Ya();var t=this.Za.length>0?this.tl():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.el(n({},t,{transport:"sendBeacon"}))})}enable(){this.Ga=!1,this.Xa()}Xa(){var t=this;this.Ga||(this.Ka=setTimeout(()=>{if(this.Ya(),this.Za.length>0){var e=this.tl(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&ke(i.data)&&On(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.el(i)};for(var r in e)i()}},this.Ja))}el(t){try{this.Qa(t)}catch(t){An.error(t)}}Ya(){clearTimeout(this.Ka),this.Ka=void 0}tl(){var t={};return On(this.Za,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;Te(t[s])&&(t[s]=n({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.Za=[],t}},D_=class{constructor(t){this._instance=t,this.il=!1,this.rl=3e3,this.Za=[],this.Za=[],this.nl=!0,this.resume()}resume(){if(!Te(a)&&"onLine"in a.navigator){if(this.nl=a.navigator.onLine,this.sl)return;this.sl=()=>{this.nl=!0,this.ol()},this.al=()=>{this.nl=!1},zn(a,"online",this.sl),zn(a,"offline",this.al)}}get length(){return this.Za.length}retriableRequest(t){var i=t.retriesPerformedSoFar,s=r(t,e);Pe(i)&&(s.url=S_(s.url,{retry_count:i})),this._instance._send_request(n({},s,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=i?i:0))return void this.Is(n({retriesPerformedSoFar:i},s));0===t.statusCode&&An.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!=i?i:0)+" retries.")}null==s.callback||s.callback(t)}}))}Is(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=(Math.random()-.5)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.Za.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),An.warn(n),this.il||(this.il=!0,this.ll())}ll(){if(this.ul&&clearTimeout(this.ul),0===this.Za.length)return this.il=!1,void(this.ul=void 0);this.ul=setTimeout(()=>{this.nl&&this.Za.length>0&&this.ol(),this.ll()},this.rl)}ol(){var t=Date.now(),e=[],i=this.Za.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Za=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.ul&&(clearTimeout(this.ul),this.ul=void 0),this.il=!1,Te(a)||(this.sl&&(a.removeEventListener("online",this.sl),this.sl=void 0),this.al&&(a.removeEventListener("offline",this.al),this.al=void 0)),this.Za)){var e=t.requestOptions;try{this._instance._send_request(n({},e,{transport:"sendBeacon"}))}catch(t){An.error(t)}}this.Za=[]}},L_=class{constructor(t){this._instance=t,this.hl=()=>{var t,e,i,r;this.dl||(this.dl={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.dl.lastScrollY=Math.ceil(s),this.dl.maxScrollY=Math.max(s,null!==(t=this.dl.maxScrollY)&&void 0!==t?t:0),this.dl.maxScrollHeight=Math.max(o,null!==(e=this.dl.maxScrollHeight)&&void 0!==e?e:0),this.dl.lastContentY=a,this.dl.maxContentY=Math.max(a,null!==(i=this.dl.maxContentY)&&void 0!==i?i:0),this.dl.maxContentHeight=Math.max(l,null!==(r=this.dl.maxContentHeight)&&void 0!==r?r:0)}}get vl(){return this._instance.config.scroll_root_selector}getContext(){return this.dl}resetContext(){var t=this.dl;return setTimeout(this.hl,0),t}startMeasuringScrollPosition(){zn(a,"scroll",this.hl,{capture:!0}),zn(a,"scrollend",this.hl,{capture:!0}),zn(a,"resize",this.hl)}scrollElement(){var t;if(!this.vl)return null==a||null==(t=a.document)?void 0:t.documentElement;for(var e of ke(this.vl)?this.vl:[this.vl]){var i,r=null==a||null==(i=a.document)?void 0:i.querySelector(e);if(r)return r}}cl(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.vl){var n=this.scrollElement();return n&&n[r]||0}return a?"y"===t?a.scrollY||a.pageYOffset||(null==(e=a.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:a.scrollX||a.pageXOffset||(null==(i=a.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.cl("y")}scrollX(){return this.cl("x")}},N_=t=>_l(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes),q_=class{constructor(t,e,i,r){this.Be=t=>{var e=this.fl();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.pl(this._instance)};this.gl.register({[Pt]:i})}},this._instance=t,this.ml=e,this.gl=i,this.pl=r||N_,this.ml.onSessionId(this.Be)}fl(){return this.gl.props[Pt]}getSetOnceProps(){var t,e=null==(t=this.fl())?void 0:t.props;return e?"r"in e?wl(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return On(qn(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+me(i)]=e}),t}},j_=class{on(t,e){return this.yl[t]||(this.yl[t]=[]),this.yl[t].push(e),()=>{this.yl[t]=this.yl[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.yl[t]||[])i(e);for(var r of this.yl["*"]||[])r(t,e)}constructor(){this.yl={}}},B_=Pn("[SessionId]"),H_=864e5,z_=class{on(t,e){return this.bl.on(t,e)}constructor(t,e,i){var r;if(this._l=null,this.wl=null,this.kl=[],this.Sl=void 0,this.xl=!1,this.bl=new j_,this.Cl=(t,e)=>!(!Pe(t)||!Pe(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.xn=t.config,this.gl=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Tl=void 0,this._sessionActivityTimestamp=null,this.Ml=e||ga,this.Il=i||ga;var n=this.xn.persistence_name||this.xn.token;if(this._sessionTimeoutMs=1e3*Ge(this.xn.session_idle_timeout_seconds||1800,60,36e3,B_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.El(),this.Rl="ph_"+n+"_window_id",this.Al="ph_"+n+"_primary_window_exists",this.Pl()){var s=La.Nt(this.Rl),o=La.Nt(this.Al);s&&!o?this.He=s:La.Dt(this.Rl),La.Ot(this.Al,!0)}null!=(r=this.xn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.xn.bootstrap.sessionID),this.Fl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Te(this.kl)&&(this.kl=[]),this.kl.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.kl=this.kl.filter(e=>e!==t)}}Pl(){return"memory"!==this.xn.persistence&&!this.gl.gi&&La.Et()}Ol(t){t!==this.He&&(this.He=t,this.Pl()&&La.Ot(this.Rl,t))}$l(){return this.He?this.He:this.Pl()?La.Nt(this.Rl):null}Dl(t){var e=this._l;return!Ee(e)&&!Ee(t)&&5e3>Math.abs(t-e)}Ll(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xt=t,n&&!r||n&&this.Dl(e)||(this._l=e,this.gl.register({[G]:[e,t,i]}))}Nl(){var t,e=null==(t=this.xn)?void 0:t.persistence_save_debounce_ms;return Pe(e)&&e>0}ql(){this.Nl()?this.gl.refreshKey(G):(this.gl.flush(),this.gl.load())}jl(){var t;if(!Ee(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._l){this.ql();var e=this.Bl();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this._l=this._sessionActivityTimestamp,this.gl.register({[G]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.gl.flush())}}Hl(){var t=this.Bl()[0],e=Pe(t)?t:0,i=Pe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}zl(t){return this.ql(),this.Cl(t,this.Hl())}Bl(){var t=this.gl.props[G];return ke(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this._l=null,this.Tl=void 0,clearTimeout(this.Ul),this.Ul=void 0,this.Ll(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void B_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void B_.error("Invalid sessionID in bootstrap",t)}}(t);return!Te(i)&&(e?this.Tl={sessionId:t,sessionStartTimestamp:i}:this.Ll(t,(new Date).getTime(),i),!0)}destroy(){this.xl=!0,this.jl(),clearTimeout(this.Ul),this.Ul=void 0,this.Sl&&a&&(a.removeEventListener(ne,this.Sl,{capture:!1}),this.Sl=void 0),this.kl=[]}Fl(){this.Sl=()=>{this.jl(),this.Pl()&&La.Dt(this.Al)},zn(a,ne,this.Sl,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.xn.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Xt;if(i)this.wl=r;else if(Ee(this.wl)||this.wl>r||r-this.wl>=1e3){var s,o;null==(s=(o=this.gl).syncCookieProperties)||s.call(o),this.wl=r}var a=this.Bl(),l=a[1],u=a[2],h=!Te(n)&&l!==n,d=this.Hl(),v=this.$l(),c=this.Tl,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>H_),p=c?f:Pe(u)&&Math.abs(r-u)>H_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Cl(r,d);if(_){(_=this.zl(r))||B_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Bl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Ml(),v=this.Il(),B_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Tl=void 0,g=!0}else v||(v=this.Il(),g=!0),(m=m||l!==b)&&(B_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=Pe(d)&&t&&!p?d:r,x=Pe(u)?u:(new Date).getTime();this.Ol(v),this.Ll(l,S,x),t||this.El();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.kl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}El(){this.xl||(clearTimeout(this.Ul),this.Ul=setTimeout(()=>{if(!this.xl)if(this.zl((new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.bl.emit("forcedIdleReset",{idleSessionId:t})}else this.El()},1.1*this.sessionTimeoutMs))}},U_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&Ve(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>Ve(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function W_(){return W_=o(function*(){var t=null==u?void 0:u.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Me(i)&&i.length>0?i:void 0}catch(t){return void An.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),W_.apply(this,arguments)}var V_="custom",G_="i.posthog.com",Z_=/^\/static\//,J_=["/s/","/e/","/i/"],Q_=class{constructor(t){this.Wl={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+G_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Wl[this.apiHost]||(this.Wl[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":V_),this.Wl[this.apiHost]}Vl(t){if(Z_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Gl(t){var e=Gn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Zl(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=Gn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&J_.some(t=>0===e.indexOf(t))){var a=this.Gl(r);if(a){var l,u=this.apiHost,h=this.Jl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Jl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Jl,i=this.Gl(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Zl(t,e,this.uiHost+e);if("flags"===t)return this.Zl(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.Vl(e);if(i)return this.Zl(t,e,""+i+e)}if(this.region===V_)return this.Zl(t,e,this.apiHost+e);var r=G_+e;switch(t){case"assets":return this.Zl(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Zl(t,e,"https://"+this.region+"."+r)}}},K_=Pn("[PostHog ExternalIntegrations]"),X_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Y_=class{constructor(t){this._instance=t}Ro(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return K_.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=b.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ro(X_[s],()=>{var e;null==(e=b.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)}),!o&&null!=(r=b.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=b.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}},tw=class{constructor(t,e){this.A=t,this.ao=e,this.Ql=new Map,this.fo=!1}add(t){var e=this;return o(function*(){if(e.fo)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Ql.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Ql.set(t.name,t);try{var i=t.setup(e.ao);i&&(yield i)}catch(i){var r=e.Ql.get(t.name)===t;r&&e.Ql.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Kl(t)}})()}getExtension(t){return this.Ql.get(t)}dispose(){if(!this.fo){this.fo=!0;var t=Array.from(this.Ql.values()).reverse();for(var e of(this.Ql.clear(),t))this.Kl(e)}}Kl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Se(e.then)&&e.then(void 0,e=>{this.A.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.A.error('Failed to dispose browser extension "'+t.name+'"',e)}}},ew=class{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var n=null==e?void 0:e.get_property(r);Te(n)||(i[r]=n)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}},iw="extensionsRemoteConfig",rw=class{constructor(t){this.instance=t,this.fo=!1,this.A=An,this.Xl=t.Yl,this.kv=new ew(t),this.onEvent=t=>kp(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.A.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.fo)return kp(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.tu.on(iw,e);return this.Xl&&e(this.Xl),kp(i)},this.eu=new tw(An.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(k);return"string"==typeof t?t:void 0}get library(){return{name:Na.LIB_NAME,version:Na.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.eu.add(t)}getExtension(t){return this.eu.getExtension(t)}capture(t,e,i){var r=this;return o(function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)})()}registerDynamicEventProperties(t){return kp(this.instance.iu(t))}handleRemoteConfig(t){this.fo||(this.Xl=t,this.instance.tu.emit(iw,t))}sendRequest(t,e){var i=this;return o(function*(){var r;void 0===e&&(e={});var n=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),s={method:e.method,url:e.query?S_(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?he.Base64:void 0,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(s),{statusCode:202}):new Promise(t=>{s.callback=t,i.instance._send_request(s)})})()}dispose(){this.fo||(this.fo=!0,this.eu.dispose())}},nw={},sw=0,ow=()=>{},aw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',lw="Surveys module not available",uw="sanitize_properties is deprecated. Use before_send instead",hw="Invalid value for property_denylist config: ",dw=/^[A-Za-z0-9_-]{1,400}$/,vw=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,cw=["token","distinct_id",qt],fw="posthog",pw=!b_&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),gw=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},mw=t=>{var e;return n({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Hn(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ow,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:d&&Me(null==d?void 0:d.search)&&-1!==d.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==a||null==(e=a.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_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(t){An.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ie,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:ow},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:bs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:gw(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(t))},yw=[["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"]],bw=t=>{var e={};for(var i of yw){var r=i[0],n=i[1];Te(t[r])||(e[n]=t[r])}var s=$n({},e,t),o=t.__preview_external_dependency_versioned_paths;return Te(o)||(Te(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Me(o)&&Te(t.asset_host)&&(s.asset_host=o)),ke(t.property_blacklist)&&(Te(t.property_denylist)?s.property_denylist=t.property_blacklist:ke(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:An.error(hw+t.property_denylist)),s},_w=class{constructor(){this.__forceAllowLocalhost=!1}get ru(){return this.__forceAllowLocalhost}set ru(t){An.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},ww=(s=class t{nu(t){if(t){var e=this.Ql.indexOf(t);-1!==e&&this.Ql.splice(e,1)}}su(t,e){return this.nu(t),this.Ql.push(e),null==e.initialize||e.initialize(),e}ou(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}au(){if(!(this.lu||this.config.reuseAnonymousId||this.config.segment||this.ou())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.uu||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.lu=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", 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)))}}hu(){if(!this.ou()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.du()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(ga());this.register({distinct_id:i,$device_id:i}),t.set_property(At,te)}this.vu()}}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var e;this.cu=!1,this.fu=!1,this.webPerformance=new _w,this.pu=!1,this.version=Na.LIB_VERSION,this.gu=new Set,this.mu="",this.tu=new j_,this.Ql=[],this.yu=[],this.uu=!1,this.lu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=mw(),this.SentryIntegration=Xb,this.sentryIntegration=t=>function(t,e){var i=Kb(t,e);return{name:Qb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bu=!1,this._u=null,this.wu=null,this.ku=null,this.scrollManager=new L_(this),this.pageViewManager=new Yb(this),this.rateLimiter=new g_(this),this.requestRouter=new Q_(this),this.consent=new zb(this),this.externalIntegrations=new Y_(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=Me(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Me(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>An.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==fw){var n,s=null!==(n=nw[r])&&void 0!==n?n:new t;return s._init(e,i,r),nw[r]=s,nw[fw][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,s,o;void 0===e&&(e={});var l,u=Me(t)?t.trim():"";if(!u)return An.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 u!==(null==(l=this.config)?void 0:l.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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=mw(e.defaults),e.debug=this.Su(e.debug),this.xu=e,this.Cu=[],e.person_profiles?this.wu=e.person_profiles:e.process_person&&(this.wu=e.process_person);var h=mw(e.defaults),d=bw(e),v=$n({},h,d,{name:i,token:u});xe(h.rageclick)&&xe(d.rageclick)&&(v.rageclick=$n({},h.rageclick,d.rageclick)),xe(h.session_recording)&&xe(d.session_recording)&&(v.session_recording=$n({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&An.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Wf;var c=this.du();if(this.persistence=new f_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new f_(n({},this.config,{persistence:"sessionStorage"}),c,!1),this.mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&La.Et()){var f=La.Nt(this.mu);ke(f)&&f.forEach(t=>{Me(t)&&this.gu.add(t)})}else La.Dt(this.mu);var p=n({},this.persistence.props),g=n({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Tu=new $_(t=>this.Mu(t),this.config.request_queue_config),this.Iu=new D_(this),this.__request_queue=[];var m=this.ou();m||(this.sessionManager=new z_(this),this.sessionPropsManager=new q_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Eu()})),this.Ru(),this.config.__preview_deferred_init_extensions?(An.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Au(m)},0)):(An.info("Initializing extensions synchronously"),this.Au(m)),Na.DEBUG=Na.DEBUG||this.config.debug,Na.DEBUG&&An.info("Starting in debug mode",{this:this,config:e,thisC:n({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=n({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(s=e.bootstrap)?void 0:s.distinctID;if(this.uu=!!y&&!Ie(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var b=e.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(At);if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"anonymous"===w)this.identify(b);else if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"identified"===w)An.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(ga()),x=e.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(At,e.bootstrap.isIdentifiedID?ee:te),this.register({distinct_id:b,$device_id:x})}}if(m)this.register_once({distinct_id:Nt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(ga());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(At,te)}return zn(a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),zn(a,"pageshow",()=>{var t;this.cu=!1,this.fu||null==(t=this.Iu)||t.resume()}),e.segment?Jb(this,()=>this.Pu()):this.Pu(),Se(this.config._onCapture)&&this.config._onCapture!==ow&&(An.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&An.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 W_.apply(this,arguments)}().then(t=>{t&&this.register({[S]:t})}).catch(ow),this}Fu(t){var e=t;return Me(e.name)&&Se(e.setup)}Ou(t,e){this.Fu(t)?e.push(()=>{this.$u().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{An.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.Ql.push(t)}Ru(){var e,i,r,n,s,o,a=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(o=this.Du)||o.call(this),this.Du=void 0,this.featureFlags=new a(this)),Se(this.featureFlags.onReloading)&&Se(this.featureFlags.setup)?this.Du||(this.Du=this.featureFlags.onReloading(()=>{this.tu.emit("featureFlagsReloading",!0)}),this.$u().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}Au(e){var i,r,s,o,a,l,u,h=performance.now(),d=n({},t.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.exceptions&&this.Ql.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Ql.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ql.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ql.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ql.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Ou(this.autocapture=new d.autocapture(this),v),d.surveys&&this.Ou(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.Ou(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this),v),d.metrics&&this.Ql.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Ql.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ql.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ql.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ql.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ql.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ql.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Vb)),d.toolbar&&this.Ql.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Ql.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Ql.forEach(t=>{t.initialize&&v.push(()=>{null==t.initialize||t.initialize()})}),v.push(()=>{if(this.Lu){var t=this.Lu;this.Lu=void 0,this.Ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Nu(v,h)}Nu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Nu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){An.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[jt]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Bt]:r}),this.config.__preview_deferred_init_extensions&&An.info("PostHog extensions initialized ("+r+"ms)")}za(t){var e;if(!h||!h.body)return An.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.za(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Lu=t),this.Yl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=pe(r.supportedCompression,Wf)?Wf:pe(r.supportedCompression,Vf)?Vf:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.wu?this.wu:ie}),null==(e=this.qu)||e.handleRemoteConfig(t),this.Ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}Pu(){try{this.config.loaded(this)}catch(t){An.critical("`loaded` function failed",t)}if(this.ju(),this.config.internal_or_test_user_hostname&&null!=d&&d.hostname){var t=d.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.ou())&&this.Bu()},1),this.Hu=new y_(this),this.Hu.load()}ju(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Tu)||t.enable())}_dom_loaded(){this.is_capturing()&&Fn(this.__request_queue,t=>this.Mu(t)),this.__request_queue=[],this.ju()}_handle_unload(){var t,e,i,r,n;this.cu=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.zu()&&this.capture(oe),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Tu)||r.unload(),null==(n=this.Iu)||n.unload()):this.zu()&&this.capture(oe,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?pw?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=n({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(Te(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,s=n({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Te(s.compression)&&s.data&&(s.compression=Vf),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=(ke(o=s.data)?o:[o]).map(t=>n({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),ke(t)?t.map(t=>n({},t,{sent_at:e})):n({},t,{sent_at:e})}(s.data))),s.url=F_(s.url,s.method,s.compression,s.timestampMode);var v=O_.filter(t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport)),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,t=>t.transport===d))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){E_(t)?An.warn(t):An.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===Wf&&p&&"undefined"!=typeof Promise&&!w_?M_(s).then(t=>{f(t)}).catch(e=>{if(rn(e))return w_=!0,void f(n({},s,{compression:void 0,url:F_(t.url,t.method,void 0,t.timestampMode)}));nn(e)&&(w_=!0),f(s)}):c(s)})(n({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}Mu(t){this.Iu?this.Iu.retriableRequest(t):this._send_request(t)}_execute_array(t){sw++;try{var e,i=[],r=[],n=[];Fn(t,t=>{if(t)if(ke(e=t[0]))n.push(t);else if(Se(t))try{t.call(this)}catch(e){An.error("Error executing queued PostHog call",t,e)}else ke(t)&&"alias"===e?i.push(t):ke(t)&&-1!==e.indexOf("capture")&&Se(this[e])?n.push(t):r.push(t)});var s=function(t,e){Fn(t,function(t){try{if(ke(t[0])){var i=e;On(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){An.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{sw--}}push(e){if(sw>0&&ke(e)&&Me(e[0])){var i=t.prototype[e[0]];Se(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Uu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Me(e)&&vw.test(e)?{value:e,delivered:!1}:xe(e)&&Me(e.value)&&vw.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Wu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Uu();if(!r){if(i)return Me(e)&&vw.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[M]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(M);if(Me(t)&&dw.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[M]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(M)}}Vu(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Uu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[M]:{value:t,delivered:!0}})}}capture(t,e,i){var r,s,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Tu){if(this.is_capturing())if(!Te(t)&&Me(t)){this.hu();var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==p||!p.isRateLimited){var g;null!=e&&e.$current_url&&!Me(null==e?void 0:e.$current_url)&&(An.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.Gu||An.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&&(g=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 m=new Date,y=(null==i?void 0:i.timestamp)||m,b=sr(null==i?void 0:i.uuid,ga),_={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},y,b)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(_.$set=null==i?void 0:i.$set);var k=xe(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&"$fbc"in i.$set,x=S||!!k&&"$fbc"in k,C=S?null==i||null==(r=i.$set)?void 0:r[T]:null==k?void 0:k[T],M=ke(null==e?void 0:e.$unset)?e.$unset:[],I=(null==i?void 0:i.$unset)||[],E=-1!==M.indexOf("$fbc")||-1!==I.indexOf("$fbc"),R=this.Wu(null==(s=g)?void 0:s.fbclid,C,x,E);R&&!0===_.properties.$process_person_profile&&R.pending&&!x&&!w&&(_.$set=n({[T]:R.value},_.$set));var A=null==i?void 0:i.$unset;A&&(_.$unset=A);var P=w?void 0:this.Zu(null==i?void 0:i.$set_once,t!==le,t===ae);if(P&&(_.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=_,v=t=>Me(t)?t.slice(0,h):t,c=new Set,_=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),ke(e))r=[],Fn(e,e=>{r.push(t(e))});else{var n={};On(qe(e)?jn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),_.timestamp=y,Te(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Xr.forEach(r),e.forEach(r),i}(_.properties,cw)),t===hp||t===dp){var F=null==e?void 0:e[vp],O=null==e?void 0:e[fp];Rp({id:F,current_iteration:O}),_.$set=n({},_.$set,{[Ua({id:F,current_iteration:O},t===dp?"responded":"dismissed")]:!0})}else t===up&&(_.$set=n({},_.$set,{[bp]:(new Date).toISOString()}));if("product tour shown"===t){var D=null==e?void 0:e.$product_tour_type;D&&(_.$set=n({},_.$set,{["$product_tour_last_seen_date/"+D]:(new Date).toISOString()}))}var L=n({},_.properties.$set,_.$set);if(Ce(L)||this.setPersonPropertiesForFlags(L),!Re(this.config.before_send)){var N=this.Ts(_);if(!N)return;(_=N).uuid=sr(_.uuid,ga)}var q=null!==(o=null==(a=_.$set)?void 0:a.$fbc)&&void 0!==o?o:xe(null==(l=_.properties)?void 0:l.$set)?_.properties.$set.$fbc:void 0,j=null!=R&&R.pending&&q===R.value?R.value:void 0;this.tu.emit("eventCaptured",_);var B,H=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),z=n({method:"POST",url:H,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(H)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},j?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Vu(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?(!z.transport&&!z.callback&&Ce(null!==(B=this.config.request_headers)&&void 0!==B?B:{})&&this.cu&&(z.transport="sendBeacon"),this.Mu(z)):this.Tu.enqueue(z),_}An.critical("This capture call is ignored due to client rate limiting.")}}else An.error("No event name provided to posthog.capture")}else An.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.qu)?void 0:e.getExtension(t)}$u(){var t;return null!==(t=this.qu)&&void 0!==t?t:this.qu=new rw(this)}iu(t){this.yu.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.yu.indexOf(t);-1!==i&&this.yu.splice(i,1)}}}Ju(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.ku=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.gu.clear(),this.Qu()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,e,i,r,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Ju();var o=s?void 0:this.persistence.remove_event_timer(t),l=n({},e);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.ou()&&(l[qt]=!0),"$snapshot"===t){var u=n({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Me(l.distinct_id)&&!Ae(l.distinct_id)||Ie(l.distinct_id))&&An.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var v,c=function(t,e,i,r){var n,s,o,l;if(void 0===r&&(r=!1),!g)return{};var u,h=t?[...hl,...e||[]]:[],v=Gi(g),c=v[0],f=v[1],p=function(t){for(var e=0;Ki.length>e;e++){var i,r=Ki[e],n=r[1],s=r[2],o=t.match(r[0]);if(o)return[n,(null==(i=s&&t.match(s)||o)?void 0:i[1])||""]}return["",""]}(g),m=p[0],y=p[1],b=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},_={};Te(i)||(_.detectGoogleSearchApp=i);var w={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,S=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==a||null==(o=a.screen)?void 0:o.width,C=null==a||null==(l=a.screen)?void 0:l.height,T=null==a?void 0:a.devicePixelRatio;Te(k)||(w.userAgentDataPlatform=k),Te(S)||(w.maxTouchPoints=S),Te(x)||(w.screenWidth=x),Te(C)||(w.screenHeight=C),Te(T)||(w.devicePixelRatio=T);var M,I=$n(qn({$os:c,$os_version:f,$browser:zi(g,navigator.vendor,b,_),$webview_app:m,$webview_app_version:y,$device:Zi(g),$device_type:Ji(g,w),$timezone:kl(),$timezone_offset:Sl()}),{$current_url:Qn(r?ar(null==d?void 0:d.href):null==d?void 0:d.href,h,vl),$host:null==d?void 0:d.host,$pathname:null==d?void 0:d.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:Wi(g,navigator.vendor,b,_),$browser_language:ml(),$browser_language_prefix:(M=ml(),"string"==typeof M?M.split("-")[0]:void 0),$screen_height:null==a?void 0:a.screen.height,$screen_width:null==a?void 0:a.screen.width,$viewport_height:null==a?void 0:a.innerHeight,$viewport_width:null==a?void 0:a.innerWidth,$lib:En.LIB_NAME,$lib_version:En.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return En.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=En.SDK_DIST_CHANNEL),I}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime(),!0),p=f.windowId;l.$session_id=f.sessionId,l.$window_id=p}this.sessionPropsManager&&$n(l,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&$n(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(m=this.Iu)?void 0:m.length}catch(t){l.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===V_&&(l.$lib_custom_api_host=this.config.api_host),v="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),l=$n(l,v),"$pageview"===t&&h&&(l.title=h.title),!Te(o)){var y=i.getTime()-o;l.$duration=parseFloat((y/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties(),w=l.$groups,k=b.$groups;xe(w)&&!Ce(w)&&(l.$groups=n({},xe(k)?k:{},w)),On(["$referrer","$referring_domain"],t=>{t in b&&delete _[t]});var S={};if(this.yu.length>0)for(var x of this.yu.slice())try{$n(S,x())}catch(t){An.error("Failed to produce browser extension event properties",t)}(l=$n({},c,b,_,n({},S,l))).$is_identified=this._isIdentified(),ke(this.config.property_denylist)?On(this.config.property_denylist,function(t){delete l[t]}):An.error(hw+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(An.error(uw),l=C(l,t));var T=this.Ku();return l.$process_person_profile=T,T&&!s&&this.Xu("_calculate_event_properties"),l}Zu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Ku())return t;if(this.pu&&!i)return t;var n=$n({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(An.error(uw),n=s(n,"$set_once")),e&&(this.pu=!0),Ce(n)?void 0:n}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.Ju(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.gu.add(t)),this.Qu()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.gu.delete(t),this.Qu()}Yu(t,e){this.register({[t]:e})}Eu(){this.gu.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.gu.clear(),this.Qu()}Qu(){var t;if(this.mu)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!La.Et())La.Dt(this.mu);else{var e=[];this.gu.forEach(t=>e.push(t)),e.length>0?La.Ot(this.mu,e):La.Dt(this.mu)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.tu.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:lw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:lw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:lw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Pp),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:lw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:lw})}th(t){return!t||Ie(t)?(An.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(An.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(An.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return An.uninitializedWarning("posthog.identify");if(Ae(t)&&(t=t.toString(),An.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.th(t)&&this.Xu("posthog.identify")){this.hu();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Ju(!1),o=this.persistence.Sa(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property("__alias")&&(this.unregister(x),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===te,h=t!==l,d=!h&&u;if(h&&u){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:l};this.persistence.set_property(At,ee),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture(ae,c,{$set:e||{},$set_once:i||{}}),this.ku=il(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(At,ee);var f=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture("$set",{$set:f,$set_once:p}),this.ku=il(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);h||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Mt)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ma(a)}}}setPersonProperties(t,e){if((t||e)&&this.Xu("posthog.setPersonProperties")){var i=il(this.get_distinct_id(),t,e);this.ku!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.ku=i):An.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(ke(t)?t:[t]).filter(t=>Me(t)&&t.length>0);0!==i.length&&this.Xu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.ku=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Ju();var s=this.getGroups(),o=s[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:n({},s,{[t]:e})}),(o||i)&&this.Ku()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(le,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else An.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Xu("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=Fe(t)?t:null==t?void 0:t.resetDeviceID,i=Fe(t)||null==t?void 0:t.bootstrap;this.eh(e,!1,i)}eh(t,e,i){var r,s,o,a;if(void 0===e&&(e=!1),An.info("reset"),!this.__loaded)return An.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.xu)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Ua());var u=this.get_property(k),h=this.get_property(S),d=this.get_property(j);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var v=this.is_capturing();this.consent.reset(),e||!v||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 c=null==(a=this.persistence)||null==a.Sa?void 0:a.Sa(),f=!1;try{var p,g,m,y,b,_,w,x,C,T,M,I,E;if(null==(p=this.persistence)||p.clear(),null==(g=this.sessionPersistence)||g.clear(),this.gu.clear(),this.Qu(),Te(d)||null==(m=this.persistence)||m.register({[j]:d}),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(_=this.conversations)||_.reset(),null==(w=this.logs)||w.reset(),null==(x=this.metrics)||x.reset(),null==(C=this.persistence)||C.set_property(At,te),null==(T=this.sessionManager)||T.resetSessionId(),this.ku=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Nt,$device_id:null},"");else{var R=this.config.get_device_id(ga());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Te(h)||this.register({[S]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.ou()||(null==(E=this.persistence)||E.set_property(At,i.isIdentifiedID?ee:te),this.register({distinct_id:i.distinctID})),null==(M=this.featureFlags)||M.initialize(),!(Te(l)||null!=(I=this.sessionManager)&&I.setBootstrapSessionId(l,!0))){var A=n({},i);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var P;c&&(null==(P=this.persistence)||null==P.Ma||P.Ma(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return o(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.fu=!0,e.$u().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.Tu)||n.unload(),null==(s=e.Iu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){An.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else An.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.ih()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.rh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property("$people_distinct_id")?(An.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xu("posthog.alias")?(Te(e)&&(e=this.get_distinct_id()),t!==e?(this.Yu(x,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(An.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=n({},this.config);if(xe(t)){var i,r,s,o,a,l,u,h,d,v,c,f,p;$n(this.config,bw(t));var g=this.du();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new f_(n({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.Su(this.config.debug);Fe(m)&&(this.config.debug=m),Fe(this.config.debug)&&(this.config.debug?(Na.DEBUG=!0,Sa.Et()&&Sa.Ot("ph_debug",!0),An.info("set_config",{config:t,oldConfig:e,newConfig:n({},this.config)})):(Na.DEBUG=!1,Sa.Et()&&Sa.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ua()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(v=this.exceptionObserver)||v.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.vu(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Jb(this,ow,!1)}}_overrideSDKInfo(t,e){Na.LIB_NAME=t,Na.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(n({},i,e))}catch(t){return}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.nh}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:fw;return e!==fw&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}Ku(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Ce(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}zu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Ku()||this.Xu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Xu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Xu(t){return"never"===this.config.person_profiles?(An.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.au(),this.Yu(Lt,!0),!0)}du(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}vu(){var t,e,i,r,n,s=this.du();return this.is_capturing()||null==(t=this.logs)||t.sh(),(null==(e=this.persistence)?void 0:e.gi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(r=this.sessionPersistence)?void 0:r.gi)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.gu.clear(),this.Qu()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.ou()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.eh(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new z_(this),this.pageViewManager=new Yb(this),this.persistence&&(this.sessionPropsManager=new q_(this,this.sessionManager,this.persistence));var d,v=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(h=t.__defaultExtensionClasses)?void 0:h.sessionRecording;v&&(this.sessionRecording=this.su(this.sessionRecording,new v(this)),this.Yl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Yl)))}this.consent.optInOut(!0),this.vu(),this.ju(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Te(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Bu()}else An.warn(aw)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var t,e,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.eh(!0,!0),this.consent.optInOut(!1),this.vu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Nt,$device_id:null}),this.nu(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Bu(),this.ju())}else An.warn(aw)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vu()}_is_bot(){return u?U_(u,this.config.custom_blocked_useragents):void 0}Bu(){h&&("visible"===h.visibilityState?this.bu||(this.bu=!0,this.capture(se,{title:h.title},{send_instantly:!0}),this._u&&(h.removeEventListener(re,this._u),this._u=null)):this._u||(this._u=this.Bu.bind(this),zn(h,re,this._u)))}debug(t){!1===t?(null==a||a.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==a||a.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}))}Ua(){var t=this.xu||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(An.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):function(t,e,i,r,n){var s=e in t&&!Re(t[e]),o=i in t&&!Re(t[i]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,An)}Ts(t){var e;if(Re(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(De),r=ke(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Re(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return $e(t.event)?An.warn(o+". This can cause unexpected behavior."):An.info(o),null}n.properties&&!Ce(n.properties)||An.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return An.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Re(n.properties[a]))return An.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.Fo)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Su(t){var e=Fe(t)&&!t,i=Sa.Et()&&"true"===Sa.Lt("ph_debug");return!e&&(!!i||t)}},s.__defaultExtensionClasses={},s.nh=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),s);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Nn(t.prototype[e[i]])}(ww,["identify"]);var kw=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=xe(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.Ua(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}},Sw=Pn("[ExceptionAutocapture]"),xw=Pn("[TracingHeaders]"),Cw=Pn("[Web Vitals]"),Tw=9e5,Mw=["CLS","FCP","INP","LCP"],Iw=["INP","LCP"],Ew=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Rw=Pn("[SessionRecording]"),Aw=Pn("[Heatmaps]");function Pw(t){return xe(t)&&"clientX"in t&&"clientY"in t&&Ae(t.clientX)&&Ae(t.clientY)}var Fw=Pn("[Product Tours]"),Ow=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(L))},$w=Pn("[SiteApps]"),Dw="Error while initializing PostHog app with config id ",Lw=(t,e)=>null!=t&&t.then?t.then(e):e(t),Nw="SDK is not enabled or survey functionality is not yet loaded",qw="Disabled. Not loading surveys.",jw=class{constructor(t,e){this.uo=t,this.oh=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ah=!1,this.uh=[],this.hh=null,this.dh=null,this.fo=!1,this.fh=new Set,this.onRemoteConfig=t=>{if(!this.fo&&!this.xn.disableSurveys){if(!t.ok)return Sp.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Re(e))return Sp.warn("Flags not loaded yet. Not loading surveys.");this.ph=Fe(e)?e:e.length>0,Sp.info("flags response received, isSurveysEnabled: "+this.ph),this.loadIfEnabled()}}}setup(t){if(!this.fo)return this.gh=t,Lw(t.kv.initialize(),()=>{if(this.gh===t&&!this.fo){this.gh=void 0,this.ao=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.fo?e.dispose():(this.yo=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.fo||(this.fo=!0,this.gh=void 0,this.ao=void 0,null==(t=this.yo)||t.dispose(),this.yo=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.uh=[],this.hh=null,this.fh.forEach(t=>clearTimeout(t)),this.fh.clear())}get xn(){return this.uo.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith("seenSurvey_")||null!=r&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t))}catch(t){}}loadIfEnabled(){if(!this.fo&&this.ao){var t=this.xn;if(!this._surveyManager)if(this.ah)Sp.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Sp.info(qw);else if(t.cookielessMode&&this.uo.isOptedOut())Sp.info("Not loading surveys in cookieless mode without consent.");else{var e=this.uo.getExtensions();if(e){if(!Te(this.ph)||t.advancedEnableSurveys){var i=this.ph||t.advancedEnableSurveys;this.ah=!0;try{var r=e.generateSurveys;if(r)return this.mh(r,i),void(this.ah=!1);var n=e.loadExternalDependency;if(!n)return this.yh(Yt),void(this.ah=!1);n(t=>{try{if(this.fo)return;var e=this.uo.getExtensions();t||null==e||!e.generateSurveys?this.yh("Could not load surveys script",t):this.mh(e.generateSurveys,i)}finally{this.ah=!1}})}catch(t){throw this.ah=!1,this.yh("Error initializing surveys",t),t}}}else Sp.error("PostHog Extensions not found.")}}}mh(t,e){this.fo||(this._surveyManager=t(e),this._surveyEventReceiver=this.uo.createEventReceiver(),Sp.info("Surveys loaded successfully"),this.bh({isLoaded:!0}))}yh(t,e){Sp.error(t,e),this.bh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.uh.push(t),this._surveyManager&&this.bh({isLoaded:!0}),()=>{this.uh=this.uh.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.ao)&&void 0!==i?i:this.oh;if(r&&!this.fo){if(this.xn.disableSurveys)return Sp.info(qw),t([]);var n=r.kv.get(pt);if(n&&!e)return t(n,{isLoaded:!0}),void(this._h()&&this.getSurveys(()=>{},!0));if(this.hh)this.hh.then(e=>{this.fo||t(e.surveys,e.context)}).catch(t=>Sp.error("Error in survey callback",t));else{var s=this.wh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.xn.requestTimeoutMs}).then(t=>{try{return this.kh(r,t)}catch(t){return Sp.error("Error processing surveys response",t),this.kh(r,{statusCode:0,error:t})}},t=>this.kh(r,{statusCode:0,error:t}));this.hh=s;var o=()=>{this.hh===s&&(this.hh=null)};s.then(e=>{o(),this.fo||t(e.surveys,e.context)},o).catch(t=>Sp.error("Error in survey callback",t))}}}wh(t,e){var i=this.ao;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(Nw)}))}kh(t,e){var i;if(this.fo)return{surveys:[],context:{isLoaded:!1,error:Nw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?Sp.error(n):e.error||Sp.warn(n),this.dh=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.dh=null;var s=e.json.surveys||[],o=s.filter(t=>Tp(t)&&(Qa(t)||Mp(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[pt]:s,[gt]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}_h(){return this.Sh()&&!this.hh&&!this.xh()}Sh(){var t,e,i=null==(t=null!==(e=this.ao)&&void 0!==e?e:this.oh)?void 0:t.kv.get(gt);return Ae(i)&&Date.now()-i>3e5}xh(){return Ae(this.dh)&&3e5>Date.now()-this.dh}markSurveyAsSeen(t,e){var i;Rp({id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}bh(t){for(var e of this.uh)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Sp.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Re(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Sp.warn("init was not called")}Ch(t){var e=null;return this.getSurveys(i=>{var r;e=null!==(r=i.find(e=>e.id===t))&&void 0!==r?r:null}),e}Th(t){if(Re(this._surveyManager))return{eligible:!1,reason:Nw};var e="string"==typeof t?this.Ch(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Mh(t){if(!this.uo.isCapturing())return{eligible:!1,reason:xp};if(Re(this._surveyManager))return{eligible:!1,reason:Nw};var e="string"==typeof t?this.Ch(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Re(this._surveyManager))return Sp.warn("init was not called"),{visible:!1,disabledReason:Nw};var e=this.Mh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Re(this._surveyManager)?(Sp.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Nw})):new Promise(i=>{this.getSurveys(e=>{var r,n=null!==(r=e.find(e=>e.id===t))&&void 0!==r?r:null;if(n){var s=this.Mh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(this.uo.isCapturing())if(Re(this._surveyManager))Sp.warn("init was not called");else{var n="string"==typeof t?this.Ch(t):t;if(null!=n&&n.id)if(Ap.includes(n.type)){var s=null==h?void 0:h.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){Sp.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.fh.delete(o),!this.fo&&this.uo.isCapturing()&&(Sp.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),Sp.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.fh.add(o)}else this._surveyManager.renderSurvey(n,s,i);else Sp.warn("Survey element not found")}else Sp.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Sp.warn("Survey not found")}}displaySurvey(t,e){var i;if(this.uo.isCapturing())if(Re(this._surveyManager))Sp.warn("init was not called");else{var r=this.Ch(t);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=n({},r,{appearance:n({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==wp&&e.initialResponses&&Sp.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.Th(r);if(!o.eligible)return void Sp.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Sp.warn("Survey not found")}}cancelPendingSurvey(t){Re(this._surveyManager)?Sp.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function Bw(t,e,i){if(Re(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}var Hw=class{constructor(t){this._instance=t,this.Ih=new Set,this.Eh=new Set,this.Rh=new j_,this.Ah=(t,e)=>this.Ph(t,e)&&this.Fh(t,e)&&this.Oh(t,e)&&this.$h(t,e),this.Ph=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Te(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Dh=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.Dh)||t.call(this),this.Dh=void 0,this.Rh=new j_}register(t){var e,i;if(!Te(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.Ih.add(t),null==(e=t.steps)||e.forEach(t=>{this.Eh.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Ih.forEach(t=>{var e;null==(e=t.steps)||e.forEach(t=>{null!=t&&t.selector&&r.add(t.selector)})}),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Ih.clear(),this.Eh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Eh.has(t)||this.Eh.has(e.event))&&this.Ih.forEach(t=>{this.Lh(e,t)&&this.Rh.emit("actionCaptured",t.name)})}Nh(t){this.onAction("actionCaptured",e=>t(e))}Lh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Ah(t,i))return!0;return!1}onAction(t,e){return this.Rh.on(t,e)}Fh(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Bw(r,e.url,e.url_matching||"contains"))return!1}return!0}Oh(t,e){return!!this.qh(t,e)&&!!this.jh(t,e)&&!!this.Bh(t,e)}qh(t,e){var i;if(null==e||!e.href)return!0;var r=this.Hh(t);if(r.length>0)return r.some(t=>Bw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Bw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}jh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Hh(t);if(r.length>0)return r.some(t=>Bw(t.text,e.text,e.text_matching||"exact")||Bw(t.$el_text,e.text,e.text_matching||"exact"));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Re(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some(t=>Bw(t,s,o)))}Bh(t,e){var i,r;if(null==e||!e.selector)return!0;if(null!=t&&null!=(i=t.properties)&&null!=(i=i.$element_selectors)&&i.includes(e.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&n)try{return new RegExp(e.selector_regex).test(n)}catch(t){return!1}return!1}Hh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}$h(t,e){return null==e||!e.properties||0===e.properties.length||el(e.properties.reduce((t,e)=>{var i=ke(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t},{}),null==t?void 0:t.properties)}},zw=class{constructor(t){var e;this.zh=[],this._instance=t,this.Uh=new Map,this.Wh=new Map,this.Vh=new Map,this.Gh=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Zh(t))}Jh(t){return!1}Qh(){return null}Kh(t){}Xh(){}Yh(t,e){return!!t&&el(t.propertyFilters,null==e?void 0:e.properties)}td(t,e){var i=new Map;return t.forEach(t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach(e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}})}),i}ed(t,e,i){var r=(i===Gf?this.Uh:this.Wh).get(t),n=[];return this.rd(t=>{n=t.filter(t=>null==r?void 0:r.includes(t.id))}),n.filter(r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find(e=>e.name===t);return this.Yh(s,e)})}register(t){this.nd(t,!1)}replace(t){this.nd(t,!0)}nd(t,e){var i;Te(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.sd(t,e),this.od(t,e))}od(t,e){var i=t.filter(t=>{var e;return null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length});if(e&&this.Vh.clear(),0!==i.length){this.ad||(this.ad=new Hw(this._instance),this.ad.init(),this.ad.Nh(t=>this.onAction(t)));var r=[];i.forEach(t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach(e=>{if(r.push(e),e.name){var i,n=null!==(i=this.Vh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Vh.set(e.name,n)}})}),e?this.ad.replace(r):this.ad.register(r)}else{var n;e&&(null==(n=this.ad)||n.replace([]))}}ld(t,e){e.forEach((e,i)=>{var r,n=null!==(r=t.get(i))&&void 0!==r?r:[];e.forEach(t=>{n.includes(t)||n.push(t)}),t.set(i,n)})}sd(t,e){var i,r,n=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),o=this.td(t,Gf),a=this.td(t,Zf);e?(this.Uh=o,this.Wh=a):(this.ld(this.Uh,o),this.ld(this.Wh,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Dh)&&void 0!==i||(this.Dh=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.ud(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.hd(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.dd([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.vd(s),void this.fd([s])}if(this.Wh.has(t)){var a=this.ed(t,e,Zf);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.dd(a.map(t=>t.id)),a.forEach(t=>this.pd(t.id)))}if(this.Uh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Uh.get(t)});var l=this.ed(t,e,Gf);this.gd(l.map(t=>t.id))}}onAction(t){this.Vh.has(t)&&this.gd(this.Vh.get(t)||[])}gd(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this.Jh(n)?this.vd(n)&&this.md(n):r.push(n);r.length>0&&(this.zh=[...new Set([...this.zh,...r])]),this.ud().info("updating activated items",{activatedItems:this.getActivatedIds()})}}vd(t){this.zh=this.zh.filter(e=>e!==t);var e=this.yd();return!e.includes(t)&&(this.bd([...e,t]),this._d(),!0)}dd(t){var e=new Set(t);this.zh=this.zh.filter(t=>!e.has(t));var i=this.wd(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.bd(r),0===r.length&&this.kd()),this.fd(t)}Sd(){var t,e=this.Qh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}md(t){if(this.Qh()){var e=this.Sd();this.Kh(n({},e,{[t]:Date.now()}))}}fd(t){if(this.Qh()){var e=this.Sd(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(Ce(i)?this.Xh():this.Kh(i))}}xd(){this.Qh()&&this.Xh()}getActivationTimestamp(t){if(this.yd().includes(t)){var e=this.Sd()[t];return Ae(e)?e:void 0}}wd(){var t,e=this.Cd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}yd(){var t,e,i=this.wd();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Td()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}_d(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Md(e)}kd(){this.Id()}Zh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Td()];if(i&&i!==t){var r=this.wd(),n=this.Sd();r.length>0&&(this.bd([]),r.filter(t=>Ae(n[t])).forEach(t=>this.pd(t))),this.kd(),this.xd()}}getActivatedIds(){return[...new Set([...this.yd(),...this.zh])].filter(t=>!this.Ed(t))}dispose(){var t,e,i;null==(t=this.Gh)||t.call(this),this.Gh=void 0,null==(e=this.Dh)||e.call(this),this.Dh=void 0,null==(i=this.ad)||i.dispose(),this.ad=void 0}reset(){this.zh=[],this.wd().length>0&&this.bd([]),this.kd(),this.xd()}getEventToItemsMap(){return this.Uh}Rd(){return this.ad}},Uw=class extends zw{constructor(t){super(t)}Cd(){return mt}Td(){return yt}Qh(){return bt}Kh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Xh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Jh(t){var e,i;this.rd(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Ae(r)&&r>0}Ad(){return up}rd(t){var e;null==(e=this._instance)||e.getSurveys(t)}pd(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}ud(){return Sp}bd(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[mt]:t})}Md(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}Id(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(yt)}Ed(){return!1}hd(t,e){var i;return this.rd(t=>{i=t.find(t=>t.id===e)}),!i||Ka(i)?t===up?"consume":"ignore":t===up?"persist":t===hp||t===dp?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Ww=class{constructor(t){this._instance=t}initialize(){}get(t){if("string"==typeof t)return this._instance.get_property(t);var e={};for(var i of t){var r=this._instance.get_property(i);Te(r)||(e[i]=r)}return e}set(t,e){this._instance.register("string"==typeof t?{[t]:e}:t)}remove(t){"string"!=typeof t?t.forEach(t=>this._instance.unregister(t)):this._instance.unregister(t)}},Vw=class{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){var t=null==b?void 0:b.__PosthogExtensions__;if(t){var e=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:e?t=>e(this._instance,t):void 0,loadExternalDependency:i?t=>i(this._instance,"surveys",t):void 0}}}createEventReceiver(){return new Uw(this._instance)}},Gw=null!=a&&a.location?Kn(a.location.hash,"__posthog")||Kn(location.hash,"state"):null,Zw="_postHogToolbarParams",Jw=Pn("[Toolbar]"),Qw=Pn("[FeatureFlags]"),Kw=class{constructor(t,e){void 0===e&&(e=!1),this.Pd=!1,this.update(t,e)}update(t,e){this.Fd=((t,e)=>{var i,r,n,s,o;return{bootstrap:{featureFlags:null==(i=t.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=t.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:e,featureFlagsDisabled:!!t.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!t.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!t.advanced_feature_flags_dedup_per_session,cacheTtlMs:t.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(n=t.remote_config_refresh_interval_ms)&&void 0!==n?n:3e5,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(o=t.evaluation_contexts)&&void 0!==o?o:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:ke(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Pd||(Qw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Pd=!0),Te(t.flag_keys)||ke(t.flag_keys)||Qw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Fd}},Xw=Pn("[FeatureFlags]"),Yw=Pn("[FeatureFlags]",{debugEnabled:!0}),tk="\" failed. Feature flags didn't load in time.",ek="connection_error",ik=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},rk=t=>{var e={};for(var i of Dn(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},nk="Refusing to render web experiment since the viewer is a likely bot",sk={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Xa(e,t),not_regex:(t,e)=>!Xa(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},ok=Pn("[Conversations]"),ak="Conversations not available yet.";function lk(t,e){var i,r,s,o,a,l,h,d=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,v=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,c=null!=e&&e.consoleCapture?void 0:null!==(s=null==t?void 0:t.maxLogsPerInterval)&&void 0!==s?s:1e3,f=Te(c)?Math.max(v,2048):Math.max(v,c),p=n({},function(){var t="",e="";try{var i=null==u?void 0:u.userAgent;if(i){var r=Gi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(pn,t)?pn[t]:t}(t);return n({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(o=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==o?o:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(h=null==p?void 0:p["deployment.environment"])&&void 0!==h?h:null==t?void 0:t.environment,resourceAttributes:p,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:v,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var uk=["debug","log","warn","error","info"],hk="console",dk="__posthogHandledLogsRequestError",vk=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[dk]=!0,i},ck=t=>!!t&&"object"==typeof t&&!0===t[dk],fk={featureFlags:class{constructor(t){this.name="featureFlags",this.Od=!1,this.featureFlagEventHandlers=[],this.A=Xw,this.$d={},this.Dd={},this.Ld=[],this.Nd=!1,this.qd=!1,this.jd=0,this.Bd=!1,this.Hd=!1,this.zd=!1,this.Ud=!1,this.Wd=0,this.nr=()=>{var t=this.Vd();this.Wd=0,t&&this.reloadFeatureFlags()},this.Gd=()=>{var t,e=this.Zd;Te(e)||this.xn.remoteRequestsDisabled||!h||"hidden"===h.visibilityState||Date.now()-(null!==(t=this.Jd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Qd())},this.ar=()=>{"visible"===(null==h?void 0:h.visibilityState)&&this.Gd()},"get"in t?this.uo=t:(this._instance=t,this.Kd=new Kw(t.config,t.Ua()),this.uo=this.Kd)}updateConfig(t,e){var i;null==(i=this.Kd)||i.update(t,e),this.ao&&this.Xd()}setup(t){return this.gh=t,this.A=t.logger.createLogger("[FeatureFlags]"),Lw(t.kv.initialize(),()=>{this.gh===t&&(this.gh=void 0,this.ao=t,this.Yd(t))})}Yd(t){var e;if(this.ao===t)return a&&zn(a,"online",this.nr),this.Xd(),this.tv=t.registerDynamicEventProperties(()=>this.ev()?this.$d:this.Dd),this.iv=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.rv(),this.nv(),this.sv()}),this.nv(),this.initialize()}Xd(){var t=this.xn.refreshIntervalMs,e=!this.xn.remoteRequestsDisabled&&h&&!Te(t)&&t>0?t:void 0;e!==this.Zd&&(this.ov(),Te(e)||(this.Zd=e,this.Qd(),null!=h&&h.addEventListener&&zn(h,re,this.ar)))}Qd(){Te(this.Zd)||(Te(this.av)||clearInterval(this.av),this.Jd=Date.now(),this.av=setInterval(this.Gd,this.Zd))}ov(){Te(this.av)||(clearInterval(this.av),this.av=void 0,null==h||null==h.removeEventListener||h.removeEventListener(re,this.ar)),this.Zd=void 0,this.Jd=void 0}destroy(){this.lv()}dispose(){this.lv()}lv(){var t,e;this.ov(),this.jd++,this.Hd=!1,this.gh=void 0,this.ao&&(this.uv(),null==(t=this.tv)||t.dispose(),this.tv=void 0,null==(e=this.iv)||e.call(this),this.iv=void 0,this.Ld=[],null==a||a.removeEventListener("online",this.nr),this.ao=void 0)}get xn(){return this.uo.get()}hv(t){var e;return this.dv&&t in this.dv?this.dv[t]:null==(e=this.ao)?void 0:e.kv.get(t)}rv(){return!!this.dv&&(this.dv=void 0,!0)}vv(){var t;return!Te(null==(t=this.ao)?void 0:t.kv.get("$enabled_feature_flags"))&&this.rv()}Ot(t){this.fv(()=>{var e;return null==(e=this.ao)?void 0:e.kv.set(t)})}pv(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.hv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(t=>{var e=t[1];return!(null!=e&&e.failed)}).map(t=>t[0]):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?a:i&&!ke(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.hv("$feature_flag_payloads")||{},d=t.$feature_flag_payloads||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p=!!c||v,g={[nt]:f,[rt]:f,[at]:p};for(var m of(t.$feature_flag_details&&(g[ot]=f),[lt,Rt,ut]))Te(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}Dt(t){this.fv(()=>{var e;return null==(e=this.ao)?void 0:e.kv.remove(t)})}fv(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}nv(){var t={};for(var e of[nt,at,lt,ht]){var i=this.hv(e);Te(i)||(t[e]=i)}this.$d=t;var r=n({},t),s=this.hv(rt);if(s)for(var o of Object.entries(s))r["$feature/"+o[0]]=o[1];this.Dd=r}ev(){var t=this.xn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.hv(Rt);return"number"!=typeof e||Date.now()-e>t}gv(){return!!this.ev()&&(this.Ud||this.qd||(this.Ud=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}mv(){var t=this.xn.evaluationContexts;return null!=t&&t.length?t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),e}):[]}yv(){var t=this.xn.flagKeys;if(!Te(t))return t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),e})}initialize(){var t,e,i=this.xn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter(t=>!Te(r[t])).reduce((t,e)=>(t[e]=r[e],t),{}),l=Object.keys(o).filter(t=>a[t]).reduce((t,e)=>(t[e]=o[e],t),{});return this.bv({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,s,o=null!=i&&i.merge&&null!==(r=this.hv("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.hv("$feature_flag_payloads"))&&void 0!==s?s:{},l=n({},o,t),u=n({},a,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:Jr(c),variant:Qr(c),reason:void 0,metadata:Te(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.bv({flags:h})}get hasLoadedFlags(){return this.Nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.hv(ot),e=this.hv(ht),i=this.hv(dt);if(!i&&!e)return t||{};var r=$n({},t||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[s],u=null==e?void 0:e[s],h=Te(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Te(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=n({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v&&(c.metadata=n({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=c}return this.Od||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Od=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Jr(r),variant:Qr(r),payload:Zr(e[i])}})}getFlagVariants(){var t=this.hv(rt),e=this.hv(ht);if(!e)return t||{};for(var i=$n({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Od||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Od=!0),i}getFlagPayloads(){var t=this.hv(at),e=this.hv(dt);if(!e)return t||{};for(var i=$n({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Od||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Od=!0),i}reloadFeatureFlags(){this.Bd||this.xn.featureFlagsDisabled||this.Vd()||(this.qd&&(this.Hd=!0),this._v||(this.Ld.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this._v=setTimeout(()=>{this.wv()},5)))}uv(){clearTimeout(this._v),this._v=void 0}onReloading(t){return this.Ld.push(t),()=>{this.Ld=this.Ld.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Nd||this.qd||this._v||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Bd=t}resetFlagCallReported(){this.Dt(Mt)}wv(t){this.uv();var e=this.ao;if(e&&!this.xn.remoteRequestsDisabled&&!this.Vd())if(this.qd)this.Hd=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:n({},e.initialPersonProperties,this.hv("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.hv(ct),timezone:kl()};Te(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.xn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.mv();r.length&&(i.evaluation_contexts=r);var s=this.yv();Te(s)||(i.flag_keys=s);var o=this.xn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.jd;this.qd=!0;var u=()=>{this.Hd&&(this.Hd=!1,this.wv())},h=t=>{this.qd=!1,l===this.jd?(this.Ot({[Et]:[ek]}),this.A.error("Feature flag request failed",t),this.vv()&&this.sv(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.xn.compression,sentAt:"body",timeoutMs:this.xn.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this.qd=!1,l===this.jd){if(this.Sv(t.statusCode),s||this.Hd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Hd){this.zd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?ek:"unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&a.push("quota_limited"),this.Ot({[Et]:a}),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.bv(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}Vd(){return Xn(this.Wd,3)}Sv(t){this.Wd=Yn(t,this.Wd,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(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.zd)if(this.Nd||this.getFlags()&&this.getFlags().length>0){if(!this.gv()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else this.A.warn('getFeatureFlag for key "'+t+tk)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e;return null==(e=this.getFeatureFlagResult(t,{send_event:!1}))?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.zd)if(this.Nd||this.getFlags()&&this.getFlags().length>0){if(!this.gv()){var i,r=this.getFlagVariants(),s=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.hv("$feature_flag_request_id")||void 0,h=this.hv("$feature_flag_evaluated_at")||void 0,d=this.hv("$flag_call_reported")||{};if(this.xn.deduplicateCallsPerSession){var v,c=null==(v=this.ao)?void 0:v.session.sessionId,f=this.hv(It);c&&c!==f&&(d={},i=c)}if(e.send_event||!("send_event"in e))if(t in d&&d[t].includes(l))i&&this.Ot({[Mt]:d,[It]:i});else{var p,g,m,y,b,_,w,k,S,x,C,T,M;ke(d[t])?d[t].push(l):d[t]=[l],this.Ot(n({[Mt]:d},i?{[It]:i}:{}));var I=this.getFeatureFlagDetails(t),E=[...null!==(p=this.hv("$feature_flag_errors"))&&void 0!==p?p:[]];Te(o)&&E.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:o,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.xn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.xn.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.zd};Te(null==I||null==(_=I.metadata)?void 0:_.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Te(null==I||null==(w=I.metadata)?void 0:w.version)||(R.$feature_flag_version=I.metadata.version);var A=null!==(k=null==I||null==(S=I.reason)?void 0:S.description)&&void 0!==k?k:null==I||null==(x=I.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=I&&null!=(C=I.metadata)&&C.id&&(R.$feature_flag_id=I.metadata.id),Te(null==I?void 0:I.original_variant)&&Te(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Te(I.original_variant)?I.original_enabled:I.original_variant),null!=I&&null!=(T=I.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==I||null==(M=I.metadata)?void 0:M.original_payload),E.length&&(R.$feature_flag_error=E.join(",")),this.xv(R)}else i&&this.Ot({[Mt]:d,[It]:i});if(s)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Zr(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+tk)}xv(t){try{var e;null==(e=this.ao)||e.capture("$feature_flag_called",t).catch(t=>{this.A.error("Failed to capture feature flag call",t)})}catch(t){this.A.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.Cv(t,e)}Cv(t,e){var i=this;return o(function*(){var r=i.ao;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.mv();s.length&&(n.evaluation_contexts=s);var o,a=i.yv();Te(a)||(n.flag_keys=a);try{var l;o=(null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.xn.compression,sentAt:"body",timeoutMs:i.xn.requestTimeoutMs})).json)||null==(l=l.featureFlagPayloads)?void 0:l[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}})()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.zd)return e.defaultValue;if(!(this.Nd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+tk),e.defaultValue;var i=this.getFeatureFlag(t,e);return Te(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,i){this.bv(t,e,i)}bv(t,e,i){if(this.ao){this.Nd=!0;var r=function(t,e,i,r,s,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=Xw);var a=((t,e)=>{var i=t.flags;return i?n({},t,{featureFlags:Object.fromEntries(Object.keys(i).map(t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter(t=>i[t].enabled).filter(t=>{var e;return!Te(null==(e=i[t].metadata)?void 0:e.payload)}).map(t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]}))}):(t.featureFlags&&e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t)})(t,o),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(ke(u)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;return{[nt]:u,[rt]:c,[ut]:!1}}var p=u,g=h,m=l;if(null!=s&&s.partialResponse){var y=Object.keys(p),b=g||{};p=n({},e,p),g=n({},i,b),y.forEach(t=>{var e;t in b||null==(e=g)||delete e[t]}),m=n({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var _=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=n({},e,Object.fromEntries(Object.entries(p).filter(t=>_.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>_.has(t[0])));g=n({},i,w),_.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=n({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>_.has(t[0]))))}else p=n({},e,p),g=n({},i,g),m=n({},r,m);return n({[nt]:Object.keys(rk(p)),[rt]:p||{},[at]:g||{},[ot]:m||{},[ut]:!0===t.minimalFlagCalledEvents},d?{[lt]:d}:{},v?{[Rt]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var s=!Te(this.ao.kv.get(rt));this.dv=r,s||this.Ot(r)}else this.rv(),this.pv(r,t,!(null==i||!i.partialResponse)),this.Ot(r);else e&&this.vv();e||(this.Ud=!1),this.sv(e)}}override(t,e){void 0===e&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Tv(t)}Tv(t){if(this.ao){if(!1===t)return this.Dt([ht,dt]),this.sv(),void Yw.info("All overrides cleared");if(ke(t))return this.Ot({[ht]:ik(t)}),this.sv(),void Yw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Od=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ht]=ke(n)?ik(n):n),s&&(r[dt]=s),Object.keys(r).length&&this.Ot(r),!1===n&&!1===s?this.Dt([ht,dt]):!1===n?this.Dt(ht):!1===s&&this.Dt(dt),this.sv(),!1===n?Yw.info("Flag overrides cleared"):n&&Yw.info("Flag overrides set",{flags:n}),void(!1===s?Yw.info("Payload overrides cleared"):s&&Yw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ot({[ht]:t}),this.sv(),void Yw.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Nd){var e=this.Mv(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.A.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r,s=(this.hv("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i);var l=n({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[nt]:[t],[rt]:[t],[vt]:Object.keys(o)}),this.Ot({[nt]:Object.keys(rk(l)),[rt]:l,[vt]:n({},this.hv("$stored_person_properties")||{},o)}),this.sv();try{var u;null==(u=this.ao)||u.capture("$feature_enrollment_update",a).catch(t=>{this.A.error("Failed to capture early access feature enrollment",t)})}catch(t){this.A.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.hv(st);!r||e?this.Iv(t,i):t(r)}Iv(t,e){var i=this;return o(function*(){var r=i.ao;if(r){var n,s=e?"&"+e.map(t=>"stage="+t).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n=o.json.earlyAccessFeatures,i.Ot({[st]:n})}catch(t){return void i.A.error("Early access feature request failed",t)}try{t(n)}catch(t){i.A.error("Early access feature callback failed",t)}}})()}Mv(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(t=>e[t]),flagVariants:Object.keys(e).filter(t=>e[t]).reduce((t,i)=>(t[i]=e[i],t),{})}}sv(t){this.nv();var e=this.Mv(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.A.error("Error while running feature flags callback",t)}})}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Ev(t,e)}Ev(t,e){void 0===e&&(e=!0);var i=this.hv("$stored_person_properties")||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this.Ot({[vt]:n({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=n({},this.hv("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.Ot({[vt]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.Dt(vt),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.hv("$stored_group_properties")||{},r=n({},i);for(var s of Object.keys(t))r[s]=n({},i[s],t[s]);this.Ot({[ct]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.hv("$stored_group_properties")||{};this.Ot({[ct]:n({},e,{[t]:{}})})}else this.Dt(ct)}reset(){this.jd++,this.Hd=!1,this.$d={},this.Dd={},this.dv=void 0,this.Nd=!1,this.Bd=!1,this.zd=!1,this.$anon_distinct_id=void 0,this.uv(),this.Od=!1,this.Wd=0}}},pk={sessionRecording:class{get xn(){return this._instance.config}get gl(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Rv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.Av||"missing_config"===this.Av?this.Av:null!==(t=null==(e=this.Rv)?void 0:e.status)&&void 0!==t?t:this.Av}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Av=Ys,this.Pv=void 0,this.Fv=!1,this.Ke=(()=>{var t;if(null==h||!h.visibilityState||"visible"===h.visibilityState)return!0;var e=null==a||null==(t=a.performance)||null==t.getEntriesByType?void 0:t.getEntriesByType("visibility-state");return!(null!=e&&e.length)||e.some(t=>"visible"===t.name)})(),this.ar=()=>{var t;"visible"===(null==h?void 0:h.visibilityState)&&(this.Ke=!0,null==(t=this.Rv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Rw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.xn.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=h&&h.addEventListener&&zn(h,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.Fv=!0,null==h||null==h.removeEventListener||h.removeEventListener("visibilitychange",this.ar),i?this.Ov(!0):this.stopRecording()}get $v(){var t,e=!(null==(t=this._instance.get_property(j))||!t.enabled),i=!this.xn.disable_session_recording,r=this.xn.disable_session_recording||this._instance.consent.isOptedOut();return a&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.Fv||this.$v&&null!=(e=this.Rv)&&e.isStarted)){var i=!Te(Object.assign)&&!Te(Array.from);this.$v&&i?(this.Dv(t),Rw.info("starting")):(this.Av=Ys,this.stopRecording())}}Dv(t){var e,i;if(this.$v)if("awaiting_config"!==this.Av&&"missing_config"!==this.Av&&(this.Av=no),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.Lv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Nv,e=>{if(!this.Fv&&this.$v&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),Rw.error("could not load recorder",e)):void this.Lv(t);this.Av=Ys})}}stopRecording(){var t,e;null==(t=this.Pv)||t.call(this),this.Pv=void 0,null==(e=this.Rv)||e.stop()}Ov(t){var e,i;void 0===t&&(t=!1),null==(e=this.Pv)||e.call(this),this.Pv=void 0,null==(i=this.Rv)||i.discard({discardProducerEvents:t})}qv(){var t,e;null==(t=this.gl)||t.unregister(Z),null==(e=this.gl)||e.unregister(H)}jv(t,e){if(Re(t))return null;var i,r=Ae(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Rw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Bv(t){if(this.gl){var e,i,r=this.gl,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.jv(null==(e=this.xn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.jv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Re(a)&&this.qv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[j]:n({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:n({capturePerformance:t.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:Te(l)?null:l,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})})};s(),null==(e=this.Pv)||e.call(this),this.Pv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.Bv(e),void this.Ov()):(this.Bv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.Av&&(this.Av="missing_config",Rw.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.Rv)&&i.log?this.Rv.log(t,e):Rw.warn("log called before recorder was ready")}get Nv(){var t;return(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.get_property("$session_recording_remote_config"))||null==(t=t.scriptConfig)?void 0:t.script)||"lazy-recorder"}Hv(){var t,e=this._instance.get_property(j);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Rw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Re(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Lv(t){var e,i,r;if(!this.Fv&&this.$v&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return Rw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ht]:!0});var n;if(this.Rv||(this.Rv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Ke),this.Rv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Hv()){if("missing_config"===this.Av||"awaiting_config"===this.Av)return;return this.Av="awaiting_config",Rw.info("persisted remote config is stale, requesting fresh config before starting"),void new y_(this._instance).load()}this.Av=no,null==(i=(r=this.Rv).setDocumentWasEverVisible)||i.call(r,this.Ke),this.Rv.start(t)}else this.Av=Ys}onRRwebEmit(t){var e;null==(e=this.Rv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Rv||null==(t=this.gl)||t.register({[U]:!0}),null==(e=this.Rv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.Rv||null==(t=this.gl)||t.register({[z]:!0}),null==(e=this.Rv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.Rv||null==(e=this.gl)||e.register({["url"===t?W:V]:!0}),null==(i=this.Rv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Rv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Rv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.Rv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},gk={autocapture:class extends Ib{constructor(t){super(new kw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.zv=this.Uv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Wv();return!!(t.path||t.search||this.Vv(t))}startIfEnabled(){this.isEnabled&&(An.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.zv=this.Uv(),this.startIfEnabled()}stop(){this.Gv&&this.Gv(),this.Gv=void 0,this.Zv&&this.Zv(),this.Zv=void 0,An.info("History API monitoring stopped")}monitorHistoryChanges(){a&&a.history&&(this.Jv("pushState"),this.Jv("replaceState"),this.Qv(),this.Vv()&&this.Kv())}Jv(t){var e;if(a&&(null==(e=a.history[t])||!e.__posthog_wrapped__)){var i=this;ic(a.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Xv(t)})}}Uv(){var t=null==a?void 0:a.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Wv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:xe(t)?t:{}}Vv(t){return void 0===t&&(t=this.Wv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Yv(t){var e=this.Wv(),i=this.zv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Vv(e)&&t.hash!==i.hash))}Xv(t){try{var e=this.Uv();if(!e)return;this.Yv(e)&&this._instance.capture(se,{navigation_type:t}),this.zv=e}catch(e){An.error("Error capturing "+t+" pageview",e)}}Qv(){if(!this.Gv){var t=()=>{this.Xv("popstate")};zn(a,"popstate",t),this.Gv=()=>{a&&a.removeEventListener("popstate",t)}}}Kv(){if(!this.Zv){var t=()=>{this.Xv("hashchange")};zn(a,"hashchange",t),this.Zv=()=>{a&&a.removeEventListener("hashchange",t)}}}},heatmaps:class{get xn(){return this.instance.config}constructor(t){var e;this.tc=!1,this.ho=!1,this.ec=null,this.instance=t,this.tc=!(null==(e=this.instance.persistence)||!e.props[R]),this.rageclicks=new kb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return xe(this.xn.capture_heatmaps)&&this.xn.capture_heatmaps.flush_interval_milliseconds&&(t=this.xn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Re(this.xn.capture_heatmaps)?Re(this.xn.enable_heatmaps)?this.tc:this.xn.enable_heatmaps:!1!==this.xn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ho)return;Aw.info("starting..."),this.rc(),this.ar()}else{var t;clearInterval(null!==(t=this.ec)&&void 0!==t?t:void 0),this.nc(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[R]:i}),this.tc=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Rt;return this.Rt=void 0,t}sc(t){Pw(t.originalEvent)&&this.Sn(t.originalEvent,"deadclick")}ar(){this.ec&&clearInterval(this.ec),this.ec=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(h)?setInterval(this.ol.bind(this),this.flushIntervalMilliseconds):null}rc(){a&&h&&(this.oc=this.ol.bind(this),zn(a,ne,this.oc),this.ac=t=>this.Sn(t||(null==a?void 0:a.event)),zn(h,"click",this.ac,{capture:!0}),this.lc=t=>this.uc(t||(null==a?void 0:a.event)),zn(h,"mousemove",this.lc,{capture:!0}),this.hc=new Gb(this.instance,Wb,this.sc.bind(this)),this.hc.startIfEnabledOrStop(),this.dc=this.ar.bind(this),zn(h,re,this.dc),this.ho=!0)}nc(){var t;a&&h&&(this.oc&&a.removeEventListener(ne,this.oc),this.ac&&h.removeEventListener("click",this.ac,{capture:!0}),this.lc&&h.removeEventListener("mousemove",this.lc,{capture:!0}),this.dc&&h.removeEventListener(re,this.dc),clearTimeout(this.vc),null==(t=this.hc)||t.stop(),this.ho=!1)}cc(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&rs(r)&&!ns(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,l;n=null==(s=null!==(o=null==(l=r.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:a)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(pe(e,n))return!0;r=gs(r)}return!1}(vs(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}Sn(t,e){var i;if(void 0===e&&(e="click"),!is(t.target)&&Pw(t)){var r=this.cc(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Cs(vs(t),this.instance.config.rageclick)&&this.Hs(n({},r,{type:"rageclick"})),this.Hs(r)}}uc(t){!is(t.target)&&Pw(t)&&(clearTimeout(this.vc),this.vc=setTimeout(()=>{this.Hs(this.cc(t,"mousemove"))},500))}Hs(t){if(a){var e=this.xn.disable_capture_url_hashes?ar(a.location.href):a.location.href,i=this.xn.custom_personal_data_properties,r=Qn(e,this.xn.mask_personal_data_properties?[...hl,...i||[]]:[],vl);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}}ol(){this.Rt&&!Ce(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Gb,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.tc=!1,this.ho=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.fc=()=>{clearTimeout(this.gc),this.gc=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",n({$current_url:this.Rt.url},this.Rt.metrics.reduce((t,e)=>n({},t,{["$web_vitals_"+e.name+"_event"]:n({},e),["$web_vitals_"+e.name+"_value"]:e.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.mc=t=>{var e;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Re(null==t?void 0:t.name)||Re(null==t?void 0:t.value))Cw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.yc(i);if(!Te(r)){var s=Ae(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.bc||this.bc>t.value){this.Rt.navigationKey!==s&&(this.fc(),this.gc=setTimeout(this.fc,this.flushToCaptureTimeoutMs)),Te(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=Te(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=n({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,xe(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of Ew){var h="url"===u&&"string"==typeof t.attribution[u]?this.yc(t.attribution[u]):t.attribution[u];Te(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Te(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.fc()}else Cw.error("Ignoring metric with value >= "+this.bc,t)}}},this._c=()=>{if(!this.ho){var t,e,i,r,s=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.wc])||("web-vitals"===this.wc&&Te(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Te(l)){var u=l.withoutAttribution,h=this.attributionMetrics;s=!Te(u),t=h.indexOf("LCP")>-1?l.onLCP:(null==u?void 0:u.onLCP)||l.onLCP,e=h.indexOf("CLS")>-1?l.onCLS:(null==u?void 0:u.onCLS)||l.onCLS,i=h.indexOf("FCP")>-1?l.onFCP:(null==u?void 0:u.onFCP)||l.onFCP,r=h.indexOf("INP")>-1?l.onINP:(null==u?void 0:u.onINP)||l.onINP}if(t&&e&&i&&r){var d={reportSoftNavs:this.useSoftNavs},v=s&&this.attributionMetrics.indexOf("INP")>-1?n({},d,{includeProcessedEventEntries:!1}):d;this.allowedMetrics.indexOf("LCP")>-1&&t(this.mc.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.mc.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.mc.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.mc.bind(this),v),this.ho=!0}else Cw.error("web vitals callbacks not loaded - not starting")}},this.tc=!(null==(e=this._instance.persistence)||!e.props[O]),this.startIfEnabled()}get kc(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=xe(this.kc)?null==(t=this.kc)?void 0:t.web_vitals_allowed_metrics:void 0;return Re(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||Mw:i}get flushToCaptureTimeoutMs(){return(xe(this.kc)?this.kc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=xe(this.kc)?this.kc.web_vitals_attribution:void 0;return Fe(t)?t?Mw:[]:ke(t)?t:Iw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=xe(this.kc)?this.kc.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get bc(){var t=xe(this.kc)&&Ae(this.kc.__web_vitals_max_value)?this.kc.__web_vitals_max_value:Tw;return t>0&&6e4>=t?Tw:t}get isEnabled(){var t=null==d?void 0:d.protocol;if("http:"!==t&&"https:"!==t)return Cw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=xe(this.kc)?this.kc.web_vitals:Fe(this.kc)?this.kc:void 0;return Fe(e)?e:this.tc}startIfEnabled(){this.isEnabled&&!this.ho&&(Cw.info("enabled, starting..."),this.Ro(this._c))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=xe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=xe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[O]:i}),this._instance.persistence.register({[q]:r})),this.tc=i,this.startIfEnabled()}}}get wc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ro(t){var e=b.__PosthogExtensions__,i=this.wc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Te(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?Cw.error("failed to load script",e):t()})}yc(t){var e=t||(null==a?void 0:a.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?ar(e):e,r=this._instance.config.custom_personal_data_properties;return Qn(i,this._instance.config.mask_personal_data_properties?[...hl,...r||[]]:[],vl)}Cw.error("Could not determine current URL")}}},mk={exceptionObserver:class{constructor(t){var e;this._c=()=>{var t;if(a&&this.isEnabled&&null!=(t=b.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=b.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=b.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=b.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Sc&&this.xn.capture_unhandled_errors&&(this.Sc=e(this.captureException.bind(this))),!this.xc&&this.xn.capture_unhandled_rejections&&(this.xc=i(this.captureException.bind(this))),!this.Cc&&this.xn.capture_console_errors&&(this.Cc=r(this.captureException.bind(this)))}catch(t){Sw.error("failed to start",t),this.Tc()}}},this._instance=t,this.Mc=!(null==(e=this._instance.persistence)||!e.props[A]),this.wt=new Ze(n({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,A:Sw})),this.xn=this.Ic(),this.startIfEnabledOrStop()}Ic(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xe(t)?e=n({},e,t):(Te(t)?this.Mc:t)&&(e=n({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.xn.capture_console_errors||this.xn.capture_unhandled_errors||this.xn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Sw.info("enabled"),this.Tc(),this.Ro(this._c)):this.Tc()}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",e=>{if(e)return Sw.error("failed to load script",e);t()})}Tc(){var t,e,i;null==(t=this.Sc)||t.call(this),this.Sc=void 0,null==(e=this.xc)||e.call(this),this.xc=void 0,null==(i=this.Cc)||i.call(this),this.Cc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Mc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A]:this.Mc}),this.xn=this.Ic(),this.startIfEnabledOrStop())}}onConfigChange(){this.xn=this.Ic()}captureException(t){try{var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";if(this.wt.consumeRateLimit(n))return void Sw.info("Skipping exception capture because of client rate limiting.",{exception:n});null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}catch(t){}}},exceptions:class{constructor(t){var e,i;this.Ec=[],this.Rc=bm(),this._instance=t,this.Ec=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this.Ac=Wr(this.Pc()),this.Fc=new Vr(this.Ac)}onConfigChange(){this.Ac=Wr(this.Pc()),this.Fc.setConfig(this.Ac)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Ec=s,this._instance.persistence&&this._instance.persistence.register({[P]:this.Ec,[F]:o})}}}get Oc(){var t,e,i=!!this._instance.get_property(F);return null!==(t=null!==(e=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==e?e:i)&&void 0!==t&&t}buildProperties(t,e){return this.Rc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ac.enabled)try{if(!Me(t)||0===t.trim().length)return void fm.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce((i,r)=>zr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.$c(e)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&fm.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Fc.add(n({[Br]:t,[Hr]:(new Date).toISOString()},r))}catch(t){fm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Dc(e)){if(this.Lc(e))return this.Nc("Exception dropped: matched a suppression rule"),void fm.info("Skipping exception capture because a suppression rule matched");if(!this.Oc&&this.qc(e))return this.Nc("Exception dropped: thrown by a browser extension"),void fm.info("Skipping exception capture because it was thrown by an extension");if(!this.Oc&&this.jc(e))return this.Nc("Exception dropped: thrown by an injected browser script"),void fm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Bc(e))return this.Nc("Exception dropped: thrown by the PostHog SDK"),void fm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Ac.enabled&&Re(t.$exception_steps)?this.Hc(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Gu:!0});return n&&this.Fc.clear(),n}catch(t){return cm(t)||fm.error("Failed to capture exception event. Dropping this exception.",t),void this.Fc.clear()}}catch(t){return void(cm(t)||fm.error("Failed to process exception event. Ignoring this exception.",t))}var s}Hc(t){try{var e=this.Fc.getAttachable();return 0===e.length?t:n({},t,{$exception_steps:e})}catch(e){return fm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Nc(t){this.Ac.enabled&&this.Fc.add({[Br]:t,[Hr]:(new Date).toISOString()})}$c(t){return xe(t)?n({},t):{}}Pc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Lc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Me(i)&&i.length>0&&t.$exception_types.push(i),Me(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.Ec.some(t=>{var i=t.values.map(t=>{var i=tl[t.operator],r=e[t.key];if(!i||!r)return!1;var n=ke(t.value)?t.value:[t.value];return n.length>0&&i(n,r)});return"OR"===t.type?i.some(Boolean):i.every(Boolean)})}catch(t){return fm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}qc(t){var e=t.flatMap(t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}),i=e.filter(t=>{var e=t.filename;return!!e&&mm.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(pm)})||t.some(t=>{var e=t.value;return"NoResponse"===t.type||Me(e)&&gm.some(t=>{var i=t.value;return t.exact?e===i:e.includes(i)})})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(pm))}))}jc(t){return t.some(t=>{var e=t.value;return Me(e)&&ym.some(t=>e.includes(t))})}Bc(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[];return null!==(r=null==(n=s[s.length-1])||null==(n=n.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Dc(t){return!Re(t)&&ke(t)}}},yk=n({productTours:class{get gl(){return this._instance.persistence}constructor(t){this.zc=null,this.Uc=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.gl&&this.gl.register({[L]:!!e.productTours}),!Ow(this._instance))return!this.zc&&Re(null==(i=this.gl)?void 0:i.props.ph_product_tours)||Fw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.zc)||r.stop(),this.zc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.zc&&Ow(this._instance)&&this.Ro(()=>this.Wc())}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",e=>{e?Fw.error("Could not load product tours script",e):t()})}Wc(){var t;!this.zc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.zc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!ke(this.Uc)||e){var i=this.gl;if(i){var r=i.props[_t];if(ke(r)&&!e)return this.Uc=r,void t(r,{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:e=>{if(Ow(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||Fw.warn(n):Fw.error(n),void t([],{isLoaded:!1,error:n})}var s=ke(e.json.product_tours)?e.json.product_tours:[];this.Uc=s,i&&i.register({[_t]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Uc,{isLoaded:!0})}getActiveProductTours(t){Re(this.zc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.zc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.zc)||e.showTourById(t)}previewTour(t){this.zc?this.zc.previewTour(t):this.Ro(()=>{var e;this.Wc(),null==(e=this.zc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.zc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.zc)||t.nextStep()}previousStep(){var t;null==(t=this.zc)||t.previousStep()}clearCache(){var t;this.Uc=null,null==(t=this.gl)||t.unregister(_t)}resetTour(t){var e;null==(e=this.zc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.zc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.zc)||e.cancelPendingTour(t)}}},fk),bk={siteApps:class{constructor(t){this._instance=t,this.Vc=0,this.Gc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zc(t,e){if(e){var i=this.globalsForEvent(e);this.Gc.push(i),this.Gc.length>1e3&&(this.Gc=this.Gc.slice(10))}}get siteAppLoaders(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Zc.bind(this));this.Jc=()=>{t(),this.Gc=[],this.Jc=void 0}}}globalsForEvent(t){var e,s,o,a,l,u,h;if(!t)throw new Error("Event payload is required");var d={},v=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(c)){var p=f[0];d[p]={id:v[p],type:p,properties:f[1]}}var g=t.$set_once,m=t.$set;return{event:n({},r(t,i),{properties:n({},t.properties,m?{$set:n({},null!==(e=null==(s=t.properties)?void 0:s.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:n({},null!==(o=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==o?o:{},g)}:{}),elements_chain:null!==(l=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==l?l:"",distinct_id:null==(h=t.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}Qc(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||($w.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||($w.error("prepare_external_dependency_script returned null"),null):t}Kc(){var t,e,i,r,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==h?void 0:h.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Vc++,this.Xc)return this.Yc();var d=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),d.push(()=>{t[e]=r})}},p=t=>{if(c.has(t))return t;var e=v.Qc(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Ee(t));return f(u,"appendChild",t=>function(e){var i=p(e);return i?t.call(this,i):e}),f(u,"insertBefore",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e}),f(u,"replaceChild",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i}),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(t=>{f(t,"append",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}),f(t,"prepend",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})}),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(t=>{f(t,"before",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}),f(t,"after",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}),f(t,"replaceWith",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=g(i);return i.length&&!n.length?void 0:t.apply(this,n)})}),f(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null}),this.Xc=()=>{d.forEach(t=>t()),this.Xc=void 0},this.Yc()}Yc(){var t=!1;return()=>{var e;t||(t=!0,this.Vc--,0===this.Vc&&(null==(e=this.Xc)||e.call(this)))}}tf(t,e){void 0===e&&(e=!0);var i=this.Kc();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.Gc.length&&($w.info("Processing "+this.Gc.length+" events for site app with id "+t.id),this.Gc.forEach(t=>this.tf(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Jc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,$w.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.tf(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){$w.error(Dw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){$w.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}ef(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}if(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.tf(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){$w.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.ef(),void this._instance.on("eventCaptured",t=>this.if(t))):void $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Jc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;b["__$$ph_site_app_"+e]=n._instance,null==(t=b.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,t=>{if(t)return $w.error(Dw+e,t)})};for(var a of s.siteApps)o()}else $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},_k={tracingHeaders:class{constructor(t){this._instance=t,this.rf=void 0,this.nf=void 0,this.sf=void 0,this._c=()=>{var t,e,i=this.af();i?(Te(this.rf)&&(this.rf=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Te(this.nf)&&(this.nf=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Tc()}}initialize(){this.startIfEnabledOrStop()}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",e=>{if(e)return xw.error("failed to load script",e);t()})}lf(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}af(){var t=this.lf();return ke(t)?(ke(this.sf)?this.sf.splice(0,this.sf.length,...t):this.sf=[...t],t.length>0?this.sf:void 0):(ke(this.sf)&&this.sf.splice(0),this.sf=t||void 0,this.sf)}Tc(){var t,e;null==(t=this.rf)||t.call(this),null==(e=this.nf)||e.call(this),this.rf=void 0,this.nf=void 0}startIfEnabledOrStop(){this.af()?this.Ro(this._c):this.Tc()}}},wk=n({surveys:class extends jw{constructor(t){var e;super(new Vw(t),(e=t,{get projectToken(){return e.config.token},kv:new Ww(e)})),this._instance=t}wh(t,e){var i=e.query?S_(t,e.query):t;return new Promise(t=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",i),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:t})})}}},fk),kk={toolbar:class{constructor(t){this.instance=t}uf(t){b.ph_toolbar_state=t}hf(){var t;return null!==(t=b.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Un(this.instance.config))return!1;if(!a||!h)return!1;t=null!=t?t:a.location,i=null!=i?i:a.history;try{if(!e){try{a.localStorage.setItem("test","test"),a.localStorage.removeItem("test")}catch(t){return!1}e=null==a?void 0:a.localStorage}var r,n=Gw||Kn(t.hash,"__posthog")||Kn(t.hash,"state"),s=n?Ln(()=>JSON.parse(atob(decodeURIComponent(n))))||Ln(()=>JSON.parse(decodeURIComponent(n))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Zw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}df(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Re(e)&&Se(e)?e(t,this.instance):Jw.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==h||!h.getElementById("__POSTHOG_TOOLBAR__"));if(!a||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=n({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(a.localStorage.setItem(Zw,JSON.stringify(n({},r,{source:void 0}))),2===this.hf())this.df(r);else if(0===this.hf()){var s;this.uf(1),null==(s=b.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Jw.error("[Toolbar] Failed to load",t),void this.uf(0);this.uf(2),this.df(r)}),zn(a,"turbolinks:load",()=>{this.uf(0),this.loadToolbar(r)})}return!0}vf(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},Sk=n({experiments:class t{get xn(){return this._instance.config}constructor(e){var i=this;this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),i.getWebExperiments(e=>{t.cf("retrieved web experiments from the server"),i.ff=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.ff&&(t.cf("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.ff)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Me(n)&&e.variants[n]&&i.pf(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.gf(o,i._instance)&&i.pf(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.cf(nk);else if(!this.xn.disable_web_experiments){if(Re(this.ff))return this.ff=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.cf("applying feature flags",e),e.forEach(t=>{var e;if(this.ff&&null!=(e=this.ff)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ff)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.pf(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Jn(null==e?void 0:e.search,"__experiment_id"),r=Jn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.cf("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.mf(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this.xn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.xn.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.xn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}mf(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.cf("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.pf(n[0].name,i,n[0].variants[i].transforms))}static gf(e,i){return!Re(e.conditions)&&t.yf(e,i)&&t.bf(e)}static yf(e,i){var r;if(Re(e.conditions)||Re(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=ts(i,n.href);return null==(s=e.conditions)||!s.url||sk[null!==(o=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return null==a?void 0:a.location}static bf(t){var e;if(Re(t.conditions)||Re(null==(e=t.conditions)?void 0:e.utm))return!0;var i=fl();if(i.utm_source){var r,n,s,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static cf(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];An.info("[WebExperiments] "+t,i)}pf(e,i,r){this._is_bot()?t.cf(nk):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.cf("applying transform of variant "+i+" for experiment "+e+" ",r),null==(n=document)||null==(n=n.querySelectorAll(r.selector))||n.forEach(t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}):t.cf("Control variants leave the page unmodified.")}_is_bot(){return u&&this._instance?U_(u,this.xn.custom_blocked_useragents):void 0}}},fk),xk=n({},fk,pk,gk,mk,yk,bk,wk,_k,kk,Sk,{conversations:class{constructor(t){this._instance=t,this._f=void 0,this._conversationsManager=null,this.wf=!1,this.re=null,this.kf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Sf=t.ok,t.ok)){var e=t.config.conversations;Re(e)||(Fe(e)?this._f=e:(this._f=e.enabled,this.re=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this._f=void 0,this.re=null,this.Sf=void 0,this.kf=!1}loadIfEnabled(){if(!(this._conversationsManager||this.wf||this._instance.config.disable_conversations||Un(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Te(this._f)&&this._f)if(this.re&&this.re.token){this.wf=!0;try{var e=t.initConversations;if(e)return this.xf(e),void(this.wf=!1);var i=t.loadExternalDependency;if(!i)return void this.Cf(Yt);i(this._instance,"conversations",e=>{e||!t.initConversations?this.Cf("Could not load conversations script",e):this.xf(t.initConversations),this.wf=!1})}catch(t){this.Cf("Error initializing conversations",t),this.wf=!1}}else ok.error("Conversations enabled but missing token in remote config.")}}xf(t){if(this.re)try{this._conversationsManager=t(this.re,this._instance),this.kf=!1,ok.info("Conversations loaded successfully")}catch(t){this.Cf("Error completing conversations initialization",t)}else ok.error("Cannot complete initialization: remote config is null")}Cf(t,e){ok.error(t,e),this._conversationsManager=null,this.wf=!1,this.kf=!0}show(){this._conversationsManager?this._conversationsManager.show():ok.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._f&&!Ee(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Un(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Sf?"remote_config_failed":Te(this._f)?this.Sf?"disabled_in_project":"remote_config_pending":this._f?Re(this.re)||!this.re.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.wf?"initializing":this.kf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,e,i){var r=this;return o(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(ok.warn(ak),null)})()}getMessages(t,e){var i=this;return o(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(ok.warn(ak),null)})()}markAsRead(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ok.warn(ak),null)})()}getTickets(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ok.warn(ak),null)})()}requestRestoreLink(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ok.warn(ak),null)})()}restoreFromToken(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ok.warn(ak),null)})()}restoreFromUrlToken(){var t=this;return o(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ok.warn(ak),null)})()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}ih(){var t;null==(t=this._conversationsManager)||t.setIdentity()}rh(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=Fp,this.Tf=!1,this.Mf=!1,this.If=!1,this.A=Pn("[logs]"),this.Ef=n({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(ck)||i.A.error(...e)}}),this.Za=[],this.Rf=[],this.Wd=0,this.fo=!1,this.Af=[],this.Pf=[],this.Ff=!1,this.Of=!1,this.$f=()=>{var t,e;this.fo||(this.Wd=0,null==(t=this.Df)||t.onReconnect(),null==(e=this.Lf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Tf=!0),a&&zn(a,"online",this.$f)}Nf(t,e,i,r){var n,s=lk(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new kn(this.qf(t,e),s,this.Ef,()=>this.jf(),t=>t(),void 0,r),s]}Bf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Df||this.Hf!==e){var i;null==(i=this.Df)||i.reset(),this.Hf=e;var r=this.Nf(()=>this.Za,t=>{this.Za=t});this.Df=r[0],this.zf=r[1]}return this.Df}Uf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Lf||this.Wf!==e){var i;null==(i=this.Lf)||i.reset(),this.Wf=e;var r=this.Nf(()=>this.Rf,t=>{this.Rf=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},hk);this.Lf=r[0],this.Vf=r[1]}return this.Lf}setup(t){var e;if(!this.fo){this.ao=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.Tf=!0),(this.Tf||this.Gf()&&this.Zf())&&this.Jf();var i=!1,r=t.onRemoteConfig(t=>{var e;i=t.ok&&!0===(null==(e=t.config.logs)?void 0:e.captureConsoleLogs),this.onRemoteConfig(t)});this.fo?r.dispose():(this.yo=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.fo||(this.fo=!0,this.Qf(),null==(t=this.yo)||t.dispose(),this.yo=void 0,this.ao=void 0,this.If=!1,null==a||a.removeEventListener("online",this.$f),null==(e=this.Kf)||e.call(this),this.Kf=void 0,null==(i=this.Df)||i.reset(),null==(r=this.Lf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.fo){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Re(r)?this.Xf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[N]:!!r}),r?(this.Tf=!0,this.Mf||this.Jf(),this.loadIfEnabled()):this.Xf())}}reset(){var t,e,i,r;this.Qf(),null==(t=this.Df)||t.clearQueue(),this.Za=[],null==(e=this.Df)||e.reset(),null==(i=this.Lf)||i.clearQueue(),this.Rf=[],null==(r=this.Lf)||r.reset(),this.Wd=0}captureLog(t){this.fo||this.Bf().captureLog(t)}captureConsoleLog(t){this.fo||this.Uf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.fo||this.Uf().captureLog(t,{context:e,occurredAtMs:i})}Zf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[N])}Gf(){var t,e;return null==(t=this._instance)||null==t.Ua||!t.Ua()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}sh(){var t;this.Qf(),null==(t=this.Lf)||t.clearQueue(),this.Rf=[]}Xf(){this.Tf||this.Qf()}Jf(){var t,e=this;if(!this.Ff&&null!=b&&b.console){var i=lk(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=em(b.console[t])}catch(t){return 0}if(!r)return 0;e.Pf.push(ic(b.console,t,n=>{var s=function(){for(var r=arguments.length,s=new Array(r),o=0;r>o;o++)s[o]=arguments[o];try{e.Yf(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of uk)r(n);this.Ff=!0,this.tp=setTimeout(()=>{this.Qf()},3e4)}}Yf(t,e,i){var r;if(this.Ff&&!this.Of&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Af.length){this.Of=!0;try{this.Af.push({level:t,args:e,occurredAtMs:Date.now(),context:this.jf()})}finally{this.Of=!1}}}else this.Qf()}Qf(){if(this.Af=[],this.Ff){for(var t of(this.Ff=!1,this.tp&&(clearTimeout(this.tp),this.tp=void 0),this.Pf))t();this.Pf=[]}}ep(){var t=this.Af;return this.Qf(),t}get logger(){return this.rp||(this.rp={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.rp}flushLogs(t){t?this.np(t):(this.Df&&this.Df.flush().catch(t=>this.sp(t)),this.Lf&&this.Lf.flush().catch(t=>this.sp(t)))}sp(t){ck(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.fo&&this.Tf&&!this.Mf&&!this.If){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Qf();var e=t.loadExternalDependency;if(!e)return this.A.error(Yt),void this.Qf();this.If=!0;try{e(this._instance,"logs",e=>{if(this.If=!1,!this.fo&&this.Tf){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.Qf();else{var r,n,s=this.ep();this.Kf=i.initializeLogs(null!==(r=this.ao)&&void 0!==r?r:this._instance),this.Mf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.ao)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.If=!1,t}}}qf(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===ue.LogsQueue?t():void 0,setPersistedProperty(t,i){t===ue.LogsQueue&&e(null!=i?i:[])},As:t=>this.As(t),getLibraryId:()=>Na.LIB_NAME,getLibraryVersion:()=>Na.LIB_VERSION}}As(t){return new Promise(e=>{if(Xn(this.Wd,3))e({kind:"fatal",error:vk(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:vk(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.op(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.ap(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:vk(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}})}ap(t){(0!==t||this._instance.__loaded)&&(this.Wd=Yn(t,this.Wd,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.")))}np(t){this.Za.length>0&&this.lp(t,this.Za,this.zf,Na.LIB_NAME,t=>{this.Za=t}),this.Rf.length>0&&this.lp(t,this.Rf,this.Vf,hk,t=>{this.Rf=t})}lp(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=wn(s,_n(i,Na.LIB_NAME,Na.LIB_VERSION),r,Na.LIB_VERSION);this._instance._send_request({method:"POST",url:this.op(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}op(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}jf(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,Re(n)||(e.sessionStartTimestamp=n),Re(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ar(b.location.href):b.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},{metrics:class{constructor(t){this._instance=t,this.A=Pn("[metrics]")}initialize(){}Bf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Df&&this.Hf===i||(null==(e=this.Df)||e.reset(),this.Hf=i,this.Df=new Tn(this.qf(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.A)),this.Df}count(t,e,i){void 0===e&&(e=1),this.Bf().count(t,e,i)}gauge(t,e,i){this.Bf().gauge(t,e,i)}histogram(t,e,i){this.Bf().histogram(t,e,i)}flush(t){if(!this.Df)return Promise.resolve();if(t){var e=this.Df.drainWindow();return e&&this.Gs(e,t),Promise.resolve()}return this.Df.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.Df)||t.reset()}qf(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Gs:t=>e.Gs(t),getLibraryId:()=>Na.LIB_NAME,getLibraryVersion:()=>Na.LIB_VERSION}}Gs(t,e){return new Promise(i=>{var r=!1,s=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(n({method:"POST",url:this.up(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;s(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:new Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!==(e=t.error)&&void 0!==e?e:new Error("metrics request failed with status "+i)})}}))})}up(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});ww.__defaultExtensionClasses=n({},xk),function(){Na.SDK_DIST_CHANNEL="cdn";var t=b.posthog;if(!t||ke(t._i)){var e=nw[fw]=new ww;if(t){var i=[];On(t._i,function(r){if(r&&ke(r)){var n=e.init(r[0],r[1],r[2]),s=t[r[2]]||t;n.__loaded&&-1===i.indexOf(s)&&(i.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}})}e.__SV=1,b.posthog=e,function(){function t(){t.done||(t.done=!0,pw=!1,On(nw,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():zn(h,"DOMContentLoaded",t,{capture:!1}):a&&An.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}()}();
|
|
1
|
+
!function(){var t=["type"],e=["retriesPerformedSoFar"],i=["$set_once","$set"];function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},n.apply(null,arguments)}function s(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function o(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var o=t.apply(e,i);function a(t){s(o,r,n,a,l,"next",t)}function l(t){s(o,r,n,a,l,"throw",t)}a(void 0)})}}!function(s){var a="u">typeof window?window:void 0,l="u">typeof globalThis?globalThis:a,u=null==l?void 0:l.navigator,h=null==l?void 0:l.document,d=null==l?void 0:l.location,v=null==l?void 0:l.fetch,c=null!=l&&l.XMLHttpRequest&&"withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:void 0,f=null==l?void 0:l.AbortController,p=null==l?void 0:l.CompressionStream,g=null==u?void 0:u.userAgent;function m(){return!(!a||!1===a.navigator.onLine)}var y="undefined"!=typeof globalThis?globalThis:a;y&&"undefined"==typeof self&&(y.self=y),y&&"undefined"==typeof File&&(y.File=function(){});var b=null!=a?a:{},_="$people_distinct_id",w="distinct_id",k="$device_id",S="$device_model",x="__alias",C="__cmpns",T="$fbc",M="$fbc_persistence",I="__timers",E="$autocapture_disabled_server_side",R="$heatmaps_enabled_server_side",A="$exception_capture_enabled_server_side",P="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",O="$web_vitals_enabled_server_side",D="$dead_clicks_enabled_server_side",L="$product_tours_enabled_server_side",N="$logs_capture_enabled_server_side",q="$web_vitals_allowed_metrics",j="$session_recording_remote_config",B="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",U="$replay_override_linked_flag",W="$replay_override_url_trigger",V="$replay_override_event_trigger",G="$sesid",Z="$session_is_sampled",J="$session_past_minimum_duration",Q="$session_recording_url_trigger_activated_session",K="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",Y="$posthog_sr_group_url_trigger_",tt="$posthog_sr_group_sampling_",et="$debug_first_full_snapshot_timestamp",it="$sess_rec_flush_size",rt="$enabled_feature_flags",nt="$active_feature_flags",st="$early_access_features",ot="$feature_flag_details",at="$feature_flag_payloads",lt="$feature_flag_request_id",ut="$minimal_flag_called_events",ht="$override_feature_flags",dt="$override_feature_flag_payloads",vt="$stored_person_properties",ct="$stored_group_properties",ft="$groups",pt="$surveys",gt="$surveys_loaded_at",mt="$surveys_activated",yt="$surveys_activated_session",bt="$surveys_activated_timestamps",_t="ph_product_tours",wt="$product_tours_activated",kt="$product_tours_activated_session",St="$conversations_widget_session_id",xt="$conversations_ticket_id",Ct="$conversations_widget_state",Tt="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Et="$feature_flag_errors",Rt="$feature_flag_evaluated_at",At="$user_state",Pt="$client_session_props",Ft="$capture_rate_limit",Ot="$initial_campaign_params",$t="$initial_referrer_info",Dt="$initial_person_info",Lt="$epp",Nt="$posthog_cookieless",qt="$cookieless_mode",jt="$sdk_debug_extensions_init_method",Bt="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Ut="$sdk_debug_replay_linked_flag_trigger_status",Wt="$sdk_debug_replay_matched_recording_trigger_groups",Vt="$sdk_debug_replay_pending_trigger_conditions",Gt="$sdk_debug_replay_remote_trigger_matching_config",Zt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Qt="$sdk_debug_rrweb_attached",Kt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",Yt="PostHog loadExternalDependency extension not found.",te="anonymous",ee="identified",ie="identified_only",re="visibilitychange",ne="beforeunload",se="$pageview",oe="$pageleave",ae="$identify",le="$groupidentify",ue=function(t){return 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}({}),he=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),de="min_length",ve="max_length",ce=["$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"],fe=["token"];function pe(t,e){return-1!==t.indexOf(e)}var ge=function(t){return t.trim()},me=function(t){return t.replace(/^\$/,"")};function ye(t){var e,i=[];return null!==(e=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}}))&&void 0!==e?e:"null"}var be=Object.prototype,_e=be.hasOwnProperty,we=be.toString,ke=Array.isArray||function(t){return"[object Array]"===we.call(t)},Se=t=>"function"==typeof t,xe=t=>t===Object(t)&&!ke(t),Ce=t=>{if(xe(t)){for(var e in t)if(_e.call(t,e))return!1;return!0}return!1},Te=t=>void 0===t,Me=t=>"[object String]"==we.call(t),Ie=t=>Me(t)&&0===t.trim().length,Ee=t=>null===t,Re=t=>Te(t)||Ee(t),Ae=t=>"[object Number]"==we.call(t)&&t==t,Pe=t=>Ae(t)&&t>0,Fe=t=>"[object Boolean]"===we.call(t),Oe=t=>t instanceof FormData,$e=t=>pe(ce,t),De=t=>pe(fe,t);function Le(t){return null===t||"object"!=typeof t}function Ne(t,e){return{}.toString.call(t)==="[object "+e+"]"}function qe(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Be(t,Error)}}function je(t){return"u">typeof Event&&Be(t,Event)}function Be(t,e){try{return t instanceof e}catch(t){return!1}}var He=[!0,"true",1,"1","yes"],ze=t=>pe(He,t),Ue=[!1,"false",0,"0","no"],We=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","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"],Ve=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return We.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function Ge(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Ae(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Ge(null!=n?n:i,e,i,r))}var Ze=class{constructor(t){this.C={},this.I=t.I,this.R=Ge(t.bucketSize,0,100,t.A),this.O=Ge(t.refillRate,0,this.R,t.A),this.N=Ge(t.refillInterval,0,864e5,t.A)}F(t,e){var i=Math.floor((e-t.lastAccess)/this.N);i>0&&(t.tokens=Math.min(t.tokens+i*this.O,this.R),t.lastAccess=t.lastAccess+i*this.N)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.C[r];return n?this.F(n,i):this.C[r]=n={tokens:this.R,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},Je="Mobile",Qe="Android",Ke="Tablet",Xe="Android Tablet",Ye="iPad",ti="Apple Watch",ei="Safari",ii="BlackBerry",ri="Samsung Internet",ni="Chrome",si="Chrome iOS",oi="Internet Explorer",ai="Internet Explorer Mobile",li="Opera",ui="Microsoft Edge",hi="Firefox",di="Firefox iOS",vi="Nintendo",ci="PlayStation",fi="Xbox",pi="Android Mobile",gi="Mobile Safari",mi="Windows",yi="Windows Phone",bi="Nokia",_i="Ouya",wi="Generic "+Je.toLowerCase(),ki="Generic "+Ke.toLowerCase(),Si="Konqueror",xi="Oculus Browser",Ci="Vivaldi",Ti="Yandex",Mi="Whale",Ii="DuckDuckGo",Ei="Pale Moon",Ri="Waterfox",Ai="Brave",Pi="Claude",Fi="Codex",Oi="ChatGPT",$i="Google Search App",Di=new RegExp("Version/(\\d+(\\.\\d+)?)"),Li=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Ni=new RegExp(fi,"i"),qi=new RegExp("PlayStation \\w+","i"),ji=new RegExp("Nintendo \\w+","i"),Bi=new RegExp("BlackBerry|PlayBook|BB10","i"),Hi={"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"},zi=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Ai:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&pe(t,"GSA/")?$i:pe(t," OPR/")&&pe(t,"Mini")?"Opera Mini":pe(t," OPR/")?li:Bi.test(t)?ii:pe(t,"IEMobile")||pe(t,"WPDesktop")?ai:pe(t,"OculusBrowser")?xi:pe(t,"SamsungBrowser")?ri:pe(t,"Edge")||pe(t,"Edg/")?ui:pe(t,"Vivaldi/")?Ci:pe(t,"YaBrowser/")?Ti:pe(t,"Whale/")?Mi:pe(t,"DuckDuckGo/")||pe(t,"Ddg/")?Ii:pe(t,"Claude/")?Pi:pe(t,"Codex/")?Fi:pe(t,"ChatGPT/")?Oi:pe(t,"FBIOS")?"Facebook Mobile":pe(t,"UCWEB")||pe(t,"UCBrowser")?"UC Browser":pe(t,"CriOS")?si:pe(t,"CrMo")||pe(t,ni)?ni:pe(t,Qe)&&pe(t,ei)?pi:pe(t,"FxiOS")?di:pe(t.toLowerCase(),Si.toLowerCase())?Si:pe(t,"Brave/")?Ai:((t,e)=>e&&pe(e,"Apple")||function(t){return pe(t,ei)&&!pe(t,ni)&&!pe(t,Qe)}(t))(t,e)?pe(t,Je)?gi:ei:pe(t,"PaleMoon/")?Ei:pe(t,"Waterfox/")?Ri:pe(t,hi)?hi:pe(t,"MSIE")||pe(t,"Trident/")?oi:pe(t,"Gecko")?hi:"")},Ui={[ai]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[ui]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ni]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ei]:[Di],[gi]:[Di],[li]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Si]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ii]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Di],[pi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Pi]:[Li],[Fi]:[Li],[Oi]:[Li],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[$i]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Wi=function(t,e,i,r){var n=Ui[zi(t,e,i,r)];if(Te(n))return null;for(var s=0;n.length>s;s++){var o=t.match(n[s]);if(o)return parseFloat(o[o.length-2])}return null},Vi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[fi,t&&t[1]||""]],[new RegExp(vi,"i"),[vi,""]],[new RegExp(ci,"i"),[ci,""]],[Bi,[ii,""]],[new RegExp(mi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[yi,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Hi[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mi,r]}return[mi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Te(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Qe,[t[2],t[3],t[4]||"0"].join(".")]:[Qe,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Gi=function(t){for(var e=0;Vi.length>e;e++){var i=Vi[e],r=i[1],n=i[0].exec(t),s=n&&(Se(r)?r(n,t):r);if(s)return s}return["",""]},Zi=function(t){return ji.test(t)?vi:qi.test(t)?ci:Ni.test(t)?fi:new RegExp(_i,"i").test(t)?_i:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?yi:/iPad/.test(t)?Ye:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ti:Bi.test(t)?ii:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(bi,"i").test(t)?bi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Je).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Qe:Xe:new RegExp("(pda|Mobile)","i").test(t)?wi:new RegExp(Ke,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?ki:""},Ji=function(t,e){var i,r,n,s,o=Zi(t);return o===Ye||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===ki?Ke:o===vi||o===fi||o===ci||o===_i?"Console":o===ti?"Wearable":o?Je:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Je:Ke:"Desktop"},Qi=/\bFBAV\/(\d+(?:\.\d+)*)/i,Ki=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Qi],[/\bFBAN\/EMA\b/i,"Facebook Lite",Qi],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Qi],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Xi="[Truncated]",Yi="[Unserializable]";function tr(t){for(var e="",i=0;t.length>i;i++){var r=t.charCodeAt(i);if(55296>r||r>56319)e+=56320>r||r>57343?t[i]:"�";else{var n=t.charCodeAt(i+1);56320>n||n>57343?e+="�":(e+=t[i]+t[i+1],i++)}}return e}Date,Date;var er,ir,rr,nr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sr(t,e){return"string"==typeof(i=t)&&nr.test(i)?t:e();var i}function or(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function ar(t){return t?t.split("#")[0]:t}function lr(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function ur(t,e,i){return hr.apply(this,arguments)}function hr(){return(hr=o(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=lr(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function dr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return rr&&i.length===ir?rr:(ir=i.length,rr=i.reduce((i,r)=>{er||(er={});var n=er[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a,l=null==(a=s[o])?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,er[r]=[l,u];break}}return i},{}))}}var vr=class{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var e=this;return o(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&ke(i.stacktrace.frames)&&(i.stacktrace.frames=yield e.applyModifiers(i.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,r;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),n({},t,{cause:i,stack:r})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return o(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(r=e.handled)||void 0===r||r,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,n({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:dr(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return n({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function cr(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?"?":i,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Te(r)||(s.lineno=r),Te(n)||(s.colno=n),s}var fr=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:"?",i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},pr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mr=/\((\S*)(?::(\d+))(?::(\d+))\)/,yr=(t,e)=>{var i=pr.exec(t);if(i)return cr(e,i[1],"?",+i[2],+i[3]);var r=gr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=mr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=fr(r[1]||"?",r[2]);return cr(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},br=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_r=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=_r.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||"?",o=fr(s,n);return cr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},kr=/\(error: (.*)\)/;function Sr(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function xr(t){for(var e=1;10>=e;e++){var i=t.length-2*e;if(0>i)break;for(var r=!0,n=0;e>n;n++)if(!Sr(t[i+n],t[i+e+n])){r=!1;break}if(r){for(var s=0;e>s;s++)t[i+s]=t[i+e+s];return t.length=i+e,{start:i,length:e}}}}function Cr(t,e){var i=e.start+e.length,r=Mr(t,e);r&&t.splice(i+r===t.length?i:e.start,r)}function Tr(t,e){for(var i=e.start;i>0&&Sr(t[i-1],t[i-1+e.length]);)i--;return e.start-i}function Mr(t,e){for(var i=e.start+e.length,r=i;t.length>r&&Sr(t[r],t[r-e.length]);)r++;return r-i}function Ir(t,e){var i=e[0],r=t.length-(i?Tr(t,i):0);for(var n of e)r-=Mr(t,n);return r}function Er(t,e,i){for(var r=0;t.length>r;r++){var n=t[(e+r)%t.length],s=t[(i+r)%t.length];if(n!==s)return s>n}return!1}var Rr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Me(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return Ne(t,"DOMException")}isDOMError(t){return Ne(t,"DOMError")}},Ar=class{match(t){return qe(t)}coerce(t,e){var i,r=this.getStack(t),n=void 0===r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=r?r:null==(i=e.syntheticException)?void 0:i.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}},Pr=class{match(t){return!!Ne(t,"ErrorEvent")&&(null!=t.error||this.un(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return n({},r,{stack:null!==(i=this.ln(t))&&void 0!==i?i:r.stack,synthetic:!0})}un(t){return Me(t.message)&&t.message.length>0}ln(t){var e,i,r=t,n=null!==(e=r.lineno)&&void 0!==e?e:0,s=null!==(i=r.colno)&&void 0!==i?i:0;if(Me(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Fr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Or=class{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Fr);return r&&(e=r[1],i=r[2]),[e,i]}},$r=["fatal","error","warning","log","info","debug"];function Dr(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}var Lr=class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(je(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Me(e)&&!Ie(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Dr(t)}isSeverityLevel(t){return Me(t)&&!Ie(t)&&$r.indexOf(t)>=0}getStack(t){try{return Me(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Me(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(qe(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Nr=class{match(t){return je(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Dr(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},qr=class{match(t){return Le(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},jr=class{match(t){return Ne(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!je(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return Le(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},Br="$message",Hr="$timestamp",zr=new Set([Br,Hr]),Ur={enabled:!0,max_bytes:32768};function Wr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Ur.enabled,max_bytes:Gr(t.max_bytes,Ur.max_bytes)}:n({},Ur)}var Vr=class{constructor(t){this.ts=[],this.es=0,this.xn=Wr(t)}setConfig(t){this.xn=Wr(t),this.rs()}add(t){var e=function(t){var e;try{e=ye(t)}catch(t){return}try{var i=JSON.parse(e);if(!xe(i))return;var r=i,n=r[Br],s=r[Hr];if(!Me(n)||0===n.trim().length)return;if(!Me(s)&&!Ae(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.xn.max_bytes||(this.ts.push({step:e.step,bytes:i}),this.es+=i,this.rs())}}getAttachable(){return this.ts.map(t=>t.step)}clear(){this.ts=[],this.es=0}size(){return this.ts.length}rs(){for(;this.es>this.xn.max_bytes&&this.ts.length>0;){var t=this.ts.shift();t&&(this.es-=t.bytes)}}};function Gr(t,e){if(!Ae(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Zr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Jr(t){return"string"==typeof t||t}function Qr(t){return"string"==typeof t?t:void 0}var Kr,Xr=["$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"],Yr="NativeGzipValidationError",tn=t=>t.length>=2&&31===t[0]&&139===t[1],en=(t,e)=>t===he.GZipJS||e===he.GZipJS||"gzip"===e,rn=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),nn=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return rn(t)||e===Yr},sn=t=>{throw or(Yr,"Native gzip produced invalid output: "+t)},on=function(){var t=o(function*(t,e){18>t.size&&sn("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());tn(i)&&8===i[2]||sn("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Kr)return Kr;Kr=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Kr[t]=e>>>0}return Kr})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&sn("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&sn("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function an(t,e,i){return ln.apply(this,arguments)}function ln(){return ln=o(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),a=s.write(r).then(()=>s.close()).catch(function(){var t=o(function*(t){try{yield s.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),l=new Response(n.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield on(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),ln.apply(this,arguments)}var un={}.propertyIsEnumerable;function hn(t,e){try{return cn(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function dn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,Fe(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt("9223372036854775808");return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);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(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==e||e.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:tr(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Xi};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?tr(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return dn(a.call(t),e,i,r+1)}catch(t){}return ke(t)?{arrayValue:{values:vn(t,e,i,r+1)}}:{kvlistValue:{values:cn(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:tr(String(t))}}function vn(t,e,i,r){for(var n=[],s=Math.min(t.length,1e3),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(Re(a))continue;n.push(dn(a,e,i,r))}catch(t){n.push({stringValue:Yi})}return t.length>o&&n.push({stringValue:Xi}),n}function cn(t,e,i,r){var n=[];for(var s in t)if(un.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(Ee(o)||Te(o))continue;n.push({key:tr(s),value:dn(o,e,i,r)})}catch(t){n.push({key:tr(s),value:{stringValue:Yi}})}}return n}function fn(t,e,i){return n({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}var pn={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var gn={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}},mn=gn.info;function yn(t){try{return tr(String(t))}catch(t){return Yi}}function bn(t,e,i,r){var s,o=gn[t.level||"info"]||mn,a=o.text,l=o.number,u=(void 0===(s=Ae(r)?r:void 0)&&(s=Date.now()),String(s)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Re(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Re(e.lastActivityTimestamp)||(h.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(h["url.full"]=e.currentUrl),e.screenName&&(h["screen.name"]=e.screenName),e.appState&&(h["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(h.feature_flags=e.activeFeatureFlags);var d=n({},h),v=t.attributes;if(v){var c=[];try{c=Object.keys(v)}catch(t){c=[]}for(var f of c){var p=void 0;try{p=v[f]}catch(t){p=Yi}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:yn(t.body)},attributes:hn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Te(t.trace_flags)||(g.flags=t.trace_flags),g}function _n(t,e,i){return fn(t,e,i)}function wn(t,e,i,r){return{resourceLogs:[{resource:{attributes:hn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var kn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.xn=e,this.A=i,this.ns=r,this.ss=n,this.ls=s,this.us=o,this.hs=null,this.ds=0,this.vs=0,this.cs=0,this.fs=0,this.ps=0,this.gs=!1,this.ys=e.maxBufferSize,this.bs=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this._s=e.flushIntervalMs,this.ws=e.maxBatchRecordsPerPost,this.ks=e.rateCapWindowMs,this.Ss=e.maxLogsPerInterval}clearQueue(){this.vs++,this._instance.setPersistedProperty(ue.LogsQueue,[])}reset(){this.xs(),this.fs=0,this.ps=0,this.gs=!1,this.cs=0,this.ws=this.xn.maxBatchRecordsPerPost}onReconnect(){this.cs=0,this.Cs()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Ts(t);if(null!==r)if(r.body){if(this.Ms()){var n={record:bn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.ns(),this.A,null==e?void 0:e.occurredAtMs)};this.ss(()=>this.Is(n))}}else this.A.info("Log was rejected in beforeSend function")}}Ts(t){var e=this.xn.beforeSend;if(!e)return t;var i=ke(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for log:",t),null}return r}Ms(){if(void 0===this.Ss)return!0;var t=Date.now(),e=t-this.fs;return this.ks>e&&e>=0||(this.fs=t,this.ps=0,this.gs=!1),this.Ss>this.ps?(this.ps++,!0):(this.gs||(this.A.warn("captureLog dropping logs: exceeded "+this.Ss+" logs per "+this.ks+"ms"),this.gs=!0),!1)}flush(){var t=this;return o(function*(){if(!t._instance.isDisabled)return t.hs||(t.hs=t.Es().finally(()=>{t.hs=null})),t.hs})()}Es(){var t=this;return o(function*(){var e;t.xs();var i=null!==(e=t._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o,a=t.vs;t.ds=0;var l=Math.min(i.length,t.ws),u=i.slice(0,l),h=wn(u.map(t=>t.record),t.Rs(),null!==(s=t.us)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.As(h);if(t.vs!==a)return;if("too-large"===d.kind&&u.length>1)t.ws=Math.max(1,Math.floor(u.length/2)),t.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.ws);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.A.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.xn.maxBatchRecordsPerPost>t.ws&&(t.ws=Math.min(t.xn.maxBatchRecordsPerPost,t.ws+1)),yield t.Ps(u.length),i=null!==(o=t._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}Ps(t){var e=this;return o(function*(){var i,r=Math.max(0,t-e.ds),n=null!==(i=e._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(ue.LogsQueue,n.slice(r)),yield e.ls()})()}Rs(){return _n(this.xn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Is(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ue.LogsQueue))&&void 0!==e?e:[];this.bs>i.length||(i.shift(),this.ds++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(ue.LogsQueue,i),this.ys>i.length?this.Fs():this.Cs()}}Fs(t){void 0===t&&(t=this._s),this.Os||(this.Os=lr(()=>{this.Os=void 0,this.Cs()},t))}$s(){var t=Math.min(Math.max(0,this.cs-1),6);return this._s*Math.pow(2,t)}Ds(){var t=this._instance.getPersistedProperty(ue.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return o(function*(){e.xs();var i=e.flush().catch(()=>{});void 0!==t?yield ur(i,t):yield i})()}flushWithTimeout(t){var e=this;return o(function*(){var i=e.flush();yield ur(i,t,()=>{i.catch(()=>{})})})()}Cs(){this.flush().then(()=>{this.cs=0},t=>{this.cs++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Ds()&&this.Fs(this.$s())})}xs(){this.Os&&(clearTimeout(this.Os),this.Os=void 0)}},Sn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function xn(t){return String(t)+"000000"}function Cn(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map(t=>JSON.stringify(t)+":"+JSON.stringify(r[t])).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}var Tn=class{constructor(t,e,i){this._instance=t,this.xn=e,this.A=i,this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Bs=0}count(t,e,i){void 0===e&&(e=1),this.Hs({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Hs({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Hs({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,e=this.hs,i=function(){var i=o(function*(){e&&(yield e.catch(()=>{})),yield t.zs()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.hs===i&&(this.hs=null)});return this.hs=i,i}drainWindow(){if(0===this.Ls.size)return null;var t=this.Ls;return this.Ls=new Map,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Us(t)}reset(){this.Bs++,this.xs(),this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set}Hs(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Ts(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?n({},e.attributes):void 0,r=Cn(e.type,e.name,e.unit,i)}catch(t){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ls.get(r);if(!s){if(!this.Ws())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ls.set(r,s)}var o=this.qs.get(e.name);void 0===o?this.qs.set(e.name,e.type):o===e.type||this.js.has(e.name)||(this.js.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Vs(s,e.value),this.Fs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ws(){return this.xn.maxSeriesPerFlush>this.Ls.size||(this.Ns||(this.Ns=!0,this.A.warn("Metric series cap reached ("+this.xn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Vs(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Sn.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Sn)]+=1}}Ts(t){var e=this.xn.beforeSend;if(!e)return t;var i=ke(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for metric:",t),null}return r}Fs(){this.Os||(this.Os=lr(()=>{this.Os=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this.xn.flushIntervalMs))}xs(){this.Os&&(clearTimeout(this.Os),this.Os=void 0)}zs(){var t=this;return o(function*(){if(0!==t.Ls.size){var e=t.Ls;t.Ls=new Map,t.Ns=!1,t.qs=new Map,t.js=new Set;var i=t.Bs,r=yield t._instance.Gs(t.Us(e));if(i===t.Bs)switch(r.kind){case"ok":return;case"retry-later":return t.Zs(e),void t.Fs();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}})()}Us(t){return e=this.Js(t),i=function(t,e,i){return fn(t,e,i)}(this.xn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:hn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Js(t){var e=xn(Date.now()),i=new Map;for(var r of t.values()){var s,o=Cn(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=n({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=hn(null!==(s=r.attributes)&&void 0!==s?s:{},this.A),u=xn(r.windowStartMs);if("count"===r.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=r.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===r.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=r.last)&&void 0!==v?v:0};a.gauge.dataPoints.push(c)}else r.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Sn})}return Array.from(i.values())}Zs(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Ls.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Ws()&&this.Ls.set(n,s)}}};function Mn(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var In="0.8.2",En={DEBUG:!1,LIB_VERSION:In,LIB_NAME:"browser-common",JS_SDK_VERSION:In},Rn=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={q(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];a&&(En.DEBUG||a.POSTHOG_DEBUG||i)&&!Te(a.console)&&a.console&&("__rrweb_original__"in a.console[e]?a.console[e].__rrweb_original__:a.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>Rn(t+" "+e,i)};return r},An=Rn("[PostHog.js]"),Pn=An.createLogger;function Fn(t,e){ke(t)&&t.forEach(e)}function On(t,e){if(!Re(t))if(ke(t))t.forEach(e);else if(Oe(t))t.forEach((t,i)=>e(t,i));else for(var i in t)_e.call(t,i)&&e(t[i],i)}var $n=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Dn(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Ln=function(t){try{return t()}catch(t){return}},Nn=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){An.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),An.critical(t)}}},qn=function(t){var e={};return On(t,function(t,i){(Me(t)&&t.length>0||Ae(t))&&(e[i]=t)}),e};function jn(t){var e=n({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var Bn=["herokuapp.com","vercel.app","netlify.app"];function Hn(t){var e=null==t?void 0:t.hostname;if(!Me(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Bn)if(i===r)return!1;return!0}function zn(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Un(t){return"ph_toolbar_internal"===t.name}var Wn=["localhost","127.0.0.1"],Vn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>qe(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,jn(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return ye(t)}},Gn=t=>{var e=null==h?void 0:h.createElement("a");return Te(e)?null:(e.href=t,e)},Zn=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return On(t,function(t,e){Te(t)||Te(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)}),n.join(e)},Jn=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!ke(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){An.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Qn=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");ke(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},Kn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Xn=(t,e)=>t>=e&&m(),Yn=(t,e,i,r)=>{if(0===t){if(m()){var n=e+1;return n===i&&r(),n}return e}return 0};function ts(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Se(r))return e;try{var n=r(e);return Me(n)&&n?n:e}catch(t){return An.error("Error in get_current_url, falling back to window.location.href",t),e}}function es(t){var e,i=null==a||null==(e=a.location)?void 0:e.href;return Te(i)?void 0:ts(t,i)}function is(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function rs(t){return!!t&&1===t.nodeType}function ns(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ss(t){return!!t&&3===t.nodeType}function os(t){return!!t&&11===t.nodeType&&rs(t.host)}function as(t){return t?ge(t).split(/\s+/):[]}function ls(t,e){var i=es(e);return!!(i&&t&&t.some(t=>i.match(t)))}function us(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return as(e)}function hs(t){return Re(t)?null:ge(t).split(/(\s+)/).filter(t=>Ls(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ds(t){var e="";return Is(t)&&!Es(t)&&t.childNodes&&t.childNodes.length&&On(t.childNodes,function(t){var i;ss(t)&&t.textContent&&(e+=null!==(i=hs(t.textContent))&&void 0!==i?i:"")}),ge(e)}function vs(t){var e;return Te(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var cs=["a","button","form","input","select","textarea","label"];function fs(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}function ps(t,e){if(Te(e))return!0;var i,r=function(t){if(e.some(e=>fs(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function gs(t){var e=t.parentNode;return!(!e||!rs(e))&&e}var ms=[".ph-no-autocapture","[data-ph-no-autocapture]"],ys=["next","previous","prev",">","<"],bs=[...ys,"+","-","−","–"],_s=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ws=[".ph-no-deadclick",".ph-no-capture"],ks=[".ph-no-rageclick",".ph-no-capture"],Ss=["","text","search","email","password","url","tel","number"];function xs(t){return!(!t||!rs(t))&&(!!ns(t,"textarea")||(ns(t,"input")?pe(Ss,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}function Cs(t,e){if(!a||Ts(t))return!1;var i,r,n,s,o;if(Fe(e)?(i=!!e&&ks,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:ks,r=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&xs(t))return!1;var l=Ms(t,!1).targetElementList;return!function(t,e){if(!1===t||Te(t))return!1;var i;if(!0===t)i=ys;else{if(!ke(t))return!1;if(t.length>10)return An.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map(t=>t.toLowerCase())}return e.some(t=>{var e=t.safeText,r=t.ariaLabel;return i.some(t=>_s(e,t)||_s(r,t))})}(r,l.map(t=>{var e;return{safeText:ds(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!ps(l,i)}var Ts=t=>!t||ns(t,"html")||!rs(t),Ms=(t,e)=>{if(!a||Ts(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!ns(n,"body");)if(os(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=gs(n);if(!s)break;if(e||cs.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=a.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function Is(t){for(var e=new Set,i=0,r=t;r.parentNode&&!ns(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=us(r);if(pe(n,"ph-sensitive")||pe(n,"ph-no-capture"))return!1}if(pe(us(t),"ph-include"))return!0;var s=t.type||"";if(Me(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Me(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function Es(t){return!!(ns(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ns(t,"select")||ns(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Rs=new 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}))$"),As=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ps=[16,15,14,13],Fs=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Os=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),$s=/[0-9A-Za-z_]/;function Ds(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Ls(t,e){if(void 0===e&&(e=!0),Re(t))return!1;if(Me(t)){if(t=ge(t),e?Rs.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(As.lastIndex=0;e=As.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ps){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Rs.test(a)&&Ds(a))return!0}}}return!1}(t))return!1;if(e?Fs.test(t):function(t){var e;for(Os.lastIndex=0;e=Os.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&$s.test(i)&&$s.test(r)))return!0}return!1}(t))return!1}return!0}function Ns(t){var e=ds(t);return Ls(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&On(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=ds(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){An.error("[AutoCapture]",t)}}),e}function js(t){return t.replace(/"|\\"/g,'\\"')}function Bs(t){var e=t.attr__class;if(e)return ke(e)?e:as(e)}var Hs=1e6;function zs(t){var e;return Math.min(Hs,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Us={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Hs,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Ws=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Vs=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Gs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Zs=t=>{Re(t)||On(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ws.includes(e)||Gs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Js=["/s/","/e/","/i/"];function Qs(t,e,i,r){if(Re(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Me(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function Ks(t,e){if(Re(t))return t;var i=t;return Ls(i,!1)||(i="[SessionRecording] "+e+" body redacted"),On(Vs,t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i="[SessionRecording] "+e+" body redacted as might contain: "+t)}),i}var Xs=new WeakSet,Ys="disabled",to="sampled",eo="active",io="buffering",ro="paused",no="lazy_loading",so="rrweb_error",oo="trigger_activated",ao="trigger_pending",lo="trigger_disabled";function uo(t,e,i,r,n,s){return 0===e?lo:(null==t?void 0:t.get_property(i?r+i:n))===s?oo:ao}function ho(t,e,i){return e.some(e=>{var r;return"regex"===e.matching&&(null!==(r=null==i?void 0:i.get(e.url))&&void 0!==r?r:new RegExp(e.url)).test(t)})}function vo(t){return t.includes("trigger_activated")?oo:t.includes("trigger_pending")?ao:lo}function co(t){var e=new Set(t);switch(e.delete(lo),e.size){case 0:return lo;case 1:return Array.from(e)[0];default:return ao}}var fo=class{constructor(t){this.j=t}triggerStatus(t){return vo(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return vo(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},po=class{constructor(t){this.j=t}triggerStatus(t){return co(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return co(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},go=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return oo}stop(){}},mo=t=>"sessionRecording"in t,yo=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,i;this.B=(mo(t)?xe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(mo(t)?xe(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){An.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){An.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return uo(this._instance,this.B.length,this.V,Y,Q,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Jt]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=es(this._instance);if(!t)return!1;try{return ho(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=es(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=ho(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=es(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=ho(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===oo,l=ho(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},bo=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ut]:t}),t}triggerStatusNoSideEffects(){var t=ao;return Re(this.linkedFlag)&&(t=lo),this.linkedFlagSeen&&(t=oo),t}onConfig(t,e){var i;if(this.linkedFlag=(mo(t)?xe(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Re(this.linkedFlag)&&!this.linkedFlagSeen){var r=Me(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Me(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(xe(i)&&r in i){var o=i[r];s=Fe(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},_o=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(mo(t)?xe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return uo(this._instance,this.K.length,this.V,X,K,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[zt]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,i){if(0!==this.K.length){var r=this.X(i)===oo,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},wo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new yo(t,e.id),this.tt=new _o(t,e.id),this.et=new bo(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map(t=>t.name),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,i);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new fo(s):new po(s)}else this.rt=new go}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===ao).map(t=>t.label)}checkEventTriggerConditions(t,e,i){this.tt.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i,r="url"===t?Y+this.group.id:X+this.group.id;null==(i=this._instance.persistence)||i.register({[r]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function ko(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Ys;if(t.urlTriggerMatching.urlBlocked)return ro;var e=!0===t.isSampled,i=new fo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?to:"trigger_activated"===i?eo:"trigger_pending"===i?io:!1===t.isSampled?Ys:eo}function So(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Ys;if(t.urlTriggerMatching.urlBlocked)return ro;var e=new po([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==lo,r=Fe(t.isSampled);return i&&"trigger_pending"===e?io:i&&"trigger_disabled"===e||r&&!t.isSampled?Ys:!0===t.isSampled?to:eo}function xo(){var t=[];return function(e,i){if(xe(i)||ke(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Co(t){var e=JSON.stringify(t,xo());return e?new Blob([e]).size:0}function To(t){if(Ee(t))return 4;if(Te(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(ke(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Te(r)||Ee(r)?4:To(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Te(l)||(o||(s+=1),o=!1,s+=a.length+3+To(l))}return s;default:return 0}}function Mo(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var i=Math.floor(t.data.length/2),r=t.sizes.slice(0,i),n=t.sizes.slice(i);return[Mo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Mo({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var Io=Uint8Array,Eo=Uint16Array,Ro=Uint32Array,Ao=new Io([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]),Po=new Io([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]),Fo=new Io([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oo=function(t,e){for(var i=new Eo(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ro(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},$o=Oo(Ao,2),Do=$o[1];$o[0][28]=258,Do[258]=28;for(var Lo=Oo(Po,0)[1],No=new Eo(32768),qo=0;32768>qo;++qo){var jo=(43690&qo)>>>1|(21845&qo)<<1;No[qo]=((65280&(jo=(61680&(jo=(52428&jo)>>>2|(13107&jo)<<2))>>>4|(3855&jo)<<4))>>>8|(255&jo)<<8)>>>1}var Bo=function(t,e,i){for(var r=t.length,n=0,s=new Eo(e);r>n;++n)++s[t[n]-1];var o,a=new Eo(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Eo(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[No[d]>>>l]=u}else for(o=new Eo(r),n=0;r>n;++n)o[n]=No[a[t[n]-1]++]>>>15-t[n];return o},Ho=new Io(288);for(qo=0;144>qo;++qo)Ho[qo]=8;for(qo=144;256>qo;++qo)Ho[qo]=9;for(qo=256;280>qo;++qo)Ho[qo]=7;for(qo=280;288>qo;++qo)Ho[qo]=8;var zo=new Io(32);for(qo=0;32>qo;++qo)zo[qo]=5;var Uo=Bo(Ho,9,0),Wo=Bo(zo,5,0),Vo=function(t){return(t/8|0)+(7&t&&1)},Go=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Eo?Eo:t instanceof Ro?Ro:Io)(i-e);return r.set(t.subarray(e,i)),r},Zo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Jo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Qo=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Io(0),0];if(1==n){var o=new Io(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new Eo(v+1),f=Ko(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort(function(t,e){return c[e.s]-c[t.s]||t.f-e.f});n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Io(c),f]},Ko=function(t,e,i){return-1==t.s?Math.max(Ko(t.l,e,i+1),Ko(t.r,e,i+1)):e[t.s]=i},Xo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Eo(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Yo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},ta=function(t,e,i){var r=i.length,n=Vo(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},ea=function(t,e,i,r,n,s,o,a,l,u,h){Zo(e,h++,i),++n[256];for(var d=Qo(n,15),v=d[0],c=d[1],f=Qo(s,15),p=f[0],g=f[1],m=Xo(v),y=m[0],b=m[1],_=Xo(p),w=_[0],k=_[1],S=new Eo(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;w.length>x;++x)S[31&w[x]]++;for(var C=Qo(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Fo[I-1]];--I);var E,R,A,P,F=u+5<<3,O=Yo(n,Ho)+Yo(s,zo)+o,D=Yo(n,v)+Yo(s,p)+o+14+3*I+Yo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&D>=F)return ta(e,h,t.subarray(l,l+u));if(Zo(e,h,1+(O>D)),h+=2,O>D){E=Bo(v,c,0),R=v,A=Bo(p,g,0),P=p;var L=Bo(T,M,0);for(Zo(e,h,b-257),Zo(e,h+5,k-1),Zo(e,h+10,I-4),h+=14,x=0;I>x;++x)Zo(e,h+3*x,T[Fo[x]]);h+=3*I;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Zo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(Zo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=Uo,R=Ho,A=Wo,P=zo;for(x=0;a>x;++x)if(r[x]>255){var B;Jo(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Zo(e,h,r[x]>>>23&31),h+=Ao[B]);var H=31&r[x];Jo(e,h,A[H]),h+=P[H],H>3&&(Jo(e,h,r[x]>>>5&8191),h+=Po[H])}else Jo(e,h,E[r[x]]),h+=R[r[x]];return Jo(e,h,E[256]),h+R[256]},ia=new Ro([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ra=new Io(0),na=function(){for(var t=new Ro(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),sa=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function oa(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=na[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new Io(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=ta(l,u,t.subarray(h,d)):(l[h]=s,u=ta(l,u,t.subarray(h,o)))}else{for(var v=ia[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Eo(32768),m=new Eo(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ro(25e3),k=new Eo(288),S=new Eo(32),x=0,C=0,T=(h=0,0),M=0,I=0;o>h;++h){var E=_(h),R=32767&h,A=m[E];if(g[R]=A,m[E]=R,h>=M){var P=o-h;if((x>7e3||T>24576)&&P>423){u=ea(t,l,0,w,k,S,C,T,I,h-I,u),T=x=C=0,I=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,D=0,L=f,N=R-A&32767;if(P>2&&E==_(h-N))for(var q=Math.min(c,P)-1,j=Math.min(32767,h),B=Math.min(258,P);j>=N&&--L&&R!=A;){if(t[h+O]==t[h+O-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>O){if(O=H,D=N,H>q)break;var z=Math.min(N,H-2),U=0;for(F=0;z>F;++F){var W=h-N+F+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Do[O]<<18|Lo[D];var G=31&Do[O],Z=31&Lo[D];C+=Ao[G]+Po[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=ea(t,l,s,w,k,S,C,T,I,h-I,u),s||(u=ta(l,u,ra))}return Go(a,0,r+Vo(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a,!l)),h=u.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&sa(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(u,e),sa(u,h-8,i.d()),sa(u,h-4,r),u}function aa(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Io(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new Io(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Go(r,0,n)}function la(t,e){var i="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var r=0;t.length>r;){var n=t[r++];128>n||e?i+=String.fromCharCode(n):224>n?i+=String.fromCharCode((31&n)<<6|63&t[r++]):240>n?i+=String.fromCharCode((15&n)<<12|(63&t[r++])<<6|63&t[r++]):(n=((15&n)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}return i}var ua=class{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,i;this.nt[t]=!0;var r=this.ft(t);null==(e=(i=this.it).onBlockedNode)||e.call(i,t,r)}},this.yt=t=>{var e=this.ft(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var i=e.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[t,e]},this.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,i,r,n,s,o,a,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.bt(e);if(e.attributes){var r,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var o=s-e.attributes.length;o>0&&(null==(r=(n=this.it).onDroppedAttributeMutations)||r.call(n,o))}var a=this.bt(e);if(0!==a||i===a){if(this.kt)return t;this.ut();var l,u,h=To(t);return h>this.ht?(null==(l=(u=this.it).onDroppedOversizedMutation)||l.call(u,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new Ze({bucketSize:null!==(i=this.it.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.it.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.vt,A:An}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var o=this.it.resyncIntervalMs;this.xt=Ae(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}},ha=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Ae(t)&&isFinite(t)&&Math.floor(t)===t});var da=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,n){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>i||0>r||0>n||e>0xffffffffffff||i>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|i>>>8,s[7]=i,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}},va=class{generate(){var t=this.generateOrAbort();if(!Te(t))return t;this.Ct=0;var e=this.generateOrAbort();if(Te(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Ae(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.Tt++,this.Tt>4398046511103&&(this.Ct++,this.Mt())}return da.fromFieldsV7(this.Ct,Math.trunc(this.Tt/Math.pow(2,30)),this.Tt&Math.pow(2,30)-1,this.It.nextUint32())}Mt(){this.Tt=1024*this.It.nextUint32()+(1023&this.It.nextUint32())}constructor(){this.Ct=0,this.Tt=0,this.It=new pa}},ca=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};a&&!Te(a.crypto)&&crypto.getRandomValues&&(ca=t=>crypto.getRandomValues(t));var fa,pa=class{nextUint32(){return this.Rt.length>this.At||(ca(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},ga=()=>ma().toString(),ma=()=>(fa||(fa=new va)).generate(),ya="",ba=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var _a=null,wa={Et(){if(!Ee(_a))return _a;if(_a=!1,h)try{var t="__ph_cookie_support_"+ga();wa.Ot(t,"xyz"),_a='"xyz"'===ha(t),wa.Dt(t)}catch(t){_a=!1}return _a},Pt(t){An.error("cookieStore error: "+t)},Lt:ha,Nt(t){var e;try{e=JSON.parse(wa.Lt(t))||{}}catch(t){}return e},Ot(t,e,i,r,n){if(!h)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),ya)return ya;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+ga();!ya&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",ya=s)}return ya}(t);if(!i){var r=(t=>{var e=t.match(ba);return e?e[0]:""})(t);r!==i&&An.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&An.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},Dt(t,e){if(null!=h&&h.cookie)try{wa.Ot(t,"",-1,e)}catch(t){return}}},ka=null,Sa={Et(){if(!Ee(ka))return ka;var t=!0;if(Te(a))t=!1;else try{var e="__mplssupport__";Sa.Ot(e,"xyz"),'"xyz"'!==Sa.Lt(e)&&(t=!1),Sa.Dt(e)}catch(e){t=!1}return t||An.error("localStorage unsupported; falling back to cookie store"),ka=t,t},Pt(t){An.error("localStorage error: "+t)},Lt(t){try{return null==a?void 0:a.localStorage.getItem(t)}catch(t){Sa.Pt(t)}return null},Nt(t){try{return JSON.parse(Sa.Lt(t))||{}}catch(t){}return null},Ot(t,e){try{return null==a||a.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Sa.Pt(t)}return!1},Dt(t){try{null==a||a.localStorage.removeItem(t)}catch(t){Sa.Pt(t)}}},xa=[vt,nt,rt,ot,at,lt,Rt,Et,Mt],Ca=[k,w,G,Z,Lt,Dt,M,At],Ta=t=>t+"_cpm",Ma=["__proto__","constructor","prototype"],Ia=t=>{if(!xe(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Ma.indexOf(i)&&(e[i]=t[i])}),e},Ea=function(t,e){void 0===e&&(e=[]);var i={};return[...Ca,...e].forEach(e=>{var r=t[e];Te(r)||Ee(r)||""===r||(i[e]=r)}),i},Ra=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Aa=(t,e)=>({p:e,f:Ra(JSON.stringify(t))}),Pa=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=wa.Nt(Ta(t)),r=(null==i?void 0:i.f)===Ra(e)&&ke(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Fa=(t,e)=>e+"|"+(wa.Lt(Ta(t))||""),Oa={},$a={Et:()=>!0,Pt(t){An.error("memoryStorage error: "+t)},Lt:t=>t in Oa?Oa[t]:null,Nt:t=>t in Oa?Oa[t]:null,Ot:(t,e)=>(Oa[t]=e,!0),Dt(t){delete Oa[t]}},Da=null,La={Et(){if(!Ee(Da))return Da;if(Da=!0,Te(a))Da=!1;else try{var t="__support__";La.Ot(t,"xyz"),'"xyz"'!==La.Lt(t)&&(Da=!1),La.Dt(t)}catch(t){Da=!1}return Da},Pt(t){An.error("sessionStorage error: ",t)},Lt(t){try{return null==a?void 0:a.sessionStorage.getItem(t)}catch(t){La.Pt(t)}return null},Nt(t){try{return JSON.parse(La.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==a||a.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){La.Pt(t)}return!1},Dt(t){try{null==a||a.sessionStorage.removeItem(t)}catch(t){La.Pt(t)}}};En.DEBUG=!1,En.LIB_VERSION="1.429.1",En.LIB_NAME="web";var Na=En,qa=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ft=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(it,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ft(it);return xe(e=i)&&Me(e.sessionId)&&Ae(e.size)&&i.sessionId===t?i.size:0}};function ja(t,e){return function(t){for(var e=0,i=0;t.length>i;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;return Math.abs(e)}(t)%100<Ge(100*e,0,100,An)}function Ba(t){return"$survey_response_"+t}function Ha(t,e){if(!e)return null;var i=t[Ba(e)];return ke(i)?[...i]:i}function za(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Te(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=Ha(t,e.id);Te(s)||(r[n]=s)}}),n({$survey_questions:e.questions.map(e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:Ha(t,e.id)}})},t,r)}function Ua(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function Wa(t){return"string"==typeof t&&t.trim()?t.trim():null}function Va(t){return t.toLowerCase()}function Ga(t,e,i){if(!t||!e)return null;var r=Va(e),n=Object.keys(t).find(t=>Va(t)===r);if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find(t=>Va(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var Za=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ja(t,e,i){var r,s=Ga(t.translations,e,i),o=n({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];if(u)if(null==i||i.info("Applying survey-level translation for language: "+s),Te(u.name)||(o.name=u.name,a=!0),o.appearance){var h=n({},o.appearance);for(var d of Za){var v=u[d];Te(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return Za.some(e=>!Te(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,s=Ga(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=n({},t),l=!1;return Te(o.question)||(a.question=o.question,l=!0),Te(o.description)||(a.description=o.description,l=!0),Te(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Te(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Te(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Te(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return ke(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return s||(g=(null==(r=c.find(t=>t.matchedKey))?void 0:r.matchedKey)||null),p&&(o.questions=f,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||g:null}}function Qa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ka(t){var e;return Qa(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Xa=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Ya=t=>t.toLowerCase(),tl={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Xa(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Xa(e,t))),icontains:(t,e)=>e.map(Ya).some(e=>t.map(Ya).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Ya).every(e=>t.map(Ya).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{var i=parseFloat(e);return!isNaN(i)&&t.some(t=>i>parseFloat(t))}),lt:(t,e)=>e.some(e=>{var i=parseFloat(e);return!isNaN(i)&&t.some(t=>i<parseFloat(t))})};function el(t,e){return!t||Object.entries(t).every(t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(null==r)return!1;var n=tl[i.operator];return!!n&&n(i.values,[String(r)])})}function il(t,e,i){return Vn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var rl=new Set(["is_not","not_icontains","not_regex"]);function nl(t,e,i){return!t||0===t.length||t.every(t=>{var r,n=null==(r="person"===t.type?i:e)?void 0:r[t.key],s=t.operator||"exact";if(Te(n)||Ee(n))return rl.has(s);var o=tl[s];return!!o&&!Te(t.value)&&!Ee(t.value)&&o(ke(t.value)?t.value.map(String):[String(t.value)],ke(n)?n.map(String):[String(n)])})}var sl=Pn("[SessionRecording]");function ol(t,e){return e?t:"!"+t}function al(t,e){return t===e||t!=="!"+e&&null}var ll=class{constructor(t,e,i,r,n,s,o){this._instance=t,this.Y=e,this.tt=i,this.et=r,this.jt=n,this.Bt=s,this.Ht=o,this.$t=null,this.Ut=So}onRemoteConfig(t){this.$t=Ae(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.zt=new fo([this.tt,this.Y]),this.Ut=ko):(this.zt=new po([this.tt,this.Y]),this.Ut=So),this._instance.register_for_session({[Gt]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.Ht()})}getStatus(t){return this.Ut({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e,i=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Ae(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.tt.K.length&&Re(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){sl.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,i,r,n=this.$t;if(!Ae(n))return null==(i=this._instance.persistence)||i.unregister(Z),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Z),o=this._instance.get_property(H),a=al(s,t),l=Ae(o)&&o!==n,u=Te(o)&&s===t,h=l||u||!Fe(a),d=h?ja(t,n):a;h&&(d?this.jt("sampled"):sl.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Z]:ol(t,d),[H]:Ee(o)&&s===t?null:n})}ensureSamplingDecision(t){Ae(this.$t)&&(Fe(al(this._instance.get_property(Z),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(K),null==(e=this._instance.persistence)||e.unregister(Q),null==(i=this._instance.persistence)||i.unregister(Z),null==(r=this._instance.persistence)||r.unregister(H),null==(n=this._instance.persistence)||n.unregister(J)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.zt)?void 0:e.triggerStatus(t))===ao}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===ao).map(t=>t.label)}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},ul=class{constructor(t,e,i,r,n){this._instance=t,this.Y=e,this.jt=i,this.Vt=r,this.Ht=n,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[Gt]:"v2_trigger_groups",[Zt]:t.triggerGroups.length}),this.Y.onConfig(t)):sl.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Ys;if(t.urlTriggerMatching.urlBlocked)return ro;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Ys;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Te(l)?An.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?to:r?io:Ys}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Zt)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;Ae(r)&&(Ee(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,e=>{n.Kt(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Ht(e))},t)};for(var o of this.Zt)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.Wt=t(t=>{var i;if(this.Qt)return sl.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Wt)||i.call(this),void(this.Wt=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,n=>{if(r.Kt(i,t.properties)){var s=(i.group.conditions.events||[]).filter(e=>e.name===t.event),o=r._instance.get_property(vt);s.some(e=>!e.properties||0===e.properties.length||nl(e.properties,t.properties,o))&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Ht(n))}},e)};for(var s of this.Zt)n(s)}catch(t){sl.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(var e of this.Zt){var i,r=e.group,n=r.id,s=r.sampleRate,o=tt+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(xe(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Ae(c)&&c!==s,l=v===t&&Ae(c)&&c===s&&Fe(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!Fe(l),g=p?ja(t+n,s):l;p&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Gt.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Z),null==(e=this._instance.persistence)||e.unregister(H),null==(i=this._instance.persistence)||i.unregister(J),this.Zt)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(X+a),null==(s=this._instance.persistence)||s.unregister(Y+a),null==(o=this._instance.persistence)||o.unregister(tt+a)}}updateActiveTriggers(t){var e=[];for(var i of this.Zt){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.Gt.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Wt]:e})}hasPendingTriggers(t){for(var e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){var i=t.group.conditions.properties;return!i||0===i.length||nl(i,e,this._instance.get_property(vt))}Jt(t){var e=this;this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();var i=function(t){var i=new wo(e._instance,t,(i,r)=>{e.jt("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Ht()});e.Zt.push(i)};for(var r of t)i(r)}},hl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],dl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hl],vl="<masked>",cl=["li_fat_id"];function fl(t,e,i){if(!h)return{};var r,n=e?[...hl,...i||[]]:[],s=pl(Qn(h.URL,n,vl),t);return $n((r={},On(cl,function(t){var e=ha(t);r[t]=e||null}),r),s)}function pl(t,e){var i=dl.concat(e||[]),r={};return On(i,function(e){var i=Jn(t,e);r[e]=i||null}),r}function gl(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Ee(e)){r.$search_engine=e;var n=h?Jn(h.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function ml(){return navigator.language||navigator.userLanguage}var yl="$direct";function bl(){return(null==h?void 0:h.referrer)||yl}function _l(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...hl,...e||[]]:[],s=null==(r=i?ar(null==d?void 0:d.href):null==d?void 0:d.href)?void 0:r.substring(0,1e3);return{r:bl().substring(0,1e3),u:s?Qn(s,n,vl):void 0}}function wl(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?ar(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==yl?yl:null==(i=Gn(r))?void 0:i.host};if(s){o.$current_url=s;var a=Gn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,$n(o,pl(s))}return r&&$n(o,gl(r)),o}function kl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Sl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var xl=1e5,Cl=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Tl=[],Ml=()=>!1,Il="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),El="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Rl="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),Al="Accommodation AdministrativeArea Country Place State".split(" "),Pl={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:El,publisher:Rl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Tl},Offer:{seller:Rl},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:Rl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Rl,areaServed:Al,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Tl}},Fl=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),Pl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Pl.Event],[Rl,Pl.Organization],[Al,Pl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Pl.Product]];function Ol(t,e){return _e.call(t,e)?t[e]:void 0}function $l(t){var e=typeof t;return Ee(t)||"string"===e||"number"===e||"boolean"===e}function Dl(t,e){return e&&function(t){return Me(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function Ll(t,e){return ke(t)&&t.every($l)?t.map(t=>Dl(t,e)).filter(t=>!Te(t)):$l(t)?Dl(t,e):void 0}function Nl(t,e){if("string"==typeof t){var i=t.trim(),r=i.indexOf("#"),n=0>r?i:i.slice(r+1);if(!(!n||0>r&&(/^[a-z][a-z\d+.-]*:/i.test(i)||i.includes("/")||i.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function ql(t){if(_e.call(Pl,t))return Pl[t];for(var e of Fl){var i=e[1];if(e[0].includes(t))return i}}function jl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function Bl(t,e,i,r){if(ke(t)){var n=t.map(t=>Bl(t,e,i,r)).filter(t=>!Te(t));return n.length?n:void 0}return Hl(t,e,i,r)||void 0}function Hl(t,e,i,r){if(!xe(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Ol(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:ke(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&Cl.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!ql(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Il){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?Nl(Ol(t,l),e):Ll(Ol(t,l),i.maskUrl);Te(u)||jl(a,l,u)}for(var h of o){var d=ql(h);for(var v of Object.keys(d)){var c=Ol(t,v),f=d[v];if(!0===f){var p=Ll(c,i.maskUrl);Te(p)||jl(a,v,p)}else{var g=Bl(c,e,i,f);Te(g)||jl(a,v,g)}}}var m=Bl(Ol(t,"@graph"),e,i);return Te(m)||jl(a,"@graph",m),Object.keys(a).length?a:null}function zl(t,e,i){if(!xe(t))return null;var r=Ol(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var s=Hl(t,e,i);return s?n({"@context":"https://schema.org"},s):null}function Ul(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Wl(t,e,i){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!i&&t.matches(i)}catch(t){return!1}}function Vl(t,e,i){for(var r=t;r;){if(Wl(r,e,i))return!0;var n=r.parentNode;r=r.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function Gl(t){return Ul(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ul)}function Zl(t){return Te(t)?void 0:Math.round(t)}function Jl(t){return xe(t)?t.network_timing:t}var Ql,Kl,Xl=Pn("[SessionRecording]"),Yl=[1,2,3,4,5,6,7,12],tu=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function eu(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function iu(){var t;return null==(t=eu())?void 0:t.record}function ru(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,xo())}}function nu(t){return la(oa(aa(ru(t))),!0)}function su(t){return ou.apply(this,arguments)}function ou(){return(ou=o(function*(t){var e=yield an(ru(t),Na.DEBUG,{rethrow:!0});return la(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var au="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,lu=!1;function uu(t){return ke(t)&&0===t.length?Ql=null!=Ql?Ql:nu([]):nu(t)}function hu(t){return du.apply(this,arguments)}function du(){return(du=o(function*(t){return ke(t)&&0===t.length?Ql||(Kl=null!=Kl?Kl:su([]).then(t=>(Ql=t,t)).catch(t=>{throw Ql=void 0,Kl=void 0,t})):su(t)})).apply(this,arguments)}function vu(t){return au&&!lu&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function cu(t){return{event:t,size:To(t)}}function fu(t,e){return n({},t,{data:e,cv:"2024-10"})}function pu(t,e){return n({},t,{cv:"2024-10",data:n({},t.data,e)})}function gu(t){try{if(2===t.type)return cu(fu(t,nu(t.data)));if(3===t.type&&0===t.data.source)return cu(pu(t,{texts:uu(t.data.texts),attributes:uu(t.data.attributes),removes:uu(t.data.removes),adds:uu(t.data.adds)}));if(3===t.type&&8===t.data.source)return cu(pu(t,{adds:t.data.adds?nu(t.data.adds):void 0,removes:t.data.removes?nu(t.data.removes):void 0}))}catch(t){Xl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Co(t)}}function mu(){return mu=o(function*(t){try{if(2===t.type)return cu(fu(t,yield su(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([hu(t.data.texts),hu(t.data.attributes),hu(t.data.removes),hu(t.data.adds)]);return cu(pu(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var i=yield Promise.all([t.data.adds?su(t.data.adds):void 0,t.data.removes?su(t.data.removes):void 0]);return cu(pu(t,{adds:i[0],removes:i[1]}))}}catch(e){return nn(e)&&(lu=!0),Xl.error("could not compress event asynchronously - trying synchronous compression",e),gu(t)}return{event:t,size:Co(t)}}),mu.apply(this,arguments)}function yu(t,e){return 5===t.type&&t.data.tag===e}function bu(t){return yu(t,"sessionIdle")}function _u(t){return yu(t,"$session_ending")}function wu(t){return yu(t,"$session_starting")}var ku=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return al(this._instance.get_property(Z),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Ae(e)?e:null}get ie(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.se=!1,this.ue=Date.now(),this.le=!1,this.he=[],this.ce="unknown",this.de=0,this.ve=0,this.fe=0,this.pe=0,this.ge=!1,this.me=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=[],this.Re=void 0,this.Ae=void 0,this.Ee=!1,this.Oe=[],this.Le=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Wt=void 0,this.Fe=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,i)=>{var r,n,s,o;if(i&&(t!==this.Xt||e!==this.He)){var a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Xt,u=this.He;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue,flushed_size:null==(r=this.$e)?void 0:r.currentTrackedSize(l)}),null==(n=this._instance.persistence)||n.unregister(et),this._e=!1,null==(s=eu())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.Ue(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.ze(h)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue}),null==(o=this.ne)||o.makeSamplingDecisions(t)}},this.We=!1,this.Ve=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[J])===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;var i=null==(t=this.Rt.data[0])?void 0:t.timestamp,r=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return Ae(i)&&Ae(r)?r-i:null},this.Ge=()=>{var t,e,i=this.ie;if(!Ae(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Qe;return Ae(r)&&r>=0&&i>r}if(this.Ve())return!1;var n,s=this.Ze();return!!Ee(s)||i>s||(null==(n=this._instance.persistence)||n.register({[J]:this.Xt}),!1)},this.Je=()=>{"buffering"!==this.status?(this.ge&&this.me&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tr(!0)):this.er()},this.rr=()=>{this.Je()},this.ir=()=>{this.Vt("browser offline",{})},this.nr=()=>{this.Vt("browser online",{})},this.ar=()=>{null!=h&&h.visibilityState&&("visible"===h.visibilityState&&(this.Ke=!0),this.Vt("window "+h.visibilityState,{}))},this.Ke=null==e||e;var i=this.Yt.checkAndGetSessionAndWindowId(),r=i.windowId,n=i.sessionStartTimestamp;this.Xt=i.sessionId,this.He=r,this._sessionStartTimestamp=n,this.et=new bo(this._instance),this.Y=new yo(this._instance),this.tt=new _o(this._instance),this.Rt=this.er(),this.sr="ph_"+(this._instance.config.persistence_name||this._instance.config.token)+"_replay_pending_buffer",this.Yt.sessionTimeoutMs>this.te||Xl.warn("session_idle_threshold_ms ("+this.te+") is greater than the session timeout ("+this.Yt.sessionTimeoutMs+"). Session will never be detected as idle"),this.$e=new qa(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get ur(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.re)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return Te(d)&&Te(v)&&Te(c)&&Te(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}lr(){var t;if(!this.xe){var e=null==(t=this.re)?void 0:t.masking;if(!Re(e)){var i=this._instance.config.session_recording,r=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{var r=null==i?void 0:i[t],n=e[t];return!Te(r)&&r!==n});0!==r.length&&(this.xe=!0,Xl.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+r.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==i?void 0:i.maskAllInputs,maskTextSelector:null==i?void 0:i.maskTextSelector,blockSelector:null==i?void 0:i.blockSelector,maskAllElementAttributes:null==i?void 0:i.maskAllElementAttributes},project:e}))}}}get hr(){var t;return Ge(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Pn("canvas recording resolution scale"),1)}get cr(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.re)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Ge(h,0,12,Pn("canvas recording fps"),4),quality:Ge(d,0,1,Pn("canvas recording quality"),.4)}}get dr(){var t,e,i=!(null==(t=this.re)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:i}get vr(){var t,e,i,r=null==(t=this.re)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=Jl(this._instance.config.capture_performance),l=Jl(null==r?void 0:r.capturePerformance),u=!!(Fe(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}pr(){var t,e,i=[],r=null==(t=b.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.dr&&i.push(r());var s=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.vr&&Se(s))if(!Wn.includes(d.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Se(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,s={payloadSizeLimitBytes:Us.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Us.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Us.payloadHostDenyList]},o=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,u=(r=zs(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Qs(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Qs(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=Gn(t.name),s=0===e.indexOf("http")?null==(r=Gn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&Js.some(t=>0===o.indexOf(t))))return t}})((Zs((r=e).requestHeaders),Zs(r.responseHeaders),r),t.api_host,i));var r},d=Se(t.session_recording.maskNetworkRequestFn);return d&&Se(t.session_recording.maskCapturedNetworkRequestFn)&&An.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:n({},e,{name:null==i?void 0:i.url})}),s.maskRequestFn=Se(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=h(e);if(i){var r=i.isInitial?{name:"",entryType:i.entryType,startTime:i.startTime,duration:i.duration,endTime:i.endTime,timeOrigin:i.timeOrigin,timestamp:i.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i);return Re(n)&&r?(Xs.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Te(t))return t.requestBody=Ks(t.requestBody,"Request"),t.responseBody=Ks(t.responseBody,"Response"),t}(h(t)),n({},Us,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,o)))}else Xl.info("NetworkCapture not started because we are on localhost.");return i}gr(t){return this._instance.config.disable_capture_url_hashes?ar(t):t}mr(t,e){void 0===e&&(e=!1);var i=e?ar(t):this.gr(t),r=this._instance.config.mask_personal_data_properties?[...hl,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(Qn(i,r,vl))}yr(t){var e,i=this._instance.config.session_recording;if(i.maskCapturedNetworkRequestFn){var r,n=i.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}return i.maskNetworkRequestFn?null==(e=i.maskNetworkRequestFn({url:t}))?void 0:e.url:t}br(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Xl.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(tu(()=>iu().addCustomEvent(t,e)))}wr(){var t;return this.se&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.ce}kr(t){if(!this.wr())return!1;try{var e=iu();return!!e&&(e.addCustomEvent("$json_ld",t),this.wr())}catch(t){return!1}}_r(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.Sr)?void 0:e.scan(t)})}Cr(){try{if(this._instance.config.capture_pageview||!a)return;var t=new URL(a.location.href),e=this.mr(t.origin+t.pathname+t.search);this.Mr!==e&&(this.Mr=e,this.Vt("$url_changed",{href:e}))}catch(t){}}Tr(){if(this.he.length){var t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.br(t)})}}Bt(){return this.br(tu(()=>iu().takeFullSnapshot()))}get Ir(){var t,e,i;if(null!=(t=this.ne)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var r,n=null==(r=this._instance.config.session_recording)?void 0:r.trigger_pending_buffer_interval_millis;return Ae(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(i=this._instance.config.session_recording)?void 0:i.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Rr(){if(this.Ar&&clearInterval(this.Ar),!0!==this.ce){var t=this.Ir;t&&(this.Ar=setInterval(()=>{this.Bt()},t))}}Ht(t){"event"===t&&this.Er(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rr()}Or(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.Sr)||t.scan(),clearInterval(this.Ar),Xl.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Lr(){var t;this.Y.urlBlocked&&(null==(t=this.Sr)||t.scan(),this.Y.urlBlocked=!1,this.Bt(),this._r(),this.Rr(),this.Vt("recording resumed",{reason:"left blocked url"}),Xl.info("recording resumed"))}Dr(t,e){var i;if("event"===t&&this.Er(),!this.le&&null!=(i=this.ne)&&i.hasPendingTriggers(this.sessionId)){this.le=!0;try{var r,n,s="url"===t?Q:K;null==(r=this._instance.persistence)||r.register({[s]:this.sessionId}),null==(n=this.ne)||n.updateActiveTriggers(this.sessionId),this.Ht(),this.tr(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.le=!1}}}get isStarted(){return!!this.ae}get re(){var t=this._instance.get_property(j);if(t){var e;try{e=xe(t)?t:JSON.parse(t)}catch(t){return void Xl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>36e5)return Xl.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(r=this._instance.persistence)||r.unregister(j))}return e}}Pr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(t){var e,i,r=this.re;if(r){if(!this.isStarted){var n=!1!==this.ce&&!this.be;this.Xe(n?"no_interaction_since_recording_started":void 0),this.be=!1,this.me=n,this.ye=!1}this.Pe&&(this.Nr(),this.er());var s=this.Yt.checkAndGetSessionAndWindowId(),o=s.windowId,l=s.sessionStartTimestamp;this.Xt=s.sessionId,this.He=o,this._sessionStartTimestamp=l,this.Fr(),null==(e=this._instance.persistence)||e.unregister(et),null!=r&&r.endpoint&&(this.oe=null==r?void 0:r.endpoint),this.ne=2===(null==r?void 0:r.version)&&null!=r&&r.triggerGroups&&r.triggerGroups.length>0?new ul(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new ll(this._instance,this.Y,this.tt,this.et,this.jt.bind(this),this.Bt.bind(this),this.Ht.bind(this)),this.ne.onRemoteConfig(r),null==(i=this.Wt)||i.call(this),this.Wt=this.ne.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Dr(t,e)),this.Pr(z,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(z)}),this.Pr(U,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(U)}),this.Pr(V,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.Pr(W,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.ne.makeSamplingDecisions(this.sessionId),this.qr(),this.we||(zn(a,"beforeunload",this.Je),zn(a,"pagehide",this.rr),zn(a,"offline",this.ir),zn(a,"online",this.nr),zn(h,"visibilitychange",this.ar),!this.Fe&&Se(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&Se(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.Ue(),this.ce="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,i)=>{var r;null==(r=this.je)||r.call(this),this.je=void 0,this.Be(t,e,i)})}):Se(this.Yt.on)||Xl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Re(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.mr(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Xl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else Xl.info("remote config must be stored in persistence before recording can start")}jr(){var t,e,i,r,n,s;null==a||a.removeEventListener("beforeunload",this.Je),null==a||a.removeEventListener("pagehide",this.rr),null==a||a.removeEventListener("offline",this.ir),null==a||a.removeEventListener("online",this.nr),null==h||h.removeEventListener("visibilitychange",this.ar),clearInterval(this.Ar),this.Br(),null==(t=this.Ne)||t.call(this),this.Ne=void 0,null==(e=this.Wt)||e.call(this),this.Wt=void 0,null==(i=this.Fe)||i.call(this),this.Fe=void 0,null==(r=this.qe)||r.call(this),this.qe=void 0,null==(n=this.je)||n.call(this),this.je=void 0,null==(s=this.ne)||s.stop(),this.Hr(),this.Nr()}Nr(){this.De+=1,this.Oe=[],this.Le=0,this.$r=void 0,this.Pe=!1}Hr(){var t,e;null==(t=this.Ur)||t.stop(),this.he=[],null==(e=this.Sr)||e.stop(),this.Sr=void 0,this.se=!1;try{var i;null==(i=this.ae)||i.call(this)}catch(t){Xl.warn("could not stop rrweb",t)}this.ae=void 0}zr(){if(!this.$r||0===this.Le)return!1;if(this.Pe)return!0;this.Pe=!0,this.Wr=void 0;var t=this.De;return this.Br(),this.Hr(),this.$r.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.tr(),this.er(),this.Vr(),this.jr(),Xl.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),Xl.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.zr())return;this.tr(),this.er(),this.Vr(),this.jr(),Xl.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}ze(t){this.We=!0,this.ue=Date.now();try{var e;this.stop(),this.Zr=void 0,this.Gr=void 0,this.ve=0,this.fe=0,this.pe=0,null==(e=eu())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.me=!1}Xe(t,e){var i=(void 0===e?{}:e).preserveLogDedup,r=void 0!==i&&i;if(this.ge=!Te(t),this.Wr=t,Te(t))r||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,Xl.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}Er(){this.isStarted||(this.be=!0),this.ge&&(this.Xe(void 0),this.me=!1,this.ye&&(this.ye=!1,this.Bt()),this.Jr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,i=void 0!==e&&e;this.ge=!0,i&&(this.er(),this.Hr()),this.er(),this.jr(),this.er(),this.Vr(),Xl.info("discarded")}Kr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};"disabled"!==this.status?(this.Xr(t,r),this.Yr(s)):this.er()}ti(){try{this.ei()}catch(t){this.Se||(this.Se=!0,Xl.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=eu())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Gr&&(this.Gr=e,this.Zr&&this.Zr.durationMs>=e.durationMs||(this.Zr=e),500>e.durationMs||Xl.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Xr(t,e){2!==t.type?3===t.type&&(Te(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,Xl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Re=e}ri(t){t.counted&&t.generation===this.De&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,i){t.processed||t.generation!==this.De||(t.processed=!0,this.Kr(t.event,e,i,t.targetSessionId,t.targetWindowId))}ni(t){try{var e=t.event,i=Co(t.event);if(t.compressionEnabled)try{var r=gu(t.event);e=r.event,i=r.size}catch(t){Xl.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,i)}catch(t){Xl.error("could not capture queued compression event",t)}}finally{this.ri(t)}}Ye(){[...this.Oe].forEach(t=>{this.ni(t)})}oi(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.De,processed:!1,counted:!0};this.Oe.push(s),this.Le+=1;var a=function(){var i=o(function*(){try{if(s.processed)return;var i,r;try{var o=e?vu(t)?yield function(t){return mu.apply(this,arguments)}(t):gu(t):{event:t,size:Co(t)};i=o.event,r=o.size}catch(e){Xl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Co(t)}n.ii(s,i,r)}finally{n.ri(s)}});return function(){return i.apply(this,arguments)}}();this.$r=this.$r?this.$r.catch(()=>{}).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,o,l,u,h;if(this._instance.sessionManager&&(this.Tr(),t&&xe(t))){if(4===t.type){var d=this.mr(t.data.href);if(this.Mr=d,!d)return;t.data.href=d}else this.Cr();if(null==(e=this.ne)||e.checkUrlTriggers(this.sessionId,()=>this.Or(),()=>this.Lr(),(t,e)=>this.Dr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var v,c,f;2===t.type&&(null!=(v=eu())&&null!=v.wasMaxDepthReached&&v.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(c=this.Ur)||c.reset(),null==(f=this._instance.persistence)||f.register_once({[et]:t.timestamp},void 0));var p=2===t.type&&(null==(i=this.ne)?void 0:i.hasPendingTriggers(this.sessionId));p&&this.ai();var g=this.Ur?this.Ur.throttleMutations(t):t;if(g){var m=function(t){var e=t;if(e&&xe(e)&&6===e.type&&xe(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var i=[],r=0;e.data.payload.payload.length>r;r++)i.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=i,t}return t}(g),y=function(t){return _u(t)?t.data.payload:null}(m),b=function(t){return wu(t)?t.data.payload:null}(m),_=function(t){return bu(t)?t.data.payload:null}(m);y||b?null!=y&&y.lastActivityTimestamp&&(m.timestamp=y.lastActivityTimestamp):null!=_&&_.sessionId||this.si(m),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var w=null!==(r=null!==(n=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==_?void 0:_.sessionId)&&void 0!==r?r:this.Xt,k=null!==(o=null!==(l=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==l?l:null==_?void 0:_.windowId)&&void 0!==o?o:this.He;if(!0!==this.ce||function(t){return bu(t)||_u(t)||wu(t)}(m)){2===m.type&&(this.de=0),_&&(m.timestamp=_.lastActivityTimestamp+_.threshold);var S=this.se;this.se=!0,p?this._r(!0):S||this._r();var x=null===(h=this._instance.config.session_recording.compress_events)||void 0===h||h;if(5===m.type&&"$json_ld"===m.data.tag){var C;try{C=a?this.mr(a.location.href):void 0}catch(t){}m.data.href=C}if(this.Le>0||x&&vu(m))this.oi(m,x,w,k);else{var T=x?gu(m):{event:m,size:Co(m)};this.Kr(m,T.event,T.size,w,k)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(m)&&this.de++}else!0===this.ce&&this.de++}}}get status(){return this.ne?this.ne.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.re}):Ys}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.Bt(),this.Er(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Z]:this.sessionId,[H]:null}),this.Bt(),this.Er(),this.jt("sampling_overridden")}overrideTrigger(t){this.Dr(t),this.Er()}ui(){try{var t,e=null==a||null==(t=a.location)?void 0:t.href;if(!e)return;var i=this.mr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Br(){this.li&&(clearTimeout(this.li),this.li=void 0)}Jr(){this.li||(this.li=setTimeout(()=>{this.tr()},2e3))}hi(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!_u(t)&&!wu(t))}ci(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return Te(this.fi)||this._instance.register_for_session({[Vt]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Te(this.fi)||this._instance.register_for_session({[Vt]:[]}),void(this.fi=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.fi&&(this.fi=r,this._instance.register_for_session({[Vt]:e}),Xl.info("buffering: "+i))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&La.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,La.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=La.Nt(this.sr);La.Dt(this.sr),xe(t)&&ke(t.data)&&0!==t.data.length&&ke(t.sizes)&&t.sizes.length===t.data.length&&Ae(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}}tr(t){var e;if(void 0===t&&(t=!1),this.Br(),this.ge)return this.Rt;if(this.hi())return this.Rt.size>943718.4?this.er():(t&&this.mi(),this.Rt);var i=this.Rt;null==(e=this.ne)||e.ensureSamplingDecision(this.sessionId);var r=this.Ge(),n=this.status;if(this.di(n),"buffering"===n||"paused"===n||"disabled"===n||r)return!t||"active"!==n&&"sampled"!==n||this.mi(),this.Jr(),this.Rt;if(this.Rt!==i)return this.Rt;if(i.data.length>0){var s,o=this.ui();Mo(i).forEach(t=>{try{var e;null==(e=this.$e)||e.trackSize(t.sessionId,t.size),this.bi({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Na.LIB_NAME,$lib_version:Na.LIB_VERSION,$snapshot_host:o})}catch(t){Xl.warn("could not capture snapshot chunk - skipping it",t)}}),Te(this.yi)||(La.Dt(this.sr),this.yi=void 0),null==(s=this.ne)||s.onFlushComplete()}return this.er()}Yr(t){var e,i=2+((null==(e=this.Rt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Rt.sessionId!==r;if(n||!0!==this.ce&&!this.ge&&this.Rt.size+t.$snapshot_bytes+i>943718.4){var s=this.Xt;if(this.Rt=this.tr(),this.Xt!==s)return;n&&this.Rt.data.length>0&&(this.Rt=this.er()),this.Rt.sessionId=r,this.Rt.windowId=t.$window_id}this.ge&&(this.ye||this.Rt.size+t.$snapshot_bytes+i>943718.4)?this.ye||(this.ye=!0,this.Rt=this.er()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.ce||this.ge||this.Jr())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e,i=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1];return i?i.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.er();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.er():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}er(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}jt(t,e){this._instance.register_for_session({[Xt]:t}),Xl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",n({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==Yl.indexOf(null==(e=t.data)?void 0:e.source)}si(t){var e=this.wi(t);e||!0===this.ce||t.timestamp-this.ue>this.te&&(this.ce=!0,clearInterval(this.Ar),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.tr());var i=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp),r=i.windowId,n=i.sessionId,s=!1;if(e&&(this.ue=t.timestamp,this.ce)){var o="unknown"===this.ce;this.ce=!1,o||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}var a=this.Xt!==n,l=this.He!==r;if(this.He=r,this.Xt=n,a||l){var u=a&&!1!==this.ce;u&&(this.ce="unknown"),this.ze(u)}else if(e&&this.Er(),s){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.ne)?void 0:h.hasPendingTriggers(this.sessionId));this.de>0&&d&&this.Bt(),this._r(),this.Rr()}}Ue(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=null==(t=eu())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wr,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this.$e)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Ie,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:Zl(null==(i=this.Zr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Zl(null==(r=this.Zr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Zr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Zr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Zr)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==u?void 0:u.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==u?void 0:u.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==u?void 0:u.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Zl(null==u?void 0:u.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Zl(null==u?void 0:u.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Zl(null==(a=eu())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=eu())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[Qt]:!!this.ae,[Kt]:this.ke}}qr(){var t;if(!this.ae){this.ke=!0;var e,i,r,s,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},l=this._instance.config.session_recording;for(var u of Object.entries(l||{})){var d=u[0],v=u[1];if(d in o)if("maskInputOptions"===d)o.maskInputOptions=n({password:!0},v);else if("sampling"===d){var c=null!=v?v:{},f={};Te(c.mousemove)||(f.mousemove=c.mousemove),Te(c.mouseInteraction)||(f.mouseInteraction=c.mouseInteraction),o.sampling=f}else o[d]=v}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=n({},o.slimDOMOptions,{script:!0})),this.cr&&this.cr.enabled&&(o.recordCanvas=!0,o.sampling=n({},o.sampling,{canvas:this.cr.fps}),o.dataURLOptions={type:"image/webp",quality:this.cr.quality},o.canvasResolutionScale=this.hr,o.canvasMasking={configured:()=>{var t;return Se(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,i=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Se(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Me||(this.Me=!0,Xl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ur&&(o.maskAllInputs=null===(e=this.ur.maskAllInputs)||void 0===e||e,o.maskTextSelector=null!==(i=this.ur.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(r=this.ur.blockSelector)&&void 0!==r?r:void 0,o.maskAllElementAttributes=null!==(s=this.ur.maskAllElementAttributes)&&void 0!==s&&s),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Xl.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.lr();var p=iu();if(p){this.Ur=null!==(t=this.Ur)&&void 0!==t?t:new ua(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var i="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Xl.info(i,{node:e}),this.log("[SessionRecording] "+i,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Ir,onDroppedOversizedMutation:t=>{0===this.fe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.fe+=1,this.pe+=t},requestFullSnapshot:()=>this.Bt()});var g=this.pr();if(this.ae=p(n({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,Xl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.ae)return this.we=!0,void Xl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==l?void 0:l.captureJsonLd)&&h&&null!=a&&a.MutationObserver&&!this.Sr&&(this.Sr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=xl,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?Ml:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!Vl(r,e.blockClass,e.blockSelector)}}(t,i),a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Vl(t,e.blockClass,e.blockSelector)||Vl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e,i){if(void 0===e&&(e=Ml),!t||t.length>xl)return null;try{var r=JSON.parse(t),n={maskUrl:i,remainingNodes:2048,exceeded:!1},s=ke(r)?r.map(t=>zl(t,e,n)):zl(r,e,n);if(n.exceeded||Ee(s)||ke(s)&&(!s.length||s.some(Ee)))return null;var o=JSON.stringify(s);return o.length>2e4?null:[s,o]}catch(t){return null}}(e.text,o,i.maskUrl);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Ee(a))return void r.set(e,h);if(r.get(e)!==h){if(h.length>s)return void(s=0);i.emit(u)&&(r.set(e,h),s-=h.length)}}catch(t){return}};try{var l=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Gl(t))a(e)};for(var i of t)if("childList"===i.type)Ul(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&Ul(r)&&a(r)}else"attributes"===i.type&&Ul(i.target)&&a(i.target)}catch(t){return}});return l.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Gl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(h,a.MutationObserver,{maskUrl:t=>this.mr(t),attributeFilter:o.attributeFilter,blockClass:o.blockClass,blockSelector:o.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:o.maskAllElementAttributes,maskAttributeFn:o.maskAttributeFn,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wr()},emit:t=>this.kr(t)}),this.Y.isCurrentUrlBlocked()&&this.Sr.scan()),this.ue=Date.now(),this.ce=Fe(this.ce)?this.ce:"unknown",this.tryAddCustomEvent("$remote_config_received",this.re),this.Vt("$session_options",{sessionRecordingOptions:o,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}else Xl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}},Su=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),xu=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),Cu=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),Tu=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Mu=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Iu=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),Eu=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function Ru(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Au={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Pu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Fu={};function Ou(t){if(Fu[t])return Fu[t];var e=function(t){var e,i,r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(i=e.__symbol__)||void 0===i?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Au?Au[t]:void 0,n=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(i,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in Pu?Pu[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof i[t]&&(null===(e=i[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&o)return Fu[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Ru(t,"AppleWebKit")&&!Ru(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Fu[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var $u=Object.create(null);function Du(t,e,i){var r,n=$u[t],s=n[i];if(s)return s.call(e);var o=Ou(t),a=null===(r=Object.getOwnPropertyDescriptor(o,i))||void 0===r?void 0:r.get;return a?(n[i]=a,a.call(e)):e[i]}$u.Node=Object.create(null),$u.ShadowRoot=Object.create(null),$u.MutationObserver=Object.create(null),$u.Element=Object.create(null);var Lu,Nu={};function qu(t,e,i){var r=t+"."+String(i);if(Nu[r])return Nu[r].bind(e);var n=Ou(t)[i];return"function"!=typeof n?e[i]:(Nu[r]=n,n.bind(e))}function ju(){return Ou("MutationObserver").constructor}function Bu(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=t[e],o=i(r);o;){if(o.next===s)return void(o.next=n.next);o=i(r=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var Hu={childNodes:t=>Du("Node",t,"childNodes"),parentNode:t=>Du("Node",t,"parentNode"),parentElement:t=>Du("Node",t,"parentElement"),textContent:t=>Du("Node",t,"textContent"),isConnected(t){if(void 0===Lu){var e,i=null===(e=Object.getOwnPropertyDescriptor(Ou("Node"),"isConnected"))||void 0===e?void 0:e.get;Lu=(null==i?void 0:i.toString().includes("[native code]"))?i:null}return null==Lu?void 0:Lu.call(t)},contains:(t,e)=>qu("Node",t,"contains")(e),getRootNode:t=>qu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Du("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Du("Element",t,"shadowRoot"):null,querySelector:(t,e)=>qu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>qu("Element",t,"querySelectorAll")(e),mutationObserver:ju,patch:Bu};function zu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Uu=0;function Wu(){Uu+=1}function Vu(){return Uu}function Gu(t,e){return(e!==Uu||t>6e4)&&!0}var Zu=0,Ju=0,Qu=0,Ku={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Xu=null,Yu=null,th=[],eh=0,ih=0,rh={slowestBatchMs:0},nh={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function sh(t){(Zu+=1)>1||(Ku={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},th=[],eh=0,Yu=(t=>t&&t>0?t:null)(t),Ju=zu(),Qu=Uu)}function oh(){return 0===Zu?Xu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Zu-=1)>0?Ku:(Ku.durationMs=zu()-Ju,Ku.deferredStylesheetCount=eh,nh.deferredCount+=eh,Yu=null,Gu(Ku.durationMs,Qu)?Ku:Xu=Ku)}function ah(t,e,i){var r=t.length;if(i>=32)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=ah(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=ah(l,e,i+1))}}}catch(t){}}return r}function lh(t){if(0!==Zu){var e=ah(t,null,0);Ku.cssRuleCount+=e,ih>0&&(Ku.nonDeferrableCssRuleCount+=e)}}function uh(t){ih+=1;try{return t()}finally{ih-=1}}function hh(t){Zu>0&&(Ku.stylesheetMs+=t)}function dh(t){if(0===Zu||null===Yu)return!1;var e=Ku.cssRuleCount-Ku.nonDeferrableCssRuleCount;return e>=Yu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),ah(e,i,0)}catch(t){return 0}}(t)>Yu}function vh(){nh.failedCount+=1}function ch(t){t>0&&(nh.abandonedCount+=t)}function fh(t){return fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fh(t)}function ph(t,e,i){return(e=function(t){var e=function(t){if("object"!=fh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=fh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fh(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function gh(t){return t.nodeType===t.ELEMENT_NODE}function mh(t){var e=t&&"host"in t&&"mode"in t&&Hu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Hu.shadowRoot(e)===t)}function yh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function bh(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function _h(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}var wh=0;function kh(t){var e=0===wh,i=e?zu():0;wh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;lh(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),bh(Array.from(r,t=>Sh(t,n)).join(""))}catch(t){return null}finally{wh-=1,e&&hh(zu()-i)}}function Sh(t,e){if(Ch(t)){var i;try{i=kh(t.styleSheet)||_h(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return Bh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return Th(t)&&t.selectorText.includes(":")&&(n=xh(n)),e?Bh(n,e):n}function xh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Ch(t){return"styleSheet"in t}function Th(t){return"selectorText"in t}var Mh=/^-?[A-Za-z_][\w-]*$/,Ih=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Eh(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){try{var r;try{r=i||_h(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=Bh(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&Ch(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void o(t,i,null)}if(!function(t,i){try{var r=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(Th(t)){if("number"==typeof e.type&&1!==e.type)return null;var i=e.style?e.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Mh.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?Mh.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Ih.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===r)return!1;var n=i.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Bh(r,n):r,fixColons:"sheet"===i.kind&&Th(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&Th(i)&&i.selectorText.includes(":")&&(s=xh(s)),t.parts.push(t.sheetHref?Bh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;lh(i);var r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);var s=Array.from(i);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){for(var i=[{sheet:e,rules:t,index:0}],r=function(){var t=i[i.length-1];if(t.index>=t.rules.length)return i.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Ch(e)||n.has(e))return 0;var r=null;try{r=e.styleSheet}catch(t){return n.set(e,null),0}if(!r||i.some(t=>t.sheet===r))return 0;try{var s=r.rules||r.cssRules;if(!s)return 0;lh(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=zu(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?xh(h):h}else u=bh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{hh(zu()-n)}return i},text:()=>i?r:null,remainingRules(){if(i)return 0;var t=0;for(var r of e)t+=r.rules.length-r.index;return t}}}var Rh=class{constructor(){ph(this,"idNodeMap",new Map),ph(this,"nodeMetaMap",new WeakMap)}getId(t){var e,i;return t&&null!==(e=null===(i=this.getMeta(t))||void 0===i?void 0:i.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),gh(t)){var i=Hu.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ah(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Ph(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Ph(t){return t.toLowerCase()}var Fh=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function Oh(t){var e=t.element,i=t.name,r=t.value,n=t.maskAttributeFn,s=t.isGenerated;return r?t.maskAllElementAttributes?void 0!==s&&s&&Fh.has(Ph(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var $h="__rrweb_original__";function Dh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ph(e):null}catch(t){return null}}var Lh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nh=/^(?:[a-z+]+:)?\/\//i,qh=/^www\..*/i,jh=/^(data:)([^,]*),(.*)/i;function Bh(t,e){return(t||"").replace(Lh,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Nh.test(l)||qh.test(l))return"url("+u+l+u+")";if(jh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"})}var Hh,zh,Uh=new Map,Wh=1,Vh=new RegExp("[^a-z0-9-_:]");function Gh(){return Wh++}var Zh=/^[^ \t\n\r\u000c]+/,Jh=/^[, \t\n\r\u000c]+/,Qh=new WeakMap;function Kh(t,e){return e&&""!==e.trim()?Xh(t,e):e}function Xh(t,e){var i=Qh.get(t);if(i||(i=t.createElement("a"),Qh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Yh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function td(t,e,i,r,n,s){if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o,a=null===(o=n.sheet)||void 0===o?void 0:o.href;if(a)return a}var l=Kh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=Uh.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(Uh.size>=10){var u=Uh.keys().next().value;void 0!==u&&Uh.delete(u)}return Uh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Yh(u,s)}if("image"===e)return Yh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Kh(t,r);return"image"===e&&h.startsWith("data:")?Yh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(Jh),e.length>i;){var s=r(Zh);if(","===s.slice(-1))s=Kh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Kh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?Bh(r,Xh(t)):"object"===e&&"data"===i?Kh(t,r):r:Kh(t,r)}function ed(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function id(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&id(Hu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&id(Hu.parentNode(t),e,i)}function rd(t,e,i,r){var n;if(gh(t)){if(!Hu.childNodes(n=t).length)return!1}else{if(null===Hu.parentElement(t))return!1;n=Hu.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(id(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function nd(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var sd=new Map;function od(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function ad(t){return null==t?"":t.toLowerCase()}var ld=!1,ud=!1;function hd(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,_=e.dataURLOptions,w=void 0===_?{}:_,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,M=e.onSerialize,I=e.onIframeLoad,E=e.iframeLoadTimeout,R=void 0===E?5e3:E,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,z=void 0===H?50:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return ud=!0,ld||(ld=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+z+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;U||(U=rd(t,o,a,void 0===U)),Zu>0&&(Ku.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,_=e.newlyAddedElement,w=void 0!==_&&_,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Eu.Document,childNodes:[],compatMode:t.compatMode}:{type:Eu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Eu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i=e.doc,r=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,o=e.maskInputFn,a=e.maskAllElementAttributes,l=void 0!==a&&a,u=e.maskAttributeFn,h=e.dataURLOptions,d=void 0===h?{}:h,v=e.inlineImages,c=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ph(t.tagName);return Vh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];ed(_,C.name)||(k[C.name]=td(i,_,Ph(C.name),C.value,t,d))}if("link"===_&&r&&!b){var T=t.sheet;if(!T){var M=function(t){return t.href}(t);M&&!(T=od(i,M))&&M.includes(".css")&&(T=od(i,window.location.origin+"/"+M.replace(window.location.href,"")))}var I=null;T&&(dh(T)?Zu>0&&(th.push(t),eh+=1):I=kh(T)),I&&(delete k.rel,delete k.href,k._cssText=I)}if("style"===_&&t.sheet&&!(t.innerText||Hu.textContent(t)||"").trim().length){var E=uh(()=>kh(t.sheet));E&&(k._cssText=E)}if("input"===_||"textarea"===_||"select"===_){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Ah({element:t,type:Dh(t),tagName:_,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===_&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===_&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===_&&c&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array(($h in n?n[$h]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var P=t.toDataURL(d.type,d.quality),F=i.createElement("canvas");F.width=t.width,F.height=t.height,P!==F.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var O,D,L=!1;if("img"===_&&v){Hh||(Hh=i.createElement("canvas"),zh=Hh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Oh({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,H=()=>{nd(N,"load",H);try{Hh.width=N.naturalWidth,Hh.height=N.naturalHeight,zh.drawImage(N,0,0);var t=Hh.toDataURL(d.type,d.quality);k.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?k.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H)}if("audio"===_||"video"===_){var z=k;z.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),z.rr_mediaCurrentTime=t.currentTime,z.rr_mediaPlaybackRate=t.playbackRate,z.rr_mediaMuted=t.muted,z.rr_mediaLoop=t.loop,z.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),b){var U,W,V,G=t.getBoundingClientRect(),Z=G.width,J=G.height,Q=G.left,K=G.top,X=null===(U=i.defaultView)||void 0===U?void 0:U.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:J+"px",rr_left:Math.floor(Q+((null===(W=i.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=i.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),X&&(k.rr_position=X.position||"static",w.add("rr_position"),X.transform&&"none"!==X.transform&&(k.rr_transform=X.transform,w.add("rr_transform")),X.display&&X.display.startsWith("inline")&&(k.rr_display=X.display,w.add("rr_display")))}if("iframe"!==_||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var Y of Object.entries(k)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(k[tt]=Oh({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(_)&&(O=!0)}catch(t){}return{type:Eu.Element,tagName:_,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:O}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=Hu.parentNode(t),o=s&&s.tagName,a=Hu.textContent(t),l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var h;if(t.nextSibling||t.previousSibling);else if(dh(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=kh(s.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(a=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}a=Bh(a,Xh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,Hu.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Eu.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Eu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Eu.Comment,textContent:Hu.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn:L,newlyAddedElement:q});if(!Z)return console.warn(t,"not serialized"),null;G=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===Eu.Comment)return!0;if(t.type===Eu.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e,i;try{i=new URL(t,window.location.href)}catch(t){return null}var r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ad(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ad(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ad(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ad(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ad(t.attributes.property).match(/^(og|twitter|fb):/)||ad(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ad(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(ad(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ad(t.attributes.name))||ad(t.attributes.property).match(/^article:/)||ad(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ad(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===Eu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Gh();var J=Object.assign(Z,{id:G});if(r.add(t,J),-2===G)return null;M&&M(t);var Q=!u;if(J.type===Eu.Element){Q=Q&&!J.needBlock,delete J.needBlock;var K=Hu.shadowRoot(t);K&&yh(K)&&(J.isShadowHost=!0)}if((J.type===Eu.Document||J.type===Eu.Element)&&Q){b.headWhitespace&&J.type===Eu.Element&&"head"===J.tagName&&(V=!1);var X={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z};if(J.type===Eu.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(Hu.childNodes(t))){var tt=hd(Y,X);tt&&J.childNodes.push(tt)}var et=null;if(gh(t)&&(et=Hu.shadowRoot(t)))for(var it of Array.from(Hu.childNodes(et))){var rt=hd(it,X);rt&&(yh(et)&&(rt.isShadow=!0),J.childNodes.push(rt))}}var nt=Hu.parentNode(t);if(nt&&mh(nt)&&yh(nt)&&(J.isShadow=!0),J.type===Eu.Element&&"iframe"===J.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),nd(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?nd(t,"load",o):(a=!0,nd(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(c),nd(t,"load",o)}}return t.addEventListener("load",o),()=>{nd(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&I){var i=hd(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B+1,maxDepth:z});i&&I(t,i)}},R);null==A||A(t,st)}return J.type===Eu.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,l,u){if(!sd.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,_=()=>{if(!g){g=!0;try{(()=>{if(P){var e=hd(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:I,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:O,keepIframeSrcFn:L,depth:B,maxDepth:z});e&&P(t,e)}})()}finally{sd.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),sd.set(e,v)}}}(t,0,O),J}function dd(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var vd=class t{constructor(){ph(this,"parentElement",null),ph(this,"parentNode",null),ph(this,"ownerDocument",void 0),ph(this,"firstChild",null),ph(this,"lastChild",null),ph(this,"previousSibling",null),ph(this,"nextSibling",null),ph(this,"ELEMENT_NODE",1),ph(this,"TEXT_NODE",3),ph(this,"nodeType",void 0),ph(this,"nodeName",void 0),ph(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function cd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>fd(i,t,e,r)}function fd(t,e,i,r){pd(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function pd(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function gd(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var md="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",yd={map:{},getId(){return console.error(md),-1},getNode(){return console.error(md),null},removeNodeFromMap(){console.error(md)},has(){return console.error(md),!1},reset(){console.error(md)}};function bd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout(()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)},u))}}function _d(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout(()=>{try{i.set.call(this,t)}catch(t){}},0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>_d(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(yd=new Proxy(yd,{get(t,e,i){return"map"===e&&console.error(md),Reflect.get(t,e,i)}}));var wd=Date.now;function kd(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=Hu.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(i=s.body)||void 0===i?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null===(r=Hu.parentElement(s.body))||void 0===r?void 0:r.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function Sd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function xd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Cd(t){return t?t.nodeType===t.ELEMENT_NODE?t:Hu.parentElement(t):null}function Td(t,e,i,r){if(!t)return!1;var n=Cd(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(id(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function Md(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function Id(t,e){if(mh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Hu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Id(r,e))}function Ed(t){return Boolean(t.changedTouches)}function Rd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ad(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Pd(t){return!!t&&(t instanceof vd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Hu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(wd=()=>(new Date).getTime());var Fd=class{constructor(){ph(this,"id",1),ph(this,"styleIDMap",new WeakMap),ph(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Od(t){var e,i=null;return"getRootNode"in t&&(null===(e=Hu.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Hu.host(Hu.getRootNode(t))&&(i=Hu.host(Hu.getRootNode(t))),i}function $d(t){var e=t.ownerDocument;if(!e)return!1;if(Hu.contains(e,t))return!0;var i=Hu.isConnected(t);return"boolean"==typeof i?i:function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Od(i);)i=e;return i}(t);return Hu.contains(e,i)}(t)}function Dd(t){return"__ln"in t}var Ld,Nd=class{constructor(){ph(this,"length",0),ph(this,"head",null),ph(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Dd(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Dd(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},qd=(t,e)=>t+"@"+e,jd=class{constructor(){ph(this,"frozen",!1),ph(this,"locked",!1),ph(this,"texts",[]),ph(this,"attributes",[]),ph(this,"attributeMap",new WeakMap),ph(this,"generatedAttributes",new WeakMap),ph(this,"removes",[]),ph(this,"mapRemoves",new Set),ph(this,"movedMap",{}),ph(this,"addedSet",new Set),ph(this,"movedSet",new Set),ph(this,"droppedSet",new Set),ph(this,"removesSubTreeCache",new Set),ph(this,"mutationCb",void 0),ph(this,"blockClass",void 0),ph(this,"blockSelector",void 0),ph(this,"maskTextClass",void 0),ph(this,"maskTextSelector",void 0),ph(this,"inlineStylesheet",void 0),ph(this,"maskInputOptions",void 0),ph(this,"maskTextFn",void 0),ph(this,"maskInputFn",void 0),ph(this,"maskAllElementAttributes",void 0),ph(this,"maskAttributeFn",void 0),ph(this,"keepIframeSrcFn",void 0),ph(this,"recordCanvas",void 0),ph(this,"canvasMaskingConfigured",void 0),ph(this,"inlineImages",void 0),ph(this,"slimDOMOptions",void 0),ph(this,"dataURLOptions",void 0),ph(this,"doc",void 0),ph(this,"mirror",void 0),ph(this,"iframeManager",void 0),ph(this,"stylesheetManager",void 0),ph(this,"shadowDomManager",void 0),ph(this,"canvasManager",void 0),ph(this,"processedNodeManager",void 0),ph(this,"unattachedDoc",void 0),ph(this,"canvasManagerReleased",!1),ph(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),ph(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=zu(),r=Vu();try{this.processBufferedMutations()}finally{t=zu()-i,e=r,Zu>0||Gu(t,null!=e?e:Uu)||t>rh.slowestBatchMs&&(rh.slowestBatchMs=t)}}}),ph(this,"processBufferedMutations",()=>{var t,e=[],i=new Set,r=new Nd,n=t=>{for(var e=t,i=-2;-2===i;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},s=s=>{var o=Hu.parentNode(s);if(o&&$d(s)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=mh(o)?this.mirror.getId(Od(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);null!=t||(t={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Rd(t,this.mirror)&&this.iframeManager.addIframe(t),Ad(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Pd(t)&&!Td(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Hu.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});var u=hd(s,t);u&&(e.push({parentId:a,nextId:l,node:u}),i.add(u.id))}};for(var o of this.mapRemoves)this.mapRemoves.delete(o),this.mirror.removeNodeFromMap(o);for(var a of this.movedSet)Hd(this.removesSubTreeCache,a)&&!this.movedSet.has(Hu.parentNode(a))||s(a);for(var l of this.addedSet)zd(this.droppedSet,l)||Hd(this.removesSubTreeCache,l)?zd(this.movedSet,l)?s(l):this.droppedSet.add(l):s(l);for(var u=null;r.length;){var h=null;if(u){var d=this.mirror.getId(Hu.parentNode(u.value)),v=n(u.value);-1!==d&&-1!==v&&(h=u)}if(!h)for(var c=r.tail;c;){var f=c;if(c=c.previous,f){var p=this.mirror.getId(Hu.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=Hu.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=Hu.host(g);if(-1!==this.mirror.getId(m)){h=f;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}u=h.previous,r.removeNode(h.value),s(h.value)}var y={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,i=Hu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,o=n[0],a=n[1];"string"!=typeof a&&null!==a||(e[o]=Oh({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&this.mutationCb(y)}),ph(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),ph(this,"genTextAreaValueMutation",t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var i=Array.from(Hu.childNodes(t),t=>Hu.textContent(t)||"").join("");e.attributes.value=Ah({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Dh(t),value:i,maskInputFn:this.maskInputFn})}),ph(this,"processMutation",t=>{if(!Md(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Hu.textContent(t.target);Td(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:rd(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Cd(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i,r=t.target,n=t.attributeName,s=null!==(i=t.attributeNamespace)&&void 0!==i?i:null,o=function(t,e,i){if(!i)return e;var r=t.getAttributeNodeNS(i,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===i)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===i)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===i)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(i);return n?n+":"+e:e}(r,n,s),a=s?r.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===o){var l=r,u=Dh(l);a=Ah({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(Td(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===r.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(a)&&r.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ed(r.tagName,o)){var v,c=td(this.doc,Ph(r.tagName),Ph(o),a,r,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(a)&&(o="rr_src"),h.attributes[o]=c,null===(v=this.generatedAttributes.get(t.target))||void 0===v||v.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=r.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";var _=this.generatedAttributes.get(t.target);_||this.generatedAttributes.set(t.target,_=new Set),_.add("rr_open_mode")}}break;case"childList":if(Td(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{var i=this.mirror.getId(e),r=mh(t.target)?this.mirror.getId(Hu.host(t.target)):this.mirror.getId(t.target);Td(t.target,this.blockClass,this.blockSelector,!1)||Md(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Bd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Id(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[qd(i,r)]?Bd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!mh(t.target)||!yh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Hu.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),ph(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Md(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[qd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!Td(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var r=Hu.childNodes(t),n=0,s=r.length;s>n;n++){var o=r[n];o&&this.genAdds(o)}if(Pd(t))for(var a=Hu.childNodes(Hu.shadowRoot(t)),l=0,u=a.length;u>l;l++){var h=a[l];h&&(this.processedNodeManager.add(h,this),this.genAdds(h,t))}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(var t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){for(var e=this.blockClass,i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(i&&(i.lastIndex=0),Td(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?Hu.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?Hu.host(r):null}return!1}};function Bd(t,e){for(var i=[e];i.length;){var r=i.pop();if(t.delete(r),r.nodeType!==r.TEXT_NODE)for(var n=Hu.childNodes(r),s=0,o=n.length;o>s;s++){var a=n[s];a&&i.push(a)}}}function Hd(t,e,i){return 0!==t.size&&function(t,e){var i=Hu.parentNode(e);return!!i&&t.has(i)}(t,e)}function zd(t,e){if(0===t.size)return!1;for(var i=Hu.parentNode(e);i;){if(t.has(i))return!0;i=Hu.parentNode(i)}return!1}var Ud=function(t,e){return void 0===e&&(e="rrweb"),Ld?function(){try{return t(...arguments)}catch(t){if(Ld&&!0===Ld(t,e))return;throw t}}:t},Wd=[];function Vd(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Gd(t,e){var i,r=new jd;r.init(t);try{i=new(ju())(Ud(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),Wd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Zd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Vd(t);if(o&&!Td(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=kd(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[cd("scroll",Ud(bd(Ud(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(cd("scrollend",Ud(l),i)),()=>u.forEach(t=>t())}function Jd(t,e){for(var i=Wd.length-1;i>=0;i--){var r=Wd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Wd.splice(i,1))}}}var Qd=["INPUT","TEXTAREA","SELECT"],Kd=new WeakMap;function Xd(t){return function t(e,i){if(iv("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||iv("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||iv("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||iv("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function Yd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function tv(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Hu.host(e));var o="#document"===e.nodeName?null===(i=e.defaultView)||void 0===i?void 0:i.Document:null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&a?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var i;e=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Ud(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function ev(t,e){void 0===e&&(e={});var i,r,s=t.doc.defaultView;if(!s)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var o=[],a=Ud(()=>{try{if(r)try{r.destroy(),r.reset()}finally{var e=Wd.indexOf(r);-1!==e&&Wd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{gd(o)}});try{if(t.recordDOM){var l=Gd(t,t.doc);i=l.observer,r=l.buffer}if(o.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=bd(Ud(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=Ud(bd(Ud(t=>{var e=Vd(t),i=Ed(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=wd()),l.push({x:r,y:o,id:n.getId(e),timeOffset:wd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?xu.Drag:t instanceof MouseEvent?xu.MouseMove:xu.TouchMove)}),o,{trailing:!1})),d=[cd("mousemove",h,r),cd("touchmove",h,r),cd("drag",h,r)];return Ud(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Cu).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Ph(t),l=(t=>i=>{var a=Vd(i);if(!Td(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Tu.Mouse;break;case"touch":l=Tu.Touch;break;case"pen":l=Tu.Pen}l===Tu.Touch&&(Cu[t]===Cu.MouseDown?u="TouchStart":Cu[t]===Cu.MouseUp&&(u="TouchEnd"))}else Ed(i)&&(l=Tu.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Tu.Touch||u.startsWith("Mouse")&&l===Tu.Mouse)&&(l=null)):Cu[t]===Cu.Click&&(l=h,h=null);var d=Ed(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;Ud(e)(n({type:Cu[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Cu[t]){case Cu.MouseDown:case Cu.MouseUp:a=a.replace("mouse","pointer");break;case Cu.TouchStart:case Cu.TouchEnd:return}u.push(cd(a,l,i))}),Ud(()=>{u.forEach(t=>t())})}(t)),o.push(Zd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return cd("resize",Ud(bd(Ud(()=>{var t=Sd(),e=xd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:s})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=Vd(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=Hu.parentElement(e)),e&&v&&Qd.indexOf(v)>=0&&!Td(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Dh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Ah({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach(t=>{if(t!==e){var i=t.value;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}})}}}function c(t,i){var s=Kd.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Kd.set(t,i);var o=r.getId(t);Ud(e)(n({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>cd(t,Ud(v),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>_d(t[0],t[1],{set(){Ud(v)({target:this,isTrusted:!1})}},!1,p))),Ud(()=>{gd(f)})}(t)),o.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=Ud(t=>bd(Ud(s=>{var o=Vd(s);if(o&&!Td(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}}),s.media||500)),l=[cd("play",a(Iu.Play),o),cd("pause",a(Iu.Pause),o),cd("seeked",a(Iu.Seeked),o),cd("volumechange",a(Iu.VolumeChange),o),cd("ratechange",a(Iu.RateChange),o)];return Ud(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var u=function(t){var e=new Map,i=new Set,r=!0,n=t=>{if(r)try{t()}catch(t){}},s=t=>{var i,r=e.get(t);if(r){for(;null===(i=r[0])||void 0===i?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(o))};try{d=t.setTimeout(f,5e3),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(o)))}},reset(){r=!1,i.forEach(e=>t.clearTimeout(e)),i.clear(),e.clear()}}}(s);o.push(u.reset),o.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,adds:[{rule:a,index:l}]})),l},"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,removes:[{index:a}]})),l},"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=Yd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,()=>i({id:d,styleId:v,replace:a}),()=>{var t=kh(e);null!==t&&i({id:d,styleId:v,replace:t})});try{u.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,replaceSync:a})),l},"host")}));var d={};rv("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(rv("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),rv("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),rv("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var v={};return Object.entries(d).forEach(t=>{var e=t[0],s=t[1];v[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(v[e].insertRule,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Yd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Xd(e),l];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Ud((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Yd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Xd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),Ud(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach(t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule})})}(t,{win:s,mutationQueue:u})),o.push(tv(t,t.doc)),o.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Ud((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Yd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Xd(e.parentRule);a.queueMutation(c,()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m}))}return v},"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Ud((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Yd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Xd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),Ud(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:s,mutationQueue:u})),t.collectFonts&&o.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=Bu(i.fonts,"add",function(t){return function(i){return setTimeout(Ud(()=>{var t=s.get(i);t&&(e(t),s.delete(i))}),0),t.apply(this,[i])}});return n.push(()=>{r.FontFace=o}),n.push(a),Ud(()=>{n.forEach(t=>t())})}(t))}for(var h of(o.push(function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Ud(()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Td(d,r,n,!0)||Td(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),cd("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Bu(i.customElements,"define",function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}}):()=>{}}(t)),t.plugins))o.push(h.observer(h.callback,s,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function iv(t){return void 0!==window[t]}function rv(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var nv=class{constructor(t){ph(this,"generateIdFn",void 0),ph(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ph(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,i,r))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,i))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},sv=class{constructor(t){ph(this,"iframes",new WeakMap),ph(this,"crossOriginIframeMap",new WeakMap),ph(this,"crossOriginIframeMirror",new nv(Gh)),ph(this,"crossOriginIframeStyleMirror",void 0),ph(this,"crossOriginIframeRootIdMap",new WeakMap),ph(this,"mirror",void 0),ph(this,"mutationCb",void 0),ph(this,"wrappedEmit",void 0),ph(this,"loadListener",void 0),ph(this,"pageHideListener",void 0),ph(this,"stylesheetManager",void 0),ph(this,"recordCrossOriginIframes",void 0),ph(this,"messageHandler",void 0),ph(this,"nestedIframeListeners",new Map),ph(this,"attachedWindows",new WeakMap),ph(this,"attachedDocuments",new WeakMap),ph(this,"attachedIframes",new Map),ph(this,"loadListenerDisposers",new WeakMap),ph(this,"iframeElementsById",new Map),ph(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new nv(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null===(r=this.attachedIframes.get(t))||void 0===r?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>pd(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{fd(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);pd(()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}pd(()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}}),null===(i=this.loadListener)||void 0===i||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case Su.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Su.IncrementalSnapshot,data:{source:xu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Su.Meta:case Su.Load:case Su.DomContentLoaded:return!1;case Su.Plugin:return e;case Su.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Su.IncrementalSnapshot:switch(e.data.source){case xu.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case xu.Drag:case xu.TouchMove:case xu.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case xu.ViewportResize:return!1;case xu.MediaInteraction:case xu.MouseInteraction:case xu.Scroll:case xu.CanvasMutation:case xu.Input:return this.replaceIds(e.data,t,["id"]),e;case xu.StyleSheetRule:case xu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case xu.Font:return e;case xu.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case xu.AdoptedStyleSheet:var r;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===Eu.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){var e=this.attachedIframes.get(t),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach(t=>{var e=this.nestedIframeListeners.get(t);e&&(fd(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(fd(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach(t=>{pd(()=>this.mirror.removeNodeFromMap(t))}),pd(()=>Jd(i,s)),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach((e,i)=>{this.mirror.has(i)||t.push(i)}),t.forEach(t=>this.removeIframeById(t))}}reattachIframes(){this.attachedIframes.forEach((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&fd(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{fd(e,"message",t)}),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(e=>t.add(e.element)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},ov=class{constructor(t){ph(this,"shadowDoms",new WeakSet),ph(this,"mutationCb",void 0),ph(this,"scrollCb",void 0),ph(this,"bypassOptions",void 0),ph(this,"mirror",void 0),ph(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,r;if(yh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(r=Hu.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=Gd(n({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Wd.indexOf(l);-1!==t&&Wd.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Zd(n({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(Hu.host(t))),this.restoreHandlers.push({doc:s,handler:tv({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:Bu(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=Hu.shadowRoot(this);return s&&$d(this)&&i.addShadowRoot(s,e),n}})})}reset(){this.restoreHandlers.forEach(t=>{var e=t.handler;try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}},av="skip-frame";function lv(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var uv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),dv=0;64>dv;dv++)hv[uv.charCodeAt(dv)]=dv;var vv=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=uv[i[e]>>2],n+=uv[(3&i[e])<<4|i[e+1]>>4],n+=uv[(15&i[e+1])<<2|i[e+2]>>6],n+=uv[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n},cv=new Map,fv=(t,e,i)=>{if(t&&(mv(t,e)||"object"==typeof t)){var r=function(t,e){var i=cv.get(t);return i||cv.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function pv(t,e,i,r){return t instanceof Array?t.map(t=>pv(t,e,i,r)):null===t?t:t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:vv(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[pv(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[pv(t.data,e,i,r),t.width,t.height]}:mv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:fv(t,e,i)}:t}var gv=(t,e,i,r)=>t.map(t=>pv(t,e,i,r)),mv=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(i.find(i=>t instanceof e[i]))},yv=["webgl","webgl2"];function bv(t){return"nodeType"in t}function _v(t,e,i,r){var s=[];try{if(r){var o=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return Bu(r.prototype,"configure",function(r){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||bv(o)&&Td(o,e,i,!0))return r.call(this,s);bv(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&s?n({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}})}(t,e,i);o&&s.push(o)}var a=Bu(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Td(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&yv.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function wv(t,e,i,r,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=Bu(t,l,function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(fv(d,s,this),this.canvas&&"tagName"in this.canvas&&!Td(this.canvas,r,n,!0)){var v={type:e,property:l,args:gv(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=_d(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!Td(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var kv='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Sv="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",kv],{type:"text/javascript;charset=utf-8"});function xv(t){var e;try{if(!(e=Sv&&(self.URL||self.webkitURL).createObjectURL(Sv)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(kv),{name:null==t?void 0:t.name})}}var Cv,Tv,Mv,Iv=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){ph(this,"pendingCanvasMutations",new Map),ph(this,"rafStamps",{latestId:0,invokeId:null}),ph(this,"mirror",void 0),ph(this,"mutationCb",void 0),ph(this,"resetObservers",void 0),ph(this,"frozen",!1),ph(this,"locked",!1),ph(this,"rafIdTimestamp",null),ph(this,"rafIdFlush",null),ph(this,"refCount",0),ph(this,"torndown",!1),ph(this,"resetFrameDedup",null),ph(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=_v(e,i,r,!0),h=new Map;try{a=new xv}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:Mu["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var v,c=1e3/t,f=0,p=t=>{var u,g;d||(f&&c>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Td(t,i,r,!0)||u.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),u).forEach(function(){var t=o(function*(t){var e=s.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i,r,o=t.getContext(t.__context);if(null==o||null===(i=o.isContextLost)||void 0===i?void 0:i.call(o))return void h.set(e,!1);!1===(null==o||null===(r=o.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&o.clear(o.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return av}if(void 0!==o){if(!Array.isArray(o)||!o.every(lv))return av;var a=i/n,l=r/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}})}}}(n.canvasMasking,t,v,c,u,d);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:e,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(p))};v=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null===(t=a.terminate)||void 0===t||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=_v(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=Bu(e.CanvasRenderingContext2D.prototype,o,function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Td(this.canvas,i,r,!0)||setTimeout(()=>{var i=gv(l,e,this,n);t(this.canvas,{type:Mu["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=_d(e.CanvasRenderingContext2D.prototype,o,{set(e){Td(this.canvas,i,r,!0)||t(this.canvas,{type:Mu["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)if(a(l))continue;return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...wv(e.WebGLRenderingContext.prototype,Mu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...wv(e.WebGL2RenderingContext.prototype,Mu.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,i){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==i){var s=n.map(e=>r(e,t));this.mutationCb({id:i,type:n[0].type,commands:s}),this.pendingCanvasMutations.delete(e)}}}},Ev=class{constructor(t){var e;ph(this,"trackedLinkElements",new WeakSet),ph(this,"pendingDeferredSheets",new Set),ph(this,"mutationCb",void 0),ph(this,"adoptedStyleSheetCb",void 0),ph(this,"maskAllElementAttributes",void 0),ph(this,"maskAttributeFn",void 0),ph(this,"styleMirror",new Fd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=Eh(r))}catch(t){}if(!i||!r)return vh(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=zu(),d=Vu(),v=!0;try{if(s)return a=!0,vh(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(vh(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(vh(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),Gu(l=zu()-h,null!=(u=d)?u:Uu)||(nh.totalMs+=l,l>nh.slowestSliceMs&&(nh.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null===(i=this.beginDeferredLinkInlining(t,e))||void 0===i||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Oh({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var o=zu();try{uh(()=>{try{var e=t.rules||t.cssRules;e&&lh(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:Sh(e,t.href),index:i}))})})}finally{hh(zu()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),sd.forEach(t=>t.abort()),sd.clear()}trackStylesheetInLinkElement(t){}},Rv=class{constructor(){ph(this,"nodeMap",new WeakMap),ph(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},Av=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Pv,Fv=document.createElement("iframe");document.body.appendChild(Fv),Array.from=(null===(Pv=Fv.contentWindow)||void 0===Pv?void 0:Pv.Array.from)||Array.from,document.body.removeChild(Fv)}}catch(t){console.debug("Unable to override Array.from",t)}var Ov=new Rh,$v=new Set([xu.Mutation,xu.MediaInteraction,xu.StyleSheetRule,xu.CanvasMutation,xu.Font,xu.Log,xu.StyleDeclaration,xu.AdoptedStyleSheet]);function Dv(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Lv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,s=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,l=void 0===a?"rr-block":a,u=i.blockSelector,h=void 0===u?null:u,d=i.ignoreClass,v=void 0===d?"rr-ignore":d,c=i.ignoreSelector,f=void 0===c?null:c,p=i.maskTextClass,g=void 0===p?"rr-mask":p,m=i.maskTextSelector,y=void 0===m?null:m,b=i.inlineStylesheet,_=void 0===b||b,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,M=i.maskAllElementAttributes,I=void 0!==M&&M,E=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,F=void 0===P?{}:P,O=i.dataURLOptions,D=void 0===O?{}:O,L=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,z=void 0!==H&&H,U=i.recordCrossOriginIframes,W=void 0!==U&&U,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,J=void 0!==Z&&Z,Q=i.collectFonts,K=void 0!==Q&&Q,X=i.inlineImages,Y=void 0!==X&&X,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;Ld=i.errorHandler;var ot=n({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),Ov.reset();var ut,ht=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=dd(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var vt,ct,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return A&&!lt&&(t=A(t)),t};Cv=(t,e)=>{var i,n=t;if(n.timestamp=wd(),!(null===(i=Wd[0])||void 0===i?void 0:i.isFrozen())||n.type===Su.FullSnapshot||n.type===Su.IncrementalSnapshot&&$v.has(n.data.source)||Wd.forEach(t=>t.unfreeze()),at)null==r||r(gt(n),e);else if(lt){var a={type:"rrweb",event:gt(n),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(n.type===Su.FullSnapshot)ut=n,ft=0;else if(n.type===Su.IncrementalSnapshot){if(n.data.source===xu.Mutation&&n.data.isAttachIframe)return;ft++,(o&&ft>=o||s&&n.timestamp-ut.timestamp>s)&&Tv(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,i=new Set;if(t.adds.length>0)for(var r of t.adds){var s=Ov.getNode(r.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach(t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}}),null==ct||ct(),wt.cleanupDetachedIframes()}Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Mutation},t)})},yt=t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Scroll},t)}),bt=t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.CanvasMutation},t)}),_t=new Ev({mutationCb:mt,adoptedStyleSheetCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new sv({mirror:Ov,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:Cv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Ov,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Rv,xt=null==N?void 0:N.configured;Mv=new Iv({recordCanvas:z,mutationCb:bt,win:window,blockClass:l,blockSelector:h,mirror:Ov,sampling:F.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new ov({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:Mv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Ov});Tv=function(t){if(void 0===t&&(t=!1),B){sh(w);try{Cv({type:Su.Meta,data:{href:window.location.href,width:xd(),height:Sd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Wd.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Rh:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,b=i.canvasMaskingConfigured,_=i.maskAllInputs,w=void 0!==_&&_,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,M=i.slimDOM,I=i.dataURLOptions,E=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,q=i.maxDepth,j=i.inlineStylesheetBudgetRules,B=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,H=dd(void 0!==M&&M);sh(j);try{return hd(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{oh()}}(document,{mirror:Ov,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:dt,dataURLOptions:ot,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,onSerialize(t){Rd(t,Ov)&&wt.addIframe(t),Ad(t,Ov)&&_t.trackLinkElement(t),Pd(t)&&Ct.addShadowRoot(Hu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){_t.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=th,th=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Cv({type:Su.FullSnapshot,data:{node:r,initialOffset:kd(window)}},t),Wd.forEach(t=>t.unlock()),Mv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&pd(()=>{o=e.beginDeferredLinkInlining(i,Ov.getId(i))})},u=()=>{if(o){var t=o,e=!0;pd(()=>{e=t.advance(200)}),e&&(o=null)}},h=()=>{o||l(),u()},d=t=>{if(n=null,!r){var e=0;do{try{h()}catch(t){null==o||o.discard(),o=null,ch(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Dv(d):i())}};return n=Dv(d),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);ch(v),null==o||o.discard(),o=null}i()}}}}(i,_t,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,Ov.getId(document))}finally{oh()}var s}};try{var Tt=[];for(var Mt of(Tt.push(cd("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(cd(Mt,Wu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{pd(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)}),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=Ov.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var It=t=>{var e;return Ud(ev)({mutationCb:mt,mousemoveCb:(t,e)=>Cv({type:Su.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.ViewportResize},t)}),inputCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Input},t)}),mediaInteractionCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.MediaInteraction},t)}),styleSheetRuleCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.StyleSheetRule},t)}),styleDeclarationCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Font},t)}),selectionCb(t){Cv({type:Su.IncrementalSnapshot,data:n({source:xu.Selection},t)})},customElementCb(t){Cv({type:Su.IncrementalSnapshot,data:n({source:xu.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:Y,userTriggeredOnInput:J,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Ov,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Mv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==tt||null===(e=tt.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>Cv({type:Su.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Ov.getId(t),i=It(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}}),wt.addPageHideListener(t=>{var e=Ov.getId(t);null==vt||vt(e),Jd(t)});var Et=-1,Rt=t=>Cv({type:Su.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),At=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Ov.getId(s):-1;o!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Tv();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(cd("fullscreenchange",At)),Tt.push(cd("webkitfullscreenchange",At)),Tt.push(cd("mozfullscreenchange",At)),Tt.push(cd("MSFullscreenChange",At)),Av=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(cd("DOMContentLoaded",()=>{Cv({type:Su.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(cd("load",()=>{Cv({type:Su.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,gd(Tt),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Ov.reset(),Av=!1,Ld=void 0}}catch(t){console.warn(t)}}Lv.addCustomEvent=(t,e)=>{if(!Av)throw new Error("please add custom event after start recording");Cv({type:Su.Custom,data:{tag:t,payload:e}})},Lv.freezePage=()=>{Wd.forEach(t=>t.freeze())},Lv.takeFullSnapshot=t=>{if(!Av)throw new Error("please take full snapshot after start recording");Tv(t)},Lv.mirror=Ov,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Nv=Object.create(null);function qv(t){return qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qv(t)}function jv(t,e,i){return(e=function(t){var e=function(t){if("object"!=qv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=qv(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Nv.Node=Object.create(null),Nv.ShadowRoot=Object.create(null),Nv.MutationObserver=Object.create(null),Nv.Element=Object.create(null);var Bv=class{constructor(t){jv(this,"fileName",void 0),jv(this,"functionName",void 0),jv(this,"lineNumber",void 0),jv(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},Hv=/(^|@)\S+:\d+/,zv=/^\s*at .*(\S+:\d+|\(native\))/m,Uv=/^(eval@)?(\[native code])?$/,Wv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(zv)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(zv)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop());return new Bv({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Uv)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Bv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Bv({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Bv({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var o=e.exec(i[n]);o&&r.push(new Bv({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(Hv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new Bv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function Vv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Gv(t){return Array.isArray(t)}function Zv(t){return"object"==typeof t&&null!==t&&!Gv(t)}function Jv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(Zv(t[i])&&Jv(t[i],e-1))return!0;return!1}function Qv(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Zv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||Zv(o)&&Jv(o,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Gv(u)?Vv(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Kv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Xv(t,e,i){var r,n=i?Object.assign({},Kv,i):Kv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message;t({level:"error",trace:Wv.parse(e.error).map(t=>t.toString()),payload:[Qv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[Qv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Qv("Uncaught (in promise)",n.stringifyOptions),Qv(e.reason,n.stringifyOptions)]),t({level:"error",trace:Wv.parse(i).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",h),l.push(()=>{e.removeEventListener("unhandledrejection",h)})}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach(t=>t())};function v(e,i){var r=this;return e[i]?function(e,s){try{if(!(s in e))return()=>{};var l=e[s],u={next:l},h=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=Wv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>Qv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Qv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return u.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:u}})),e[s]=h,()=>{if(e[s]!==h)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=e[s],r=t(i);r;){if(r.next===h)return void(r.next=u.next);r=t(i=r.next)}else e[s]=u.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Yv=t=>({name:"rrweb/console@1",observer:Xv,options:t}),tc=()=>{},ec=t=>{var e;if(Se(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function ic(t,e,i){try{if(!(e in t))return tc;var r={next:t[e]},n=i(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)});return Se(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e],s=ec(i);s;){if(s.next===n)return void(s.next=r.next);s=ec(i=s.next)}else t[e]=r.next}}catch(t){return tc}}function rc(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var nc=Pn("[Recorder]"),sc=t=>"navigation"===t.entryType,oc=t=>"resource"===t.entryType;function ac(t,e){return!!e&&(Fe(e)||e[t])}function lc(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var uc=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function hc(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find(t=>"content-type"===t.toLowerCase()),i=e&&r[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!lc(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(uc))return!1;if(Fe(i))return!0;if(ke(i))return n(i);var s=i[e];return Fe(s)?s:n(s)}function dc(t,e,i,r,n,s){return vc.apply(this,arguments)}function vc(){return vc=o(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(nc.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null):function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),t=>oc(t)&&t.initiatorType===e&&(Te(r)||t.startTime>=r)&&(Te(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),dc(t,e,i,r,n,s+1))}),vc.apply(this,arguments)}function cc(t){var e=t.body,i=t.options,r=t.url;if(Re(e))return null;var n=rc(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Me(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Oe(e))return Zn(e);if(xe(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var fc=t=>!Ee(t)&&("navigation"===t.entryType||"resource"===t.entryType);function pc(t){var e=t.entry,i=t.method,r=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(a||0)),c=[n({},e?e.toJSON():{name:u},{startTime:Te(a)?void 0:Math.round(a),endTime:Te(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:r,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(fc(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var gc=["video/","audio/"];function mc(t){return xe(t)&&Se(t.getReader)&&Se(t.tee)}var yc="[SessionReplay] Timeout while trying to read body",bc="[SessionReplay] Failed to read body";function _c(t){return bc+": "+t}function wc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function kc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(yc),500);try{t.clone().text().then(t=>e(t),t=>e(_c(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(bc)}})}(t);var i=zs(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(wc(i)):function(t,e){return new Promise(i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch(()=>{})}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout(()=>o(yc),500);try{a=t.clone()}catch(t){return void o(bc)}var u=a.body;if(mc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(bc)}var h=[],d=0;!function t(){r.read().then(i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(wc(e));d+=a.byteLength,h.push(a)}t()}},t=>o(_c(t)))}()}else try{a.text().then(t=>o(t),t=>o(_c(t)))}catch(t){o(bc)}})}(t,i)}function Sc(){return Sc=o(function*(t){var e=t.r,i=t.options,r=rc(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):kc(e,i)}),Sc.apply(this,arguments)}function xc(){return xc=o(function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=gc.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=rc(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Ee(r)?kc(e,i):Promise.resolve(r)}),xc.apply(this,arguments)}var Cc=null;function Tc(t,e,i){if(!("performance"in e))return()=>{};if(Cc)return nc.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Us,i):Us,s=e=>{var i=[],s=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!s){var n=r.maskRequestFn(t);e||(s=!n||(t=>!!t&&Xs.has(t))(n)),n&&i.push(n)}}),i.length>0&&t(n({},e,{requests:i}))},a=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>sc(t)||oc(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>pc({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>sc(t)||oc(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>pc({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>i.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:n}),()=>{r.disconnect()}}(s,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=ac("request",i.recordHeaders),n=ac("response",i.recordHeaders),s=ic(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(hc({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=cc({body:t,options:i,url:a})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)}),n&&(p.responseHeaders=r),hc({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=cc({body:d.response,options:i,url:a})),dc(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:pc({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){nc.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(s,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=ac("request",i.recordHeaders),n=ac("response",i.recordHeaders),s=ic(e,"fetch",s=>function(){var a=o(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return nc.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach((t,e)=>{c[e]=t}),r&&(v.requestHeaders=c),!mc(null==a?void 0:a.body)&&hc({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return Sc.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){nc.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=lc(o)?yield s(l):yield s(o,a),d=e.performance.now();try{var f={};u.headers.forEach((t,e)=>{f[e]=t}),n&&(v.responseHeaders=f),hc({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return xc.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){nc.error("Failed to record fetch response for network capture",t)}return u}finally{dc(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:pc({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return a.apply(this,arguments)}}());return()=>{s()}}(s,e,r)),Cc=()=>{a(),l(),u(),Cc=null}}var Mc,Ic,Ec,Rc,Ac,Pc,Fc,Oc,$c,Dc,Lc,Nc,qc,jc,Bc,Hc=t=>({name:"rrweb/network@1",observer:Tc,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Yv,getRecordNetworkPlugin:Hc},b.__PosthogExtensions__.rrweb={record:Lv,version:"v2",wasMaxDepthReached:()=>ud,resetMaxDepthState(){ud=!1,ld=!1},getLastSnapshotCost:()=>Xu,getMutationCost:()=>n({},rh),resetSnapshotCostState(){Zu=0,Ju=0,Qu=0,Uu=0,Ku={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Xu=null,Yu=null,th=[],eh=0,ih=0,rh={slowestBatchMs:0},nh={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Lv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:Yv},b.getRecordNetworkPlugin=Hc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new ku(t,e);var zc,Uc,Wc,Vc,Gc={},Zc=[],Jc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qc=Array.isArray;function Kc(t,e){for(var i in e)t[i]=e[i];return t}function Xc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Yc(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Mc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return tf(t,o,r,n,null)}function tf(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Ec:n,__i:-1,__u:0};return null==n&&null!=Ic.vnode&&Ic.vnode(s),s}function ef(t){return t.children}function rf(t,e){this.props=t,this.context=e}function nf(t,e){if(null==e)return t.__?nf(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?nf(t):null}function sf(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Kc({},e);s.__v=e.__v+1,Ic.vnode&&Ic.vnode(s),pf(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?nf(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,mf(r,s,n),e.__e=e.__=null,s.__e!=i&&of(s)}}function of(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),of(t)}function af(t){(!t.__d&&(t.__d=!0)&&Rc.push(t)&&!lf.__r++||Ac!=Ic.debounceRendering)&&((Ac=Ic.debounceRendering)||Pc)(lf)}function lf(){try{for(var t,e=1;Rc.length;)Rc.length>e&&Rc.sort(Fc),t=Rc.shift(),e=Rc.length,sf(t)}finally{Rc.length=lf.__r=0}}function uf(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Zc,b=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=tf(null,o,null,null,null):Qc(o)?o=t.__k[s]=tf(ef,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=tf(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=df(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&!(2&a.__u)&&(a.__e==r&&(r=nf(a)),_f(a,a));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Gc,c.__i=d,g=pf(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&bf(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=hf(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function hf(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=hf(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=nf(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function df(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&!(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&!(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function vf(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Jc.test(e)?i:i+"px"}function cf(t,e,i,r,n){var s,o;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||vf(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||vf(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Lc,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Dc]=r[Dc]:(i[Dc]=Nc,t.addEventListener(e,s?jc:qc,s)):t.removeEventListener(e,s?jc:qc,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function ff(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[$c])e[$c]=Nc++;else if(i[Dc]>e[$c])return;return i(Ic.event?Ic.event(e):e)}}}function pf(t,e,i,r,n,s,o,a,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=Ic.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new rf(y,_),v.constructor=C,v.render=wf),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Kc({},v.__s)),Kc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(t){t&&(t.__=e)}),Zc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,p,g)})}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=Ic.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Zc.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++k);v.state=v.__s,null!=v.getChildContext&&(r=Kc(Kc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===ef&&null==h.key?yf(h.props.children):h,a=uf(t,Qc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)Xc(s[x]);gf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||gf(e);Ic.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||Gc,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Ic.__m&&Ic.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Mc.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||cf(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:a&&"function"!=typeof c||g[u]===c||cf(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),uf("template"==e.type?t.content:t,Qc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&nf(i,0),a,l),null!=s)for(u=s.length;u--;)Xc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&cf(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&cf(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Ic.diffed)&&h(e),128&e.__u?void 0:a}function gf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(gf))}function mf(t,e,i){for(var r=0;i.length>r;r++)bf(i[r],i[++r],i[++r]);Ic.__c&&Ic.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){Ic.__e(t,e.__v)}})}function yf(t){return"object"!=typeof t||null==t||t.__b>0?t:Qc(t)?t.map(yf):void 0!==t.constructor?null:Kc({},t)}function bf(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Ic.__e(t,i)}}function _f(t,e,i){var r,n;if(Ic.unmount&&Ic.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||bf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Ic.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&_f(r[n],e,i||"function"!=typeof t.type);i||Xc(t.__e),t.__c=t.__=t.__e=void 0}function wf(t,e,i){return this.constructor(t,i)}function kf(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),Ic.__&&Ic.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],pf(e,t=(!r&&i||e).__k=Yc(ef,null,[t]),n||Gc,Gc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?Mc.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),mf(s,t,o),t.props.children=null}Mc=Zc.slice,Ic={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Ec=0,rf.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Kc({},this.state);"function"==typeof t&&(t=t(Kc({},i),this.props)),t&&Kc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),af(this))},rf.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),af(this))},rf.prototype.render=ef,Rc=[],Pc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fc=function(t,e){return t.__v.__b-e.__v.__b},lf.__r=0,Oc=Math.random().toString(8),$c="__d"+Oc,Dc="__a"+Oc,Lc=/(PointerCapture)$|Capture$/i,Nc=0,qc=ff(!1),jc=ff(!0),Bc=0;var Sf=0,xf=[],Cf=Ic,Tf=Cf.__b,Mf=Cf.__r,If=Cf.diffed,Ef=Cf.__c,Rf=Cf.unmount,Af=Cf.__;function Pf(t,e){Cf.__h&&Cf.__h(Uc,t,Sf||e),Sf=0;var i=Uc.__H||(Uc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Ff(t){return Sf=1,function(t,e){var i=Pf(zc++,2);if(i.t=t,!i.__c&&(i.__=[Uf(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Uc,!Uc.__f)){var r=function(t,e,r){if(!i.__c.__H)return!0;var s=!1,o=i.__c.props!==t;if(i.__c.__H.__.some(function(t){if(t.__N){s=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),n){var a=n.call(this,t,e,r);return s?a||o:a}return!s||o};Uc.__f=!0;var n=Uc.shouldComponentUpdate,s=Uc.componentWillUpdate;Uc.componentWillUpdate=function(t,e,i){if(this.__e){var o=n;n=void 0,r(t,e,i),n=o}s&&s.call(this,t,e,i)},Uc.shouldComponentUpdate=r}return i.__N||i.__}(Uf,t)}function Of(t,e){var i=Pf(zc++,3);!Cf.__s&&zf(i.__H,e)&&(i.__=t,i.u=e,Uc.__H.__h.push(i))}function $f(t){return Sf=5,Df(function(){return{current:t}},[])}function Df(t,e){var i=Pf(zc++,7);return zf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Lf(t){var e,i=Uc.context[t.__c],r=Pf(zc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(Uc)),i.props.value):t.__}function Nf(){for(var t;t=xf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Bf),e.__h.some(Hf),e.__h=[]}catch(i){e.__h=[],Cf.__e(i,t.__v)}}}Cf.__b=function(t){Uc=null,Tf&&Tf(t)},Cf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Af&&Af(t,e)},Cf.__r=function(t){Mf&&Mf(t),zc=0;var e=(Uc=t.__c).__H;e&&(Wc===Uc?(e.__h=[],Uc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Nf(),zc=0)),Wc=Uc},Cf.diffed=function(t){If&&If(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==xf.push(e)&&Vc===Cf.requestAnimationFrame||((Vc=Cf.requestAnimationFrame)||jf)(Nf)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Wc=Uc=null},Cf.__c=function(t,e){e.some(function(t){try{t.__h.some(Bf),t.__h=t.__h.filter(function(t){return!t.__||Hf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Cf.__e(i,t.__v)}}),Ef&&Ef(t,e)},Cf.unmount=function(t){Rf&&Rf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{Bf(t)}catch(t){e=t}}),i.__H=void 0,e&&Cf.__e(e,i.__v))};var qf="function"==typeof requestAnimationFrame;function jf(t){var e,i=function(){clearTimeout(r),qf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);qf&&(e=requestAnimationFrame(i))}function Bf(t){var e=Uc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Uc=e}function Hf(t){var e=Uc;t.__c=t.__(),Uc=e}function zf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function Uf(t,e){return"function"==typeof e?e(t):e}var Wf="gzip-js",Vf="base64",Gf="events",Zf="cancelEvents",Jf="tab",Qf="left",Kf="center",Xf="right",Yf="next_to_trigger",tp="popover",ep="widget",ip="external_survey",rp="open",np="multiple_choice",sp="single_choice",op="rating",ap="end",lp="always",up="survey shown",hp="survey dismissed",dp="survey sent",vp="$survey_id",cp="$survey_name",fp="$survey_iteration",pp="$survey_iteration_start_date",gp="$survey_partially_completed",mp="$survey_submission_id",yp="$survey_completed",bp="$survey_last_seen_date",_p="$survey_language",wp="popover";function kp(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Se(i.then)&&i.then(void 0,()=>{})}}}}var Sp=Pn("[Surveys]"),xp="PostHog is not capturing, so a survey response cannot be recorded";function Cp(t){return Se(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing()}function Tp(t){return!(!t.start_date||t.end_date)}function Mp(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Ip=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Ep=t=>Ip("seenSurvey_",t),Rp=t=>{try{var e=Ep(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Sp.error("Failed to persist survey seen state",t)}},Ap=[tp,ep,"api"],Pp={ignoreConditions:!1,ignoreDelay:!1,displayType:wp},Fp="logs",Op=Pn("[Stylesheet Loader]"),$p=a,Dp=h,Lp="#020617",Np={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Xf,widgetType:Jf,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Lp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},qp=[Kf,Qf,Xf];function jp(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Bp(t){var e;void 0===t&&(t=Np.backgroundColor),"#"===t[0]&&(e=jp(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=jp(i)),!e)return Lp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Lp:"white"}return Lp}var Hp=(t,e,i)=>{var r=ag(t),s=Dp.querySelector("."+r);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Dp.createElement("div");((t,e,i)=>{var r=n({},Np,i),s=t.style,o=!qp.includes(r.position)||e===ep&&(null==i?void 0:i.widgetType)===Jf;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),s.setProperty("--ph-survey-box-padding",r.boxPadding),s.setProperty("--ph-survey-max-width",r.maxWidth),s.setProperty("--ph-survey-z-index",r.zIndex),s.setProperty("--ph-survey-border-color",r.borderColor),o?(s.setProperty("--ph-survey-border-radius",r.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",r.backgroundColor),s.setProperty("--ph-survey-box-shadow",r.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Bp(r.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",Bp(r.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Bp(r.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),s.setProperty("--ph-widget-color",r.widgetColor),s.setProperty("--ph-widget-text-color",Bp(r.widgetColor)),s.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||r.inputBackground;a||"white"!==r.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||Bp(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",r.outlineColor)})(o,t.type,t.appearance),o.className=r;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Se(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Op.error("prepare_external_dependency_stylesheet returned null"),null)})(Dp,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return(i||Dp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},zp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;s?Cp(s)&&(Rp(i),s.capture(dp,n({[cp]:i.name,[vp]:i.id,[fp]:i.current_iteration,[pp]:i.current_iteration_start_date,[mp]:r,[yp]:o},l&&{[_p]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},za(e,i,u),a,{$set:{[Ua(i,"responded")]:!0}})),o&&($p.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),og(i),s.reloadFeatureFlags())):Sp.error("[survey sent] event not captured, PostHog instance not found.")},Up=(t,e,i)=>{return n({[cp]:t.name,[vp]:t.id,[fp]:t.current_iteration,[pp]:t.current_iteration_start_date,[gp]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Re(t)))},(null==e?void 0:e.surveyLanguage)&&{[_p]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[mp]:null==e?void 0:e.surveySubmissionId},za(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Wp=(t,e,i,r)=>{if(e){if(!i){var s=ng(t),o=s?s.surveyLanguage:r;e.capture(hp,n({},Up(t,s,e),o&&{[_p]:o},{$set:{[Ua(t,"dismissed")]:!0}})),og(t),Rp(t),$p.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Sp.error("[survey dismissed] event not captured, PostHog instance not found.")},Vp=(t,e)=>{if(e){var i=(t=>Ip("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ng(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture("survey abandoned",Up(t,r,e),{transport:"sendBeacon"})}}else Sp.error("[survey abandoned] event not captured, PostHog instance not found.")},Gp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Zp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,Jp=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Qp=(t,e)=>{var i;return(t=>t.questions.some(t=>{var e;return!(null==(e=t.branching)||!e.type)}))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map(t=>[t.id,t])),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Zp(t.questions,Gp(t.questions)):t.questions},Kp=t=>Ka(t)||sg(t),Xp=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach(function(t){t.__e=!0,af(t)})},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Bc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Yp=()=>Lf(Xp),tg=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=Kc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Mc.call(arguments,2):i),tf(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function eg(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=es(e);return!!s&&tl[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var ig=t=>Ip("inProgressSurvey_",t),rg=(t,e)=>{try{localStorage.setItem(ig(t),JSON.stringify(e))}catch(t){Sp.error("Error setting in-progress survey state in localStorage",t)}},ng=t=>{try{var e=localStorage.getItem(ig(t));if(e)return JSON.parse(e)}catch(t){Sp.error("Error getting in-progress survey state from localStorage",t)}return null},sg=t=>{var e=ng(t);return!Re(null==e?void 0:e.surveySubmissionId)},og=t=>{try{localStorage.removeItem(ig(t))}catch(t){Sp.error("Error clearing in-progress survey state from localStorage",t)}};function ag(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function lg(t,e,i){if(void 0===e&&(e=Xf),t===ip)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Qf:return{left:"30px"};case Kf:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===ep&&i===Jf?"60px":"30px"}}}var ug=0;function hg(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ug,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Ic.vnode&&Ic.vnode(u),u}var dg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),vg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),cg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),fg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),pg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),gg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:hg("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),mg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:hg("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),yg=hg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[hg("g",{"clip-path":"url(#clip0_2415_6911)",children:[hg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:hg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),hg("g",{mask:"url(#mask0_2415_6911)",children:[hg("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),hg("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),hg("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),hg("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),hg("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),hg("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),hg("defs",{children:hg("clipPath",{id:"clip0_2415_6911",children:hg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function bg(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return hg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",yg]})}function _g(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,l=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Lf(Xp).isPreviewMode,v=!!u&&!!h,c=!l&&hg("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==a||a.open(s)),d?null==o||o():n()},children:e});return hg("div",{className:"bottom-section",children:[v?hg("div",{className:"form-buttons form-buttons-with-back",children:[hg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&hg(bg,{urlParams:{utm_source:"survey-footer"}})]})}function wg(t){var e=t.question,i=t.forceDisableHtml;return hg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[hg(e.type===rp?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&tg({component:Yc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function kg(t){var e,i,r;return hg("button",{className:"form-cancel",onClick:t.onClick,disabled:Lf(Xp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,hg("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[hg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),hg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]}))})}var Sg=a;function xg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Lf(Xp).isPopup;return Of(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return zn(Sg,"keydown",t),()=>{Sg.removeEventListener("keydown",t)}},[o]),hg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&hg(kg,{onClick:()=>o()}),hg("h3",{className:"thank-you-message-header",children:e}),i&&tg({component:Yc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&hg(_g,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Cg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Lf(Xp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return hg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&hg(kg,{onClick:()=>u()}),e&&hg("h3",{className:"intro-screen-header",children:e}),i&&tg({component:Yc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),hg(_g,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var Tg=t=>ke(t)&&t.every(t=>Me(t));function Mg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Yp().isPreviewMode,d=$f(null),v=Ff(()=>Me(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Of(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Df(()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case de:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case ve:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=Mn(e.validation,de),b=Mn(e.validation,ve),_=Df(()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return hg(ef,{children:[hg("div",{className:"question-container",children:[hg(wg,{question:e,forceDisableHtml:i,htmlFor:g}),hg("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),_&&hg("div",{className:"validation-hint",children:_})]}),hg(_g,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Ig(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return hg(ef,{children:[hg("div",{className:"question-container",children:hg(wg,{question:e,forceDisableHtml:t.forceDisableHtml})}),hg(_g,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Eg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Ff(()=>Ae(l)?l:ke(l)&&l.length>0&&Ae(parseInt(l[0]))?parseInt(l[0]):Me(l)&&Ae(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Yp().isPreviewMode,y=t=>m?a(t):o(t);return hg(ef,{children:[hg("div",{className:"question-container",children:[hg(wg,{question:i,forceDisableHtml:r}),hg("div",{className:"rating-section",children:[hg("div",{className:"rating-options",children:["emoji"===i.display&&hg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=$g[i.scale])?void 0:e.map((t,e)=>hg("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e))}),"number"===i.display&&hg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Dg(i.scale).map((t,e)=>hg(Rg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&hg("div",{className:"rating-text",children:[hg("div",{children:i.lowerBoundLabel}),hg("div",{children:i.upperBoundLabel})]})]})]}),hg(_g,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ee(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Rg(t){var e=t.num,i=t.setActiveNumber;return hg("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function Ag(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=$f(null),v=Df(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Zp(e,Gp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Ff(()=>((t,e)=>Me(t)||Tg(t)?t:e===sp?null:[])(l,e.type)),f=c[0],p=c[1],g=Ff(()=>((t,e)=>{if(Me(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Tg(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],b=Yp().isPreviewMode,_=e.type===sp,w=e.type===np,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>n({},t,{isSelected:i,inputValue:i?t.inputValue:""})),_&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(_)return p(t),y(t=>n({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),b&&a(t)));w&&ke(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>n({},t,{inputValue:e})),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y(t=>n({},t,{isSelected:!1,inputValue:""})),_&&p(null))},T=()=>!(e.optional||!Ee(f)&&(!ke(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?ke(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return hg(ef,{children:[hg("div",{className:"question-container",children:[hg(wg,{question:e,forceDisableHtml:i}),hg("fieldset",{className:"multiple-choice-options limit-height",children:[hg("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:_?f===t:ke(f)&&f.includes(t);return hg("label",{className:n?"choice-option-open":"",children:[hg("div",{className:"response-choice",children:[hg("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),hg("span",{children:n?t+":":t})]}),n&&hg("input",{type:"text",ref:d,id:o,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)})]})]}),hg(_g,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var Pg=[1,2,3,4,5],Fg=[1,2,3,4,5,6,7],Og=[0,1,2,3,4,5,6,7,8,9,10],$g={2:[gg,mg],3:[cg,vg,dg],5:[fg,cg,vg,dg,pg]};function Dg(t){switch(t){case 5:default:return Pg;case 7:return Fg;case 10:return Og}}var Lg=Pn("[Surveys]");function Ng(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?ap:s;if(n.branching.type===ap)return ap;if("specific_question"===n.branching.type){if(Number.isInteger(n.branching.index))return n.branching.index}else if("response_based"===n.branching.type){if(n.type===sp){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===ap?ap:s}}else if(n.type===op){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===ap?ap:s}}return s}return Lg.warn("Falling back to next question index due to unexpected branching type"),s}var qg=Pn("[SurveyTranslations]");function jg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Wa(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?Wa(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Wa(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Se(t.get_property)?t.get_property(vt):void 0,locale:ml()},qg)}(e);if(!i)return qg.info("No user language detected"),{survey:t,language:null};var r=Ja(t,i,qg);return{survey:r.survey,language:r.matchedKey}}var Bg=a,Hg=h,zg="ph:show_survey_widget",Ug="PHWidgetSurveyClickListener";function Wg(t,e){try{var i=t.getBoundingClientRect(),r=Bg.innerHeight,n=Bg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:Np.zIndex}}catch(t){return Sp.warn("Failed to calculate trigger position:",t),null}}var Vg=class{constructor(t){var e=this;this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Map,this.Mi=new Set,this.Ti=null,this.Ii=!1,this.Ri=null,this.Ai=null,this.Ei=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(pt);if(t)for(var e of t)sg(e)&&Vp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var s,o,a,l,u,h=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==h&&h;if(Cp(e._posthog)){var v=e.Oi(t),c=v.survey,f=v.language;e.Ti=f,e.Ei=null,e.Li=i;var p=e.Di(c,i);e.Pi(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Ni(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.Fi(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===Yf&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=Hg.querySelector(p.appearance.widgetSelector);k&&(_=Wg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||Np.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=Hp(p,e._posthog).shadow;e.Ci.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.qi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Ei=C,0>=S)return e.Ii=!0,kf(hg(Kg,n({},C)),x);var T=()=>{if(!Cp(e._posthog)||!e.ji(p))return Sp.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.qi(p);(()=>{e.Ii=!0;var r=e.Oi(t),s=r.survey,o=r.language;e.Ti=o;var a=e.Di(s,i),l=n({},C,{survey:a,surveyLanguage:o});e.Ei=l,kf(hg(Kg,n({},l,{survey:n({},a,{appearance:n({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,I=Ae(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Bg.setTimeout(()=>{e.ki.delete(p.id),T()},E);e.ki.set(p.id,R)}}},this.Bi=t=>{var e,i=this.Oi(t),r=i.survey,n=i.language,s=Hp(r,this._posthog),o=s.shadow,a=s.isNewlyCreated;this.Ci.set(o,o.host),(null==(e=t.appearance)?void 0:e.widgetType)===Jf&&this.xi.set(t.id,t),a&&kf(hg(Yg,{posthog:this._posthog,survey:r,surveyLanguage:n},t.id),o)},this.Hi=t=>{var e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Ug),this.Si.delete(t),Sp.info("Removed click listener for survey "+t))},this.$i=t=>{this.Ui(t)||(this.zi(t),this.Hi(t.id))},this.Wi=t=>{this.Ui(t)||(this.zi(t),this.xi.delete(t.id))},this.Ui=t=>{try{var e;return!(null==(e=Hg.querySelector(ag(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Vi=(t,e)=>{var i=Hg.querySelector(e),r=this.Si.get(t.id);if(i){if(this.Bi(t),r){if(i===r.element)return;Sp.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Hi(t.id)}if(!i.hasAttribute(Ug)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Yf?Wg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Np.maxWidth)):{};Bg.dispatchEvent(new CustomEvent(zg,{detail:{surveyId:t.id,position:n}}))};zn(i,"click",n),i.setAttribute(Ug,"true"),this.Si.set(t.id,{element:i,listener:n,survey:t}),Sp.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.$i(t)},this.renderPopover=t=>{if(Cp(this._posthog)){var e=this.Oi(t),i=e.survey,r=e.language,n=Hp(i,this._posthog).shadow;this.Ci.set(n,n.host),kf(hg(Kg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.qi,surveyLanguage:r}),n)}},this.renderSurvey=(t,e,i)=>{var r;if(Cp(this._posthog)){var n=this.Oi(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.Zi(s,o,i)),kf(hg(Kg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.qi,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)}},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys(i=>{t(i.filter(t=>e.ji(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=Cp(e._posthog),r=t.filter(t=>i&&(t.type===tp||t.type===ep)),n=new Set(r.map(t=>t.id));for(var s of Array.from(e.ki.keys()))n.has(s)||e.cancelSurvey(s);var o=e.Gi(r),a=new Set,l=new Set;o.forEach(t=>{if(t.type===ep){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Jf)return l.add(t.id),void e.Bi(t);"selector"===(null==(r=t.appearance)?void 0:r.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Vi(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ee(e.Qi)&&t.type===tp&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.Si.forEach(t=>{var i=t.survey;a.has(i.id)||e.$i(i)}),e.xi.forEach((t,i)=>{l.has(i)||e.Wi(t)})},t)},this.Fi=t=>{Ee(this.Qi)||Sp.error("Survey "+this.Qi+" already in focus. Cannot add survey "+t.id+"."),this.Qi=t.id},this.qi=t=>{this.Qi!==t.id&&Sp.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Pi(t.id),this.Qi=null,this.Ti=null,this.Ii=!1,this.Ei=null,this.Li=void 0,this.zi(t)},this._posthog=t,this.Qi=null,this.Ri=()=>this.Ji(),zn(Bg,"languagechange",this.Ri),this.Ai=t.onFeatureFlags(()=>this.Ji())}Ji(){var t;if(!Ee(this.Qi)){var e=null==(t=this._posthog.get_property(pt))?void 0:t.find(t=>t.id===this.Qi);if(e){var i=this.Oi(e),r=i.survey,s=i.language;if(s!==this.Ti&&(this.Ti=s,this.Ii)){var o=this.Di(r,this.Li),a=Hp(o,this._posthog).shadow;kf(hg(Kg,n({},this.Ei,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.qi,surveyLanguage:s})),a)}}}}get Ki(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Di(t,e){return null!=e&&e.position||null!=e&&e.selector?n({},t,{appearance:n({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}Pi(t){var e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(Sp.info("Cancelled pending survey "+t),this.Pi(t),this.Qi===t&&(this.Qi=null,this.Ti=null,this.Ii=!1,this.Ei=null,this.Li=void 0))}setAutomaticDisplayDispose(t){this.Xi=t}dispose(){var t;null==(t=this.Xi)||t.call(this),this.Xi=void 0,this.Ri&&(Bg.removeEventListener("languagechange",this.Ri),this.Ri=null),this.Ai&&(this.Ai(),this.Ai=null),this.ki.forEach((t,e)=>this.Pi(e)),this.Si.forEach((t,e)=>this.Hi(e)),this.Ci.forEach((t,e)=>{kf(null,e),null==t||t.remove()}),this.Ci.clear(),this.xi.clear(),this.Qi=null}Gi(t){return t.sort((t,e)=>{var i,r,n=sg(t),s=sg(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===lp,a=e.schedule===lp;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}Oi(t){return jg(t,this._posthog)}Zi(t,e,i){if(this.Mi.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};for(var n of r.split("&")){var s=n.split("="),o=s[0],a=s[1];if(o&&!Te(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var d=parseInt(h[1],10);e[d]||(e[d]=[]),e[d].push(u)}}else i=!0}}return{params:e,autoSubmit:i}}(Bg.location.search).params;if(0===Object.keys(r).length)return!1;Sp.info("[Survey Prefill] Detected URL prefill parameters");var n=this.Yi(t,r,e);return!!n&&(this.tn(t,n,i,e),this.Mi.add(t.id),n.isSurveyCompleted)}tn(t,e,i,r){var n=e.responses,s=e.submissionId,o=e.isSurveyCompleted,a=e.skippedResponses;(Object.keys(a).length>0&&t.enable_partial_responses||o)&&zp({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Ni(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=ke(o)?o.map(String):[String(o)]}Sp.info("[Survey] Processing initial responses");var a=this.Yi(t,n,r);return!!a&&(this.tn(t,a,i,r),a.isSurveyCompleted)}Yi(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach((t,r)=>{if(e[r]&&t.id){var n=e[r],s=Ba(t.id);try{switch(t.type){case sp:if(!t.choices||0===t.choices.length)return void An.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void An.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case np:if(!t.choices||0===t.choices.length)return void An.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===a.length)return void An.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&An.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case op:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void An.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:An.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){An.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return Sp.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ga(),s=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=Ba(l.id);Te(i[u])||(n[u]=i[u])}s.push(r);var h=Ng(t,r,l.id?i[Ba(l.id)]:null);if(h===ap)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,Object.keys(e).map(t=>parseInt(t,10)),r),o=s.startQuestionIndex,a=s.skippedResponses,l=s.skippedIndices,u=o>=t.questions.length;return rg(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Jp(t.questions),visitedIndices:l,surveyLanguage:i}),Sp.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Sp.error("[Survey Prefill] Error handling prefill:",t),null}}en(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Ki,r=!(null==i||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),r&&n}rn(t){return!t.conditions||eg(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!g)return!1;var s=Ji(g,{userAgentDataPlatform:null==u||null==(i=u.userAgentData)?void 0:i.platform,maxTouchPoints:null==u?void 0:u.maxTouchPoints,screenWidth:null==a||null==(r=a.screen)?void 0:r.width,screenHeight:null==a||null==(n=a.screen)?void 0:n.height,devicePixelRatio:null==a?void 0:a.devicePixelRatio});return tl[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Dp||!Dp.querySelector(t.conditions.selector))}(t)}nn(t){var e;return Kp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.Ki)&&e.hasLoadedFlags?{satisfied:this.en(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!Tp(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Ap.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.en(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.en(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.nn(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=Math.abs((new Date).getTime()-i.getTime());return Math.ceil(r/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,Sa.Lt("lastSeenSurveyDate"))?(t=>!!Sa.Lt(Ep(t))&&!Kp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyCaptureEligibility(){return Cp(this._posthog)?{eligible:!0}:{eligible:!1,reason:xp}}checkSurveyDisplayEligibility(t){var e=this.checkSurveyCaptureEligibility();return e.eligible?this.checkSurveyEligibility(t):e}checkSurveyRenderability(t){var e=this.checkSurveyDisplayEligibility(t);return e.eligible&&!this.an(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}an(t){var e;return!Qa(t)&&!Mp(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}sn(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every(t=>{var e=t.value;return!t.key||!e||this.en(e)})}ji(t){return this.checkSurveyEligibility(t).eligible&&this.rn(t)&&this.an(t)&&this.sn(t)}zi(t){try{var e=Hg.querySelector(ag(t,!0));null!=e&&e.shadowRoot&&(kf(null,e.shadowRoot),this.Ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Sp.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Fi,removeSurveyFromFocus:this.qi,surveyInFocus:this.Qi,surveyTimeouts:this.ki,handleWidget:this.Bi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Vi,sortSurveysByAppearanceDelay:this.Gi,checkFlags:this.sn.bind(this),isSurveyFeatureFlagEnabled:this.en.bind(this),onLanguageChange:this.Ji.bind(this),currentLanguage:this.Ti,surveyIsRendered:this.Ii}}};function Gg(t,e){if(Hg&&Bg){var i,r=new Vg(t);if(t.config.disable_surveys_automatic_display)return Sp.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Sp.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Te(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Te(i)||(clearInterval(i),i=void 0)};n();var o=()=>{Hg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return zn(Hg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),Hg.removeEventListener("visibilitychange",o)}),r}}function Zg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Of(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===ep,s=eg(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===Jf&&i;if(!s)return Sp.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(Sp.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};zn(Bg,"popstate",i),zn(Bg,"hashchange",i);var s=Bg.history.pushState,l=Bg.history.replaceState;return Bg.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},Bg.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{Bg.removeEventListener("popstate",i),Bg.removeEventListener("hashchange",i),Bg.history.pushState=s,Bg.history.replaceState=l}}},[o,e,r,n,a])}var Jg=200;function Qg(t){switch(void 0===t&&(t="right"),t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Kg(t){var e,i,r,s,o,a,l,u,h,d,v,c,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,_=t.removeSurveyFromFocus,w=void 0===_?()=>{}:_,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,M=void 0===T?()=>{}:T,I=t.onPopupSurveyDismissed,E=void 0===I?()=>{}:I,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,D=t.surveyLanguage,L=$f(null),N=Number.isInteger(b),q=function(t,e,i,r,s,o,a,l,u){var h=Ff(r||0===i||t.type===ip),d=h[0],v=h[1],c=Ff(!1),f=c[0],p=c[1],g=$f(!1),m=()=>{var e=()=>{o&&s(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Jg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Of(()=>{if(e){if(!r){var s,o=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&(s&&clearTimeout(s),s=setTimeout(m,5e3))}},a=()=>{if(eg(t,e)){v(!0),Bg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(up,n({[cp]:t.name,[vp]:t.id,[fp]:t.current_iteration,[pp]:t.current_iteration_start_date},u&&{[_p]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};zn(Bg,"PHSurveyClosed",y),zn(Bg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Te(h)&&a(),()=>{Te(h)||clearTimeout(h),Te(s)||clearTimeout(s),Bg.removeEventListener("PHSurveyClosed",y),Bg.removeEventListener("PHSurveySent",o)}}}else Sp.error("usePopupVisibility hook called without a PostHog instance.")},[]),Zg({survey:t,removeSurveyFromFocus:s,setSurveyVisible:v,isPreviewMode:r,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithAnimation:m}}(f,g,null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,w,S,L,O,D),j=q.isPopupVisible,B=q.hidePopupWithAnimation,H=q.isSurveySent||b===f.questions.length||!0===F,z=Ff(!1),U=z[0],W=z[1],V=Df(()=>!!ng(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===b:!(null==(s=f.appearance)||!s.displayIntroScreen)&&G&&!U&&!V,J=Df(()=>{var t,e=(null==(t=ng(f))?void 0:t.surveySubmissionId)||ga();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){D?Wp(f,g,N,D):Wp(f,g,N),E()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:P,surveyLanguage:D}},[N,b,S,g,f,E,C,M,P,D]);return j?hg(Xp.Provider,{value:J,children:hg("div",{className:"ph-survey",style:n({},lg(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:H?hg(xg,{header:(null==(l=f.appearance)?void 0:l.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||Np,onClose(){B(),A()}}):Z?hg(Cg,{header:(null==(d=f.appearance)?void 0:d.introScreenHeader)||"",description:(null==(v=f.appearance)?void 0:v.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(c=f.appearance)?void 0:c.introScreenDescriptionContentType,appearance:f.appearance||Np,onStart:()=>W(!0)}):hg(Xg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Xg(t){var e,i,r=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Df(()=>{var t=ng(r);if(!t)return null;var e=Ae(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(og(r),null)},[r]),l=Ff(()=>(null!=a&&a.responses&&Sp.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Ff(!1),v=d[0],c=d[1],f=Lf(Xp),p=f.previewPageIndex,g=f.onPopupSurveyDismissed,m=f.isPopup,y=f.onPreviewSubmit,b=f.onPreviewBack,_=f.surveySubmissionId,w=f.isPreviewMode,k=f.properties,S=f.surveyLanguage,x=Ff(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Ae(t)&&t>=0&&r.questions.length>t?t:0;return Ae(p)&&p>=0?p:e}),C=x[0],T=x[1],M=Ff(()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&r.questions.length>t)}),I=M[0],E=M[1],R=Ff(()=>{var t,e;return null!==(t=null==(e=ng(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),A=R[0],P=R[1],F=Df(()=>Jp(Qp(r,a)),[r.id,a]),O=Df(()=>{if(!F||new Set(F).size!==F.length)return Qp(r,a);var t=new Map(r.questions.map(t=>[t.id,t])),e=F.map(e=>t.get(e)).filter(t=>!!t);return e.length===F.length?e:r.questions},[F,r.questions,r,a]);Of(()=>{!w||Te(p)||0>p||T(p)},[p,w]);var D=!(null==(e=r.appearance)||!e.allowGoBack)&&(w?(null!=p?p:0)>0:I.length>0),L=O.at(C);return L?hg("form",{className:"survey-form",name:"surveyForm",children:[m&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&hg(kg,{onClick(){g()}}),hg("div",{className:"survey-box","data-question-index":C,children:[v&&hg("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),tm({question:L,forceDisableHtml:s,displayQuestionIndex:C,appearance:r.appearance||Np,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(Cp(o))if(c(!1),s){var a=Ba(s),l=n({},u,{[a]:e});h(l);var d=O[i],v=null!=d&&d.id?n({},A,{[d.id]:d.question}):A;P(v);var f=Ng(r,i,e),p=f===ap,g=[...I,i];if(p||(E(g),T(f),rg(r,{surveySubmissionId:_,responses:l,lastQuestionIndex:f,questionOrder:Jp(O),visitedIndices:g,surveyLanguage:S,questionSnapshots:v})),r.enable_partial_responses||p){var m=new Set(g.map(t=>{var e;return null==(e=O[t])?void 0:e.id}).filter(t=>!!t).map(t=>Ba(t)));zp({responses:Object.fromEntries(Object.entries(l).filter(t=>m.has(t[0]))),survey:r,surveySubmissionId:_,isSurveyCompleted:p,posthog:o,properties:k,surveyLanguage:S,questionSnapshots:v})}}else Sp.error("onNextButtonClick called without a questionId.");else c(!0);else Sp.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:C,questionId:L.id}),onPreviewSubmit:y,initialValue:L.id?u[Ba(L.id)]:void 0,canGoBack:D,onBack(){if(w)b();else if(0!==I.length){var t=I[I.length-1],e=I.slice(0,-1);E(e),T(t),rg(r,{surveySubmissionId:_,responses:u,lastQuestionIndex:t,questionOrder:Jp(O),visitedIndices:e,surveyLanguage:S,questionSnapshots:A})}}})]})]}):null}function Yg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Ff(!0),f=c[0],p=c[1],g=Ff(!1),m=g[0],y=g[1],b=Ff({}),_=b[0],w=b[1],k=$f(void 0),S=()=>{(m||!h||d||Cp(h))&&y(!m)};if(Of(()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Sp.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return zn(Bg,zg,e),()=>{Te(k.current)||(clearTimeout(k.current),k.current=void 0),Bg.removeEventListener(zg,e)}}}else Sp.error("FeedbackWidget called without a PostHog instance.")},[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),Zg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==lp&&p(!1),Te(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return hg(ef,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&hg("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:S,disabled:d,style:Qg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&hg(Kg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var tm=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,s=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){s(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case rp:return Yc(Mg,n({},o,{question:e,key:e.id}));case"link":return Yc(Ig,n({},o,{question:e,key:e.id}));case op:return Yc(Eg,n({},o,{question:e,key:e.id}));case sp:case np:return Yc(Ag,n({},o,{question:e,key:e.id}));default:return Sp.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=Gg,b.extendPostHogWithSurveys=Gg;var em=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},im=1e4,rm=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),nm=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return rm(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return rm(e,JSON.stringify(t.slice(0,n)),i)},sm=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,om=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},am=(t,e,i)=>{if(!i.truncated)if(xe(t)){if(i.seen.has(t))return void om(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(am(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else om(e,t,i)},lm=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!sm(t))return!n||rm(e,"null",i);if(Ee(t)||(t=>{try{return Ae(t)||Fe(t)}catch(t){return!1}})(t))return rm(e,JSON.stringify(t),i);if("string"==typeof t)return nm(t,e,i);if(!xe(t)&&!ke(t))return rm(e,JSON.stringify(t),i);if(r.has(t))return nm("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Se(o))return lm(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return nm(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return rm(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return lm(l,e,i,r,n,s)}if(ke(t)){if(!rm(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!rm(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!lm(d,e,i,r,!0))return!1}return rm(e,"]",i)}if(!rm(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{am(f,c,s)}catch(t){}if(sm(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!rm(e,p,i))return!1;var b=e.length,_=lm(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return rm(e,"}",i)},um=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=xe(t[0])?{result:{},keysRemaining:50,sizeRemaining:im,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||rm(i," ",r))&&lm(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}},hm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},dm=t=>"canCapture"in t,vm=t=>dm(t)?t.canCapture?t.getExtension(Fp):void 0:t.is_capturing()?t.logs:void 0;b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:b.location.host},s=!1,o=function(t){var o=b.console[t];i.push(ic(b.console,t,i=>{var a=(i=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{var h=e;if(l.length>0&&!s&&h){var d=vm(h);if(d){s=!0,o=!0;var v=um(l,im),c=v.body,f=v.attributes,p=n({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(dm(t))e.captureConsoleLog(i);else{var r=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var i=Number(e[1]),r=Number(e[2]);if(i>=392&&419>=i)return 410===i?r>4?r>10?void 0:"de":"le":418===i?r>3?r>10?r>14?r>17?void 0:"vi":"ci":"ui":"he":419===i?r>2?void 0:"vi":410>i?"le":"he"}})(t.version),n=r?e[r]:void 0;Se(n)&&n.call(e,i)}})(h,d,{level:hm[t],body:c,attributes:n({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(s=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=em(o),a}))};for(var a of Object.keys(hm))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=vm(t);if(i)for(var r of e)try{var s=um(r.args,im);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:hm[r.level],body:s.body,attributes:n({"log.source":"console."+r.level,host:b.location.host},s.truncated?{body_truncated:"true"}:{},s.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var cm=t=>qe(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),fm=Pn("[Error tracking]"),pm="webkit-masked-url:",gm=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],mm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",pm],ym=["__firefox__","__gCrWeb"];function bm(){return new vr([new Rr,new jr,new Pr,new Ar,new Nr,new Lr,new Or,new qr],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var s=[],o=e.split("\n"),a=Math.min(o.length,r+1e3),l=[],u=r;a>u;u++){var h=o[u];if(1024>=h.length){var d=kr.test(h)?h.replace(kr,"$1"):h;if(!d.match(/\S*Error: /)){for(var v of i){var c=v(d,t);if(c){s.push(c);var f=xr(s);if(f){for(var p=l.length-1;p>=0;p--){var g=l[p];if(f.start>=g.start+g.length)break;l.pop()}l.push(f)}break}}if(Ir(s,l)>=50)break}}}var m=[...l].sort((t,e)=>e.start-t.start),y=m[m.length-1];if(y){var b=Tr(s,y);for(var _ of(s.splice(y.start-b,b),m))_.start-=b}for(var w of m)Cr(s,w);return l.some(t=>0===t.start&&s.length===t.length)&&function(t){for(var e=t.map(t=>t.function+"|"+t.filename+"|"+t.lineno+"|"+t.colno+"|"+t.module),i=0,r=1;e.length>r;r++)Er(e,r,i)&&(i=r);t.push(...t.splice(0,i))}(s),function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return n({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(s)}}("web:javascript",yr,wr))}var _m=Pn("[ExceptionAutocapture]"),wm=bm(),km=(t,e)=>{try{return t()}catch(t){return e}},Sm=(t,e)=>km(()=>t(e()),void 0),xm=t=>km(()=>Se(t)&&Se(t.call),!1),Cm=(t,e)=>km(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Tm=(t,e,i)=>{km(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),km(()=>{t[e]=i},void 0)},Mm=t=>{var e=a;e||_m.info("window not available, cannot wrap onerror");var i=km(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];return Sm(t,()=>wm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Me(e)&&Me(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}})),!!xm(i)&&null!==(e=i(...n))&&void 0!==e&&e},Cm(e,"onerror"),()=>Tm(e,"onerror",i)},Im=function(t,e){void 0===e&&(e=!1);var i=a;i||_m.info("window not available, cannot wrap onUnhandledRejection");var r=km(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return Sm(t,()=>wm.buildFromUnknown(i,{mechanism:{handled:!1}})),xm(r)?null!==(n=r(i))&&void 0!==n&&n:e},Cm(i,"onunhandledrejection"),()=>Tm(i,"onunhandledrejection",r)},Em={wrapOnError:Mm,wrapUnhandledRejection:Im,wrapConsoleError(t){var e=console;e||_m.info("console not available, cannot wrap console.error");var i=km(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];Sm(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return wm.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),xm(i)&&i(...r)},Cm(e,"error"),()=>Tm(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=Em,b.posthogErrorWrappingFunctions=Em;var Rm=(t,e)=>{if(Se(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Ee(i)&&"object"==typeof i&&ke(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){_m.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){_m.error("Failed to capture exception for a legacy client",t)}};Mm(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),Im(n,!0)}};b.extendPostHogWithExceptionAutoCapture=Rm,b.extendPostHogWithExceptionAutocapture=Rm;var Am="X-POSTHOG-SESSION-ID",Pm="X-POSTHOG-WINDOW-ID",Fm="X-POSTHOG-DISTINCT-ID",Om=[Am,Pm,Fm],$m=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Dm=(t,e)=>({}.hasOwnProperty.call(t,e)),Lm=t=>"object"==typeof t&&!Ee(t)||Se(t),Nm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),qm=t=>{try{var e;return Nm(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==a||null==(e=a.location)?void 0:e.href).toString()}catch(t){return}},jm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(ke(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Am,a.sessionId),n.set(Pm,l),o=!0}var u=(t=>Se(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(Fm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var Bm={_patchFetch:(t,e,i)=>ic(a,"fetch",r=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=qm(s);if(u)if(Nm(s)){var h=new Request(s,o);jm(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Lm(o)?o.headers:void 0);if(jm(t,e,i,u,d)){var v=((t,e)=>{if(Te(t)||Ee(t))return{headers:e};if(Lm(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(i);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),r}return new Proxy({headers:e},{get:(t,e)=>Dm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Dm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),$m.forEach(t=>{t in i&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&$m.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?n({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[s,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>ic(a.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=qm(s);d&&jm(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return Om.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=Bm,b.postHogTracingHeadersPatchFns=Bm,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});var Hm=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}},zm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Um=t=>{if("loading"===document.readyState)return"loading";var e=zm();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Wm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Vm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Wm(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},Gm=new WeakMap;function Zm(t,e){var i=Gm.get(e);return i||Gm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Jm,Qm=-1,Km=()=>Qm,Xm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Qm=e.timeStamp,t(e))},!0)},Ym=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},ty=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},ey=()=>{var t,e;return null!==(t=null==(e=zm())?void 0:e.activationStart)&&void 0!==t?t:0},iy=-1,ry=new Set,ny=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,sy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ry)e();isFinite(iy)||(iy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",sy,!0))}},oy=function(t){if(void 0===t&&(t=!1),t&&(iy=1/0),0>iy){var e,i,r=ey();iy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:ny(),addEventListener("visibilitychange",sy,!0),addEventListener("prerenderingchange",sy,!0),Xm(()=>{setTimeout(()=>{iy=ny()})})}return{get firstHiddenTime(){return iy},onHidden(t){ry.add(t)}}},ay=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=zm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Km()?a&&(document.prerendering||ey()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},ly=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},uy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},hy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},dy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},vy=class{constructor(){this.u=void 0}},cy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},fy=[1800,3e3],py=function(t,e){void 0===e&&(e={});var i=uy(e);cy(()=>{var r,n=Zm(e,vy),s=oy(),o=ay("FCP"),a=ly(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-ey(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Ym(t,o,fy,e.reportAllChanges),Xm(i=>{o=ay("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Km()),r=Ym(t,o,fy,e.reportAllChanges),ty(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&ly(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&hy(n.u,i),o=ay("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Ym(t,o,fy,e.reportAllChanges))(!0)})},e)})},gy=[.1,.25],my=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],yy=function(t,e){void 0===e&&(e={});var i=Zm(e=Object.assign({},e),Hm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=my(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Vm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=oy();py(dy(()=>{var r,n=ay("CLS",0),s=Zm(e,Hm),o=(i,o,a,l,u)=>{n=ay("CLS",0,i,o,a,l,u),s.o=0,r=Ym(t,n,gy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];uy(e)&&h.push("soft-navigation");var d=ly(h,u);d&&(r=Ym(t,n,gy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Xm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Km()),ty(r)}),setTimeout(r))}))}(e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null!=n&&null!=(i=n.sources)&&i.length){var s=my(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Um(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},by=function(t,e){void 0===e&&(e={});var i=Zm(e=Object.assign({},e),vy);uy(e)&&(i.u=new Map),py(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Um(Km())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=zm(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:Um(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))},e)},_y=0,wy=1/0,ky=0,Sy=t=>{for(var e of t)e.interactionId&&(wy=Math.min(wy,e.interactionId),ky=Math.max(ky,e.interactionId),_y=ky?(ky-wy)/7+1:0)},xy=()=>{var t;return Jm?_y:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Cy=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return xy()-this.h}D(){this.h=xy(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.p.get(t.interactionId);if(r||10>this.v.length||t.duration>i.k){var n;if(r?t.duration>r.k?(r.entries=[t],r.k=t.duration):t.duration===r.k&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.p.set((r={id:t.interactionId,entries:[t],k:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var s of this.v.splice(10))this.p.delete(s.id);null==(n=this.M)||n.call(this,r)}}}},Ty=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=dy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},My=[200,500],Iy=function(t,e){void 0===e&&(e={});var i=Zm(e=Object.assign({},e),Cy),r=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Ty(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=s.length-10;s=s.filter((i,r)=>r>=e||t.has(i));var n=new Set;for(var l of s)for(var h of v(l.startTime,l.processingEnd))n.add(h);r=r.filter(t=>t.startTime>o||n.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||s.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&a.set(t,i),h()},i.M=t=>{if(!l.get(t)){var i,r=null==(i=t.entries.find(t=>t.target))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Vm(r);l.set(t,s)}else{var o,a=null==(o=t.entries.find(t=>t.targetSelector))?void 0:o.targetSelector;a&&l.set(t,a)}}};var v=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};ly(["long-animation-frame"],t=>{r=r.concat(t),h()},e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=oy();cy(()=>{var r;"interactionCount"in performance||Jm||(Jm=ly(["event"],Sy,{durationThreshold:0}));var s,o=ay("INP"),a=Zm(e,Cy),l=(i,r,n,l,u)=>{a.D(),o=ay("INP",-1,i,r,n,l,u),s=Ym(t,o,My,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Ty(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];uy(e)&&v.push("soft-navigation");var c=ly(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Ym(t,o,My,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Xm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Km())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Um(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=Math.max(n.processingStart,r.startTime),o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),d=v(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:l.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-u,loadState:Um(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+o>c.startTime?"input-delay":i+o+a>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+o+a&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))},e)},Ey=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],Ry=50,Ay=[];ly(["resource"],t=>{for(var e of t)Ay.push(e),Ay.length>Ry&&Ay.shift()});var Py=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(Ry=e.resourceBufferSize);var i=Zm(e,Ey),r=new WeakMap;uy(e)&&(i.u=new Map),i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Vm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=uy(e);cy(()=>{var n,s=oy(),o=ay("LCP"),a=Zm(e,Ey),l=(r,a,l,u,h)=>{o=ay("LCP",-1,r,a,l,u,h),n=Ym(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=oy(!0))},u=t=>{a.u&&t.navigationId&&hy(a.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-ey(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=ly(d,h);if(v){n=Ym(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Ty(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});Xm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Km()),n=Ym(t,o,$,e.reportAllChanges),ty(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})}(e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(Ay.findLast(t=>t.name===d.url)||performance.getEntriesByType("resource").findLast(t=>t.name===d.url));e.target=r.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(s=null==(o=h=zm())?void 0:o.activationStart)&&void 0!==s?s:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(c=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=n({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},Fy=-1,Oy=()=>Fy,$y=t=>{addEventListener("pageshow",e=>{e.persisted&&(Fy=e.timeStamp,t(e))},!0)},Dy=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Ly=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Ny=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},qy=()=>{var t,e;return null!==(t=null==(e=Ny())?void 0:e.activationStart)&&void 0!==t?t:0},jy=-1,By=new Set,Hy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,zy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of By)e();isFinite(jy)||(jy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",zy,!0))}},Uy=function(t){if(void 0===t&&(t=!1),t&&(jy=1/0),0>jy){var e,i,r=qy();jy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:Hy(),addEventListener("visibilitychange",zy,!0),addEventListener("prerenderingchange",zy,!0),$y(()=>{setTimeout(()=>{jy=Hy()})})}return{get firstHiddenTime(){return jy},onHidden(t){By.add(t)}}},Wy=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Ny(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Oy()?a&&(document.prerendering||qy()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Vy=new WeakMap;function Gy(t,e){var i=Vy.get(e);return i||Vy.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Zy,Jy=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}},Qy=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var s=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)s.observe(n({type:o,buffered:!0},i));return s}}catch(t){}},Ky=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Xy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Yy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},tb=class{constructor(){this.l=void 0}},eb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ib=[1800,3e3],rb=function(t,e){void 0===e&&(e={});var i=Ky(e);eb(()=>{var r,n=Gy(e,tb),s=Uy(),o=Wy("FCP"),a=Qy(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-qy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Dy(t,o,ib,e.reportAllChanges),$y(i=>{o=Wy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Oy()),r=Dy(t,o,ib,e.reportAllChanges),Ly(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Qy(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Xy(n.l,i),o=Wy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Dy(t,o,ib,e.reportAllChanges))(!0)})},e)})},nb=[.1,.25],sb=function(t,e){void 0===e&&(e={});var i=Uy();rb(Yy(()=>{var r,n=Wy("CLS",0),s=Gy(e,Jy),o=(i,o,a,l,u)=>{n=Wy("CLS",0,i,o,a,l,u),s.i=0,r=Dy(t,n,nb,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];Ky(e)&&h.push("soft-navigation");var d=Qy(h,u);d&&(r=Dy(t,n,nb,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),$y(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Oy()),Ly(r)}),setTimeout(r))}))},ob=0,ab=1/0,lb=0,ub=t=>{for(var e of t)e.interactionId&&(ab=Math.min(ab,e.interactionId),lb=Math.max(lb,e.interactionId),ob=lb?(lb-ab)/7+1:0)},hb=()=>{var t;return Zy?ob:null!==(t=performance.interactionCount)&&void 0!==t?t:0},db=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return hb()-this.u}M(){this.u=hb(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var s of this.v.splice(10))this.m.delete(s.id);null==(n=this.T)||n.call(this,r)}}}},vb=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Yy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},cb=[200,500],fb=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Uy();eb(()=>{var r;"interactionCount"in performance||Zy||(Zy=Qy(["event"],ub,{durationThreshold:0}));var s,o=Wy("INP"),a=Gy(e,db),l=(i,r,n,l,u)=>{a.M(),o=Wy("INP",-1,i,r,n,l,u),s=Dy(t,o,cb,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),vb(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Ky(e)&&v.push("soft-navigation");var c=Qy(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Dy(t,o,cb,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),$y(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Oy())}))})}},pb=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},gb=[2500,4e3],mb=function(t,e){void 0===e&&(e={});var i=!1,r=Ky(e);eb(()=>{var n,s=Uy(),o=Wy("LCP"),a=Gy(e,pb),l=(r,a,l,u,h)=>{o=Wy("LCP",-1,r,a,l,u,h),n=Dy(t,o,gb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Uy(!0))},u=t=>{a.l&&t.navigationId&&Xy(a.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-qy(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Qy(d,h);if(v){n=Dy(t,o,gb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;vb(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});$y(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Oy()),n=Dy(t,o,gb,e.reportAllChanges),Ly(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},yb={onLCP:Py,onCLS:yy,onFCP:by,onINP:Iy,withoutAttribution:{onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=yb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=yb,b.postHogWebVitalsCallbacks=yb;var bb={onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=bb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=bb,b.postHogWebVitalsCallbacks=bb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>bb;var _b={onLCP:Py,onCLS:yy,onFCP:by,onINP:Iy,withoutAttribution:{onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=_b,b.__PosthogExtensions__.postHogWebVitalsCallbacks=_b,b.postHogWebVitalsCallbacks=_b;var wb={onLCP:mb,onCLS:sb,onFCP:rb,onINP:fb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=wb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=wb,b.postHogWebVitalsCallbacks=wb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>wb;var kb=class{constructor(t){this.disabled=!1===t;var e=xe(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}},Sb="$copy_autocapture",xb=Pn("[AutoCapture]");function Cb(t,e){return e.length>t?e.slice(0,t)+"...":e}function Tb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!rs(e));return e}function Mb(t,e){var i,r,s=e.e,o=e.maskAllElementAttributes,l=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!rs(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!ns(f,"body")&&1e3>v.length;)if(os(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!rs(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===s.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>ns(t,"button")||ns(t,"a")):-1;g>0&&(l=l||v.slice(0,g+1).some(t=>!Is(t)||Es(t)));var m,y,b,_=[],w={},k=!1,S=!1;if(On(v,t=>{var e=Is(t);if(ns(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Ls(i))&&(d?ar(i):i)}pe(us(t),"ph-no-capture")&&(S=!0),_.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};cs.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Cb(1024,Ns(t)):Cb(1024,ds(t)));var a=us(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),On(t.attributes,function(i){var s;if((!Es(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Ls(i.value)&&(!Me(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=as(a).join(" ")),o["attr__"+i.name]=Cb(1024,"href"===i.name&&n?ar(a):a)}});for(var l=1,u=1,h=t;h=Tb(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,l,u,d)),On(function(t){if(!Is(t))return{};var e={};return On(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Ls(r)&&(e[i]=r)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=v[g],_.splice(0,g)),l||(_[0].$el_text=ns(t,"a")||ns(t,"button")?Ns(t):ds(t)),k){var x,C;_[0].attr__href=k;var T=null==(x=Gn(k))?void 0:x.host,M=null==a||null==(C=a.location)?void 0:C.host;T&&M&&T!==M&&(m=k)}return{props:$n((y=s.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:_},{$elements_chain:(b=_,ke(b)?function(t){return t.map(t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var o=n({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Dn(o).sort((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0])).forEach(t=>{var e=t[1];return a[js(t[0].toString())]=js(e.toString())}),(r+=":")+Dn(a).map(t=>t[0]+'="'+t[1]+'"').join("")}).join(";")}(function(t){return t.map(t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Bs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dn(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(b)):"")},null!=(i=_[0])&&i.$el_text?{$el_text:null==(r=_[0])?void 0:r.$el_text}:{},m&&"click"===s.type?{$external_click_url:m}:{},w),target:t}}var Ib=class{Qs(){this.Ks=void 0,clearTimeout(this.Xs),this.Xs=void 0}Ys(t){var e;if(!Is(t))return!0;for(var i,r=null!==(e=this.so().css_selector_ignorelist)&&void 0!==e?e:ms,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=us(t);if(pe(e,"ph-no-capture")||pe(e,"ph-sensitive")||Es(t)||r.some(e=>fs(t,e)))return{v:!0};var i=s.parentNode;s=os(i)?i.host:i&&rs(i)?i:null};s;)if(i=o())return i.v;return!1}oo(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Ks;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.Qs():"pointerup"===t.type&&(e.released=!0,this.Xs=setTimeout(()=>this.Qs(),0)))}else{var i;this.Qs();var r=vs(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&rs(r)&&(this.Ks={target:r,excluded:this.Ys(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.ao)?void 0:i.distinctId})}else this.Qs()}lo(t){var e,i=this.Ks;this.Qs();var r=vs(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.ao)?void 0:e.distinctId)&&t.pointerId===i.id&&(t.detail>0||"touch"===t.pointerType||"pen"===t.pointerType)&&0===t.button&&5>=Math.abs(t.clientX-i.x)&&5>=Math.abs(t.clientY-i.y)&&r&&(ns(r,"html")||ns(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.so().css_selector_ignorelist)&&void 0!==n?n:ms;return[r,null==h?void 0:h.documentElement,null==h?void 0:h.body].some(t=>{if(!t)return!1;var e=us(t);return pe(e,"ph-no-capture")||pe(e,"ph-sensitive")||!Is(t)||Es(t)||s.some(e=>fs(t,e))})?null:i.target}}constructor(t){this.uo=t,this.name="autocapture",this.ho=!1,this.do=null,this.vo=!1,this.co=!1,this.xn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.fo=!1,this.uo.refresh(this.xn),this.rageclicks=new kb(this.xn.rageclick),this.po=null}setup(t){this.mo(),this.ao=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.fo?e.dispose():(this.yo=e,this.startIfEnabled())}dispose(){var t;this.fo||(this.fo=!0,this.ao=void 0,null==(t=this.yo)||t.dispose(),this.yo=void 0,this.bo())}so(){return this.uo.refresh(this.xn),this.xn}mo(){var t,e;return this.so(),this.xn.url_allowlist=null==(t=this.xn.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this.xn.url_ignorelist=null==(e=this.xn.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this.xn}_o(){if(this.isBrowserSupported()){if(a&&h){var t=this.wo=t=>{t=t||(null==a?void 0:a.event);try{if("blur"===t.type)return void this.Qs();if(0===t.type.indexOf("pointer"))return void this.oo(t);var e="click"===t.type?this.lo(t):void 0;if(Ee(e))return;this.ko(t,"$autocapture",e)}catch(t){xb.error("Failed to capture event",t)}};if(zn(a,"blur",t),zn(h,"submit",t,{capture:!0}),zn(h,"change",t,{capture:!0}),zn(h,"click",t,{capture:!0}),On(["pointerdown","pointermove","pointerup","pointercancel"],e=>{zn(h,e,t,{capture:!0})}),this.so().capture_copied_text){var e=this.So=t=>{t=t||(null==a?void 0:a.event);try{this.ko(t,Sb)}catch(t){xb.error("Failed to capture clipboard event",t)}};zn(h,"copy",e,{capture:!0}),zn(h,"cut",e,{capture:!0}),zn(h,"paste",e,{capture:!0})}}}else xb.info("Disabling Automatic Event Collection because this browser is not supported")}bo(){this.Qs(),this.wo&&(null==a||a.removeEventListener("blur",this.wo),On(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==h||h.removeEventListener(t,this.wo,!0)}),null==h||h.removeEventListener("submit",this.wo,!0),null==h||h.removeEventListener("change",this.wo,!0),null==h||h.removeEventListener("click",this.wo,!0),this.wo=void 0),this.So&&(null==h||h.removeEventListener("copy",this.So,!0),null==h||h.removeEventListener("cut",this.So,!0),null==h||h.removeEventListener("paste",this.So,!0),this.So=void 0),this.ho=!1}startIfEnabled(){this.isEnabled||this.Qs(),!this.fo&&this.ao&&this.isEnabled&&!this.ho&&(this._o(),this.ho=!0)}onRemoteConfig(t){if(!this.fo)if(this.vo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.co=e.elementsChainAsString);var i,r=e.autocapture_opt_out;Fe(r)&&(null==(i=this.ao)||i.kv.set(E,r),this.do=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.po=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.po)||i.forEach(i=>{var n;null==h||null==(n=h.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||pe(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.fo)return!1;var i=null==(t=this.ao)?void 0:t.kv.get(E),r=this.do,n=this.so();if(!n.remoteRequestsDisabled&&!this.vo)return!1;var s=n.remoteRequestsDisabled&&!this.vo;if(Ee(r)&&!Fe(i)&&!s)return!1;var o=null!==(e=this.do)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ko(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||vs(t);ss(r)&&(r=r.parentNode||null);var s,o=this.mo();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Cs(r,o.rageclick)&&this.ko(t,"$rageclick",i);var l=e===Sb,u=l?n({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!a||Ts(t))return!1;if(null!=i&&i.url_allowlist&&!ls(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&ls(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var l=i.dom_event_allowlist;if(l&&!l.some(t=>e.type===t))return!1}var u=Ms(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Te(i))return!0;var r,n=function(t){if(i.some(e=>t.tagName.toLowerCase()===e))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(d,i))return!1;if(!ps(d,null==i?void 0:i.css_selector_allowlist))return!1;if(ps(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:ms))return!1;try{var v=a.getComputedStyle(t);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(cs.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,l,l?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=Mb(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.co,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),v=d.props;if(d.explicitNoCapture)return!1;var c=this.getElementSelectors(r,d.target);if(c&&c.length>0&&(v.$element_selectors=c),e===Sb){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==a||null==(p=a.getSelection())?void 0:p.toString(),y=hs(m);if(!y)return!1;v.$selected_content=y,v.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}v.$copy_type=f}return null==(h=this.ao)||h.capture(e,v).catch(t=>xb.error("Failed to capture event",t)),!0}}else this.Qs()}isBrowserSupported(){return Se(null==h?void 0:h.querySelectorAll)}},Eb={};function Rb(t,e){var i=vs(t);return i?n({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Ab(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Pb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Fb="canvas,video,audio,embed,object";function Ob(t,e){return Ae(t)&&t>=e}function $b(t,e){return void 0===e&&(e=1e3),t>=0&&e>t?t:void 0}function Db(t,e,i){return void 0===i&&(i=1e3),Ae(e)?$b(t-e,i):void 0}var Lb=class{hn(t){var e,i,r,n,s,o,a,l,u=this.cn((null==t?void 0:t.__onCapture)||this.dn.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this.vn=!1,this.fn=[],this.pn=0,this.cn=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.gn=()=>{clearTimeout(this.mn),this.mn=void 0,this.yn=void 0},this.bn=t=>{if(this.gn(),0===t.button){var e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},i=null==h?void 0:h.getSelection();e.selectionInitiallyRelated="Range"===(null==i?void 0:i.type)&&this.wn(i,e),this.yn=e}},this.kn=t=>{Ee(t.relatedTarget)&&this.gn()},this._n=t=>{var e=this.yn,i=t;if(e&&0===i.button&&t.isTrusted===e.trusted){var r=t.composedPath();for(var n of e.path)if(rs(n)&&-1!==r.indexOf(n)){e.clickTarget=n;break}e.clickDetail=i.detail,this.mn=b.setTimeout(this.gn,0)}},this.Sn=t=>{var e=t,i=Rb(e,{type:"click"}),r=this.yn;i&&r&&0===e.button&&e.detail>0&&e.detail===r.clickDetail&&t.isTrusted===r.trusted&&i.node===r.clickTarget&&(i.selectionChangedDuringGesture=r.selectionChanged&&this.xn.selection_change_threshold_ms>0,this.gn()),Ee(i)||this.Cn(i)||this.Mn(i),this.Tn()},this.In=()=>{var t=Date.now();this.Rn=t,t%50==0&&this.fn.forEach(e=>{Te(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.An=t=>{var e=null==h?void 0:h.getSelection(),i=this.vn;this.vn="Range"===(null==e?void 0:e.type);for(var r=null==e?void 0:e.focusNode,n=r&&(rs(r)?r:r.parentElement),s=null==h?void 0:h.activeElement,o=s;null!=(a=o)&&null!=(a=a.shadowRoot)&&a.activeElement;){var a;o=o.shadowRoot.activeElement}var l=xs(vs(t))||xs(null!=n?n:null)||xs(null!=o?o:null),u="Caret"===(null==e?void 0:e.type)&&o&&!o.shadowRoot&&r&&r!==s&&r.contains(null!=s?s:null);if(i||this.vn||l||u){var d=Date.now();this.En=d;var v=this.yn;if(v&&(i||this.vn||l)){var c,f=vs(t);xs(f)?c=f:"Caret"===(null==e?void 0:e.type)&&(xs(null!=o?o:null)||u?c=o:l&&(c=n));var p=c?this.On(c,v):e&&(r||e.anchorNode)?this.wn(e,v):i&&!this.vn&&v.selectionInitiallyRelated;v.selectionChanged=v.selectionChanged||p}this.fn.forEach(t=>{var e=d-t.timestamp;0>e||!Te(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})}},this.ar=()=>{"hidden"===(null==h?void 0:h.visibilityState)&&this.gn();var t=Date.now();this.Ln=t,this.Dn("visibilityChangedDelayMs",t)},this.Pn=()=>{var t=Date.now();this.Nn=t,this.Dn("focusChangedDelayMs",t)},this.Fn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.qn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.jn=()=>{this.qn=void 0},this.Bn=t=>{var e,i=this.qn;if(this.qn=void 0,!Te(i)&&this.xn.max_dead_swipes_per_page_load>this.pn){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,o=n.clientY-i.y,a=s*s+o*o,l=this.xn.swipe_threshold_px;if(a>=l*l&&![this.Rn,this.Hn,this.En].some(t=>Ae(t)&&t>=i.timestamp)){var u;if(this.$n()&&(null!==(u=null==h||null==h.elementsFromPoint?void 0:h.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(Fb)))return;var d=Rb(r,{type:"swipe",swipeDirection:Ab(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ee(d)||this.Cn(d)||this.Mn(d),this.Tn()}}}},this.xn=this.hn(e),this._onCapture=this.xn.__onCapture}start(t){this.Un(),this.zn(),this.Wn(),this.Vn(),this.Zn(),this.Gn(t),this.xn.capture_dead_swipes&&this.Qn()}Gn(t){if(!this.Jn){var e=function(t){return function(t,e){var i=Eb[t];if(i)return i;var r=e[t];if((t=>Se(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==a||!a.Zone))return Eb[t]=r.bind(e);var n=e.document;if(n&&Se(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var l,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return pe(t,"AppleWebKit")&&!pe(t,"Chrome")}(null!==(l=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){An.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var d;!o&&null!=(d=s)&&d.parentNode&&s.parentNode.removeChild(s)}}return r&&Se(r)?Eb[t]=r.bind(e):r}("MutationObserver",t)}(b);this.Jn=new e(t=>{this.Kn(t)}),this.Jn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Jn)||t.disconnect(),this.Jn=void 0,b.removeEventListener("click",this.Sn),b.removeEventListener("mousedown",this.bn,{capture:!0}),b.removeEventListener("mouseup",this._n,{capture:!0}),b.removeEventListener("mouseout",this.kn,{capture:!0}),b.removeEventListener("dragstart",this.gn,{capture:!0}),b.removeEventListener("pointercancel",this.gn,{capture:!0}),b.removeEventListener("blur",this.gn),this.gn(),b.removeEventListener("scroll",this.In,{capture:!0}),null==h||h.removeEventListener("selectionchange",this.An),b.removeEventListener("touchstart",this.Fn,{capture:!0}),b.removeEventListener("touchend",this.Bn,{capture:!0}),b.removeEventListener("touchcancel",this.jn,{capture:!0}),null==h||h.removeEventListener("visibilitychange",this.ar),b.removeEventListener("blur",this.Pn),b.removeEventListener("focus",this.Pn),this.qn=void 0}Kn(t){this.Hn=Date.now()}Un(){zn(b,"click",this.Sn),zn(b,"mousedown",this.bn,{capture:!0}),zn(b,"mouseup",this._n,{capture:!0}),zn(b,"mouseout",this.kn,{capture:!0}),zn(b,"dragstart",this.gn,{capture:!0}),zn(b,"pointercancel",this.gn,{capture:!0}),zn(b,"blur",this.gn)}Mn(t){t.selectionChangedDelayMs=Db(t.timestamp,this.En,this.xn.selection_change_threshold_ms),t.visibilityChangedDelayMs=Db(t.timestamp,this.Ln),t.focusChangedDelayMs=Db(t.timestamp,this.Nn),this.fn.push(t)}Tn(){this.fn.length&&Te(this.Xn)&&(this.Xn=b.setTimeout(()=>{this.Yn()},1e3))}zn(){zn(b,"scroll",this.In,{capture:!0})}Wn(){var t;this.vn="Range"===(null==h||null==(t=h.getSelection())?void 0:t.type),zn(h,"selectionchange",this.An)}On(t,e){for(var i=e.path[0];t;){if(-1!==e.path.indexOf(t)||rs(i)&&i.contains(t))return!0;t=t.getRootNode().host}return!1}wn(t,e){var i=e.path[0],r=t.rangeCount>0?t.getRangeAt(0):void 0;if(r&&rs(i)&&r.startContainer.getRootNode()===i.getRootNode()){var n;if(!r.collapsed)return r.intersectsNode(i);var s=rs(r.startContainer)&&null!==(n=r.startContainer.childNodes[r.startOffset])&&void 0!==n?n:r.startContainer;return this.On(s,e)}return this.On(t.focusNode,e)||this.On(t.anchorNode,e)}Vn(){zn(h,"visibilitychange",this.ar)}Zn(){zn(b,"blur",this.Pn),zn(b,"focus",this.Pn)}Dn(t,e){this.fn.forEach(i=>{var r=$b(e-i.timestamp);Ae(r)&&(Te(i[t])||i[t]>r)&&(i[t]=r)})}Qn(){zn(b,"touchstart",this.Fn,{capture:!0,passive:!0}),zn(b,"touchend",this.Bn,{capture:!0,passive:!0}),zn(b,"touchcancel",this.jn,{capture:!0,passive:!0})}$n(){var t=Te(this.eo)||Ae(this.Hn)&&this.Hn>this.eo;return(Te(this.ro)||t)&&(this.eo=Date.now(),this.ro=!(null==h||!h.querySelector(Fb))),!!this.ro}Cn(t){return!t||("swipe"===t.type?this.io(t):this.no(t))}io(t){return!(!is(t.node)&&!this.fn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!ns(t.node,"html")&&rs(t.node)&&function(t,e){var i;if(!a||Ts(t))return!1;var r=Fe(e)?ws:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ws;return!ps(Ms(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.xn.css_selector_ignorelist}))}no(t){return!(this.xn.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.io(t)||(i=t.node,!(!a||Ts(i))&&Ms(i,!1).targetElementList.some(t=>ns(t,"a")));var e,i}Yn(){if(this.fn.length){clearTimeout(this.Xn),this.Xn=void 0;var t=this.fn;for(var e of(this.fn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Hn&&this.Hn>=e.timestamp?this.Hn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp;var r=Ob(e.scrollDelayMs,this.xn.scroll_threshold_ms),n=Ob(e.selectionChangedDelayMs,this.xn.selection_change_threshold_ms),s=Ob(e.mutationDelayMs,this.xn.mutation_threshold_ms),o=Ob(e.absoluteDelayMs,1.1*this.xn.mutation_threshold_ms),a=Ae(e.scrollDelayMs)&&this.xn.scroll_threshold_ms>e.scrollDelayMs,l=Ae(e.mutationDelayMs)&&this.xn.mutation_threshold_ms>e.mutationDelayMs,u=e.selectionChangedDuringGesture||Ae(e.selectionChangedDelayMs)&&this.xn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Ae(e.visibilityChangedDelayMs),d=Ae(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=Pb(e);if("$dead_swipe"===v){if(this.pn>=this.xn.max_dead_swipes_per_page_load)continue;this.pn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Hn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.xn.mutation_threshold_ms>e.absoluteDelayMs&&this.fn.push(e)}this.Tn()}}dn(t,e){var i=Pb(t);this.instance.capture(i,n({},e,Mb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.xn.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lb(t,e);var Nb=Pn("[ExternalScriptsLoader]"),qb=t=>{var e=null==h?void 0:h.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},jb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Nb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=qb(e);if(r){if(r.__posthog_loading_callback_fired)return i();var n=r.__posthog_loading_error;return n?i(n):(r.addEventListener("load",t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)}),void r.addEventListener("error",t=>{r.__posthog_loading_error=t,i(t)}))}var s=()=>{if(!h)return i("document not found");if(qb(e))return jb(t,e,i);var r=h.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>{r.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)h.head.appendChild(r);else{var n,s=h.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):h.body.appendChild(r)}};null!=h&&h.body?s():null==h||h.addEventListener("DOMContentLoaded",s)},Bb={},Hb=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=Bb[n];if("fallback"===r&&s){if(qb(s))return void jb(t,s,i);delete Bb[n]}jb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=Hb(t,e);Bb[n]=a;var l=qb(n);null==l||null==(o=l.parentNode)||o.removeChild(l),jb(t,a,i)}else i(void 0,s)}:i)}else jb(t,Hb(t,e),i)}else jb(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{jb(t,t.requestRouter.endpointFor("api",e),i)};var zb=class{constructor(t){this._instance=t}get xn(){return this._instance.config}get consent(){return this.xo()?0:this.Co}isOptedOut(){return"always"===this.xn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.xn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.xn.opt_out_capturing_by_default}optInOut(t){this.To.Ot(this.Mo,t?1:0,this.xn.cookie_expiration,this.xn.cross_subdomain_cookie,this.xn.secure_cookie)}reset(){this.To.Dt(this.Mo,this.xn.cross_subdomain_cookie)}get Mo(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get Co(){var t=this.To.Lt(this.Mo);return ze(t)?1:pe(Ue,t)?0:-1}get To(){var t=this.xn.opt_out_capturing_persistence_type,e="localStorage"===t?Sa:wa,i=e.Et()?e:$a;if(!this.Io||this.Io!==i){this.Io=i;var r="localStorage"===t?wa:Sa;r.Lt(this.Mo)&&(this.Io.Lt(this.Mo)||this.optInOut(ze(r.Lt(this.Mo))),r.Dt(this.Mo,this.xn.cross_subdomain_cookie))}return this.Io}xo(){return!!this.xn.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,b.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(t=>ze(t))}},Ub=Pn("[Dead Clicks]"),Wb=()=>!0,Vb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(D)),r=t.instance.config.capture_dead_clicks;return Fe(r)?r:!!xe(r)||i},Gb=class{get lazyLoadedDeadClicksAutocapture(){return this.Eo}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[D]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ro(()=>{this.Ao()}):this.stop()}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",e=>{e?Ub.error("failed to load script",e):t()})}Ao(){var t;if(h){if(!this.Eo&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=xe(this.instance.config.capture_dead_clicks)?n({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Eo=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Eo.start(h),Ub.info("starting...")}}else Ub.error("`document` not found. Cannot start.")}stop(){this.Eo&&(this.Eo.stop(),this.Eo=void 0,Ub.info("stopping..."))}},Zb=Pn("[SegmentIntegration]");function Jb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();var s,o=(t=>Se(t.register))(s=r)?{analytics:s}:s,a=o.analytics,l=o.filterProperties;!function(t,e,i,r){var n=e=>{var n=()=>e.anonymousId()||ga();t.config.get_device_id=n,r&&e.id()&&(t.register({distinct_id:e.id(),$device_id:n()}),t.persistence.set_property(At,ee)),i(r?void 0:e.anonymousId()||void 0)},s=e.user();"then"in s&&Se(s.then)?s.then(n):n(s)}(t,a,i=>{a.register(function(t,e,i){var r=(void 0===i?{}:i).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Zb.warn("This browser does not have Promise support, and can not use the segment integration");var s=(i,s)=>{if(!s)return i;var o=!!e&&i.event.anonymousId===e&&!i.event.userId;o||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Zb.info("No userId set, resetting PostHog"),t.reset()),o||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Zb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var a=t.calculateEventProperties(s,i.event.properties);if(!Re(r)){var l=i.event.properties||{},u={};for(var h of Object.keys(a))_e.call(l,h)||(u[h]=a[h]);var d=((t,e)=>{var i=ke(t)?t:[t],r=n({},e);for(var s of i)try{if(r=s(r),Re(r))return null}catch(t){return Zb.error("Error in Segment filterProperties:",t),null}return r})(r,u);if(Re(d))return i;a=d}return i.event.properties=Object.assign({},a,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return s(t,t.event.event)},page(t){return s(t,se)},identify(t){return s(t,ae)},screen(t){return s(t,"$screen")}}}(t,i,{filterProperties:l})).then(()=>{e()},t=>{Zb.error("Failed to register the Segment integration",t),e()})},i)}var Qb="posthog-js";function Kb(t,e){var i=void 0===e?{}:e,r=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,v,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map(t=>n({},t,{stacktrace:t.stacktrace?n({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>n({},t,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return r&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var Xb=class{constructor(t,e,i,r,n,s){this.name=Qb,this.setupOnce=function(o){o(Kb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},Yb=class{constructor(t){this.Po=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(An.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Fo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Oo()}Oo(){var t;this.$o=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Po)}destroy(){var t;null==(t=this.$o)||t.call(this),this.$o=void 0}doPageView(t,e){var i,r=this.Do(t,e);return this.Fo={pathname:null!==(i=null==a?void 0:a.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Do(t,null==(e=this.Fo)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Fo)?void 0:t.pageViewId}}Do(t,e){var i=this.Fo;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Te(s)||Te(o)||Te(a)||Te(l)||Te(u)||Te(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Ge(o/s,0,1,An):1,v=s>1?Ge(a/s,0,1,An):1,c=l>1?Ge(u/l,0,1,An):1,f=l>1?Ge(h/l,0,1,An):1;r=$n(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},t_=["flags","surveys"],e_={[_]:{exposure:"hidden"},[x]:{exposure:"hidden"},[C]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[E]:{exposure:"event"},[R]:{exposure:"hidden"},[N]:{exposure:"hidden"},[A]:{exposure:"event"},[P]:{exposure:"hidden"},[F]:{exposure:"event"},[O]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"hidden"},[q]:{exposure:"event"},[j]:{exposure:"hidden"},[B]:{exposure:"hidden"},[G]:{exposure:"hidden"},[Z]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Ee(t)},[J]:{exposure:"event"},[Q]:{exposure:"event"},[K]:{exposure:"event"},[et]:{exposure:"event"},[it]:{exposure:"hidden"},[rt]:{exposure:"hidden",storageGroup:"flags"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden"},[ot]:{exposure:"hidden",storageGroup:"flags"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ut]:{exposure:"hidden",storageGroup:"flags"},[ht]:{exposure:"hidden"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[pt]:{exposure:"hidden",storageGroup:"surveys"},[gt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[mt]:{exposure:"event"},[yt]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[_t]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"event"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[ft]:{exposure:"event"},[Et]:{exposure:"hidden"},[Rt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[At]:{exposure:"hidden"},[Pt]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[z]:{exposure:"event"},[U]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[jt]:{exposure:"event"},[Bt]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Ut]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},i_=[[X,{exposure:"hidden"}],[Y,{exposure:"hidden"}],[tt,{exposure:"hidden"}]],r_=t=>{var e=e_[t];if(e)return e;for(var i of i_){var r=i[1];if(0===t.indexOf(i[0]))return r}},n_={flags:Rt,surveys:gt},s_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],o_=t=>t+"_cookie_identity_change_pending",a_=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},l_="main",u_=[rt,nt,ot,at,lt,Rt,ut,vt],h_=t=>-1!==u_.indexOf(t),d_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},v_=t=>{if(!t)return{};var e=JSON.parse(t);return xe(e)?e:{}},c_=(t,e)=>{On(t,(i,r)=>{var n=r_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},f_=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.Lo={},this.No=!1,this.qo=!1,this.jo=!1,this.Bo=!1,this.Ho=!1,this.zo=new Map,this.Uo=!1,this.Wo=!1,this.Vo=!1,this.Go=!1,this.Zo=new Set,this.xn=t,this.Jo=i,this.props={},this.Qo=void 0,this.Ko=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.To=this.Xo(t),this.jo=this.Yo(t),this.load(),this.ta(),t.debug&&An.info("Persistence loaded",t.persistence,n({},this.props)),this.update_config(t,t,e),this.save(),a){var r=()=>this.flush();zn(a,"beforeunload",r,{capture:!1}),zn(a,"pagehide",r,{capture:!1}),this.ea=t=>{if(this.No&&(!t.storageArea||t.storageArea===(null==a?void 0:a.localStorage))&&t.key)if(t.key!==this.Ko){if(this.jo){var e=t_.find(e=>t.key===this.ia(e));e&&this.ra(t.key,e)}}else this.ra(t.key,l_)},zn(a,"storage",this.ea)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.zo.get(e);if(h_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.na(e,n)}else this.na(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Zo.add(t),()=>this.Zo.delete(t)}destroy(){this.ea&&a&&(a.removeEventListener("storage",this.ea),this.ea=void 0),this.Zo.clear()}ra(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,n;try{if(n=Sa.Lt(t),Ee(n)){var s=this.sa(e);return s.storageValue=null,e!==l_&&(s.persisted=!1),!1}r=v_(n)}catch(t){return!1}var o=e===l_?r:Sa.Nt(this.Ko);if(o&&this.oa(o))return!1;var a=this.aa(r,e,i);return e===l_&&this.jo&&!d_(this.la().main,r)||this.ua(r,e,!0,n),a}oa(t){var e=this.props[w],i=t[w];return!Te(e)&&!Te(i)&&e!==i}ua(t,e,i,r){var n=this.sa(e);n.storageValue=r,e!==l_&&(n.persisted=i);try{n.fingerprint=this.ha(t,e)}catch(t){n.fingerprint=void 0}}aa(t,e,i){var r=!1;return u_.forEach(i=>{var n,s=null==(n=r_(i))?void 0:n.storageGroup;if(!(e===l_&&this.jo&&s||e!==l_&&s!==e)){var o=i in t,a=this.da(i,o?t[i]:void 0),l=this.zo.has(i)?i in this.props:o;l===i in this.props&&d_(a,this.props[i])||(l?this.va(i,a,!1):this.ca(i,!1),r=!0)}}),r&&i&&this.Zo.forEach(t=>t()),r}fa(){if(!this.No)return!1;try{this.Vo=!1;var t,e=Sa.Lt(this.Ko),i=this.sa(l_),r=!1,n=!1;if(e!==i.storageValue)if(Ee(e))i.storageValue=null;else{if(t=v_(e),this.Vo=!this.Wo&&this.oa(t),this.Vo)return!1;n=this.aa(t,l_,!1),!this.jo||d_(this.la().main,t)?this.ua(t,l_,!0,e):i.storageValue=e,r=!0}return this.jo&&t_.forEach(e=>{var i=Sa.Lt(this.ia(e)),s=this.sa(e),o=t||{},a=r&&u_.some(t=>{var i;return(null==(i=r_(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Ee(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.aa(o,e,!1)||n));var l=v_(i);n=this.aa(l,e,!1)||n,this.ua(l,e,!0,i)}}),n}catch(t){return!1}}na(t,e){this.zo.set(t,e);var i=r_(t);null!=i&&i.volatile||(this.sa((this.jo?null==i?void 0:i.storageGroup:void 0)||l_).fingerprint=void 0,this.pa(t))}ga(){u_.forEach(t=>this.zo.set(t,!0))}ta(){if(this.No)try{var t=Sa.Lt(this.Ko),e=v_(t);this.sa(l_).storageValue=t,u_.forEach(t=>{var i,r=this.jo?null==(i=r_(t))?void 0:i.storageGroup:void 0,n=r?Sa.Lt(this.ia(r)):null;if(r){var s=this.sa(r);s.storageValue=n,s.persisted=!Ee(n)}var o=r&&!Ee(n)?v_(n):e;t in this.props?this.ma(t,o[t],this.props[t]):t in o&&this.na(t,!0)})}catch(t){}}da(t,e){var i=this.zo.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(ke(e)?e:[]),s=new Set(ke(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=xe(e)?n({},e):{},a=xe(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}ma(t,e,i){if(h_(t)){var r=this.zo.get(t);if(!0!==r){var n=e;if(this.No)try{var s,o=this.jo?null==(s=r_(t))?void 0:s.storageGroup:void 0,a=o?this.ia(o):this.Ko;n=v_(Sa.Lt(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Te(e)&&!ke(e)||!Te(n)&&!ke(n)||!ke(i))return void this.na(t,!0);var u=new Set(e||[]),h=new Set(n||[]),d=new Set(i);new Set([...u,...d]).forEach(t=>{u.has(t)!==d.has(t)&&l.add(t)}),l.forEach(t=>{h.has(t)===d.has(t)&&l.delete(t)})}else{if(!xe(i))return void(d_(n,i)?this.zo.delete(t):this.na(t,!0));if(!Te(e)&&!xe(e)||Te(e)&&Ce(i)&&Te(n))return void this.na(t,!0);var v=xe(e)?e:{},c=xe(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&d_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&d_(c[t],i[t])&&l.delete(t)})}l.size?this.na(t,l):this.zo.delete(t)}}}ya(){var t,e=null==(t=this.xn)?void 0:t.persistence_save_debounce_ms;return Ae(e)&&e>0?e:0}ba(t){if(this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase())if(t)try{var e=Ea(t,this.xn.cookie_persisted_properties||[]),i=Aa(e,this.xn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=wa.Lt(this.Ko)||void 0;n&&Fa(this.Ko,n)===r&&(this._a=r,this.wa=n)}catch(t){}else try{var s=wa.Lt(this.Ko)||void 0;this._a=s?Fa(this.Ko,s):void 0,this.wa=s}catch(t){}}syncCookieProperties(){return this.ka(this.xn)}ka(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.Ho||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=wa.Lt(this.Ko)||void 0}catch(t){}if(!i||i===this.wa)return!1;var r,n=Fa(this.Ko,i);try{r=Ia(JSON.parse(i))}catch(t){return!1}if((wa.Lt(this.Ko)||void 0)!==i)return!1;this._a=n,this.wa=i;var s=Pa(this.Ko,i),o=[...Ca,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Te(e)||Ee(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Ce(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[w],d=u[At],v=$n({},u);[...Ca,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(s.isValid||-1===Ca.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=$n(v,r),u_.forEach(t=>{var e=t in this.props;t in u===e&&d_(u[t],this.props[t])||(e?this.ma(t,u[t],this.props[t]):this.na(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.va(At,te);var c=this.props[w],f=this.props[At];return!l||c===h&&f===d||(this.Wo=!0,this.Bo=!0,La.Ot(o_(this.Ko),!0),this.ca(vt),this.ca(nt),this.ca(rt),this.ca(ot),this.ca(at),this.ca(lt),this.ca(Rt),this.ca(Et),this.ca(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Te(h)||c===h)||(c_(this.props,r),this.ca(ct)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.ca(x)),!0}consumeCookieIdentityChange(){var t=o_(this.Ko),e=this.Bo||!!La.Lt(t);return this.Bo=!1,e&&La.Dt(t),e}Sa(t){return void 0===t&&(t=!1),!(this.Ho||this.gi&&!t||!this.xn.cookieWinsOnConflict||"localstorage+cookie"!==this.xn.persistence.toLowerCase()||(this.Ho=!0,0))}xa(){this.Ho&&(Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0),delete this.Lo[l_],this.Ta(!0))}Ma(t){if(void 0===t&&(t=!0),this.Ho)try{t?this.xa():Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0)}finally{this.Ho=!1}}isDisabled(){return!!this.gi}Xo(t){-1===s_.indexOf(t.persistence.toLowerCase())&&(An.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Ca,...t];return n({},Sa,{Nt(t){try{var r,n={};try{r=wa.Lt(t)||void 0,n=r?Ia(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(Sa.Lt(t)||"{}");if(e){var a=Pa(t,r),l=[...Ca,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Ee(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var d,v=o[w],c=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";i.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=o[t];(a.isValid||-1===Ca.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[At]=te),!h||("distinct_id"in u?u[w]:o[w])===v&&("$user_state"in u?u[At]:o[At])===c||(xa.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[w]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[ft],delete o[ct]),delete o.__alias)}s=$n(o,u)}else s=$n(n,o);return Sa.Ot(t,s),s}catch(t){}return null},Ot(i,r,n,s,o,a){var l=Sa.Ot(i,r,void 0,void 0,a);try{var u=Ea(r,t);if(Object.keys(u).length){if(e){var h=Ta(i),d=Aa(u,t);if(wa.Ot(h,d,n,s,o,a),wa.Lt(h)!==JSON.stringify(d)){wa.Dt(h,s);var v=Ea(r);return wa.Ot(i,v,n,s,o,a),l}}wa.Ot(i,u,n,s,o,a)}}catch(t){Sa.Pt(t)}return l},Dt(t,e){try{null==a||a.localStorage.removeItem(t),wa.Dt(t,e),wa.Dt(Ta(t),e)}catch(t){Sa.Pt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,s=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&Sa.Et()?(e=Sa,s=!0):"localstorage+cookie"===o&&i.Et()?(e=i,s=!0,r=!0):"sessionstorage"===o&&La.Et()?e=La:"memory"===o?e=$a:"cookie"===o&&wa.Et()?(e=wa,r=!0):i.Et()?(e=i,s=!0,r=!0):wa.Et()?(e=wa,r=!0):e=$a,this.No=s,this.qo=r,e}ia(t){return this.Ko+"__"+t}Yo(t){return this.No&&!!t.split_storage}properties(){var t={};return On(this.props,(e,i)=>{var r=r_(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}}),t}load(t){if(void 0===t&&(t=!1),!this.gi||t){var e=this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase(),i=e?Sa.Nt(this.Ko):null,r={};if(e)try{On(r=Ia(wa.Nt(this.Ko)),(t,e)=>{(Te(t)||Ee(t)||""===t)&&delete r[e]})}catch(t){}var n=this.To.Nt(this.Ko);if(n&&(this.props=$n({},n)),this.jo&&this.Ia(),e&&n){var s,o,a=null==i?void 0:i[w],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[w],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.Bo=!0,La.Ot(o_(this.Ko),!0);var d=$n({},this.props);xa.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Te(a)||u===a)||(c_(d,r),delete d[ct]),this.props=d;var v=new Set;xa.forEach(t=>{var e,i=null==(e=r_(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};On(this.props,(i,r)=>{var n;(null==(n=r_(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Ce(e)?(Sa.Dt(this.ia(t)),this.Lo[t]={}):Sa.Ot(this.ia(t),e)&&(this.Lo[t]={persisted:!0,fingerprint:this.ha(e,t)})})}}La.Lt(o_(this.Ko))&&(this.Bo=!0)}}Ia(){for(var t of t_){var e=Sa.Nt(this.ia(t));if(e&&!Ce(e)){var i=this.sa(t);i.persisted=!0,this.Ea(t)||(i.fingerprint=this.ha(e,t)),this.Ra(t,e)||$n(this.props,e)}}}Ea(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=r_(e))?void 0:i.storageGroup)===t})}Ra(t,e){var i=n_[t];if(!i)return!1;var r=e[i],n=this.props[i];return Ae(r)&&Ae(n)&&n>r}refreshKey(t){var e;if(!(this.gi||"$fbc_persistence"===t&&this.Go)){var i=this.jo?null==(e=r_(t))?void 0:e.storageGroup:void 0,r=i?Sa.Nt(this.ia(i)):this.To.Nt(this.Ko);if(r&&t in r)this.va(t,r[t],!1);else{if(i){var n=this.To.Nt(this.Ko);if(n&&t in n)return void this.va(t,n[t],!1)}this.ca(t,!1)}}}save(){if(!this.gi){var t=this.ya();t>0?Te(this.Ca)&&(this.Ca=setTimeout(()=>{this.Ca=void 0,this.Ta()},t)):this.Ta()}}flush(){Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0,this.Ta())}Ta(t){if(void 0===t&&(t=!1),!(this.gi||this.Ho&&!t)){t||(this.syncCookieProperties(),this.Go||this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.Uo;e||(this.Vo=!1);var i=!!e&&this.fa();if(this.Vo)this.xn.debug&&An.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.jo)return this.Aa(),void(i&&this.Zo.forEach(t=>t()));var r=this.Pa(this.To,this.Ko,this.props,l_);"written"===r&&this.ba(this.props),"failed"!==r&&(this.zo.clear(),this.Wo=!1,this.Go=!1),i&&this.Zo.forEach(t=>t())}}}Aa(){var t=this,e=this.la(),i=e.main,r=e.groups,n=this.Pa(this.To,this.Ko,i,l_);"written"===n&&this.ba(i),"failed"!==n&&(this.Wo=!1,this.Go=!1,u_.forEach(t=>{var e;null!=(e=r_(t))&&e.storageGroup||this.zo.delete(t)}));var s=function(e){var i,n=r[e];if(Ce(n)&&(null==(i=t.Lo[e])||!i.persisted))return u_.forEach(i=>{var r;(null==(r=r_(i))?void 0:r.storageGroup)===e&&t.zo.delete(i)}),1;var s=t.Pa(Sa,t.ia(e),n,e);"failed"!==s&&u_.forEach(i=>{var r=r_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.zo.delete(i)})};for(var o of t_)if(s(o))continue}la(){var t={},e={flags:{},surveys:{}};return On(this.props,(i,r)=>{var n,s=null==(n=r_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}ha(t,e){if(e===l_)return JSON.stringify(t)+"|"+this.Fa+"|"+this.Oa+"|"+this.$a;var i={};return On(t,(t,e)=>{var r;i[e]=null!=(r=r_(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}Pa(t,e,i,r){var n,s=this.sa(r);if(r!==l_&&!s.dirty&&!Te(s.fingerprint))return"skipped";try{if((n=this.ha(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.Ot(e,i,this.Fa,this.Oa,this.$a,this.xn.debug)?(s.dirty=!1,r!==l_&&(s.persisted=!0),Te(n)||(s.fingerprint=n),this.No&&(s.storageValue=Sa.Lt(e)),"written"):(this.xn.debug&&An.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.ga(),Te(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0),this.To.Dt(this.Ko,!1),this.To.Dt(this.Ko,!0),!i&&this.Jo)for(var r of t_)Sa.Dt(this.ia(r));i?delete this.Lo[l_]:this.Lo={},this._a=void 0,this.wa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(xe(t)){this.syncCookieProperties(),Te(e)&&(e="None"),this.Fa=Te(i)?this.Da:i;var r=!1;if(On(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.va(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(xe(t)){this.syncCookieProperties(),this.Fa=Te(e)?this.Da:e;var i=!1;if(On(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||xe(e)||ke(e))&&(this.va(r,e),i=!0)}),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.ca(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.Qo){var e=fl(this.xn.custom_campaign_params,this.xn.mask_personal_data_properties,this.xn.custom_personal_data_properties),i=!Ce(qn(e));return i&&this.register(e),this.Qo=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==h?void 0:h.referrer)?gl(t):{})}update_referrer_info(){var t;this.register_once({$referrer:bl(),$referring_domain:null!=h&&h.referrer&&(null==(t=Gn(h.referrer))?void 0:t.host)||yl},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=_l(this.xn.mask_personal_data_properties,this.xn.custom_personal_data_properties,this.xn.disable_capture_url_hashes);this.register_once({[Dt]:this.qo?{r:a_(t.r),u:t.u?a_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};On([$t,Ot],e=>{var i=this.props[e];i&&On(i,function(e,i){t["$initial_"+me(i)]=e})});var e=this.props[Dt];return e&&$n(t,function(t,e){void 0===e&&(e=!1);var i=wl(t,e),r={};return On(i,function(t,e){r["$initial_"+me(e)]=t}),r}(e,this.xn.disable_capture_url_hashes)),t}safe_merge(t){return On(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,i){var r=t.persistence!==e.persistence,s=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every((t,e)=>t===r[e])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=r||s,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.gi&&!l;l||this.ka(e,u),this.xn=t,!l&&(r||s||a)&&(this._a=void 0,this.wa=void 0,this.ka(n({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Xo(t):this.To;this.La();var d=this.Yo(t),v=o||d!==this.jo,c=!l&&(v||t.cross_subdomain_cookie!==this.Oa||t.secure_cookie!==this.$a)&&this.Sa(u);this.Uo=v;try{if(this.Da=this.Fa=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var f=this.props;this.clear(),this.To=h,this.jo=d,this.props=f,this.save()}else a&&(this.To=h,l||(delete this.Lo[l_],this.Ta()))}finally{this.Uo=!1,c&&this.Ma()}}La(){var t=this.props[Dt];if(this.qo&&xe(t)&&"string"==typeof t.r){var e=a_(t.r),i="string"==typeof t.u?a_(t.u):t.u;e===t.r&&i===t.u||this.va(Dt,n({},t,{r:e,u:i}))}}set_disabled(t){this.gi=t,this.gi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Oa&&(this.Oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.$a&&(this.$a=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.va(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Te(i)||(delete e[t],this.va(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.va(t,e),this.save()}va(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||n===e||(this.Wo=!0),"$fbc_persistence"!==t||d_(n,e)||(this.Go=!0),this.ma(t,n,e),null!=(r=r_(t))&&r.volatile||this.pa(t))}ca(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(h_(t)&&this.na(t,!0),"$fbc_persistence"===t&&(this.Go=!0),this.pa(t))}pa(t){var e,i=null==(e=r_(t))?void 0:e.storageGroup;i&&(this.sa(i).dirty=!0)}sa(t){return this.Lo[t]||(this.Lo[t]={})}},p_=Pn("[RateLimiter]"),g_=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach(t=>{p_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void p_.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(Ae(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Na(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}qa(t){var e=this.instance.config.property_denylist;return!ke(e)||!e.includes(t)}ja(){var t;if(this.qa("$current_url")&&this.qa("$pathname")&&null!=d&&d.pathname)return""+(null!==(t=d.origin)&&void 0!==t?t:"")+d.pathname}Na(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ja(),o=this.qa("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}},m_=Pn("[RemoteConfig]"),y_=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Ba(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Ha(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return m_.info("Using preloaded remote config",this.remoteConfig),void this.za(this.remoteConfig);if(this._instance.Ua())return void m_.warn("Remote config is disabled. Falling back to local config.");this.Ba(t=>{if(!t)return m_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ha(t=>{this.za(t.json,t)});this.za(t)})}catch(t){m_.error("Error loading remote config",t),this.za()}}za(t,e){!t&&e&&(0===e.statusCode?e.error||m_.warn("Failed to fetch remote config from PostHog."):m_.error("Failed to fetch remote config from PostHog."));try{this._instance.za(t?{ok:!0,config:t}:{ok:!1})}catch(t){m_.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){m_.error("Error loading feature flags",t)}}},b_=!!c||!!v,__="text/plain",w_=!1,k_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},S_=function(t,e,i){var r;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=n({},e),u=null!==(r=null==a?void 0:a.split("&").map(t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s}))&&void 0!==r?r:[],h=Zn(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},x_=t=>{if(t.Wa)return t.Wa;var e=t.data,i=t.compression;if(e){if(i===Wf){var r=oa(aa(Vn(e)),{mtime:0});return{contentType:__,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Vf){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Vn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(Vn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=Vn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},C_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:S_(t.url,{compression:Vf}),encodedBody:x_(n({},t,{compression:Vf,Wa:void 0}))}:{url:k_(t.url,"compression"),encodedBody:x_(n({},t,{compression:void 0,Wa:void 0}))};try{e=x_(t)}catch(e){if(en(t.compression,Jn(t.url,"compression")))return An.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&en(t.compression,Jn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?tn(new Uint8Array(i)):ArrayBuffer.isView(i)&&tn(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(w_=!0,r()):{url:t.url,encodedBody:e}},T_=t=>{try{return C_(t)}catch(e){return An.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},M_=function(){var t=o(function*(t){var e=yield an(Vn(t.data),Na.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return n({},t,{Wa:{contentType:__,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),I_=/Failed to fetch|NetworkError|Load failed/i,E_=t=>"TypeError"===(null==t?void 0:t.name)&&I_.test((null==t?void 0:t.message)||""),R_=t=>{var e=T_(t);if(e){var i=new c,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;On(t.headers,function(t,e){i.setRequestHeader(e,t)}),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(o)}},A_=t=>{var e=T_(t);if(e){var i=e.url,r=e.encodedBody,s=null!=r?r:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;On(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var h=null,d=!1;if(f){var c=new f;h={signal:c.signal,timeout:setTimeout(()=>{var e;d=!0,c.abort(or("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var p=e=>{d&&"AbortError"===(null==e?void 0:e.name)||E_(e)?An.warn(e):An.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;v(i,n({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Va&&52428.8>(l||0),body:a,signal:null==(g=h)?void 0:g.signal},t.fetchOptions)).then(e=>e.text().then(i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){An.error(t)}null==t.callback||t.callback(r)})).catch(p).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),p(t)}}},P_=t=>{try{var e,i=C_(t),r=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var h=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(u.sendBeacon(r,h))return;var d=ke(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(ke(d)&&d.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(d.length/2),f=e=>ke(t.data)?e:n({},t.data,{batch:e});return P_(n({},t,{data:f(d.slice(0,c))})),void P_(n({},t,{data:f(d.slice(c))}))}An.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(v?"fetch":"XHR")),v?A_(n({},t,{Va:!0})):R_(t)}catch(t){An.warn("Beacon send failed",t)}},F_=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return S_(i===Wf?k_(t,"compression"):t,n({},s?{[s]:Date.now().toString()}:{},i===Wf?{}:{compression:i}))},O_=[];v&&O_.push({transport:"fetch",method:A_}),c&&O_.push({transport:"XHR",method:R_}),null!=u&&u.sendBeacon&&O_.push({transport:"sendBeacon",method:P_});var $_=class{constructor(t,e){this.Ga=!0,this.Za=[],this.Ja=Ge((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,An.createLogger("flush interval"),3e3),this.Qa=t}enqueue(t){this.Za.push(t),this.Ka||this.Xa()}unload(){this.Ya();var t=this.Za.length>0?this.tl():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.el(n({},t,{transport:"sendBeacon"}))})}enable(){this.Ga=!1,this.Xa()}Xa(){var t=this;this.Ga||(this.Ka=setTimeout(()=>{if(this.Ya(),this.Za.length>0){var e=this.tl(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&ke(i.data)&&On(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.el(i)};for(var r in e)i()}},this.Ja))}el(t){try{this.Qa(t)}catch(t){An.error(t)}}Ya(){clearTimeout(this.Ka),this.Ka=void 0}tl(){var t={};return On(this.Za,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;Te(t[s])&&(t[s]=n({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.Za=[],t}},D_=class{constructor(t){this._instance=t,this.il=!1,this.rl=3e3,this.Za=[],this.Za=[],this.nl=!0,this.resume()}resume(){if(!Te(a)&&"onLine"in a.navigator){if(this.nl=a.navigator.onLine,this.sl)return;this.sl=()=>{this.nl=!0,this.ol()},this.al=()=>{this.nl=!1},zn(a,"online",this.sl),zn(a,"offline",this.al)}}get length(){return this.Za.length}retriableRequest(t){var i=t.retriesPerformedSoFar,s=r(t,e);Pe(i)&&(s.url=S_(s.url,{retry_count:i})),this._instance._send_request(n({},s,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=i?i:0))return void this.Is(n({retriesPerformedSoFar:i},s));0===t.statusCode&&An.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!=i?i:0)+" retries.")}null==s.callback||s.callback(t)}}))}Is(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=(Math.random()-.5)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.Za.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),An.warn(n),this.il||(this.il=!0,this.ll())}ll(){if(this.ul&&clearTimeout(this.ul),0===this.Za.length)return this.il=!1,void(this.ul=void 0);this.ul=setTimeout(()=>{this.nl&&this.Za.length>0&&this.ol(),this.ll()},this.rl)}ol(){var t=Date.now(),e=[],i=this.Za.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Za=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.ul&&(clearTimeout(this.ul),this.ul=void 0),this.il=!1,Te(a)||(this.sl&&(a.removeEventListener("online",this.sl),this.sl=void 0),this.al&&(a.removeEventListener("offline",this.al),this.al=void 0)),this.Za)){var e=t.requestOptions;try{this._instance._send_request(n({},e,{transport:"sendBeacon"}))}catch(t){An.error(t)}}this.Za=[]}},L_=class{constructor(t){this._instance=t,this.hl=()=>{var t,e,i,r;this.dl||(this.dl={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.dl.lastScrollY=Math.ceil(s),this.dl.maxScrollY=Math.max(s,null!==(t=this.dl.maxScrollY)&&void 0!==t?t:0),this.dl.maxScrollHeight=Math.max(o,null!==(e=this.dl.maxScrollHeight)&&void 0!==e?e:0),this.dl.lastContentY=a,this.dl.maxContentY=Math.max(a,null!==(i=this.dl.maxContentY)&&void 0!==i?i:0),this.dl.maxContentHeight=Math.max(l,null!==(r=this.dl.maxContentHeight)&&void 0!==r?r:0)}}get vl(){return this._instance.config.scroll_root_selector}getContext(){return this.dl}resetContext(){var t=this.dl;return setTimeout(this.hl,0),t}startMeasuringScrollPosition(){zn(a,"scroll",this.hl,{capture:!0}),zn(a,"scrollend",this.hl,{capture:!0}),zn(a,"resize",this.hl)}scrollElement(){var t;if(!this.vl)return null==a||null==(t=a.document)?void 0:t.documentElement;for(var e of ke(this.vl)?this.vl:[this.vl]){var i,r=null==a||null==(i=a.document)?void 0:i.querySelector(e);if(r)return r}}cl(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.vl){var n=this.scrollElement();return n&&n[r]||0}return a?"y"===t?a.scrollY||a.pageYOffset||(null==(e=a.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:a.scrollX||a.pageXOffset||(null==(i=a.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.cl("y")}scrollX(){return this.cl("x")}},N_=t=>_l(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes),q_=class{constructor(t,e,i,r){this.Be=t=>{var e=this.fl();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.pl(this._instance)};this.gl.register({[Pt]:i})}},this._instance=t,this.ml=e,this.gl=i,this.pl=r||N_,this.ml.onSessionId(this.Be)}fl(){return this.gl.props[Pt]}getSetOnceProps(){var t,e=null==(t=this.fl())?void 0:t.props;return e?"r"in e?wl(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return On(qn(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+me(i)]=e}),t}},j_=class{on(t,e){return this.yl[t]||(this.yl[t]=[]),this.yl[t].push(e),()=>{this.yl[t]=this.yl[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.yl[t]||[])i(e);for(var r of this.yl["*"]||[])r(t,e)}constructor(){this.yl={}}},B_=Pn("[SessionId]"),H_=864e5,z_=class{on(t,e){return this.bl.on(t,e)}constructor(t,e,i){var r;if(this._l=null,this.wl=null,this.kl=[],this.Sl=void 0,this.xl=!1,this.bl=new j_,this.Cl=(t,e)=>!(!Pe(t)||!Pe(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.xn=t.config,this.gl=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Tl=void 0,this._sessionActivityTimestamp=null,this.Ml=e||ga,this.Il=i||ga;var n=this.xn.persistence_name||this.xn.token;if(this._sessionTimeoutMs=1e3*Ge(this.xn.session_idle_timeout_seconds||1800,60,36e3,B_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.El(),this.Rl="ph_"+n+"_window_id",this.Al="ph_"+n+"_primary_window_exists",this.Pl()){var s=La.Nt(this.Rl),o=La.Nt(this.Al);s&&!o?this.He=s:La.Dt(this.Rl),La.Ot(this.Al,!0)}null!=(r=this.xn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.xn.bootstrap.sessionID),this.Fl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Te(this.kl)&&(this.kl=[]),this.kl.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.kl=this.kl.filter(e=>e!==t)}}Pl(){return"memory"!==this.xn.persistence&&!this.gl.gi&&La.Et()}Ol(t){t!==this.He&&(this.He=t,this.Pl()&&La.Ot(this.Rl,t))}$l(){return this.He?this.He:this.Pl()?La.Nt(this.Rl):null}Dl(t){var e=this._l;return!Ee(e)&&!Ee(t)&&5e3>Math.abs(t-e)}Ll(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xt=t,n&&!r||n&&this.Dl(e)||(this._l=e,this.gl.register({[G]:[e,t,i]}))}Nl(){var t,e=null==(t=this.xn)?void 0:t.persistence_save_debounce_ms;return Pe(e)&&e>0}ql(){this.Nl()?this.gl.refreshKey(G):(this.gl.flush(),this.gl.load())}jl(){var t;if(!Ee(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._l){this.ql();var e=this.Bl();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this._l=this._sessionActivityTimestamp,this.gl.register({[G]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.gl.flush())}}Hl(){var t=this.Bl()[0],e=Pe(t)?t:0,i=Pe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}zl(t){return this.ql(),this.Cl(t,this.Hl())}Bl(){var t=this.gl.props[G];return ke(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this._l=null,this.Tl=void 0,clearTimeout(this.Ul),this.Ul=void 0,this.Ll(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void B_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void B_.error("Invalid sessionID in bootstrap",t)}}(t);return!Te(i)&&(e?this.Tl={sessionId:t,sessionStartTimestamp:i}:this.Ll(t,(new Date).getTime(),i),!0)}destroy(){this.xl=!0,this.jl(),clearTimeout(this.Ul),this.Ul=void 0,this.Sl&&a&&(a.removeEventListener(ne,this.Sl,{capture:!1}),this.Sl=void 0),this.kl=[]}Fl(){this.Sl=()=>{this.jl(),this.Pl()&&La.Dt(this.Al)},zn(a,ne,this.Sl,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.xn.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Xt;if(i)this.wl=r;else if(Ee(this.wl)||this.wl>r||r-this.wl>=1e3){var s,o;null==(s=(o=this.gl).syncCookieProperties)||s.call(o),this.wl=r}var a=this.Bl(),l=a[1],u=a[2],h=!Te(n)&&l!==n,d=this.Hl(),v=this.$l(),c=this.Tl,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>H_),p=c?f:Pe(u)&&Math.abs(r-u)>H_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Cl(r,d);if(_){(_=this.zl(r))||B_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Bl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Ml(),v=this.Il(),B_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Tl=void 0,g=!0}else v||(v=this.Il(),g=!0),(m=m||l!==b)&&(B_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=Pe(d)&&t&&!p?d:r,x=Pe(u)?u:(new Date).getTime();this.Ol(v),this.Ll(l,S,x),t||this.El();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.kl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}El(){this.xl||(clearTimeout(this.Ul),this.Ul=setTimeout(()=>{if(!this.xl)if(this.zl((new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.bl.emit("forcedIdleReset",{idleSessionId:t})}else this.El()},1.1*this.sessionTimeoutMs))}},U_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&Ve(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>Ve(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function W_(){return W_=o(function*(){var t=null==u?void 0:u.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Me(i)&&i.length>0?i:void 0}catch(t){return void An.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),W_.apply(this,arguments)}var V_="custom",G_="i.posthog.com",Z_=/^\/static\//,J_=["/s/","/e/","/i/"],Q_=class{constructor(t){this.Wl={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+G_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Wl[this.apiHost]||(this.Wl[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":V_),this.Wl[this.apiHost]}Vl(t){if(Z_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Gl(t){var e=Gn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Zl(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=Gn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&J_.some(t=>0===e.indexOf(t))){var a=this.Gl(r);if(a){var l,u=this.apiHost,h=this.Jl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Jl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Jl,i=this.Gl(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Zl(t,e,this.uiHost+e);if("flags"===t)return this.Zl(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.Vl(e);if(i)return this.Zl(t,e,""+i+e)}if(this.region===V_)return this.Zl(t,e,this.apiHost+e);var r=G_+e;switch(t){case"assets":return this.Zl(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Zl(t,e,"https://"+this.region+"."+r)}}},K_=Pn("[PostHog ExternalIntegrations]"),X_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Y_=class{constructor(t){this._instance=t}Ro(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return K_.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=b.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ro(X_[s],()=>{var e;null==(e=b.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)}),!o&&null!=(r=b.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=b.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}},tw=class{constructor(t,e){this.A=t,this.ao=e,this.Ql=new Map,this.fo=!1}add(t){var e=this;return o(function*(){if(e.fo)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Ql.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Ql.set(t.name,t);try{var i=t.setup(e.ao);i&&(yield i)}catch(i){var r=e.Ql.get(t.name)===t;r&&e.Ql.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Kl(t)}})()}getExtension(t){return this.Ql.get(t)}dispose(){if(!this.fo){this.fo=!0;var t=Array.from(this.Ql.values()).reverse();for(var e of(this.Ql.clear(),t))this.Kl(e)}}Kl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Se(e.then)&&e.then(void 0,e=>{this.A.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.A.error('Failed to dispose browser extension "'+t.name+'"',e)}}},ew=class{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var n=null==e?void 0:e.get_property(r);Te(n)||(i[r]=n)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}},iw="extensionsRemoteConfig",rw=class{constructor(t){this.instance=t,this.fo=!1,this.A=An,this.Xl=t.Yl,this.kv=new ew(t),this.onEvent=t=>kp(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.A.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.fo)return kp(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.tu.on(iw,e);return this.Xl&&e(this.Xl),kp(i)},this.eu=new tw(An.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(k);return"string"==typeof t?t:void 0}get library(){return{name:Na.LIB_NAME,version:Na.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.eu.add(t)}getExtension(t){return this.eu.getExtension(t)}capture(t,e,i){var r=this;return o(function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)})()}registerDynamicEventProperties(t){return kp(this.instance.iu(t))}handleRemoteConfig(t){this.fo||(this.Xl=t,this.instance.tu.emit(iw,t))}sendRequest(t,e){var i=this;return o(function*(){var r;void 0===e&&(e={});var n=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),s={method:e.method,url:e.query?S_(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?he.Base64:void 0,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(s),{statusCode:202}):new Promise(t=>{s.callback=t,i.instance._send_request(s)})})()}dispose(){this.fo||(this.fo=!0,this.eu.dispose())}},nw={},sw=0,ow=()=>{},aw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',lw="Surveys module not available",uw="sanitize_properties is deprecated. Use before_send instead",hw="Invalid value for property_denylist config: ",dw=/^[A-Za-z0-9_-]{1,400}$/,vw=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,cw=["token","distinct_id",qt],fw="posthog",pw=!b_&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),gw=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},mw=t=>{var e;return n({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Hn(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ow,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:d&&Me(null==d?void 0:d.search)&&-1!==d.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==a||null==(e=a.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_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(t){An.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ie,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:ow},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:bs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:gw(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(t))},yw=[["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"]],bw=t=>{var e={};for(var i of yw){var r=i[0],n=i[1];Te(t[r])||(e[n]=t[r])}var s=$n({},e,t),o=t.__preview_external_dependency_versioned_paths;return Te(o)||(Te(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Me(o)&&Te(t.asset_host)&&(s.asset_host=o)),ke(t.property_blacklist)&&(Te(t.property_denylist)?s.property_denylist=t.property_blacklist:ke(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:An.error(hw+t.property_denylist)),s},_w=class{constructor(){this.__forceAllowLocalhost=!1}get ru(){return this.__forceAllowLocalhost}set ru(t){An.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},ww=(s=class t{nu(t){if(t){var e=this.Ql.indexOf(t);-1!==e&&this.Ql.splice(e,1)}}su(t,e){return this.nu(t),this.Ql.push(e),null==e.initialize||e.initialize(),e}ou(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}au(){if(!(this.lu||this.config.reuseAnonymousId||this.config.segment||this.ou())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.uu||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.lu=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", 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)))}}hu(){if(!this.ou()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.du()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(ga());this.register({distinct_id:i,$device_id:i}),t.set_property(At,te)}this.vu()}}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var e;this.cu=!1,this.fu=!1,this.webPerformance=new _w,this.pu=!1,this.version=Na.LIB_VERSION,this.gu=new Set,this.mu="",this.tu=new j_,this.Ql=[],this.yu=[],this.uu=!1,this.lu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=mw(),this.SentryIntegration=Xb,this.sentryIntegration=t=>function(t,e){var i=Kb(t,e);return{name:Qb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bu=!1,this._u=null,this.wu=null,this.ku=null,this.scrollManager=new L_(this),this.pageViewManager=new Yb(this),this.rateLimiter=new g_(this),this.requestRouter=new Q_(this),this.consent=new zb(this),this.externalIntegrations=new Y_(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=Me(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Me(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>An.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==fw){var n,s=null!==(n=nw[r])&&void 0!==n?n:new t;return s._init(e,i,r),nw[r]=s,nw[fw][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,s,o;void 0===e&&(e={});var l,u=Me(t)?t.trim():"";if(!u)return An.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 u!==(null==(l=this.config)?void 0:l.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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=mw(e.defaults),e.debug=this.Su(e.debug),this.xu=e,this.Cu=[],e.person_profiles?this.wu=e.person_profiles:e.process_person&&(this.wu=e.process_person);var h=mw(e.defaults),d=bw(e),v=$n({},h,d,{name:i,token:u});xe(h.rageclick)&&xe(d.rageclick)&&(v.rageclick=$n({},h.rageclick,d.rageclick)),xe(h.session_recording)&&xe(d.session_recording)&&(v.session_recording=$n({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&An.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Wf;var c=this.du();if(this.persistence=new f_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new f_(n({},this.config,{persistence:"sessionStorage"}),c,!1),this.mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&La.Et()){var f=La.Nt(this.mu);ke(f)&&f.forEach(t=>{Me(t)&&this.gu.add(t)})}else La.Dt(this.mu);var p=n({},this.persistence.props),g=n({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Tu=new $_(t=>this.Mu(t),this.config.request_queue_config),this.Iu=new D_(this),this.__request_queue=[];var m=this.ou();m||(this.sessionManager=new z_(this),this.sessionPropsManager=new q_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Eu()})),this.Ru(),this.config.__preview_deferred_init_extensions?(An.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Au(m)},0)):(An.info("Initializing extensions synchronously"),this.Au(m)),Na.DEBUG=Na.DEBUG||this.config.debug,Na.DEBUG&&An.info("Starting in debug mode",{this:this,config:e,thisC:n({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=n({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(s=e.bootstrap)?void 0:s.distinctID;if(this.uu=!!y&&!Ie(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var b=e.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(At);if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"anonymous"===w)this.identify(b);else if(e.bootstrap.isIdentifiedID&&null!=_&&_!==b&&"identified"===w)An.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(ga()),x=e.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(At,e.bootstrap.isIdentifiedID?ee:te),this.register({distinct_id:b,$device_id:x})}}if(m)this.register_once({distinct_id:Nt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(ga());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(At,te)}return zn(a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),zn(a,"pageshow",()=>{var t;this.cu=!1,this.fu||null==(t=this.Iu)||t.resume()}),e.segment?Jb(this,()=>this.Pu()):this.Pu(),Se(this.config._onCapture)&&this.config._onCapture!==ow&&(An.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&An.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 W_.apply(this,arguments)}().then(t=>{t&&this.register({[S]:t})}).catch(ow),this}Fu(t){var e=t;return Me(e.name)&&Se(e.setup)}Ou(t,e){this.Fu(t)?e.push(()=>{this.$u().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{An.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.Ql.push(t)}Ru(){var e,i,r,n,s,o,a=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(o=this.Du)||o.call(this),this.Du=void 0,this.featureFlags=new a(this)),Se(this.featureFlags.onReloading)&&Se(this.featureFlags.setup)?this.Du||(this.Du=this.featureFlags.onReloading(()=>{this.tu.emit("featureFlagsReloading",!0)}),this.$u().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}Au(e){var i,r,s,o,a,l,u,h=performance.now(),d=n({},t.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.exceptions&&this.Ql.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Ql.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ql.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ql.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ql.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Ou(this.autocapture=new d.autocapture(this),v),d.surveys&&this.Ou(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.Ou(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this),v),d.metrics&&this.Ql.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Ql.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ql.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ql.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ql.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ql.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ql.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Vb)),d.toolbar&&this.Ql.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Ql.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Ql.forEach(t=>{t.initialize&&v.push(()=>{null==t.initialize||t.initialize()})}),v.push(()=>{if(this.Lu){var t=this.Lu;this.Lu=void 0,this.Ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Nu(v,h)}Nu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Nu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){An.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[jt]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Bt]:r}),this.config.__preview_deferred_init_extensions&&An.info("PostHog extensions initialized ("+r+"ms)")}za(t){var e;if(!h||!h.body)return An.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.za(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Lu=t),this.Yl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=pe(r.supportedCompression,Wf)?Wf:pe(r.supportedCompression,Vf)?Vf:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.wu?this.wu:ie}),null==(e=this.qu)||e.handleRemoteConfig(t),this.Ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}Pu(){try{this.config.loaded(this)}catch(t){An.critical("`loaded` function failed",t)}if(this.ju(),this.config.internal_or_test_user_hostname&&null!=d&&d.hostname){var t=d.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.ou())&&this.Bu()},1),this.Hu=new y_(this),this.Hu.load()}ju(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Tu)||t.enable())}_dom_loaded(){this.is_capturing()&&Fn(this.__request_queue,t=>this.Mu(t)),this.__request_queue=[],this.ju()}_handle_unload(){var t,e,i,r,n;this.cu=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.zu()&&this.capture(oe),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Tu)||r.unload(),null==(n=this.Iu)||n.unload()):this.zu()&&this.capture(oe,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?pw?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=n({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(Te(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,s=n({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Te(s.compression)&&s.data&&(s.compression=Vf),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=(ke(o=s.data)?o:[o]).map(t=>n({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),ke(t)?t.map(t=>n({},t,{sent_at:e})):n({},t,{sent_at:e})}(s.data))),s.url=F_(s.url,s.method,s.compression,s.timestampMode);var v=O_.filter(t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport)),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,t=>t.transport===d))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){E_(t)?An.warn(t):An.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===Wf&&p&&"undefined"!=typeof Promise&&!w_?M_(s).then(t=>{f(t)}).catch(e=>{if(rn(e))return w_=!0,void f(n({},s,{compression:void 0,url:F_(t.url,t.method,void 0,t.timestampMode)}));nn(e)&&(w_=!0),f(s)}):c(s)})(n({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}Mu(t){this.Iu?this.Iu.retriableRequest(t):this._send_request(t)}_execute_array(t){sw++;try{var e,i=[],r=[],n=[];Fn(t,t=>{if(t)if(ke(e=t[0]))n.push(t);else if(Se(t))try{t.call(this)}catch(e){An.error("Error executing queued PostHog call",t,e)}else ke(t)&&"alias"===e?i.push(t):ke(t)&&-1!==e.indexOf("capture")&&Se(this[e])?n.push(t):r.push(t)});var s=function(t,e){Fn(t,function(t){try{if(ke(t[0])){var i=e;On(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){An.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{sw--}}push(e){if(sw>0&&ke(e)&&Me(e[0])){var i=t.prototype[e[0]];Se(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Uu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Me(e)&&vw.test(e)?{value:e,delivered:!1}:xe(e)&&Me(e.value)&&vw.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Wu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Uu();if(!r){if(i)return Me(e)&&vw.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[M]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(M);if(Me(t)&&dw.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[M]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(M)}}Vu(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Uu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[M]:{value:t,delivered:!0}})}}capture(t,e,i){var r,s,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Tu){if(this.is_capturing())if(!Te(t)&&Me(t)){this.hu();var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==p||!p.isRateLimited){var g;null!=e&&e.$current_url&&!Me(null==e?void 0:e.$current_url)&&(An.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.Gu||An.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&&(g=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 m=new Date,y=(null==i?void 0:i.timestamp)||m,b=sr(null==i?void 0:i.uuid,ga),_={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},y,b)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),p&&(_.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(_.$set=null==i?void 0:i.$set);var k=xe(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&"$fbc"in i.$set,x=S||!!k&&"$fbc"in k,C=S?null==i||null==(r=i.$set)?void 0:r[T]:null==k?void 0:k[T],M=ke(null==e?void 0:e.$unset)?e.$unset:[],I=(null==i?void 0:i.$unset)||[],E=-1!==M.indexOf("$fbc")||-1!==I.indexOf("$fbc"),R=this.Wu(null==(s=g)?void 0:s.fbclid,C,x,E);R&&!0===_.properties.$process_person_profile&&R.pending&&!x&&!w&&(_.$set=n({[T]:R.value},_.$set));var A=null==i?void 0:i.$unset;A&&(_.$unset=A);var P=w?void 0:this.Zu(null==i?void 0:i.$set_once,t!==le,t===ae);if(P&&(_.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=_,v=t=>Me(t)?t.slice(0,h):t,c=new Set,_=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),ke(e))r=[],Fn(e,e=>{r.push(t(e))});else{var n={};On(qe(e)?jn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),_.timestamp=y,Te(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Xr.forEach(r),e.forEach(r),i}(_.properties,cw)),t===hp||t===dp){var F=null==e?void 0:e[vp],O=null==e?void 0:e[fp];Rp({id:F,current_iteration:O}),_.$set=n({},_.$set,{[Ua({id:F,current_iteration:O},t===dp?"responded":"dismissed")]:!0})}else t===up&&(_.$set=n({},_.$set,{[bp]:(new Date).toISOString()}));if("product tour shown"===t){var D=null==e?void 0:e.$product_tour_type;D&&(_.$set=n({},_.$set,{["$product_tour_last_seen_date/"+D]:(new Date).toISOString()}))}var L=n({},_.properties.$set,_.$set);if(Ce(L)||this.setPersonPropertiesForFlags(L),!Re(this.config.before_send)){var N=this.Ts(_);if(!N)return;(_=N).uuid=sr(_.uuid,ga)}var q=null!==(o=null==(a=_.$set)?void 0:a.$fbc)&&void 0!==o?o:xe(null==(l=_.properties)?void 0:l.$set)?_.properties.$set.$fbc:void 0,j=null!=R&&R.pending&&q===R.value?R.value:void 0;this.tu.emit("eventCaptured",_);var B,H=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),z=n({method:"POST",url:H,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(H)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},j?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Vu(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?(!z.transport&&!z.callback&&Ce(null!==(B=this.config.request_headers)&&void 0!==B?B:{})&&this.cu&&(z.transport="sendBeacon"),this.Mu(z)):this.Tu.enqueue(z),_}An.critical("This capture call is ignored due to client rate limiting.")}}else An.error("No event name provided to posthog.capture")}else An.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.qu)?void 0:e.getExtension(t)}$u(){var t;return null!==(t=this.qu)&&void 0!==t?t:this.qu=new rw(this)}iu(t){this.yu.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.yu.indexOf(t);-1!==i&&this.yu.splice(i,1)}}}Ju(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.ku=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.gu.clear(),this.Qu()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,e,i,r,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Ju();var o=s?void 0:this.persistence.remove_event_timer(t),l=n({},e);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.ou()&&(l[qt]=!0),"$snapshot"===t){var u=n({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Me(l.distinct_id)&&!Ae(l.distinct_id)||Ie(l.distinct_id))&&An.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var v,c=function(t,e,i,r){var n,s,o,l;if(void 0===r&&(r=!1),!g)return{};var u,h=t?[...hl,...e||[]]:[],v=Gi(g),c=v[0],f=v[1],p=function(t){for(var e=0;Ki.length>e;e++){var i,r=Ki[e],n=r[1],s=r[2],o=t.match(r[0]);if(o)return[n,(null==(i=s&&t.match(s)||o)?void 0:i[1])||""]}return["",""]}(g),m=p[0],y=p[1],b=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},_={};Te(i)||(_.detectGoogleSearchApp=i);var w={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,S=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==a||null==(o=a.screen)?void 0:o.width,C=null==a||null==(l=a.screen)?void 0:l.height,T=null==a?void 0:a.devicePixelRatio;Te(k)||(w.userAgentDataPlatform=k),Te(S)||(w.maxTouchPoints=S),Te(x)||(w.screenWidth=x),Te(C)||(w.screenHeight=C),Te(T)||(w.devicePixelRatio=T);var M,I=$n(qn({$os:c,$os_version:f,$browser:zi(g,navigator.vendor,b,_),$webview_app:m,$webview_app_version:y,$device:Zi(g),$device_type:Ji(g,w),$timezone:kl(),$timezone_offset:Sl()}),{$current_url:Qn(r?ar(null==d?void 0:d.href):null==d?void 0:d.href,h,vl),$host:null==d?void 0:d.host,$pathname:null==d?void 0:d.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:Wi(g,navigator.vendor,b,_),$browser_language:ml(),$browser_language_prefix:(M=ml(),"string"==typeof M?M.split("-")[0]:void 0),$screen_height:null==a?void 0:a.screen.height,$screen_width:null==a?void 0:a.screen.width,$viewport_height:null==a?void 0:a.innerHeight,$viewport_width:null==a?void 0:a.innerWidth,$lib:En.LIB_NAME,$lib_version:En.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return En.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=En.SDK_DIST_CHANNEL),I}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime(),!0),p=f.windowId;l.$session_id=f.sessionId,l.$window_id=p}this.sessionPropsManager&&$n(l,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&$n(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(m=this.Iu)?void 0:m.length}catch(t){l.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===V_&&(l.$lib_custom_api_host=this.config.api_host),v="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),l=$n(l,v),"$pageview"===t&&h&&(l.title=h.title),!Te(o)){var y=i.getTime()-o;l.$duration=parseFloat((y/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties(),w=l.$groups,k=b.$groups;xe(w)&&!Ce(w)&&(l.$groups=n({},xe(k)?k:{},w)),On(["$referrer","$referring_domain"],t=>{t in b&&delete _[t]});var S={};if(this.yu.length>0)for(var x of this.yu.slice())try{$n(S,x())}catch(t){An.error("Failed to produce browser extension event properties",t)}(l=$n({},c,b,_,n({},S,l))).$is_identified=this._isIdentified(),ke(this.config.property_denylist)?On(this.config.property_denylist,function(t){delete l[t]}):An.error(hw+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(An.error(uw),l=C(l,t));var T=this.Ku();return l.$process_person_profile=T,T&&!s&&this.Xu("_calculate_event_properties"),l}Zu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Ku())return t;if(this.pu&&!i)return t;var n=$n({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(An.error(uw),n=s(n,"$set_once")),e&&(this.pu=!0),Ce(n)?void 0:n}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.Ju(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.gu.add(t)),this.Qu()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.gu.delete(t),this.Qu()}Yu(t,e){this.register({[t]:e})}Eu(){this.gu.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.gu.clear(),this.Qu()}Qu(){var t;if(this.mu)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!La.Et())La.Dt(this.mu);else{var e=[];this.gu.forEach(t=>e.push(t)),e.length>0?La.Ot(this.mu,e):La.Dt(this.mu)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.tu.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:lw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:lw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:lw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Pp),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:lw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:lw})}th(t){return!t||Ie(t)?(An.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(An.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(An.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return An.uninitializedWarning("posthog.identify");if(Ae(t)&&(t=t.toString(),An.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.th(t)&&this.Xu("posthog.identify")){this.hu();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Ju(!1),o=this.persistence.Sa(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property("__alias")&&(this.unregister(x),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===te,h=t!==l,d=!h&&u;if(h&&u){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:l};this.persistence.set_property(At,ee),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture(ae,c,{$set:e||{},$set_once:i||{}}),this.ku=il(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(At,ee);var f=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture("$set",{$set:f,$set_once:p}),this.ku=il(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);h||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Mt)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ma(a)}}}setPersonProperties(t,e){if((t||e)&&this.Xu("posthog.setPersonProperties")){var i=il(this.get_distinct_id(),t,e);this.ku!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.ku=i):An.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(ke(t)?t:[t]).filter(t=>Me(t)&&t.length>0);0!==i.length&&this.Xu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.ku=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Ju();var s=this.getGroups(),o=s[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:n({},s,{[t]:e})}),(o||i)&&this.Ku()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(le,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else An.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Xu("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=Fe(t)?t:null==t?void 0:t.resetDeviceID,i=Fe(t)||null==t?void 0:t.bootstrap;this.eh(e,!1,i)}eh(t,e,i){var r,s,o,a;if(void 0===e&&(e=!1),An.info("reset"),!this.__loaded)return An.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.xu)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Ua());var u=this.get_property(k),h=this.get_property(S),d=this.get_property(j);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var v=this.is_capturing();this.consent.reset(),e||!v||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 c=null==(a=this.persistence)||null==a.Sa?void 0:a.Sa(),f=!1;try{var p,g,m,y,b,_,w,x,C,T,M,I,E;if(null==(p=this.persistence)||p.clear(),null==(g=this.sessionPersistence)||g.clear(),this.gu.clear(),this.Qu(),Te(d)||null==(m=this.persistence)||m.register({[j]:d}),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(_=this.conversations)||_.reset(),null==(w=this.logs)||w.reset(),null==(x=this.metrics)||x.reset(),null==(C=this.persistence)||C.set_property(At,te),null==(T=this.sessionManager)||T.resetSessionId(),this.ku=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Nt,$device_id:null},"");else{var R=this.config.get_device_id(ga());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Te(h)||this.register({[S]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.ou()||(null==(E=this.persistence)||E.set_property(At,i.isIdentifiedID?ee:te),this.register({distinct_id:i.distinctID})),null==(M=this.featureFlags)||M.initialize(),!(Te(l)||null!=(I=this.sessionManager)&&I.setBootstrapSessionId(l,!0))){var A=n({},i);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var P;c&&(null==(P=this.persistence)||null==P.Ma||P.Ma(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return o(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.fu=!0,e.$u().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.Tu)||n.unload(),null==(s=e.Iu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){An.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else An.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.ih()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.rh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property("$people_distinct_id")?(An.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xu("posthog.alias")?(Te(e)&&(e=this.get_distinct_id()),t!==e?(this.Yu(x,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(An.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=n({},this.config);if(xe(t)){var i,r,s,o,a,l,u,h,d,v,c,f,p;$n(this.config,bw(t));var g=this.du();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new f_(n({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.Su(this.config.debug);Fe(m)&&(this.config.debug=m),Fe(this.config.debug)&&(this.config.debug?(Na.DEBUG=!0,Sa.Et()&&Sa.Ot("ph_debug",!0),An.info("set_config",{config:t,oldConfig:e,newConfig:n({},this.config)})):(Na.DEBUG=!1,Sa.Et()&&Sa.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ua()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(v=this.exceptionObserver)||v.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.vu(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Jb(this,ow,!1)}}_overrideSDKInfo(t,e){Na.LIB_NAME=t,Na.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(n({},i,e))}catch(t){return}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.nh}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:fw;return e!==fw&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}Ku(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Ce(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}zu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Ku()||this.Xu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Xu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Xu(t){return"never"===this.config.person_profiles?(An.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.au(),this.Yu(Lt,!0),!0)}du(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}vu(){var t,e,i,r,n,s=this.du();return this.is_capturing()||null==(t=this.logs)||t.sh(),(null==(e=this.persistence)?void 0:e.gi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(r=this.sessionPersistence)?void 0:r.gi)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.gu.clear(),this.Qu()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.ou()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.eh(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new z_(this),this.pageViewManager=new Yb(this),this.persistence&&(this.sessionPropsManager=new q_(this,this.sessionManager,this.persistence));var d,v=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(h=t.__defaultExtensionClasses)?void 0:h.sessionRecording;v&&(this.sessionRecording=this.su(this.sessionRecording,new v(this)),this.Yl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Yl)))}this.consent.optInOut(!0),this.vu(),this.ju(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Te(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Bu()}else An.warn(aw)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var t,e,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.eh(!0,!0),this.consent.optInOut(!1),this.vu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Nt,$device_id:null}),this.nu(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Bu(),this.ju())}else An.warn(aw)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vu()}_is_bot(){return u?U_(u,this.config.custom_blocked_useragents):void 0}Bu(){h&&("visible"===h.visibilityState?this.bu||(this.bu=!0,this.capture(se,{title:h.title},{send_instantly:!0}),this._u&&(h.removeEventListener(re,this._u),this._u=null)):this._u||(this._u=this.Bu.bind(this),zn(h,re,this._u)))}debug(t){!1===t?(null==a||a.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==a||a.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}))}Ua(){var t=this.xu||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(An.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):function(t,e,i,r,n){var s=e in t&&!Re(t[e]),o=i in t&&!Re(t[i]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,An)}Ts(t){var e;if(Re(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(De),r=ke(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Re(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return $e(t.event)?An.warn(o+". This can cause unexpected behavior."):An.info(o),null}n.properties&&!Ce(n.properties)||An.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return An.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Re(n.properties[a]))return An.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.Fo)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Su(t){var e=Fe(t)&&!t,i=Sa.Et()&&"true"===Sa.Lt("ph_debug");return!e&&(!!i||t)}},s.__defaultExtensionClasses={},s.nh=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),s);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Nn(t.prototype[e[i]])}(ww,["identify"]);var kw=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=xe(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.Ua(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}},Sw=Pn("[ExceptionAutocapture]"),xw=Pn("[TracingHeaders]"),Cw=Pn("[Web Vitals]"),Tw=9e5,Mw=["CLS","FCP","INP","LCP"],Iw=["INP","LCP"],Ew=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Rw=Pn("[SessionRecording]"),Aw=Pn("[Heatmaps]");function Pw(t){return xe(t)&&"clientX"in t&&"clientY"in t&&Ae(t.clientX)&&Ae(t.clientY)}var Fw=Pn("[Product Tours]"),Ow=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(L))},$w=Pn("[SiteApps]"),Dw="Error while initializing PostHog app with config id ",Lw=(t,e)=>null!=t&&t.then?t.then(e):e(t),Nw="SDK is not enabled or survey functionality is not yet loaded",qw="Disabled. Not loading surveys.",jw=class{constructor(t,e){this.uo=t,this.oh=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ah=!1,this.uh=[],this.hh=null,this.dh=null,this.fo=!1,this.fh=new Set,this.onRemoteConfig=t=>{if(!this.fo&&!this.xn.disableSurveys){if(!t.ok)return Sp.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Re(e))return Sp.warn("Flags not loaded yet. Not loading surveys.");this.ph=Fe(e)?e:e.length>0,Sp.info("flags response received, isSurveysEnabled: "+this.ph),this.loadIfEnabled()}}}setup(t){if(!this.fo)return this.gh=t,Lw(t.kv.initialize(),()=>{if(this.gh===t&&!this.fo){this.gh=void 0,this.ao=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.fo?e.dispose():(this.yo=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.fo||(this.fo=!0,this.gh=void 0,this.ao=void 0,null==(t=this.yo)||t.dispose(),this.yo=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.uh=[],this.hh=null,this.fh.forEach(t=>clearTimeout(t)),this.fh.clear())}get xn(){return this.uo.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith("seenSurvey_")||null!=r&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t))}catch(t){}}loadIfEnabled(){if(!this.fo&&this.ao){var t=this.xn;if(!this._surveyManager)if(this.ah)Sp.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Sp.info(qw);else if(t.cookielessMode&&this.uo.isOptedOut())Sp.info("Not loading surveys in cookieless mode without consent.");else{var e=this.uo.getExtensions();if(e){if(!Te(this.ph)||t.advancedEnableSurveys){var i=this.ph||t.advancedEnableSurveys;this.ah=!0;try{var r=e.generateSurveys;if(r)return this.mh(r,i),void(this.ah=!1);var n=e.loadExternalDependency;if(!n)return this.yh(Yt),void(this.ah=!1);n(t=>{try{if(this.fo)return;var e=this.uo.getExtensions();t||null==e||!e.generateSurveys?this.yh("Could not load surveys script",t):this.mh(e.generateSurveys,i)}finally{this.ah=!1}})}catch(t){throw this.ah=!1,this.yh("Error initializing surveys",t),t}}}else Sp.error("PostHog Extensions not found.")}}}mh(t,e){this.fo||(this._surveyManager=t(e),this._surveyEventReceiver=this.uo.createEventReceiver(),Sp.info("Surveys loaded successfully"),this.bh({isLoaded:!0}))}yh(t,e){Sp.error(t,e),this.bh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.uh.push(t),this._surveyManager&&this.bh({isLoaded:!0}),()=>{this.uh=this.uh.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.ao)&&void 0!==i?i:this.oh;if(r&&!this.fo){if(this.xn.disableSurveys)return Sp.info(qw),t([]);var n=r.kv.get(pt);if(n&&!e)return t(n,{isLoaded:!0}),void(this._h()&&this.getSurveys(()=>{},!0));if(this.hh)this.hh.then(e=>{this.fo||t(e.surveys,e.context)}).catch(t=>Sp.error("Error in survey callback",t));else{var s=this.wh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.xn.requestTimeoutMs}).then(t=>{try{return this.kh(r,t)}catch(t){return Sp.error("Error processing surveys response",t),this.kh(r,{statusCode:0,error:t})}},t=>this.kh(r,{statusCode:0,error:t}));this.hh=s;var o=()=>{this.hh===s&&(this.hh=null)};s.then(e=>{o(),this.fo||t(e.surveys,e.context)},o).catch(t=>Sp.error("Error in survey callback",t))}}}wh(t,e){var i=this.ao;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(Nw)}))}kh(t,e){var i;if(this.fo)return{surveys:[],context:{isLoaded:!1,error:Nw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?Sp.error(n):e.error||Sp.warn(n),this.dh=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.dh=null;var s=e.json.surveys||[],o=s.filter(t=>Tp(t)&&(Qa(t)||Mp(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[pt]:s,[gt]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}_h(){return this.Sh()&&!this.hh&&!this.xh()}Sh(){var t,e,i=null==(t=null!==(e=this.ao)&&void 0!==e?e:this.oh)?void 0:t.kv.get(gt);return Ae(i)&&Date.now()-i>3e5}xh(){return Ae(this.dh)&&3e5>Date.now()-this.dh}markSurveyAsSeen(t,e){var i;Rp({id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}bh(t){for(var e of this.uh)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Sp.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Re(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Sp.warn("init was not called")}Ch(t){var e=null;return this.getSurveys(i=>{var r;e=null!==(r=i.find(e=>e.id===t))&&void 0!==r?r:null}),e}Th(t){if(Re(this._surveyManager))return{eligible:!1,reason:Nw};var e="string"==typeof t?this.Ch(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Mh(t){if(!this.uo.isCapturing())return{eligible:!1,reason:xp};if(Re(this._surveyManager))return{eligible:!1,reason:Nw};var e="string"==typeof t?this.Ch(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Re(this._surveyManager))return Sp.warn("init was not called"),{visible:!1,disabledReason:Nw};var e=this.Mh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Re(this._surveyManager)?(Sp.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Nw})):new Promise(i=>{this.getSurveys(e=>{var r,n=null!==(r=e.find(e=>e.id===t))&&void 0!==r?r:null;if(n){var s=this.Mh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(this.uo.isCapturing())if(Re(this._surveyManager))Sp.warn("init was not called");else{var n="string"==typeof t?this.Ch(t):t;if(null!=n&&n.id)if(Ap.includes(n.type)){var s=null==h?void 0:h.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){Sp.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.fh.delete(o),!this.fo&&this.uo.isCapturing()&&(Sp.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),Sp.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.fh.add(o)}else this._surveyManager.renderSurvey(n,s,i);else Sp.warn("Survey element not found")}else Sp.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Sp.warn("Survey not found")}}displaySurvey(t,e){var i;if(this.uo.isCapturing())if(Re(this._surveyManager))Sp.warn("init was not called");else{var r=this.Ch(t);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=n({},r,{appearance:n({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==wp&&e.initialResponses&&Sp.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.Th(r);if(!o.eligible)return void Sp.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Sp.warn("Survey not found")}}cancelPendingSurvey(t){Re(this._surveyManager)?Sp.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function Bw(t,e,i){if(Re(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}var Hw=class{constructor(t){this._instance=t,this.Ih=new Set,this.Eh=new Set,this.Rh=new j_,this.Ah=(t,e)=>this.Ph(t,e)&&this.Fh(t,e)&&this.Oh(t,e)&&this.$h(t,e),this.Ph=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Te(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Dh=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.Dh)||t.call(this),this.Dh=void 0,this.Rh=new j_}register(t){var e,i;if(!Te(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.Ih.add(t),null==(e=t.steps)||e.forEach(t=>{this.Eh.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Ih.forEach(t=>{var e;null==(e=t.steps)||e.forEach(t=>{null!=t&&t.selector&&r.add(t.selector)})}),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Ih.clear(),this.Eh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Eh.has(t)||this.Eh.has(e.event))&&this.Ih.forEach(t=>{this.Lh(e,t)&&this.Rh.emit("actionCaptured",t.name)})}Nh(t){this.onAction("actionCaptured",e=>t(e))}Lh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Ah(t,i))return!0;return!1}onAction(t,e){return this.Rh.on(t,e)}Fh(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Bw(r,e.url,e.url_matching||"contains"))return!1}return!0}Oh(t,e){return!!this.qh(t,e)&&!!this.jh(t,e)&&!!this.Bh(t,e)}qh(t,e){var i;if(null==e||!e.href)return!0;var r=this.Hh(t);if(r.length>0)return r.some(t=>Bw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Bw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}jh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Hh(t);if(r.length>0)return r.some(t=>Bw(t.text,e.text,e.text_matching||"exact")||Bw(t.$el_text,e.text,e.text_matching||"exact"));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Re(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some(t=>Bw(t,s,o)))}Bh(t,e){var i,r;if(null==e||!e.selector)return!0;if(null!=t&&null!=(i=t.properties)&&null!=(i=i.$element_selectors)&&i.includes(e.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&n)try{return new RegExp(e.selector_regex).test(n)}catch(t){return!1}return!1}Hh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}$h(t,e){return null==e||!e.properties||0===e.properties.length||el(e.properties.reduce((t,e)=>{var i=ke(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t},{}),null==t?void 0:t.properties)}},zw=class{constructor(t){var e;this.zh=[],this._instance=t,this.Uh=new Map,this.Wh=new Map,this.Vh=new Map,this.Gh=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Zh(t))}Jh(t){return!1}Qh(){return null}Kh(t){}Xh(){}Yh(t,e){return!!t&&el(t.propertyFilters,null==e?void 0:e.properties)}td(t,e){var i=new Map;return t.forEach(t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach(e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}})}),i}ed(t,e,i){var r=(i===Gf?this.Uh:this.Wh).get(t),n=[];return this.rd(t=>{n=t.filter(t=>null==r?void 0:r.includes(t.id))}),n.filter(r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find(e=>e.name===t);return this.Yh(s,e)})}register(t){this.nd(t,!1)}replace(t){this.nd(t,!0)}nd(t,e){var i;Te(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.sd(t,e),this.od(t,e))}od(t,e){var i=t.filter(t=>{var e;return null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length});if(e&&this.Vh.clear(),0!==i.length){this.ad||(this.ad=new Hw(this._instance),this.ad.init(),this.ad.Nh(t=>this.onAction(t)));var r=[];i.forEach(t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach(e=>{if(r.push(e),e.name){var i,n=null!==(i=this.Vh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Vh.set(e.name,n)}})}),e?this.ad.replace(r):this.ad.register(r)}else{var n;e&&(null==(n=this.ad)||n.replace([]))}}ld(t,e){e.forEach((e,i)=>{var r,n=null!==(r=t.get(i))&&void 0!==r?r:[];e.forEach(t=>{n.includes(t)||n.push(t)}),t.set(i,n)})}sd(t,e){var i,r,n=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=t.filter(t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),o=this.td(t,Gf),a=this.td(t,Zf);e?(this.Uh=o,this.Wh=a):(this.ld(this.Uh,o),this.ld(this.Wh,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Dh)&&void 0!==i||(this.Dh=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.ud(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.hd(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.dd([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.vd(s),void this.fd([s])}if(this.Wh.has(t)){var a=this.ed(t,e,Zf);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.dd(a.map(t=>t.id)),a.forEach(t=>this.pd(t.id)))}if(this.Uh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Uh.get(t)});var l=this.ed(t,e,Gf);this.gd(l.map(t=>t.id))}}onAction(t){this.Vh.has(t)&&this.gd(this.Vh.get(t)||[])}gd(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this.Jh(n)?this.vd(n)&&this.md(n):r.push(n);r.length>0&&(this.zh=[...new Set([...this.zh,...r])]),this.ud().info("updating activated items",{activatedItems:this.getActivatedIds()})}}vd(t){this.zh=this.zh.filter(e=>e!==t);var e=this.yd();return!e.includes(t)&&(this.bd([...e,t]),this._d(),!0)}dd(t){var e=new Set(t);this.zh=this.zh.filter(t=>!e.has(t));var i=this.wd(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.bd(r),0===r.length&&this.kd()),this.fd(t)}Sd(){var t,e=this.Qh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}md(t){if(this.Qh()){var e=this.Sd();this.Kh(n({},e,{[t]:Date.now()}))}}fd(t){if(this.Qh()){var e=this.Sd(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(Ce(i)?this.Xh():this.Kh(i))}}xd(){this.Qh()&&this.Xh()}getActivationTimestamp(t){if(this.yd().includes(t)){var e=this.Sd()[t];return Ae(e)?e:void 0}}wd(){var t,e=this.Cd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}yd(){var t,e,i=this.wd();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Td()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}_d(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Md(e)}kd(){this.Id()}Zh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Td()];if(i&&i!==t){var r=this.wd(),n=this.Sd();r.length>0&&(this.bd([]),r.filter(t=>Ae(n[t])).forEach(t=>this.pd(t))),this.kd(),this.xd()}}getActivatedIds(){return[...new Set([...this.yd(),...this.zh])].filter(t=>!this.Ed(t))}dispose(){var t,e,i;null==(t=this.Gh)||t.call(this),this.Gh=void 0,null==(e=this.Dh)||e.call(this),this.Dh=void 0,null==(i=this.ad)||i.dispose(),this.ad=void 0}reset(){this.zh=[],this.wd().length>0&&this.bd([]),this.kd(),this.xd()}getEventToItemsMap(){return this.Uh}Rd(){return this.ad}},Uw=class extends zw{constructor(t){super(t)}Cd(){return mt}Td(){return yt}Qh(){return bt}Kh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Xh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Jh(t){var e,i;this.rd(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Ae(r)&&r>0}Ad(){return up}rd(t){var e;null==(e=this._instance)||e.getSurveys(t)}pd(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}ud(){return Sp}bd(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[mt]:t})}Md(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}Id(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(yt)}Ed(){return!1}hd(t,e){var i;return this.rd(t=>{i=t.find(t=>t.id===e)}),!i||Ka(i)?t===up?"consume":"ignore":t===up?"persist":t===hp||t===dp?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Ww=class{constructor(t){this._instance=t}initialize(){}get(t){if("string"==typeof t)return this._instance.get_property(t);var e={};for(var i of t){var r=this._instance.get_property(i);Te(r)||(e[i]=r)}return e}set(t,e){this._instance.register("string"==typeof t?{[t]:e}:t)}remove(t){"string"!=typeof t?t.forEach(t=>this._instance.unregister(t)):this._instance.unregister(t)}},Vw=class{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){var t=null==b?void 0:b.__PosthogExtensions__;if(t){var e=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:e?t=>e(this._instance,t):void 0,loadExternalDependency:i?t=>i(this._instance,"surveys",t):void 0}}}createEventReceiver(){return new Uw(this._instance)}},Gw=null!=a&&a.location?Kn(a.location.hash,"__posthog")||Kn(location.hash,"state"):null,Zw="_postHogToolbarParams",Jw=Pn("[Toolbar]"),Qw=Pn("[FeatureFlags]"),Kw=class{constructor(t,e){void 0===e&&(e=!1),this.Pd=!1,this.update(t,e)}update(t,e){this.Fd=((t,e)=>{var i,r,n,s,o;return{bootstrap:{featureFlags:null==(i=t.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=t.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:e,featureFlagsDisabled:!!t.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!t.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!t.advanced_feature_flags_dedup_per_session,cacheTtlMs:t.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(n=t.remote_config_refresh_interval_ms)&&void 0!==n?n:3e5,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(o=t.evaluation_contexts)&&void 0!==o?o:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:ke(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Pd||(Qw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Pd=!0),Te(t.flag_keys)||ke(t.flag_keys)||Qw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Fd}},Xw=Pn("[FeatureFlags]"),Yw=Pn("[FeatureFlags]",{debugEnabled:!0}),tk="\" failed. Feature flags didn't load in time.",ek="connection_error",ik=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},rk=t=>{var e={};for(var i of Dn(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},nk="Refusing to render web experiment since the viewer is a likely bot",sk={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Xa(e,t),not_regex:(t,e)=>!Xa(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},ok=Pn("[Conversations]"),ak="Conversations not available yet.";function lk(t,e){var i,r,s,o,a,l,h,d=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,v=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,c=null!=e&&e.consoleCapture?void 0:null!==(s=null==t?void 0:t.maxLogsPerInterval)&&void 0!==s?s:1e3,f=Te(c)?Math.max(v,2048):Math.max(v,c),p=n({},function(){var t="",e="";try{var i=null==u?void 0:u.userAgent;if(i){var r=Gi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(pn,t)?pn[t]:t}(t);return n({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(o=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==o?o:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(h=null==p?void 0:p["deployment.environment"])&&void 0!==h?h:null==t?void 0:t.environment,resourceAttributes:p,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:v,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var uk=["debug","log","warn","error","info"],hk="console",dk="__posthogHandledLogsRequestError",vk=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[dk]=!0,i},ck=t=>!!t&&"object"==typeof t&&!0===t[dk],fk={featureFlags:class{constructor(t){this.name="featureFlags",this.Od=!1,this.featureFlagEventHandlers=[],this.A=Xw,this.$d={},this.Dd={},this.Ld=[],this.Nd=!1,this.qd=!1,this.jd=0,this.Bd=!1,this.Hd=!1,this.zd=!1,this.Ud=!1,this.Wd=0,this.nr=()=>{var t=this.Vd();this.Wd=0,t&&this.reloadFeatureFlags()},this.Gd=()=>{var t,e=this.Zd;Te(e)||this.xn.remoteRequestsDisabled||!h||"hidden"===h.visibilityState||Date.now()-(null!==(t=this.Jd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Qd())},this.ar=()=>{"visible"===(null==h?void 0:h.visibilityState)&&this.Gd()},"get"in t?this.uo=t:(this._instance=t,this.Kd=new Kw(t.config,t.Ua()),this.uo=this.Kd)}updateConfig(t,e){var i;null==(i=this.Kd)||i.update(t,e),this.ao&&this.Xd()}setup(t){return this.gh=t,this.A=t.logger.createLogger("[FeatureFlags]"),Lw(t.kv.initialize(),()=>{this.gh===t&&(this.gh=void 0,this.ao=t,this.Yd(t))})}Yd(t){var e;if(this.ao===t)return a&&zn(a,"online",this.nr),this.Xd(),this.tv=t.registerDynamicEventProperties(()=>this.ev()?this.$d:this.Dd),this.iv=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.rv(),this.nv(),this.sv()}),this.nv(),this.initialize()}Xd(){var t=this.xn.refreshIntervalMs,e=!this.xn.remoteRequestsDisabled&&h&&!Te(t)&&t>0?t:void 0;e!==this.Zd&&(this.ov(),Te(e)||(this.Zd=e,this.Qd(),null!=h&&h.addEventListener&&zn(h,re,this.ar)))}Qd(){Te(this.Zd)||(Te(this.av)||clearInterval(this.av),this.Jd=Date.now(),this.av=setInterval(this.Gd,this.Zd))}ov(){Te(this.av)||(clearInterval(this.av),this.av=void 0,null==h||null==h.removeEventListener||h.removeEventListener(re,this.ar)),this.Zd=void 0,this.Jd=void 0}destroy(){this.lv()}dispose(){this.lv()}lv(){var t,e;this.ov(),this.jd++,this.Hd=!1,this.gh=void 0,this.ao&&(this.uv(),null==(t=this.tv)||t.dispose(),this.tv=void 0,null==(e=this.iv)||e.call(this),this.iv=void 0,this.Ld=[],null==a||a.removeEventListener("online",this.nr),this.ao=void 0)}get xn(){return this.uo.get()}hv(t){var e;return this.dv&&t in this.dv?this.dv[t]:null==(e=this.ao)?void 0:e.kv.get(t)}rv(){return!!this.dv&&(this.dv=void 0,!0)}vv(){var t;return!Te(null==(t=this.ao)?void 0:t.kv.get("$enabled_feature_flags"))&&this.rv()}Ot(t){this.fv(()=>{var e;return null==(e=this.ao)?void 0:e.kv.set(t)})}pv(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.hv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(t=>{var e=t[1];return!(null!=e&&e.failed)}).map(t=>t[0]):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?a:i&&!ke(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.hv("$feature_flag_payloads")||{},d=t.$feature_flag_payloads||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p=!!c||v,g={[nt]:f,[rt]:f,[at]:p};for(var m of(t.$feature_flag_details&&(g[ot]=f),[lt,Rt,ut]))Te(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}Dt(t){this.fv(()=>{var e;return null==(e=this.ao)?void 0:e.kv.remove(t)})}fv(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}nv(){var t={};for(var e of[nt,at,lt,ht]){var i=this.hv(e);Te(i)||(t[e]=i)}this.$d=t;var r=n({},t),s=this.hv(rt);if(s)for(var o of Object.entries(s))r["$feature/"+o[0]]=o[1];this.Dd=r}ev(){var t=this.xn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.hv(Rt);return"number"!=typeof e||Date.now()-e>t}gv(){return!!this.ev()&&(this.Ud||this.qd||(this.Ud=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}mv(){var t=this.xn.evaluationContexts;return null!=t&&t.length?t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),e}):[]}yv(){var t=this.xn.flagKeys;if(!Te(t))return t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),e})}initialize(){var t,e,i=this.xn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter(t=>!Te(r[t])).reduce((t,e)=>(t[e]=r[e],t),{}),l=Object.keys(o).filter(t=>a[t]).reduce((t,e)=>(t[e]=o[e],t),{});return this.bv({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,s,o=null!=i&&i.merge&&null!==(r=this.hv("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.hv("$feature_flag_payloads"))&&void 0!==s?s:{},l=n({},o,t),u=n({},a,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:Jr(c),variant:Qr(c),reason:void 0,metadata:Te(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.bv({flags:h})}get hasLoadedFlags(){return this.Nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.hv(ot),e=this.hv(ht),i=this.hv(dt);if(!i&&!e)return t||{};var r=$n({},t||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[s],u=null==e?void 0:e[s],h=Te(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Te(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=n({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v&&(c.metadata=n({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=c}return this.Od||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Od=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Jr(r),variant:Qr(r),payload:Zr(e[i])}})}getFlagVariants(){var t=this.hv(rt),e=this.hv(ht);if(!e)return t||{};for(var i=$n({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Od||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Od=!0),i}getFlagPayloads(){var t=this.hv(at),e=this.hv(dt);if(!e)return t||{};for(var i=$n({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Od||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Od=!0),i}reloadFeatureFlags(){this.Bd||this.xn.featureFlagsDisabled||this.Vd()||(this.qd&&(this.Hd=!0),this._v||(this.Ld.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this._v=setTimeout(()=>{this.wv()},5)))}uv(){clearTimeout(this._v),this._v=void 0}onReloading(t){return this.Ld.push(t),()=>{this.Ld=this.Ld.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Nd||this.qd||this._v||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Bd=t}resetFlagCallReported(){this.Dt(Mt)}wv(t){this.uv();var e=this.ao;if(e&&!this.xn.remoteRequestsDisabled&&!this.Vd())if(this.qd)this.Hd=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:n({},e.initialPersonProperties,this.hv("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.hv(ct),timezone:kl()};Te(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.xn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.mv();r.length&&(i.evaluation_contexts=r);var s=this.yv();Te(s)||(i.flag_keys=s);var o=this.xn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.jd;this.qd=!0;var u=()=>{this.Hd&&(this.Hd=!1,this.wv())},h=t=>{this.qd=!1,l===this.jd?(this.Ot({[Et]:[ek]}),this.A.error("Feature flag request failed",t),this.vv()&&this.sv(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.xn.compression,sentAt:"body",timeoutMs:this.xn.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this.qd=!1,l===this.jd){if(this.Sv(t.statusCode),s||this.Hd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Hd){this.zd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?ek:"unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&a.push("quota_limited"),this.Ot({[Et]:a}),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.bv(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}Vd(){return Xn(this.Wd,3)}Sv(t){this.Wd=Yn(t,this.Wd,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(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.zd)if(this.Nd||this.getFlags()&&this.getFlags().length>0){if(!this.gv()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else this.A.warn('getFeatureFlag for key "'+t+tk)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e;return null==(e=this.getFeatureFlagResult(t,{send_event:!1}))?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.zd)if(this.Nd||this.getFlags()&&this.getFlags().length>0){if(!this.gv()){var i,r=this.getFlagVariants(),s=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.hv("$feature_flag_request_id")||void 0,h=this.hv("$feature_flag_evaluated_at")||void 0,d=this.hv("$flag_call_reported")||{};if(this.xn.deduplicateCallsPerSession){var v,c=null==(v=this.ao)?void 0:v.session.sessionId,f=this.hv(It);c&&c!==f&&(d={},i=c)}if(e.send_event||!("send_event"in e))if(t in d&&d[t].includes(l))i&&this.Ot({[Mt]:d,[It]:i});else{var p,g,m,y,b,_,w,k,S,x,C,T,M;ke(d[t])?d[t].push(l):d[t]=[l],this.Ot(n({[Mt]:d},i?{[It]:i}:{}));var I=this.getFeatureFlagDetails(t),E=[...null!==(p=this.hv("$feature_flag_errors"))&&void 0!==p?p:[]];Te(o)&&E.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:o,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.xn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.xn.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.zd};Te(null==I||null==(_=I.metadata)?void 0:_.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Te(null==I||null==(w=I.metadata)?void 0:w.version)||(R.$feature_flag_version=I.metadata.version);var A=null!==(k=null==I||null==(S=I.reason)?void 0:S.description)&&void 0!==k?k:null==I||null==(x=I.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=I&&null!=(C=I.metadata)&&C.id&&(R.$feature_flag_id=I.metadata.id),Te(null==I?void 0:I.original_variant)&&Te(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Te(I.original_variant)?I.original_enabled:I.original_variant),null!=I&&null!=(T=I.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==I||null==(M=I.metadata)?void 0:M.original_payload),E.length&&(R.$feature_flag_error=E.join(",")),this.xv(R)}else i&&this.Ot({[Mt]:d,[It]:i});if(s)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Zr(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+tk)}xv(t){try{var e;null==(e=this.ao)||e.capture("$feature_flag_called",t).catch(t=>{this.A.error("Failed to capture feature flag call",t)})}catch(t){this.A.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.Cv(t,e)}Cv(t,e){var i=this;return o(function*(){var r=i.ao;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.mv();s.length&&(n.evaluation_contexts=s);var o,a=i.yv();Te(a)||(n.flag_keys=a);try{var l;o=(null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.xn.compression,sentAt:"body",timeoutMs:i.xn.requestTimeoutMs})).json)||null==(l=l.featureFlagPayloads)?void 0:l[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}})()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.zd)return e.defaultValue;if(!(this.Nd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+tk),e.defaultValue;var i=this.getFeatureFlag(t,e);return Te(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,i){this.bv(t,e,i)}bv(t,e,i){if(this.ao){this.Nd=!0;var r=function(t,e,i,r,s,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=Xw);var a=((t,e)=>{var i=t.flags;return i?n({},t,{featureFlags:Object.fromEntries(Object.keys(i).map(t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter(t=>i[t].enabled).filter(t=>{var e;return!Te(null==(e=i[t].metadata)?void 0:e.payload)}).map(t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]}))}):(t.featureFlags&&e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t)})(t,o),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(ke(u)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;return{[nt]:u,[rt]:c,[ut]:!1}}var p=u,g=h,m=l;if(null!=s&&s.partialResponse){var y=Object.keys(p),b=g||{};p=n({},e,p),g=n({},i,b),y.forEach(t=>{var e;t in b||null==(e=g)||delete e[t]}),m=n({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var _=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=n({},e,Object.fromEntries(Object.entries(p).filter(t=>_.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>_.has(t[0])));g=n({},i,w),_.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=n({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>_.has(t[0]))))}else p=n({},e,p),g=n({},i,g),m=n({},r,m);return n({[nt]:Object.keys(rk(p)),[rt]:p||{},[at]:g||{},[ot]:m||{},[ut]:!0===t.minimalFlagCalledEvents},d?{[lt]:d}:{},v?{[Rt]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var s=!Te(this.ao.kv.get(rt));this.dv=r,s||this.Ot(r)}else this.rv(),this.pv(r,t,!(null==i||!i.partialResponse)),this.Ot(r);else e&&this.vv();e||(this.Ud=!1),this.sv(e)}}override(t,e){void 0===e&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Tv(t)}Tv(t){if(this.ao){if(!1===t)return this.Dt([ht,dt]),this.sv(),void Yw.info("All overrides cleared");if(ke(t))return this.Ot({[ht]:ik(t)}),this.sv(),void Yw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Od=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ht]=ke(n)?ik(n):n),s&&(r[dt]=s),Object.keys(r).length&&this.Ot(r),!1===n&&!1===s?this.Dt([ht,dt]):!1===n?this.Dt(ht):!1===s&&this.Dt(dt),this.sv(),!1===n?Yw.info("Flag overrides cleared"):n&&Yw.info("Flag overrides set",{flags:n}),void(!1===s?Yw.info("Payload overrides cleared"):s&&Yw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ot({[ht]:t}),this.sv(),void Yw.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Nd){var e=this.Mv(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.A.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r,s=(this.hv("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i);var l=n({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[nt]:[t],[rt]:[t],[vt]:Object.keys(o)}),this.Ot({[nt]:Object.keys(rk(l)),[rt]:l,[vt]:n({},this.hv("$stored_person_properties")||{},o)}),this.sv();try{var u;null==(u=this.ao)||u.capture("$feature_enrollment_update",a).catch(t=>{this.A.error("Failed to capture early access feature enrollment",t)})}catch(t){this.A.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.hv(st);!r||e?this.Iv(t,i):t(r)}Iv(t,e){var i=this;return o(function*(){var r=i.ao;if(r){var n,s=e?"&"+e.map(t=>"stage="+t).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n=o.json.earlyAccessFeatures,i.Ot({[st]:n})}catch(t){return void i.A.error("Early access feature request failed",t)}try{t(n)}catch(t){i.A.error("Early access feature callback failed",t)}}})()}Mv(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(t=>e[t]),flagVariants:Object.keys(e).filter(t=>e[t]).reduce((t,i)=>(t[i]=e[i],t),{})}}sv(t){this.nv();var e=this.Mv(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.A.error("Error while running feature flags callback",t)}})}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Ev(t,e)}Ev(t,e){void 0===e&&(e=!0);var i=this.hv("$stored_person_properties")||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this.Ot({[vt]:n({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=n({},this.hv("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.Ot({[vt]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.Dt(vt),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.hv("$stored_group_properties")||{},r=n({},i);for(var s of Object.keys(t))r[s]=n({},i[s],t[s]);this.Ot({[ct]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.hv("$stored_group_properties")||{};this.Ot({[ct]:n({},e,{[t]:{}})})}else this.Dt(ct)}reset(){this.jd++,this.Hd=!1,this.$d={},this.Dd={},this.dv=void 0,this.Nd=!1,this.Bd=!1,this.zd=!1,this.$anon_distinct_id=void 0,this.uv(),this.Od=!1,this.Wd=0}}},pk={sessionRecording:class{get xn(){return this._instance.config}get gl(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Rv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.Av||"missing_config"===this.Av?this.Av:null!==(t=null==(e=this.Rv)?void 0:e.status)&&void 0!==t?t:this.Av}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Av=Ys,this.Pv=void 0,this.Fv=!1,this.Ke=(()=>{var t;if(null==h||!h.visibilityState||"visible"===h.visibilityState)return!0;var e=null==a||null==(t=a.performance)||null==t.getEntriesByType?void 0:t.getEntriesByType("visibility-state");return!(null!=e&&e.length)||e.some(t=>"visible"===t.name)})(),this.ar=()=>{var t;"visible"===(null==h?void 0:h.visibilityState)&&(this.Ke=!0,null==(t=this.Rv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Rw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.xn.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=h&&h.addEventListener&&zn(h,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.Fv=!0,null==h||null==h.removeEventListener||h.removeEventListener("visibilitychange",this.ar),i?this.Ov(!0):this.stopRecording()}get $v(){var t,e=!(null==(t=this._instance.get_property(j))||!t.enabled),i=!this.xn.disable_session_recording,r=this.xn.disable_session_recording||this._instance.consent.isOptedOut();return a&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.Fv||this.$v&&null!=(e=this.Rv)&&e.isStarted)){var i=!Te(Object.assign)&&!Te(Array.from);this.$v&&i?(this.Dv(t),Rw.info("starting")):(this.Av=Ys,this.stopRecording())}}Dv(t){var e,i;if(this.$v)if("awaiting_config"!==this.Av&&"missing_config"!==this.Av&&(this.Av=no),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.Lv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Nv,e=>{if(!this.Fv&&this.$v&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),Rw.error("could not load recorder",e)):void this.Lv(t);this.Av=Ys})}}stopRecording(){var t,e;null==(t=this.Pv)||t.call(this),this.Pv=void 0,null==(e=this.Rv)||e.stop()}Ov(t){var e,i;void 0===t&&(t=!1),null==(e=this.Pv)||e.call(this),this.Pv=void 0,null==(i=this.Rv)||i.discard({discardProducerEvents:t})}qv(){var t,e;null==(t=this.gl)||t.unregister(Z),null==(e=this.gl)||e.unregister(H)}jv(t,e){if(Re(t))return null;var i,r=Ae(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Rw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Bv(t){if(this.gl){var e,i,r=this.gl,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.jv(null==(e=this.xn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.jv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Re(a)&&this.qv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[j]:n({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:n({capturePerformance:t.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:Te(l)?null:l,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})})};s(),null==(e=this.Pv)||e.call(this),this.Pv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.Bv(e),void this.Ov()):(this.Bv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.Av&&(this.Av="missing_config",Rw.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.Rv)&&i.log?this.Rv.log(t,e):Rw.warn("log called before recorder was ready")}get Nv(){var t;return(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.get_property("$session_recording_remote_config"))||null==(t=t.scriptConfig)?void 0:t.script)||"lazy-recorder"}Hv(){var t,e=this._instance.get_property(j);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Rw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Re(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Lv(t){var e,i,r;if(!this.Fv&&this.$v&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return Rw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ht]:!0});var n;if(this.Rv||(this.Rv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Ke),this.Rv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Hv()){if("missing_config"===this.Av||"awaiting_config"===this.Av)return;return this.Av="awaiting_config",Rw.info("persisted remote config is stale, requesting fresh config before starting"),void new y_(this._instance).load()}this.Av=no,null==(i=(r=this.Rv).setDocumentWasEverVisible)||i.call(r,this.Ke),this.Rv.start(t)}else this.Av=Ys}onRRwebEmit(t){var e;null==(e=this.Rv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Rv||null==(t=this.gl)||t.register({[U]:!0}),null==(e=this.Rv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.Rv||null==(t=this.gl)||t.register({[z]:!0}),null==(e=this.Rv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.Rv||null==(e=this.gl)||e.register({["url"===t?W:V]:!0}),null==(i=this.Rv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Rv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Rv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.Rv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},gk={autocapture:class extends Ib{constructor(t){super(new kw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.zv=this.Uv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Wv();return!!(t.path||t.search||this.Vv(t))}startIfEnabled(){this.isEnabled&&(An.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.zv=this.Uv(),this.startIfEnabled()}stop(){this.Gv&&this.Gv(),this.Gv=void 0,this.Zv&&this.Zv(),this.Zv=void 0,An.info("History API monitoring stopped")}monitorHistoryChanges(){a&&a.history&&(this.Jv("pushState"),this.Jv("replaceState"),this.Qv(),this.Vv()&&this.Kv())}Jv(t){var e;if(a&&(null==(e=a.history[t])||!e.__posthog_wrapped__)){var i=this;ic(a.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Xv(t)})}}Uv(){var t=null==a?void 0:a.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Wv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:xe(t)?t:{}}Vv(t){return void 0===t&&(t=this.Wv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Yv(t){var e=this.Wv(),i=this.zv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Vv(e)&&t.hash!==i.hash))}Xv(t){try{var e=this.Uv();if(!e)return;this.Yv(e)&&this._instance.capture(se,{navigation_type:t}),this.zv=e}catch(e){An.error("Error capturing "+t+" pageview",e)}}Qv(){if(!this.Gv){var t=()=>{this.Xv("popstate")};zn(a,"popstate",t),this.Gv=()=>{a&&a.removeEventListener("popstate",t)}}}Kv(){if(!this.Zv){var t=()=>{this.Xv("hashchange")};zn(a,"hashchange",t),this.Zv=()=>{a&&a.removeEventListener("hashchange",t)}}}},heatmaps:class{get xn(){return this.instance.config}constructor(t){var e;this.tc=!1,this.ho=!1,this.ec=null,this.instance=t,this.tc=!(null==(e=this.instance.persistence)||!e.props[R]),this.rageclicks=new kb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return xe(this.xn.capture_heatmaps)&&this.xn.capture_heatmaps.flush_interval_milliseconds&&(t=this.xn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Re(this.xn.capture_heatmaps)?Re(this.xn.enable_heatmaps)?this.tc:this.xn.enable_heatmaps:!1!==this.xn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ho)return;Aw.info("starting..."),this.rc(),this.ar()}else{var t;clearInterval(null!==(t=this.ec)&&void 0!==t?t:void 0),this.nc(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[R]:i}),this.tc=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Rt;return this.Rt=void 0,t}sc(t){Pw(t.originalEvent)&&this.Sn(t.originalEvent,"deadclick")}ar(){this.ec&&clearInterval(this.ec),this.ec=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(h)?setInterval(this.ol.bind(this),this.flushIntervalMilliseconds):null}rc(){a&&h&&(this.oc=this.ol.bind(this),zn(a,ne,this.oc),this.ac=t=>this.Sn(t||(null==a?void 0:a.event)),zn(h,"click",this.ac,{capture:!0}),this.lc=t=>this.uc(t||(null==a?void 0:a.event)),zn(h,"mousemove",this.lc,{capture:!0}),this.hc=new Gb(this.instance,Wb,this.sc.bind(this)),this.hc.startIfEnabledOrStop(),this.dc=this.ar.bind(this),zn(h,re,this.dc),this.ho=!0)}nc(){var t;a&&h&&(this.oc&&a.removeEventListener(ne,this.oc),this.ac&&h.removeEventListener("click",this.ac,{capture:!0}),this.lc&&h.removeEventListener("mousemove",this.lc,{capture:!0}),this.dc&&h.removeEventListener(re,this.dc),clearTimeout(this.vc),null==(t=this.hc)||t.stop(),this.ho=!1)}cc(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&rs(r)&&!ns(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,l;n=null==(s=null!==(o=null==(l=r.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:a)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(pe(e,n))return!0;r=gs(r)}return!1}(vs(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}Sn(t,e){var i;if(void 0===e&&(e="click"),!is(t.target)&&Pw(t)){var r=this.cc(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Cs(vs(t),this.instance.config.rageclick)&&this.Hs(n({},r,{type:"rageclick"})),this.Hs(r)}}uc(t){!is(t.target)&&Pw(t)&&(clearTimeout(this.vc),this.vc=setTimeout(()=>{this.Hs(this.cc(t,"mousemove"))},500))}Hs(t){if(a){var e=this.xn.disable_capture_url_hashes?ar(a.location.href):a.location.href,i=this.xn.custom_personal_data_properties,r=Qn(e,this.xn.mask_personal_data_properties?[...hl,...i||[]]:[],vl);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}}ol(){this.Rt&&!Ce(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Gb,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.tc=!1,this.ho=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.fc=()=>{clearTimeout(this.gc),this.gc=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",n({$current_url:this.Rt.url},this.Rt.metrics.reduce((t,e)=>n({},t,{["$web_vitals_"+e.name+"_event"]:n({},e),["$web_vitals_"+e.name+"_value"]:e.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.mc=t=>{var e;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Re(null==t?void 0:t.name)||Re(null==t?void 0:t.value))Cw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.yc(i);if(!Te(r)){var s=Ae(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.bc||this.bc>t.value){this.Rt.navigationKey!==s&&(this.fc(),this.gc=setTimeout(this.fc,this.flushToCaptureTimeoutMs)),Te(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=Te(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=n({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,xe(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of Ew){var h="url"===u&&"string"==typeof t.attribution[u]?this.yc(t.attribution[u]):t.attribution[u];Te(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Te(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.fc()}else Cw.error("Ignoring metric with value >= "+this.bc,t)}}},this._c=()=>{if(!this.ho){var t,e,i,r,s=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.wc])||("web-vitals"===this.wc&&Te(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Te(l)){var u=l.withoutAttribution,h=this.attributionMetrics;s=!Te(u),t=h.indexOf("LCP")>-1?l.onLCP:(null==u?void 0:u.onLCP)||l.onLCP,e=h.indexOf("CLS")>-1?l.onCLS:(null==u?void 0:u.onCLS)||l.onCLS,i=h.indexOf("FCP")>-1?l.onFCP:(null==u?void 0:u.onFCP)||l.onFCP,r=h.indexOf("INP")>-1?l.onINP:(null==u?void 0:u.onINP)||l.onINP}if(t&&e&&i&&r){var d={reportSoftNavs:this.useSoftNavs},v=s&&this.attributionMetrics.indexOf("INP")>-1?n({},d,{includeProcessedEventEntries:!1}):d;this.allowedMetrics.indexOf("LCP")>-1&&t(this.mc.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.mc.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.mc.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.mc.bind(this),v),this.ho=!0}else Cw.error("web vitals callbacks not loaded - not starting")}},this.tc=!(null==(e=this._instance.persistence)||!e.props[O]),this.startIfEnabled()}get kc(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=xe(this.kc)?null==(t=this.kc)?void 0:t.web_vitals_allowed_metrics:void 0;return Re(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||Mw:i}get flushToCaptureTimeoutMs(){return(xe(this.kc)?this.kc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=xe(this.kc)?this.kc.web_vitals_attribution:void 0;return Fe(t)?t?Mw:[]:ke(t)?t:Iw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=xe(this.kc)?this.kc.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get bc(){var t=xe(this.kc)&&Ae(this.kc.__web_vitals_max_value)?this.kc.__web_vitals_max_value:Tw;return t>0&&6e4>=t?Tw:t}get isEnabled(){var t=null==d?void 0:d.protocol;if("http:"!==t&&"https:"!==t)return Cw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=xe(this.kc)?this.kc.web_vitals:Fe(this.kc)?this.kc:void 0;return Fe(e)?e:this.tc}startIfEnabled(){this.isEnabled&&!this.ho&&(Cw.info("enabled, starting..."),this.Ro(this._c))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=xe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=xe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[O]:i}),this._instance.persistence.register({[q]:r})),this.tc=i,this.startIfEnabled()}}}get wc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ro(t){var e=b.__PosthogExtensions__,i=this.wc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Te(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?Cw.error("failed to load script",e):t()})}yc(t){var e=t||(null==a?void 0:a.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?ar(e):e,r=this._instance.config.custom_personal_data_properties;return Qn(i,this._instance.config.mask_personal_data_properties?[...hl,...r||[]]:[],vl)}Cw.error("Could not determine current URL")}}},mk={exceptionObserver:class{constructor(t){var e;this._c=()=>{var t;if(a&&this.isEnabled&&null!=(t=b.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=b.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=b.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=b.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Sc&&this.xn.capture_unhandled_errors&&(this.Sc=e(this.captureException.bind(this))),!this.xc&&this.xn.capture_unhandled_rejections&&(this.xc=i(this.captureException.bind(this))),!this.Cc&&this.xn.capture_console_errors&&(this.Cc=r(this.captureException.bind(this)))}catch(t){Sw.error("failed to start",t),this.Tc()}}},this._instance=t,this.Mc=!(null==(e=this._instance.persistence)||!e.props[A]),this.wt=new Ze(n({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,A:Sw})),this.xn=this.Ic(),this.startIfEnabledOrStop()}Ic(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xe(t)?e=n({},e,t):(Te(t)?this.Mc:t)&&(e=n({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.xn.capture_console_errors||this.xn.capture_unhandled_errors||this.xn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Sw.info("enabled"),this.Tc(),this.Ro(this._c)):this.Tc()}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",e=>{if(e)return Sw.error("failed to load script",e);t()})}Tc(){var t,e,i;null==(t=this.Sc)||t.call(this),this.Sc=void 0,null==(e=this.xc)||e.call(this),this.xc=void 0,null==(i=this.Cc)||i.call(this),this.Cc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Mc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A]:this.Mc}),this.xn=this.Ic(),this.startIfEnabledOrStop())}}onConfigChange(){this.xn=this.Ic()}captureException(t){try{var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";if(this.wt.consumeRateLimit(n))return void Sw.info("Skipping exception capture because of client rate limiting.",{exception:n});null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}catch(t){}}},exceptions:class{constructor(t){var e,i;this.Ec=[],this.Rc=bm(),this._instance=t,this.Ec=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this.Ac=Wr(this.Pc()),this.Fc=new Vr(this.Ac)}onConfigChange(){this.Ac=Wr(this.Pc()),this.Fc.setConfig(this.Ac)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Ec=s,this._instance.persistence&&this._instance.persistence.register({[P]:this.Ec,[F]:o})}}}get Oc(){var t,e,i=!!this._instance.get_property(F);return null!==(t=null!==(e=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==e?e:i)&&void 0!==t&&t}buildProperties(t,e){return this.Rc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ac.enabled)try{if(!Me(t)||0===t.trim().length)return void fm.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce((i,r)=>zr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.$c(e)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&fm.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Fc.add(n({[Br]:t,[Hr]:(new Date).toISOString()},r))}catch(t){fm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Dc(e)){if(this.Lc(e))return this.Nc("Exception dropped: matched a suppression rule"),void fm.info("Skipping exception capture because a suppression rule matched");if(!this.Oc&&this.qc(e))return this.Nc("Exception dropped: thrown by a browser extension"),void fm.info("Skipping exception capture because it was thrown by an extension");if(!this.Oc&&this.jc(e))return this.Nc("Exception dropped: thrown by an injected browser script"),void fm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Bc(e))return this.Nc("Exception dropped: thrown by the PostHog SDK"),void fm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Ac.enabled&&Re(t.$exception_steps)?this.Hc(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Gu:!0});return n&&this.Fc.clear(),n}catch(t){return cm(t)||fm.error("Failed to capture exception event. Dropping this exception.",t),void this.Fc.clear()}}catch(t){return void(cm(t)||fm.error("Failed to process exception event. Ignoring this exception.",t))}var s}Hc(t){try{var e=this.Fc.getAttachable();return 0===e.length?t:n({},t,{$exception_steps:e})}catch(e){return fm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Nc(t){this.Ac.enabled&&this.Fc.add({[Br]:t,[Hr]:(new Date).toISOString()})}$c(t){return xe(t)?n({},t):{}}Pc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Lc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Me(i)&&i.length>0&&t.$exception_types.push(i),Me(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.Ec.some(t=>{var i=t.values.map(t=>{var i=tl[t.operator],r=e[t.key];if(!i||!r)return!1;var n=ke(t.value)?t.value:[t.value];return n.length>0&&i(n,r)});return"OR"===t.type?i.some(Boolean):i.every(Boolean)})}catch(t){return fm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}qc(t){var e=t.flatMap(t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}),i=e.filter(t=>{var e=t.filename;return!!e&&mm.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(pm)})||t.some(t=>{var e=t.value;return"NoResponse"===t.type||Me(e)&&gm.some(t=>{var i=t.value;return t.exact?e===i:e.includes(i)})})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(pm))}))}jc(t){return t.some(t=>{var e=t.value;return Me(e)&&ym.some(t=>e.includes(t))})}Bc(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[];return null!==(r=null==(n=s[s.length-1])||null==(n=n.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Dc(t){return!Re(t)&&ke(t)}}},yk=n({productTours:class{get gl(){return this._instance.persistence}constructor(t){this.zc=null,this.Uc=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.gl&&this.gl.register({[L]:!!e.productTours}),!Ow(this._instance))return!this.zc&&Re(null==(i=this.gl)?void 0:i.props.ph_product_tours)||Fw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.zc)||r.stop(),this.zc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.zc&&Ow(this._instance)&&this.Ro(()=>this.Wc())}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",e=>{e?Fw.error("Could not load product tours script",e):t()})}Wc(){var t;!this.zc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.zc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!ke(this.Uc)||e){var i=this.gl;if(i){var r=i.props[_t];if(ke(r)&&!e)return this.Uc=r,void t(r,{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:e=>{if(Ow(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||Fw.warn(n):Fw.error(n),void t([],{isLoaded:!1,error:n})}var s=ke(e.json.product_tours)?e.json.product_tours:[];this.Uc=s,i&&i.register({[_t]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Uc,{isLoaded:!0})}getActiveProductTours(t){Re(this.zc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.zc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.zc)||e.showTourById(t)}previewTour(t){this.zc?this.zc.previewTour(t):this.Ro(()=>{var e;this.Wc(),null==(e=this.zc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.zc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.zc)||t.nextStep()}previousStep(){var t;null==(t=this.zc)||t.previousStep()}clearCache(){var t;this.Uc=null,null==(t=this.gl)||t.unregister(_t)}resetTour(t){var e;null==(e=this.zc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.zc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.zc)||e.cancelPendingTour(t)}}},fk),bk={siteApps:class{constructor(t){this._instance=t,this.Vc=0,this.Gc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zc(t,e){if(e){var i=this.globalsForEvent(e);this.Gc.push(i),this.Gc.length>1e3&&(this.Gc=this.Gc.slice(10))}}get siteAppLoaders(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Zc.bind(this));this.Jc=()=>{t(),this.Gc=[],this.Jc=void 0}}}globalsForEvent(t){var e,s,o,a,l,u,h;if(!t)throw new Error("Event payload is required");var d={},v=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(c)){var p=f[0];d[p]={id:v[p],type:p,properties:f[1]}}var g=t.$set_once,m=t.$set;return{event:n({},r(t,i),{properties:n({},t.properties,m?{$set:n({},null!==(e=null==(s=t.properties)?void 0:s.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:n({},null!==(o=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==o?o:{},g)}:{}),elements_chain:null!==(l=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==l?l:"",distinct_id:null==(h=t.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}Qc(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||($w.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||($w.error("prepare_external_dependency_script returned null"),null):t}Kc(){var t,e,i,r,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==h?void 0:h.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Vc++,this.Xc)return this.Yc();var d=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),d.push(()=>{t[e]=r})}},p=t=>{if(c.has(t))return t;var e=v.Qc(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Ee(t));return f(u,"appendChild",t=>function(e){var i=p(e);return i?t.call(this,i):e}),f(u,"insertBefore",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e}),f(u,"replaceChild",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i}),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(t=>{f(t,"append",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}),f(t,"prepend",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})}),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(t=>{f(t,"before",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}),f(t,"after",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}),f(t,"replaceWith",t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=g(i);return i.length&&!n.length?void 0:t.apply(this,n)})}),f(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null}),this.Xc=()=>{d.forEach(t=>t()),this.Xc=void 0},this.Yc()}Yc(){var t=!1;return()=>{var e;t||(t=!0,this.Vc--,0===this.Vc&&(null==(e=this.Xc)||e.call(this)))}}tf(t,e){void 0===e&&(e=!0);var i=this.Kc();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.Gc.length&&($w.info("Processing "+this.Gc.length+" events for site app with id "+t.id),this.Gc.forEach(t=>this.tf(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Jc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,$w.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.tf(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){$w.error(Dw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){$w.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}ef(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}if(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.tf(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){$w.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.ef(),void this._instance.on("eventCaptured",t=>this.if(t))):void $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Jc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;b["__$$ph_site_app_"+e]=n._instance,null==(t=b.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,t=>{if(t)return $w.error(Dw+e,t)})};for(var a of s.siteApps)o()}else $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},_k={tracingHeaders:class{constructor(t){this._instance=t,this.rf=void 0,this.nf=void 0,this.sf=void 0,this._c=()=>{var t,e,i=this.af();i?(Te(this.rf)&&(this.rf=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Te(this.nf)&&(this.nf=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Tc()}}initialize(){this.startIfEnabledOrStop()}Ro(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",e=>{if(e)return xw.error("failed to load script",e);t()})}lf(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}af(){var t=this.lf();return ke(t)?(ke(this.sf)?this.sf.splice(0,this.sf.length,...t):this.sf=[...t],t.length>0?this.sf:void 0):(ke(this.sf)&&this.sf.splice(0),this.sf=t||void 0,this.sf)}Tc(){var t,e;null==(t=this.rf)||t.call(this),null==(e=this.nf)||e.call(this),this.rf=void 0,this.nf=void 0}startIfEnabledOrStop(){this.af()?this.Ro(this._c):this.Tc()}}},wk=n({surveys:class extends jw{constructor(t){var e;super(new Vw(t),(e=t,{get projectToken(){return e.config.token},kv:new Ww(e)})),this._instance=t}wh(t,e){var i=e.query?S_(t,e.query):t;return new Promise(t=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",i),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:t})})}}},fk),kk={toolbar:class{constructor(t){this.instance=t}uf(t){b.ph_toolbar_state=t}hf(){var t;return null!==(t=b.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Un(this.instance.config))return!1;if(!a||!h)return!1;t=null!=t?t:a.location,i=null!=i?i:a.history;try{if(!e){try{a.localStorage.setItem("test","test"),a.localStorage.removeItem("test")}catch(t){return!1}e=null==a?void 0:a.localStorage}var r,n=Gw||Kn(t.hash,"__posthog")||Kn(t.hash,"state"),s=n?Ln(()=>JSON.parse(atob(decodeURIComponent(n))))||Ln(()=>JSON.parse(decodeURIComponent(n))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Zw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}df(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Re(e)&&Se(e)?e(t,this.instance):Jw.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==h||!h.getElementById("__POSTHOG_TOOLBAR__"));if(!a||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=n({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(a.localStorage.setItem(Zw,JSON.stringify(n({},r,{source:void 0}))),2===this.hf())this.df(r);else if(0===this.hf()){var s;this.uf(1),null==(s=b.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Jw.error("[Toolbar] Failed to load",t),void this.uf(0);this.uf(2),this.df(r)}),zn(a,"turbolinks:load",()=>{this.uf(0),this.loadToolbar(r)})}return!0}vf(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},Sk=n({experiments:class t{get xn(){return this._instance.config}constructor(e){var i=this;this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),i.getWebExperiments(e=>{t.cf("retrieved web experiments from the server"),i.ff=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.ff&&(t.cf("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.ff)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Me(n)&&e.variants[n]&&i.pf(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.gf(o,i._instance)&&i.pf(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.cf(nk);else if(!this.xn.disable_web_experiments){if(Re(this.ff))return this.ff=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.cf("applying feature flags",e),e.forEach(t=>{var e;if(this.ff&&null!=(e=this.ff)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ff)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.pf(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Jn(null==e?void 0:e.search,"__experiment_id"),r=Jn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.cf("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.mf(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this.xn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.xn.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.xn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}mf(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.cf("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.pf(n[0].name,i,n[0].variants[i].transforms))}static gf(e,i){return!Re(e.conditions)&&t.yf(e,i)&&t.bf(e)}static yf(e,i){var r;if(Re(e.conditions)||Re(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=ts(i,n.href);return null==(s=e.conditions)||!s.url||sk[null!==(o=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return null==a?void 0:a.location}static bf(t){var e;if(Re(t.conditions)||Re(null==(e=t.conditions)?void 0:e.utm))return!0;var i=fl();if(i.utm_source){var r,n,s,o,a,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static cf(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];An.info("[WebExperiments] "+t,i)}pf(e,i,r){this._is_bot()?t.cf(nk):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.cf("applying transform of variant "+i+" for experiment "+e+" ",r),null==(n=document)||null==(n=n.querySelectorAll(r.selector))||n.forEach(t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}):t.cf("Control variants leave the page unmodified.")}_is_bot(){return u&&this._instance?U_(u,this.xn.custom_blocked_useragents):void 0}}},fk),xk=n({},fk,pk,gk,mk,yk,bk,wk,_k,kk,Sk,{conversations:class{constructor(t){this._instance=t,this._f=void 0,this._conversationsManager=null,this.wf=!1,this.re=null,this.kf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Sf=t.ok,t.ok)){var e=t.config.conversations;Re(e)||(Fe(e)?this._f=e:(this._f=e.enabled,this.re=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this._f=void 0,this.re=null,this.Sf=void 0,this.kf=!1}loadIfEnabled(){if(!(this._conversationsManager||this.wf||this._instance.config.disable_conversations||Un(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Te(this._f)&&this._f)if(this.re&&this.re.token){this.wf=!0;try{var e=t.initConversations;if(e)return this.xf(e),void(this.wf=!1);var i=t.loadExternalDependency;if(!i)return void this.Cf(Yt);i(this._instance,"conversations",e=>{e||!t.initConversations?this.Cf("Could not load conversations script",e):this.xf(t.initConversations),this.wf=!1})}catch(t){this.Cf("Error initializing conversations",t),this.wf=!1}}else ok.error("Conversations enabled but missing token in remote config.")}}xf(t){if(this.re)try{this._conversationsManager=t(this.re,this._instance),this.kf=!1,ok.info("Conversations loaded successfully")}catch(t){this.Cf("Error completing conversations initialization",t)}else ok.error("Cannot complete initialization: remote config is null")}Cf(t,e){ok.error(t,e),this._conversationsManager=null,this.wf=!1,this.kf=!0}show(){this._conversationsManager?this._conversationsManager.show():ok.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._f&&!Ee(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Un(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Sf?"remote_config_failed":Te(this._f)?this.Sf?"disabled_in_project":"remote_config_pending":this._f?Re(this.re)||!this.re.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.wf?"initializing":this.kf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,e,i){var r=this;return o(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(ok.warn(ak),null)})()}getMessages(t,e){var i=this;return o(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(ok.warn(ak),null)})()}markAsRead(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ok.warn(ak),null)})()}getTickets(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ok.warn(ak),null)})()}requestRestoreLink(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ok.warn(ak),null)})()}restoreFromToken(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ok.warn(ak),null)})()}restoreFromUrlToken(){var t=this;return o(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ok.warn(ak),null)})()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}ih(){var t;null==(t=this._conversationsManager)||t.setIdentity()}rh(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=Fp,this.Tf=!1,this.Mf=!1,this.If=!1,this.A=Pn("[logs]"),this.Ef=n({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(ck)||i.A.error(...e)}}),this.Za=[],this.Rf=[],this.Wd=0,this.fo=!1,this.Af=[],this.Pf=[],this.Ff=!1,this.Of=!1,this.$f=()=>{var t,e;this.fo||(this.Wd=0,null==(t=this.Df)||t.onReconnect(),null==(e=this.Lf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Tf=!0),a&&zn(a,"online",this.$f)}Nf(t,e,i,r){var n,s=lk(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new kn(this.qf(t,e),s,this.Ef,()=>this.jf(),t=>t(),void 0,r),s]}Bf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Df||this.Hf!==e){var i;null==(i=this.Df)||i.reset(),this.Hf=e;var r=this.Nf(()=>this.Za,t=>{this.Za=t});this.Df=r[0],this.zf=r[1]}return this.Df}Uf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Lf||this.Wf!==e){var i;null==(i=this.Lf)||i.reset(),this.Wf=e;var r=this.Nf(()=>this.Rf,t=>{this.Rf=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},hk);this.Lf=r[0],this.Vf=r[1]}return this.Lf}setup(t){var e;if(!this.fo){this.ao=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.Tf=!0),(this.Tf||this.Gf()&&this.Zf())&&this.Jf();var i=!1,r=t.onRemoteConfig(t=>{var e;i=t.ok&&!0===(null==(e=t.config.logs)?void 0:e.captureConsoleLogs),this.onRemoteConfig(t)});this.fo?r.dispose():(this.yo=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.fo||(this.fo=!0,this.Qf(),null==(t=this.yo)||t.dispose(),this.yo=void 0,this.ao=void 0,this.If=!1,null==a||a.removeEventListener("online",this.$f),null==(e=this.Kf)||e.call(this),this.Kf=void 0,null==(i=this.Df)||i.reset(),null==(r=this.Lf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.fo){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Re(r)?this.Xf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[N]:!!r}),r?(this.Tf=!0,this.Mf||this.Jf(),this.loadIfEnabled()):this.Xf())}}reset(){var t,e,i,r;this.Qf(),null==(t=this.Df)||t.clearQueue(),this.Za=[],null==(e=this.Df)||e.reset(),null==(i=this.Lf)||i.clearQueue(),this.Rf=[],null==(r=this.Lf)||r.reset(),this.Wd=0}captureLog(t){this.fo||this.Bf().captureLog(t)}captureConsoleLog(t){this.fo||this.Uf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.fo||this.Uf().captureLog(t,{context:e,occurredAtMs:i})}Zf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[N])}Gf(){var t,e;return null==(t=this._instance)||null==t.Ua||!t.Ua()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}sh(){var t;this.Qf(),null==(t=this.Lf)||t.clearQueue(),this.Rf=[]}Xf(){this.Tf||this.Qf()}Jf(){var t,e=this;if(!this.Ff&&null!=b&&b.console){var i=lk(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=em(b.console[t])}catch(t){return 0}if(!r)return 0;e.Pf.push(ic(b.console,t,n=>{var s=function(){for(var r=arguments.length,s=new Array(r),o=0;r>o;o++)s[o]=arguments[o];try{e.Yf(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of uk)r(n);this.Ff=!0,this.tp=setTimeout(()=>{this.Qf()},3e4)}}Yf(t,e,i){var r;if(this.Ff&&!this.Of&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Af.length){this.Of=!0;try{this.Af.push({level:t,args:e,occurredAtMs:Date.now(),context:this.jf()})}finally{this.Of=!1}}}else this.Qf()}Qf(){if(this.Af=[],this.Ff){for(var t of(this.Ff=!1,this.tp&&(clearTimeout(this.tp),this.tp=void 0),this.Pf))t();this.Pf=[]}}ep(){var t=this.Af;return this.Qf(),t}get logger(){return this.rp||(this.rp={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.rp}flushLogs(t){t?this.np(t):(this.Df&&this.Df.flush().catch(t=>this.sp(t)),this.Lf&&this.Lf.flush().catch(t=>this.sp(t)))}sp(t){ck(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.fo&&this.Tf&&!this.Mf&&!this.If){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Qf();var e=t.loadExternalDependency;if(!e)return this.A.error(Yt),void this.Qf();this.If=!0;try{e(this._instance,"logs",e=>{if(this.If=!1,!this.fo&&this.Tf){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.Qf();else{var r,n,s=this.ep();this.Kf=i.initializeLogs(null!==(r=this.ao)&&void 0!==r?r:this._instance),this.Mf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.ao)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.If=!1,t}}}qf(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===ue.LogsQueue?t():void 0,setPersistedProperty(t,i){t===ue.LogsQueue&&e(null!=i?i:[])},As:t=>this.As(t),getLibraryId:()=>Na.LIB_NAME,getLibraryVersion:()=>Na.LIB_VERSION}}As(t){return new Promise(e=>{if(Xn(this.Wd,3))e({kind:"fatal",error:vk(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:vk(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.op(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.ap(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:vk(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}})}ap(t){(0!==t||this._instance.__loaded)&&(this.Wd=Yn(t,this.Wd,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.")))}np(t){this.Za.length>0&&this.lp(t,this.Za,this.zf,Na.LIB_NAME,t=>{this.Za=t}),this.Rf.length>0&&this.lp(t,this.Rf,this.Vf,hk,t=>{this.Rf=t})}lp(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=wn(s,_n(i,Na.LIB_NAME,Na.LIB_VERSION),r,Na.LIB_VERSION);this._instance._send_request({method:"POST",url:this.op(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}op(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}jf(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,Re(n)||(e.sessionStartTimestamp=n),Re(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ar(b.location.href):b.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},{metrics:class{constructor(t){this._instance=t,this.A=Pn("[metrics]")}initialize(){}Bf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Df&&this.Hf===i||(null==(e=this.Df)||e.reset(),this.Hf=i,this.Df=new Tn(this.qf(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.A)),this.Df}count(t,e,i){void 0===e&&(e=1),this.Bf().count(t,e,i)}gauge(t,e,i){this.Bf().gauge(t,e,i)}histogram(t,e,i){this.Bf().histogram(t,e,i)}flush(t){if(!this.Df)return Promise.resolve();if(t){var e=this.Df.drainWindow();return e&&this.Gs(e,t),Promise.resolve()}return this.Df.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.Df)||t.reset()}qf(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Gs:t=>e.Gs(t),getLibraryId:()=>Na.LIB_NAME,getLibraryVersion:()=>Na.LIB_VERSION}}Gs(t,e){return new Promise(i=>{var r=!1,s=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(n({method:"POST",url:this.up(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;s(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:new Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!==(e=t.error)&&void 0!==e?e:new Error("metrics request failed with status "+i)})}}))})}up(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});ww.__defaultExtensionClasses=n({},xk),function(){Na.SDK_DIST_CHANNEL="cdn";var t=b.posthog;if(!t||ke(t._i)){var e=nw[fw]=new ww;if(t){var i=[];On(t._i,function(r){if(r&&ke(r)){var n=e.init(r[0],r[1],r[2]),s=t[r[2]]||t;n.__loaded&&-1===i.indexOf(s)&&(i.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}})}e.__SV=1,b.posthog=e,function(){function t(){t.done||(t.done=!0,pw=!1,On(nw,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():zn(h,"DOMContentLoaded",t,{capture:!1}):a&&An.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.js.map
|