posthog-js 1.428.6 → 1.428.8
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/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/conversations.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/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +2 -0
- package/dist/module.full.d.ts +2 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +2 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.d.ts +2 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.js.map +1 -1
- package/dist/module.slim.no-external.d.ts +2 -0
- package/dist/module.slim.no-external.js +1 -1
- package/dist/module.slim.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/src/posthog-core.d.ts +1 -0
- package/dist/src/retry-queue.d.ts +1 -0
- package/lib/package.json +10 -4
- package/lib/src/posthog-core.d.ts +1 -0
- package/lib/src/posthog-core.js +6 -0
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/retry-queue.d.ts +1 -0
- package/lib/src/retry-queue.js +8 -2
- package/lib/src/retry-queue.js.map +1 -1
- package/package.json +12 -6
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=["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"],he=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return ue.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function de(t,e){return-1!==t.indexOf(e)}var ve=function(t){return t.trim()},ce=function(t){return t.replace(/^\$/,"")};function fe(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 pe=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}({}),ge=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),me="min_length",ye="max_length",be=["$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"],_e=["token"],we=Object.prototype,ke=we.hasOwnProperty,Se=we.toString,xe=Array.isArray||function(t){return"[object Array]"===Se.call(t)},Ce=t=>"function"==typeof t,Te=t=>t===Object(t)&&!xe(t),Me=t=>{if(Te(t)){for(var e in t)if(ke.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Ee=t=>"[object String]"==Se.call(t),Re=t=>Ee(t)&&0===t.trim().length,Ae=t=>null===t,Pe=t=>Ie(t)||Ae(t),Fe=t=>"[object Number]"==Se.call(t)&&t==t,Oe=t=>Fe(t)&&t>0,$e=t=>"[object Boolean]"===Se.call(t),De=t=>t instanceof FormData,Le=t=>de(be,t),Ne=t=>de(_e,t);function qe(t){return null===t||"object"!=typeof t}function je(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Be(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 ze(t,Error)}}function He(t){return"u">typeof Event&&ze(t,Event)}function ze(t,e){try{return t instanceof e}catch(t){return!1}}var Ue=[!0,"true",1,"1","yes"],We=t=>de(Ue,t),Ve=[!1,"false",0,"0","no"];function Ge(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Fe(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&&de(t,"GSA/")?$i:de(t," OPR/")&&de(t,"Mini")?"Opera Mini":de(t," OPR/")?li:Bi.test(t)?ii:de(t,"IEMobile")||de(t,"WPDesktop")?ai:de(t,"OculusBrowser")?xi:de(t,"SamsungBrowser")?ri:de(t,"Edge")||de(t,"Edg/")?ui:de(t,"Vivaldi/")?Ci:de(t,"YaBrowser/")?Ti:de(t,"Whale/")?Mi:de(t,"DuckDuckGo/")||de(t,"Ddg/")?Ii:de(t,"Claude/")?Pi:de(t,"Codex/")?Fi:de(t,"ChatGPT/")?Oi:de(t,"FBIOS")?"Facebook Mobile":de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?si:de(t,"CrMo")||de(t,ni)?ni:de(t,Qe)&&de(t,ei)?pi:de(t,"FxiOS")?di:de(t.toLowerCase(),Si.toLowerCase())?Si:de(t,"Brave/")?Ai:((t,e)=>e&&de(e,"Apple")||function(t){return de(t,ei)&&!de(t,ni)&&!de(t,Qe)}(t))(t,e)?de(t,Je)?gi:ei:de(t,"PaleMoon/")?Ei:de(t,"Waterfox/")?Ri:de(t,hi)?hi:de(t,"MSIE")||de(t,"Trident/")?oi:de(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(Ie(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=Ie(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&&(Ce(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&&xe(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 Ie(r)||(s.lineno=r),Ie(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: (.*)\)/;var Sr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Ee(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 je(t,"DOMException")}isDOMError(t){return je(t,"DOMError")}},xr=class{match(t){return Be(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}},Cr=class{match(t){return!!je(t,"ErrorEvent")&&(null!=t.error||this.an(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.sn(t))&&void 0!==i?i:r.stack,synthetic:!0})}an(t){return Ee(t.message)&&t.message.length>0}sn(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(Ee(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Tr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Mr=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(Tr);return r&&(e=r[1],i=r[2]),[e,i]}},Ir=["fatal","error","warning","log","info","debug"];function Er(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 Rr=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(He(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Ee(e)&&!Re(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: "+Er(t)}isSeverityLevel(t){return Ee(t)&&!Re(t)&&Ir.indexOf(t)>=0}getStack(t){try{return Ee(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Ee(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(Be(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Ar=class{match(t){return He(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Er(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},Pr=class{match(t){return qe(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}}},Fr=class{match(t){return je(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!He(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 qe(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}},Or="$message",$r="$timestamp",Dr=new Set([Or,$r]),Lr={enabled:!0,max_bytes:32768};function Nr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Lr.enabled,max_bytes:jr(t.max_bytes,Lr.max_bytes)}:n({},Lr)}var qr=class{constructor(t){this.Gn=[],this.Zn=0,this.Rn=Nr(t)}setConfig(t){this.Rn=Nr(t),this.Jn()}add(t){var e=function(t){var e;try{e=fe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Te(i))return;var r=i,n=r[Or],s=r[$r];if(!Ee(n)||0===n.trim().length)return;if(!Ee(s)&&!Fe(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.Rn.max_bytes||(this.Gn.push({step:e.step,bytes:i}),this.Zn+=i,this.Jn())}}getAttachable(){return this.Gn.map(t=>t.step)}clear(){this.Gn=[],this.Zn=0}size(){return this.Gn.length}Jn(){for(;this.Zn>this.Rn.max_bytes&&this.Gn.length>0;){var t=this.Gn.shift();t&&(this.Zn-=t.bytes)}}};function jr(t,e){if(!Fe(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Br=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Hr(t){return"string"==typeof t||t}function zr(t){return"string"==typeof t?t:void 0}var Ur,Wr=["$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"],Vr="NativeGzipValidationError",Gr=t=>t.length>=2&&31===t[0]&&139===t[1],Zr=(t,e)=>t===ge.GZipJS||e===ge.GZipJS||"gzip"===e,Jr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Qr=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Jr(t)||e===Vr},Kr=t=>{throw or(Vr,"Native gzip produced invalid output: "+t)},Xr=function(){var t=o(function*(t,e){18>t.size&&Kr("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Gr(i)&&8===i[2]||Kr("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Ur)return Ur;Ur=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Ur[t]=e>>>0}return Ur})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Kr("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Kr("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function Yr(t,e,i){return tn.apply(this,arguments)}function tn(){return tn=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 Xr(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),tn.apply(this,arguments)}var en={}.propertyIsEnumerable;function rn(t,e){try{return on(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function nn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,$e(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 nn(a.call(t),e,i,r+1)}catch(t){}return xe(t)?{arrayValue:{values:sn(t,e,i,r+1)}}:{kvlistValue:{values:on(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:tr(String(t))}}function sn(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(Pe(a))continue;n.push(nn(a,e,i,r))}catch(t){n.push({stringValue:Yi})}return t.length>o&&n.push({stringValue:Xi}),n}function on(t,e,i,r){var n=[];for(var s in t)if(en.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(Ae(o)||Ie(o))continue;n.push({key:tr(s),value:nn(o,e,i,r)})}catch(t){n.push({key:tr(s),value:{stringValue:Yi}})}}return n}function an(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 ln={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var un={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}},hn=un.info;function dn(t){try{return tr(String(t))}catch(t){return Yi}}function vn(t,e,i,r){var s,o=un[t.level||"info"]||hn,a=o.text,l=o.number,u=(void 0===(s=Fe(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),Pe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Pe(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:dn(t.body)},attributes:rn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Ie(t.trace_flags)||(g.flags=t.trace_flags),g}function cn(t,e,i){return an(t,e,i)}function fn(t,e,i,r){return{resourceLogs:[{resource:{attributes:rn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var pn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Rn=e,this.A=i,this.Qn=r,this.Kn=n,this.Xn=s,this.Yn=o,this.ts=null,this.es=0,this.rs=0,this.ns=0,this.ss=0,this.ls=0,this.us=!1,this.hs=e.maxBufferSize,this.ds=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.vs=e.flushIntervalMs,this.cs=e.maxBatchRecordsPerPost,this.fs=e.rateCapWindowMs,this.ps=e.maxLogsPerInterval}clearQueue(){this.rs++,this._instance.setPersistedProperty(pe.LogsQueue,[])}reset(){this.gs(),this.ss=0,this.ls=0,this.us=!1,this.ns=0,this.cs=this.Rn.maxBatchRecordsPerPost}onReconnect(){this.ns=0,this.ys()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.bs(t);if(null!==r)if(r.body){if(this._s()){var n={record:vn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Qn(),this.A,null==e?void 0:e.occurredAtMs)};this.Kn(()=>this.ws(n))}}else this.A.info("Log was rejected in beforeSend function")}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=xe(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}_s(){if(void 0===this.ps)return!0;var t=Date.now(),e=t-this.ss;return this.fs>e&&e>=0||(this.ss=t,this.ls=0,this.us=!1),this.ps>this.ls?(this.ls++,!0):(this.us||(this.A.warn("captureLog dropping logs: exceeded "+this.ps+" logs per "+this.fs+"ms"),this.us=!0),!1)}flush(){var t=this;return o(function*(){if(!t._instance.isDisabled)return t.ts||(t.ts=t.ks().finally(()=>{t.ts=null})),t.ts})()}ks(){var t=this;return o(function*(){var e;t.gs();var i=null!==(e=t._instance.getPersistedProperty(pe.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.rs;t.es=0;var l=Math.min(i.length,t.cs),u=i.slice(0,l),h=fn(u.map(t=>t.record),t.Ss(),null!==(s=t.Yn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.xs(h);if(t.rs!==a)return;if("too-large"===d.kind&&u.length>1)t.cs=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.cs);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.Rn.maxBatchRecordsPerPost>t.cs&&(t.cs=Math.min(t.Rn.maxBatchRecordsPerPost,t.cs+1)),yield t.Cs(u.length),i=null!==(o=t._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}Cs(t){var e=this;return o(function*(){var i,r=Math.max(0,t-e.es),n=null!==(i=e._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(pe.LogsQueue,n.slice(r)),yield e.Xn()})()}Ss(){return cn(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}ws(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==e?e:[];this.ds>i.length||(i.shift(),this.es++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(pe.LogsQueue,i),this.hs>i.length?this.Ts():this.ys()}}Ts(t){void 0===t&&(t=this.vs),this.Ms||(this.Ms=lr(()=>{this.Ms=void 0,this.ys()},t))}Is(){var t=Math.min(Math.max(0,this.ns-1),6);return this.vs*Math.pow(2,t)}Es(){var t=this._instance.getPersistedProperty(pe.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return o(function*(){e.gs();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(()=>{})})})()}ys(){this.flush().then(()=>{this.ns=0},t=>{this.ns++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Es()&&this.Ts(this.Is())})}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}},gn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function mn(t){return String(t)+"000000"}function yn(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 bn=class{constructor(t,e,i){this._instance=t,this.Rn=e,this.A=i,this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Os=0}count(t,e,i){void 0===e&&(e=1),this.$s({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.$s({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.$s({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.ts,i=function(){var i=o(function*(){e&&(yield e.catch(()=>{})),yield t.Ds()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.ts===i&&(this.ts=null)});return this.ts=i,i}drainWindow(){if(0===this.Rs.size)return null;var t=this.Rs;return this.Rs=new Map,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Ls(t)}reset(){this.Os++,this.gs(),this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set}$s(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.bs(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=yn(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.Rs.get(r);if(!s){if(!this.Ns())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Rs.set(r,s)}var o=this.Ps.get(e.name);void 0===o?this.Ps.set(e.name,e.type):o===e.type||this.Fs.has(e.name)||(this.Fs.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.qs(s,e.value),this.Ts()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ns(){return this.Rn.maxSeriesPerFlush>this.Rs.size||(this.As||(this.As=!0,this.A.warn("Metric series cap reached ("+this.Rn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}qs(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(gn.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,gn)]+=1}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=xe(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}Ts(){this.Ms||(this.Ms=lr(()=>{this.Ms=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this.Rn.flushIntervalMs))}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}Ds(){var t=this;return o(function*(){if(0!==t.Rs.size){var e=t.Rs;t.Rs=new Map,t.As=!1,t.Ps=new Map,t.Fs=new Set;var i=t.Os,r=yield t._instance.js(t.Ls(e));if(i===t.Os)switch(r.kind){case"ok":return;case"retry-later":return t.Bs(e),void t.Ts();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)}}})()}Ls(t){return e=this.Hs(t),i=function(t,e,i){return an(t,e,i)}(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:rn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Hs(t){var e=mn(Date.now()),i=new Map;for(var r of t.values()){var s,o=yn(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=rn(null!==(s=r.attributes)&&void 0!==s?s:{},this.A),u=mn(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:gn})}return Array.from(i.values())}Bs(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Rs.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.Ns()&&this.Rs.set(n,s)}}};function _n(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var wn="0.8.2",kn={DEBUG:!1,LIB_VERSION:wn,LIB_NAME:"browser-common",JS_SDK_VERSION:wn},Sn=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&&(kn.DEBUG||a.POSTHOG_DEBUG||i)&&!Ie(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)=>Sn(t+" "+e,i)};return r},xn=Sn("[PostHog.js]"),Cn=xn.createLogger;function Tn(t,e){xe(t)&&t.forEach(e)}function Mn(t,e){if(!Pe(t))if(xe(t))t.forEach(e);else if(De(t))t.forEach((t,i)=>e(t,i));else for(var i in t)ke.call(t,i)&&e(t[i],i)}var In=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 En(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 Rn=function(t){try{return t()}catch(t){return}},An=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){xn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xn.critical(t)}}},Pn=function(t){var e={};return Mn(t,function(t,i){(Ee(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};function Fn(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 On=["herokuapp.com","vercel.app","netlify.app"];function $n(t){var e=null==t?void 0:t.hostname;if(!Ee(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of On)if(i===r)return!1;return!0}function Dn(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 Ln(t){return"ph_toolbar_internal"===t.name}var Nn=["localhost","127.0.0.1"],qn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>Be(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,Fn(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return fe(t)}},jn=t=>{var e=null==h?void 0:h.createElement("a");return Ie(e)?null:(e.href=t,e)},Bn=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Mn(t,function(t,e){Ie(t)||Ie(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)},Hn=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(!xe(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){xn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},zn=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("=");xe(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},Un=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Wn=(t,e)=>t>=e&&m(),Vn=(t,e,i,r)=>{if(0===t){if(m()){var n=e+1;return n===i&&r(),n}return e}return 0};function Gn(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Ce(r))return e;try{var n=r(e);return Ee(n)&&n?n:e}catch(t){return xn.error("Error in get_current_url, falling back to window.location.href",t),e}}function Zn(t){var e,i=null==a||null==(e=a.location)?void 0:e.href;return Ie(i)?void 0:Gn(t,i)}function Jn(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Qn(t){return!!t&&1===t.nodeType}function Kn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Xn(t){return!!t&&3===t.nodeType}function Yn(t){return!!t&&11===t.nodeType&&Qn(t.host)}function ts(t){return t?ve(t).split(/\s+/):[]}function es(t,e){var i=Zn(e);return!!(i&&t&&t.some(t=>i.match(t)))}function is(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 ts(e)}function rs(t){return Pe(t)?null:ve(t).split(/(\s+)/).filter(t=>Es(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ns(t){var e="";return _s(t)&&!ws(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;Xn(t)&&t.textContent&&(e+=null!==(i=rs(t.textContent))&&void 0!==i?i:"")}),ve(e)}function ss(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var os=["a","button","form","input","select","textarea","label"];function as(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 ls(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>as(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function us(t){var e=t.parentNode;return!(!e||!Qn(e))&&e}var hs=[".ph-no-autocapture","[data-ph-no-autocapture]"],ds=["next","previous","prev",">","<"],vs=[...ds,"+","-","−","–"],cs=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,fs=[".ph-no-deadclick",".ph-no-capture"],ps=[".ph-no-rageclick",".ph-no-capture"],gs=["","text","search","email","password","url","tel","number"];function ms(t,e){if(!a||ys(t))return!1;var i,r,n,s,o;if($e(e)?(i=!!e&&ps,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:ps,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&&function(t){return!(!t||!Qn(t))&&(!!Kn(t,"textarea")||(Kn(t,"input")?de(gs,(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)))}(t))return!1;var l=bs(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=ds;else{if(!xe(t))return!1;if(t.length>10)return xn.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=>cs(e,t)||cs(r,t))})}(r,l.map(t=>{var e;return{safeText:ns(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!ls(l,i)}var ys=t=>!t||Kn(t,"html")||!Qn(t),bs=(t,e)=>{if(!a||ys(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!Kn(n,"body");)if(Yn(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=us(n);if(!s)break;if(e||os.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 _s(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Kn(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=is(r);if(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(is(t),"ph-include"))return!0;var s=t.type||"";if(Ee(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Ee(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 ws(t){return!!(Kn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Kn(t,"select")||Kn(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ks=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}))$"),Ss=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,xs=[16,15,14,13],Cs=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ts=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ms=/[0-9A-Za-z_]/;function Is(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 Es(t,e){if(void 0===e&&(e=!0),Pe(t))return!1;if(Ee(t)){if(t=ve(t),e?ks.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Ss.lastIndex=0;e=Ss.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of xs){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(ks.test(a)&&Is(a))return!0}}}return!1}(t))return!1;if(e?Cs.test(t):function(t){var e;for(Ts.lastIndex=0;e=Ts.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Ms.test(i)&&Ms.test(r)))return!0}return!1}(t))return!1}return!0}function Rs(t){var e=ns(t);return Es(e=(e+" "+As(t)).trim())?e:""}function As(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=ns(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+As(t)).trim())}catch(t){xn.error("[AutoCapture]",t)}}),e}function Ps(t){return t.replace(/"|\\"/g,'\\"')}function Fs(t){var e=t.attr__class;if(e)return xe(e)?e:ts(e)}var Os=1e6;function $s(t){var e;return Math.min(Os,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ds={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:Os,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},Ls=["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"],Ns=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],js=t=>{Pe(t)||Mn(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ls.includes(e)||qs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Bs=["/s/","/e/","/i/"];function Hs(t,e,i,r){if(Pe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Ee(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function zs(t,e){if(Pe(t))return t;var i=t;return Es(i,!1)||(i="[SessionRecording] "+e+" body redacted"),Mn(Ns,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 Us=new WeakSet,Ws="disabled",Vs="sampled",Gs="active",Zs="buffering",Js="paused",Qs="lazy_loading",Ks="rrweb_error",Xs="trigger_activated",Ys="trigger_pending",to="trigger_disabled";function eo(t,e,i,r,n,s){return 0===e?to:(null==t?void 0:t.get_property(i?r+i:n))===s?Xs:Ys}function io(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 ro(t){return t.includes("trigger_activated")?Xs:t.includes("trigger_pending")?Ys:to}function no(t){var e=new Set(t);switch(e.delete(to),e.size){case 0:return to;case 1:return Array.from(e)[0];default:return Ys}}var so=class{constructor(t){this.j=t}triggerStatus(t){return ro(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return ro(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},oo=class{constructor(t){this.j=t}triggerStatus(t){return no(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return no(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},ao=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Xs}stop(){}},lo=t=>"sessionRecording"in t,uo=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=(lo(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(lo(t)?Te(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){xn.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){xn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return eo(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=Zn(this._instance);if(!t)return!1;try{return io(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=Zn(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=io(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=Zn(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=io(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===Xs,l=io(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},ho=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=Ys;return Pe(this.linkedFlag)&&(t=to),this.linkedFlagSeen&&(t=Xs),t}onConfig(t,e){var i;if(this.linkedFlag=(lo(t)?Te(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Pe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Ee(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Ee(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Te(i)&&r in i){var o=i[r];s=$e(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()}},vo=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(lo(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return eo(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)===Xs,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},co=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new uo(t,e.id),this.tt=new vo(t,e.id),this.et=new ho(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 so(s):new oo(s)}else this.rt=new ao}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===Ys).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 fo(t){if(t.rrwebError)return Ks;if(!t.receivedFlags)return Zs;if(!t.isRecordingEnabled)return Ws;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new so([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Vs:"trigger_activated"===i?Gs:"trigger_pending"===i?Zs:!1===t.isSampled?Ws:Gs}function po(t){if(t.rrwebError)return Ks;if(!t.receivedFlags)return Zs;if(!t.isRecordingEnabled)return Ws;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new oo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==to,r=$e(t.isSampled);return i&&"trigger_pending"===e?Zs:i&&"trigger_disabled"===e||r&&!t.isSampled?Ws:!0===t.isSampled?Vs:Gs}function go(){var t=[];return function(e,i){if(Te(i)||xe(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function mo(t){var e=JSON.stringify(t,go());return e?new Blob([e]).size:0}function yo(t){if(Ae(t))return 4;if(Ie(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(xe(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Ae(r)?4:yo(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Ie(l)||(o||(s+=1),o=!1,s+=a.length+3+yo(l))}return s;default:return 0}}function bo(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[bo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),bo({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 _o=Uint8Array,wo=Uint16Array,ko=Uint32Array,So=new _o([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]),xo=new _o([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]),Co=new _o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),To=function(t,e){for(var i=new wo(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new ko(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]},Mo=To(So,2),Io=Mo[1];Mo[0][28]=258,Io[258]=28;for(var Eo=To(xo,0)[1],Ro=new wo(32768),Ao=0;32768>Ao;++Ao){var Po=(43690&Ao)>>>1|(21845&Ao)<<1;Ro[Ao]=((65280&(Po=(61680&(Po=(52428&Po)>>>2|(13107&Po)<<2))>>>4|(3855&Po)<<4))>>>8|(255&Po)<<8)>>>1}var Fo=function(t,e,i){for(var r=t.length,n=0,s=new wo(e);r>n;++n)++s[t[n]-1];var o,a=new wo(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new wo(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[Ro[d]>>>l]=u}else for(o=new wo(r),n=0;r>n;++n)o[n]=Ro[a[t[n]-1]++]>>>15-t[n];return o},Oo=new _o(288);for(Ao=0;144>Ao;++Ao)Oo[Ao]=8;for(Ao=144;256>Ao;++Ao)Oo[Ao]=9;for(Ao=256;280>Ao;++Ao)Oo[Ao]=7;for(Ao=280;288>Ao;++Ao)Oo[Ao]=8;var $o=new _o(32);for(Ao=0;32>Ao;++Ao)$o[Ao]=5;var Do=Fo(Oo,9,0),Lo=Fo($o,5,0),No=function(t){return(t/8|0)+(7&t&&1)},qo=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof wo?wo:t instanceof ko?ko:_o)(i-e);return r.set(t.subarray(e,i)),r},jo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Bo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Ho=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 _o(0),0];if(1==n){var o=new _o(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 wo(v+1),f=zo(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 _o(c),f]},zo=function(t,e,i){return-1==t.s?Math.max(zo(t.l,e,i+1),zo(t.r,e,i+1)):e[t.s]=i},Uo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new wo(++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]},Wo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Vo=function(t,e,i){var r=i.length,n=No(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)},Go=function(t,e,i,r,n,s,o,a,l,u,h){jo(e,h++,i),++n[256];for(var d=Ho(n,15),v=d[0],c=d[1],f=Ho(s,15),p=f[0],g=f[1],m=Uo(v),y=m[0],b=m[1],_=Uo(p),w=_[0],k=_[1],S=new wo(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=Ho(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Co[I-1]];--I);var E,R,A,P,F=u+5<<3,O=Wo(n,Oo)+Wo(s,$o)+o,D=Wo(n,v)+Wo(s,p)+o+14+3*I+Wo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&D>=F)return Vo(e,h,t.subarray(l,l+u));if(jo(e,h,1+(O>D)),h+=2,O>D){E=Fo(v,c,0),R=v,A=Fo(p,g,0),P=p;var L=Fo(T,M,0);for(jo(e,h,b-257),jo(e,h+5,k-1),jo(e,h+10,I-4),h+=14,x=0;I>x;++x)jo(e,h+3*x,T[Co[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)jo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(jo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=Do,R=Oo,A=Lo,P=$o;for(x=0;a>x;++x)if(r[x]>255){var B;Bo(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(jo(e,h,r[x]>>>23&31),h+=So[B]);var H=31&r[x];Bo(e,h,A[H]),h+=P[H],H>3&&(Bo(e,h,r[x]>>>5&8191),h+=xo[H])}else Bo(e,h,E[r[x]]),h+=R[r[x]];return Bo(e,h,E[256]),h+R[256]},Zo=new ko([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new _o(0),Qo=function(){for(var t=new ko(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Ko=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Xo(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=Qo[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 _o(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=Vo(l,u,t.subarray(h,d)):(l[h]=s,u=Vo(l,u,t.subarray(h,o)))}else{for(var v=Zo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new wo(32768),m=new wo(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 ko(25e3),k=new wo(288),S=new wo(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=Go(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|Io[O]<<18|Eo[D];var G=31&Io[O],Z=31&Eo[D];C+=So[G]+xo[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Go(t,l,s,w,k,S,C,T,I,h-I,u),s||(u=Vo(l,u,Jo))}return qo(a,0,r+No(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&&Ko(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),Ko(u,h-8,i.d()),Ko(u,h-4,r),u}function Yo(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new _o(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 _o(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 qo(r,0,n)}function ta(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 ea=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=yo(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:xn}),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=Fe(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}},ia=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 Fe(t)&&isFinite(t)&&Math.floor(t)===t});var ra=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}},na=class{generate(){var t=this.generateOrAbort();if(!Ie(t))return t;this.Ct=0;var e=this.generateOrAbort();if(Ie(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Fe(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 ra.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 aa}},sa=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&&!Ie(a.crypto)&&crypto.getRandomValues&&(sa=t=>crypto.getRandomValues(t));var oa,aa=class{nextUint32(){return this.Rt.length>this.At||(sa(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},la=()=>ua().toString(),ua=()=>(oa||(oa=new na)).generate(),ha="",da=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var va=null,ca={Et(){if(!Ae(va))return va;if(va=!1,h)try{var t="__ph_cookie_support_"+la();ca.Ot(t,"xyz"),va='"xyz"'===ia(t),ca.Dt(t)}catch(t){va=!1}return va},Pt(t){xn.error("cookieStore error: "+t)},Lt:ia,Nt(t){var e;try{e=JSON.parse(ca.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),ha)return ha;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_"+la();!ha&&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",ha=s)}return ha}(t);if(!i){var r=(t=>{var e=t.match(da);return e?e[0]:""})(t);r!==i&&xn.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&&xn.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{ca.Ot(t,"",-1,e)}catch(t){return}}},fa=null,pa={Et(){if(!Ae(fa))return fa;var t=!0;if(Ie(a))t=!1;else try{var e="__mplssupport__";pa.Ot(e,"xyz"),'"xyz"'!==pa.Lt(e)&&(t=!1),pa.Dt(e)}catch(e){t=!1}return t||xn.error("localStorage unsupported; falling back to cookie store"),fa=t,t},Pt(t){xn.error("localStorage error: "+t)},Lt(t){try{return null==a?void 0:a.localStorage.getItem(t)}catch(t){pa.Pt(t)}return null},Nt(t){try{return JSON.parse(pa.Lt(t))||{}}catch(t){}return null},Ot(t,e){try{return null==a||a.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){pa.Pt(t)}return!1},Dt(t){try{null==a||a.localStorage.removeItem(t)}catch(t){pa.Pt(t)}}},ga=[vt,nt,rt,ot,at,lt,Rt,Et,Mt],ma=[k,w,G,Z,Lt,Dt,M,At],ya=t=>t+"_cpm",ba=["__proto__","constructor","prototype"],_a=t=>{if(!Te(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===ba.indexOf(i)&&(e[i]=t[i])}),e},wa=function(t,e){void 0===e&&(e=[]);var i={};return[...ma,...e].forEach(e=>{var r=t[e];Ie(r)||Ae(r)||""===r||(i[e]=r)}),i},ka=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)},Sa=(t,e)=>({p:e,f:ka(JSON.stringify(t))}),xa=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=ca.Nt(ya(t)),r=(null==i?void 0:i.f)===ka(e)&&xe(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Ca=(t,e)=>e+"|"+(ca.Lt(ya(t))||""),Ta={},Ma={Et:()=>!0,Pt(t){xn.error("memoryStorage error: "+t)},Lt:t=>t in Ta?Ta[t]:null,Nt:t=>t in Ta?Ta[t]:null,Ot:(t,e)=>(Ta[t]=e,!0),Dt(t){delete Ta[t]}},Ia=null,Ea={Et(){if(!Ae(Ia))return Ia;if(Ia=!0,Ie(a))Ia=!1;else try{var t="__support__";Ea.Ot(t,"xyz"),'"xyz"'!==Ea.Lt(t)&&(Ia=!1),Ea.Dt(t)}catch(t){Ia=!1}return Ia},Pt(t){xn.error("sessionStorage error: ",t)},Lt(t){try{return null==a?void 0:a.sessionStorage.getItem(t)}catch(t){Ea.Pt(t)}return null},Nt(t){try{return JSON.parse(Ea.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==a||a.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Ea.Pt(t)}return!1},Dt(t){try{null==a||a.sessionStorage.removeItem(t)}catch(t){Ea.Pt(t)}}};kn.DEBUG=!1,kn.LIB_VERSION="1.428.6",kn.LIB_NAME="web";var Ra=kn,Aa=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 Te(e=i)&&Ee(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function Pa(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,xn)}function Fa(t){return"$survey_response_"+t}function Oa(t,e){if(!e)return null;var i=t[Fa(e)];return xe(i)?[...i]:i}function $a(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Ie(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=Oa(t,e.id);Ie(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:Oa(t,e.id)}})},t,r)}function Da(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 La(t){return"string"==typeof t&&t.trim()?t.trim():null}function Na(t){return t.toLowerCase()}function qa(t,e,i){if(!t||!e)return null;var r=Na(e),n=Object.keys(t).find(t=>Na(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=>Na(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var ja=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ba(t,e,i){var r,s=qa(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),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=n({},o.appearance);for(var d of ja){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return ja.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,s=qa(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 Ie(o.question)||(a.question=o.question,l=!0),Ie(o.description)||(a.description=o.description,l=!0),Ie(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ie(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ie(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ie(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return xe(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 Ha(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function za(t){var e;return Ha(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ua=(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}},Wa=t=>t.toLowerCase(),Va={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=>Ua(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Ua(e,t))),icontains:(t,e)=>e.map(Wa).some(e=>t.map(Wa).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Wa).every(e=>t.map(Wa).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 Ga(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=Va[i.operator];return!!n&&n(i.values,[String(r)])})}function Za(t,e,i){return qn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Ja=new Set(["is_not","not_icontains","not_regex"]);function Qa(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(Ie(n)||Ae(n))return Ja.has(s);var o=Va[s];return!!o&&!Ie(t.value)&&!Ae(t.value)&&o(xe(t.value)?t.value.map(String):[String(t.value)],xe(n)?n.map(String):[String(n)])})}var Ka=Cn("[SessionRecording]");function Xa(t,e){return e?t:"!"+t}function Ya(t,e){return t===e||t!=="!"+e&&null}var tl=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.zt=po}onRemoteConfig(t){this.$t=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new so([this.tt,this.Y]),this.zt=fo):(this.Ut=new oo([this.tt,this.Y]),this.zt=po),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.zt({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 Fe(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&&Pe(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){Ka.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,i,r,n=this.$t;if(!Fe(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=Ya(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!$e(a),d=h?Pa(t,n):a;h&&(d?this.jt("sampled"):Ka.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]:Xa(t,d),[H]:Ae(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.$t)&&($e(Ya(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.Ut)?void 0:e.triggerStatus(t))===Ys}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===Ys).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()}},el=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)):Ka.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ks;if(!t.receivedFlags)return Zs;if(!t.isRecordingEnabled)return Ws;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Ws;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);Ie(l)?xn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?Vs:r?Zs:Ws}({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;Fe(r)&&(Ae(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 Ka.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||Qa(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){Ka.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(Te(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Fe(c)&&c!==s,l=v===t&&Fe(c)&&c===s&&$e(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!$e(l),g=p?Pa(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||Qa(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 co(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)}},il=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...il],nl="<masked>",sl=["li_fat_id"];function ol(t,e,i){if(!h)return{};var r,n=e?[...il,...i||[]]:[],s=al(zn(h.URL,n,nl),t);return In((r={},Mn(sl,function(t){var e=ia(t);r[t]=e||null}),r),s)}function al(t,e){var i=rl.concat(e||[]),r={};return Mn(i,function(e){var i=Hn(t,e);r[e]=i||null}),r}function ll(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(!Ae(e)){r.$search_engine=e;var n=h?Hn(h.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function ul(){return navigator.language||navigator.userLanguage}var hl="$direct";function dl(){return(null==h?void 0:h.referrer)||hl}function vl(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...il,...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:dl().substring(0,1e3),u:s?zn(s,n,nl):void 0}}function cl(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==hl?hl:null==(i=jn(r))?void 0:i.host};if(s){o.$current_url=s;var a=jn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,In(o,al(s))}return r&&In(o,ll(r)),o}function fl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function pl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var gl=1e5,ml=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,yl=[],bl=()=>!1,_l="@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(" "),wl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),kl="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(" "),Sl="Accommodation AdministrativeArea Country Place State".split(" "),xl={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:wl,publisher:kl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:yl},Offer:{seller:kl},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:kl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:kl,areaServed:Sl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:yl}},Cl=[["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(" "),xl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),xl.Event],[kl,xl.Organization],[Sl,xl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),xl.Product]];function Tl(t,e){return ke.call(t,e)?t[e]:void 0}function Ml(t){var e=typeof t;return Ae(t)||"string"===e||"number"===e||"boolean"===e}function Il(t){return Ml(t)||xe(t)&&t.every(Ml)?t:void 0}function El(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 Rl(t){if(ke.call(xl,t))return xl[t];for(var e of Cl){var i=e[1];if(e[0].includes(t))return i}}function Al(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function Pl(t,e,i,r){if(xe(t)){var n=t.map(t=>Pl(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return Fl(t,e,i,r)||void 0}function Fl(t,e,i,r){if(!Te(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Tl(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:xe(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&ml.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!Rl(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of _l){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?El(Tl(t,l),e):Il(Tl(t,l));Ie(u)||Al(a,l,u)}for(var h of o){var d=Rl(h);for(var v of Object.keys(d)){var c=Tl(t,v),f=d[v];if(!0===f){var p=Il(c);Ie(p)||Al(a,v,p)}else{var g=Pl(c,e,i,f);Ie(g)||Al(a,v,g)}}}var m=Pl(Tl(t,"@graph"),e,i);return Ie(m)||Al(a,"@graph",m),Object.keys(a).length?a:null}function Ol(t,e,i){if(!Te(t))return null;var r=Tl(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var s=Fl(t,e,i);return s?n({"@context":"https://schema.org"},s):null}function $l(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Dl(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 Ll(t,e,i){for(var r=t;r;){if(Dl(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 Nl(t){return $l(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter($l)}function ql(t){return Ie(t)?void 0:Math.round(t)}function jl(t){return Te(t)?t.network_timing:t}var Bl,Hl,zl=Cn("[SessionRecording]"),Ul=[1,2,3,4,5,6,7,12],Wl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Vl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function Gl(){var t;return null==(t=Vl())?void 0:t.record}function Zl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,go())}}function Jl(t){return ta(Xo(Yo(Zl(t))),!0)}function Ql(t){return Kl.apply(this,arguments)}function Kl(){return(Kl=o(function*(t){var e=yield Yr(Zl(t),Ra.DEBUG,{rethrow:!0});return ta(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var Xl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Yl=!1;function tu(t){return xe(t)&&0===t.length?Bl=null!=Bl?Bl:Jl([]):Jl(t)}function eu(t){return iu.apply(this,arguments)}function iu(){return(iu=o(function*(t){return xe(t)&&0===t.length?Bl||(Hl=null!=Hl?Hl:Ql([]).then(t=>(Bl=t,t)).catch(t=>{throw Bl=void 0,Hl=void 0,t})):Ql(t)})).apply(this,arguments)}function ru(t){return Xl&&!Yl&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function nu(t){return{event:t,size:yo(t)}}function su(t,e){return n({},t,{data:e,cv:"2024-10"})}function ou(t,e){return n({},t,{cv:"2024-10",data:n({},t.data,e)})}function au(t){try{if(2===t.type)return nu(su(t,Jl(t.data)));if(3===t.type&&0===t.data.source)return nu(ou(t,{texts:tu(t.data.texts),attributes:tu(t.data.attributes),removes:tu(t.data.removes),adds:tu(t.data.adds)}));if(3===t.type&&8===t.data.source)return nu(ou(t,{adds:t.data.adds?Jl(t.data.adds):void 0,removes:t.data.removes?Jl(t.data.removes):void 0}))}catch(t){zl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:mo(t)}}function lu(){return lu=o(function*(t){try{if(2===t.type)return nu(su(t,yield Ql(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([eu(t.data.texts),eu(t.data.attributes),eu(t.data.removes),eu(t.data.adds)]);return nu(ou(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?Ql(t.data.adds):void 0,t.data.removes?Ql(t.data.removes):void 0]);return nu(ou(t,{adds:i[0],removes:i[1]}))}}catch(e){return Qr(e)&&(Yl=!0),zl.error("could not compress event asynchronously - trying synchronous compression",e),au(t)}return{event:t,size:mo(t)}}),lu.apply(this,arguments)}function uu(t,e){return 5===t.type&&t.data.tag===e}function hu(t){return uu(t,"sessionIdle")}function du(t){return uu(t,"$session_ending")}function vu(t){return uu(t,"$session_starting")}var cu=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 Ya(this._instance.get_property(Z),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Fe(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=Vl())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ze(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.Ue(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 Fe(i)&&Fe(r)?r-i:null},this.Ge=()=>{var t,e,i=this.ie;if(!Fe(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 Fe(r)&&r>=0&&i>r}if(this.Ve())return!1;var n,s=this.Ze();return!!Ae(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 ho(this._instance),this.Y=new uo(this._instance),this.tt=new vo(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||zl.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 Aa(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 Ie(d)&&Ie(v)&&Ie(c)&&Ie(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(!Pe(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!Ie(r)&&r!==n});0!==r.length&&(this.xe=!0,zl.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,Cn("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,Cn("canvas recording fps"),4),quality:Ge(d,0,1,Cn("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=!!($e(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&&Ce(s))if(!Nn.includes(d.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Ce(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,s={payloadSizeLimitBytes:Ds.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ds.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ds.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=$s(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Hs(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Hs(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=jn(t.name),s=0===e.indexOf("http")?null==(r=jn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&Bs.some(t=>0===o.indexOf(t))))return t}})((js((r=e).requestHeaders),js(r.responseHeaders),r),t.api_host,i));var r},d=Ce(t.session_recording.maskNetworkRequestFn);return d&&Ce(t.session_recording.maskCapturedNetworkRequestFn)&&xn.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=Ce(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 Pe(n)&&r?(Us.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Ie(t))return t.requestBody=zs(t.requestBody,"Request"),t.responseBody=zs(t.responseBody,"Response"),t}(h(t)),n({},Ds,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,o)))}else zl.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?[...il,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(zn(i,r,nl))}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}):zl.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(Wl(()=>Gl().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=Gl();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(Wl(()=>Gl().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 Fe(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),zl.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"}),zl.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=Te(t)?t:JSON.parse(t)}catch(t){return void zl.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 zl.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 el(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new tl(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||(Dn(a,"beforeunload",this.Je),Dn(a,"pagehide",this.rr),Dn(a,"offline",this.ir),Dn(a,"online",this.nr),Dn(h,"visibilitychange",this.ar),!this.Fe&&Ce(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&Ce(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.ze(),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)})}):Ce(this.Yt.on)||zl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Pe(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){zl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else zl.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.zr)||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){zl.warn("could not stop rrweb",t)}this.ae=void 0}Ur(){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(),zl.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),zl.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.Ur())return;this.tr(),this.er(),this.Vr(),this.jr(),zl.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}Ue(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=Vl())||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=!Ie(t),this.Wr=t,Ie(t))r||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,zl.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(),zl.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,zl.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=Vl())||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||zl.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&&(Ie(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,zl.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=mo(t.event);if(t.compressionEnabled)try{var r=au(t.event);e=r.event,i=r.size}catch(t){zl.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,i)}catch(t){zl.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?ru(t)?yield function(t){return lu.apply(this,arguments)}(t):au(t):{event:t,size:mo(t)};i=o.event,r=o.size}catch(e){zl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=mo(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,a,l,u;if(this._instance.sessionManager&&(this.Tr(),t&&Te(t))){if(4===t.type){var h=this.mr(t.data.href);if(this.Mr=h,!h)return;t.data.href=h}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 d,v,c;2===t.type&&(null!=(d=Vl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(v=this.zr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[et]:t.timestamp},void 0));var f=2===t.type&&(null==(i=this.ne)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ai();var p=this.zr?this.zr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Te(e)&&6===e.type&&Te(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}(p),m=function(t){return du(t)?t.data.payload:null}(g),y=function(t){return vu(t)?t.data.payload:null}(g),b=function(t){return hu(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=b&&b.sessionId||this.si(g),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var _=null!==(r=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==r?r:this.Xt,w=null!==(o=null!==(a=null!==(l=null==m?void 0:m.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==a?a:null==b?void 0:b.windowId)&&void 0!==o?o:this.He;if(!0!==this.ce||function(t){return hu(t)||du(t)||vu(t)}(g)){2===g.type&&(this.de=0),b&&(g.timestamp=b.lastActivityTimestamp+b.threshold);var k=this.se;this.se=!0,f?this._r(!0):k||this._r();var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Le>0||S&&ru(g))this.oi(g,S,_,w);else{var x=S?au(g):{event:g,size:mo(g)};this.Kr(g,x.event,x.size,_,w)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&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}):Ws}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)&&!du(t)&&!vu(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 Ie(this.fi)||this._instance.register_for_session({[Vt]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Ie(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}),zl.info("buffering: "+i))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&Ea.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,Ea.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=Ea.Nt(this.sr);Ea.Dt(this.sr),Te(t)&&xe(t.data)&&0!==t.data.length&&xe(t.sizes)&&t.sizes.length===t.data.length&&Fe(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();bo(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:Ra.LIB_NAME,$lib_version:Ra.LIB_VERSION,$snapshot_host:o})}catch(t){zl.warn("could not capture snapshot chunk - skipping it",t)}}),Ie(this.yi)||(Ea.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}),zl.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!==Ul.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.Ue(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()}}ze(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=null==(t=Vl())||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:ql(null==(i=this.Zr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:ql(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:ql(null==u?void 0:u.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:ql(null==u?void 0:u.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:ql(null==(a=Vl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Vl())||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={};Ie(c.mousemove)||(f.mousemove=c.mousemove),Ie(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 Ce(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(Ce(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Me||(this.Me=!0,zl.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,zl.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=Gl();if(p){this.zr=null!==(t=this.zr)&&void 0!==t?t:new ea(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";zl.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,zl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.ae)return this.we=!0,void zl.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=gl,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?bl:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!Ll(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 Ll(t,e.blockClass,e.blockSelector)||Ll(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=bl),!t||t.length>gl)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=xe(i)?i.map(t=>Ol(t,e,r)):Ol(i,e,r);if(r.exceeded||Ae(n)||xe(n)&&(!n.length||n.some(Ae)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,o);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Ae(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 Nl(t))a(e)};for(var i of t)if("childList"===i.type)$l(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&$l(r)&&a(r)}else"attributes"===i.type&&$l(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()&&Nl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(h,a.MutationObserver,{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=$e(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 zl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}},fu=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}({}),pu=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}({}),gu=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}({}),mu=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),yu=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),bu=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}({}),_u=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 wu(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 ku={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Su={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},xu={};function Cu(t){if(xu[t])return xu[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 ku?ku[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 Su?Su[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 xu[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 wu(t,"AppleWebKit")&&!wu(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),xu[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Tu=Object.create(null);function Mu(t,e,i){var r,n=Tu[t],s=n[i];if(s)return s.call(e);var o=Cu(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]}Tu.Node=Object.create(null),Tu.ShadowRoot=Object.create(null),Tu.MutationObserver=Object.create(null),Tu.Element=Object.create(null);var Iu,Eu={};function Ru(t,e,i){var r=t+"."+String(i);if(Eu[r])return Eu[r].bind(e);var n=Cu(t)[i];return"function"!=typeof n?e[i]:(Eu[r]=n,n.bind(e))}function Au(){return Cu("MutationObserver").constructor}function Pu(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 Fu={childNodes:t=>Mu("Node",t,"childNodes"),parentNode:t=>Mu("Node",t,"parentNode"),parentElement:t=>Mu("Node",t,"parentElement"),textContent:t=>Mu("Node",t,"textContent"),isConnected(t){if(void 0===Iu){var e,i=null===(e=Object.getOwnPropertyDescriptor(Cu("Node"),"isConnected"))||void 0===e?void 0:e.get;Iu=(null==i?void 0:i.toString().includes("[native code]"))?i:null}return null==Iu?void 0:Iu.call(t)},contains:(t,e)=>Ru("Node",t,"contains")(e),getRootNode:t=>Ru("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Mu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Mu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Ru("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Ru("Element",t,"querySelectorAll")(e),mutationObserver:Au,patch:Pu};function Ou(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var $u=0;function Du(){$u+=1}function Lu(){return $u}function Nu(t,e){return(e!==$u||t>6e4)&&!0}var qu=0,ju=0,Bu=0,Hu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},zu=null,Uu=null,Wu=[],Vu=0,Gu=0,Zu={slowestBatchMs:0},Ju={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Qu(t){(qu+=1)>1||(Hu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Wu=[],Vu=0,Uu=(t=>t&&t>0?t:null)(t),ju=Ou(),Bu=$u)}function Ku(){return 0===qu?zu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(qu-=1)>0?Hu:(Hu.durationMs=Ou()-ju,Hu.deferredStylesheetCount=Vu,Ju.deferredCount+=Vu,Uu=null,Nu(Hu.durationMs,Bu)?Hu:zu=Hu)}function Xu(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+=Xu(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+=Xu(l,e,i+1))}}}catch(t){}}return r}function Yu(t){if(0!==qu){var e=Xu(t,null,0);Hu.cssRuleCount+=e,Gu>0&&(Hu.nonDeferrableCssRuleCount+=e)}}function th(t){Gu+=1;try{return t()}finally{Gu-=1}}function eh(t){qu>0&&(Hu.stylesheetMs+=t)}function ih(t){if(0===qu||null===Uu)return!1;var e=Hu.cssRuleCount-Hu.nonDeferrableCssRuleCount;return e>=Uu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Xu(e,i,0)}catch(t){return 0}}(t)>Uu}function rh(){Ju.failedCount+=1}function nh(t){t>0&&(Ju.abandonedCount+=t)}function sh(t){return sh="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},sh(t)}function oh(t,e,i){return(e=function(t){var e=function(t){if("object"!=sh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=sh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sh(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ah(t){return t.nodeType===t.ELEMENT_NODE}function lh(t){var e=t&&"host"in t&&"mode"in t&&Fu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Fu.shadowRoot(e)===t)}function uh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function hh(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 dh(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 vh=0;function ch(t){var e=0===vh,i=e?Ou():0;vh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Yu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),hh(Array.from(r,t=>fh(t,n)).join(""))}catch(t){return null}finally{vh-=1,e&&eh(Ou()-i)}}function fh(t,e){if(gh(t)){var i;try{i=ch(t.styleSheet)||dh(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return Ph(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return mh(t)&&t.selectorText.includes(":")&&(n=ph(n)),e?Ph(n,e):n}function ph(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function gh(t){return"styleSheet"in t}function mh(t){return"selectorText"in t}var yh=/^-?[A-Za-z_][\w-]*$/,bh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function _h(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||dh(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=Ph(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&&gh(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(mh(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&&!yh.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]?yh.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":bh.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?Ph(r,n):r,fixColons:"sheet"===i.kind&&mh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&mh(i)&&i.selectorText.includes(":")&&(s=ph(s)),t.parts.push(t.sheetHref?Ph(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Yu(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,!gh(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;Yu(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=Ou(),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?ph(h):h}else u=hh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{eh(Ou()-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 wh=class{constructor(){oh(this,"idNodeMap",new Map),oh(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)),ah(t)){var i=Fu.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 kh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Sh(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Sh(t){return t.toLowerCase()}var xh=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 Ch(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&&xh.has(Sh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Th="__rrweb_original__";function Mh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Sh(e):null}catch(t){return null}}var Ih=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Eh=/^(?:[a-z+]+:)?\/\//i,Rh=/^www\..*/i,Ah=/^(data:)([^,]*),(.*)/i;function Ph(t,e){return(t||"").replace(Ih,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Eh.test(l)||Rh.test(l))return"url("+u+l+u+")";if(Ah.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 Fh,Oh,$h=new Map,Dh=1,Lh=new RegExp("[^a-z0-9-_:]");function Nh(){return Dh++}var qh=/^[^ \t\n\r\u000c]+/,jh=/^[, \t\n\r\u000c]+/,Bh=new WeakMap;function Hh(t,e){return e&&""!==e.trim()?zh(t,e):e}function zh(t,e){var i=Bh.get(t);if(i||(i=t.createElement("a"),Bh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Uh(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 Wh(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=Hh(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=$h.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($h.size>=10){var u=$h.keys().next().value;void 0!==u&&$h.delete(u)}return $h.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Uh(u,s)}if("image"===e)return Uh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Hh(t,r);return"image"===e&&h.startsWith("data:")?Uh(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(qh);if(","===s.slice(-1))s=Hh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Hh(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?Ph(r,zh(t)):"object"===e&&"data"===i?Hh(t,r):r:Hh(t,r)}function Vh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Gh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Gh(Fu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Gh(Fu.parentNode(t),e,i)}function Zh(t,e,i,r){var n;if(ah(t)){if(!Fu.childNodes(n=t).length)return!1}else{if(null===Fu.parentElement(t))return!1;n=Fu.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(Gh(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 Jh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Qh=new Map;function Kh(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Xh(t){return null==t?"":t.toLowerCase()}var Yh=!1,td=!1;function ed(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 td=!0,Yh||(Yh=!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=Zh(t,o,a,void 0===U)),qu>0&&(Hu.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:_u.Document,childNodes:[],compatMode:t.compatMode}:{type:_u.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:_u.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=Sh(t.tagName);return Lh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];Vh(_,C.name)||(k[C.name]=Wh(i,_,Sh(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=Kh(i,M))&&M.includes(".css")&&(T=Kh(i,window.location.origin+"/"+M.replace(window.location.href,"")))}var I=null;T&&(ih(T)?qu>0&&(Wu.push(t),Vu+=1):I=ch(T)),I&&(delete k.rel,delete k.href,k._cssText=I)}if("style"===_&&t.sheet&&!(t.innerText||Fu.textContent(t)||"").trim().length){var E=th(()=>ch(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=kh({element:t,type:Mh(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((Th in n?n[Th]: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){Fh||(Fh=i.createElement("canvas"),Oh=Fh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Ch({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,H=()=>{Jh(N,"load",H);try{Fh.width=N.naturalWidth,Fh.height=N.naturalHeight,Oh.drawImage(N,0,0);var t=Fh.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]=Ch({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:_u.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=Fu.parentNode(t),o=s&&s.tagName,a=Fu.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(ih(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=ch(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=Ph(a,zh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,Fu.parentElement(t)):a.replace(/[\S]/g,"*")),{type:_u.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:_u.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:_u.Comment,textContent:Fu.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===_u.Comment)return!0;if(t.type===_u.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&&(Xh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Xh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Xh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Xh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Xh(t.attributes.property).match(/^(og|twitter|fb):/)||Xh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Xh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Xh(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(Xh(t.attributes.name))||Xh(t.attributes.property).match(/^article:/)||Xh(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(Xh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===_u.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Nh();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===_u.Element){Q=Q&&!J.needBlock,delete J.needBlock;var K=Fu.shadowRoot(t);K&&uh(K)&&(J.isShadowHost=!0)}if((J.type===_u.Document||J.type===_u.Element)&&Q){b.headWhitespace&&J.type===_u.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===_u.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(Fu.childNodes(t))){var tt=ed(Y,X);tt&&J.childNodes.push(tt)}var et=null;if(ah(t)&&(et=Fu.shadowRoot(t)))for(var it of Array.from(Fu.childNodes(et))){var rt=ed(it,X);rt&&(uh(et)&&(rt.isShadow=!0),J.childNodes.push(rt))}}var nt=Fu.parentNode(t);if(nt&&lh(nt)&&uh(nt)&&(J.isShadow=!0),J.type===_u.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),Jh(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?Jh(t,"load",o):(a=!0,Jh(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),Jh(t,"load",o)}}return t.addEventListener("load",o),()=>{Jh(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&I){var i=ed(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===_u.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,l,u){if(!Qh.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=ed(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{Qh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),Qh.set(e,v)}}}(t,0,O),J}function id(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 rd=class t{constructor(){oh(this,"parentElement",null),oh(this,"parentNode",null),oh(this,"ownerDocument",void 0),oh(this,"firstChild",null),oh(this,"lastChild",null),oh(this,"previousSibling",null),oh(this,"nextSibling",null),oh(this,"ELEMENT_NODE",1),oh(this,"TEXT_NODE",3),oh(this,"nodeType",void 0),oh(this,"nodeName",void 0),oh(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 nd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>sd(i,t,e,r)}function sd(t,e,i,r){od(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function od(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function ad(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var ld="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.",ud={map:{},getId(){return console.error(ld),-1},getNode(){return console.error(ld),null},removeNodeFromMap(){console.error(ld)},has(){return console.error(ld),!1},reset(){console.error(ld)}};function hd(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 dd(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)}}}),()=>dd(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ud=new Proxy(ud,{get(t,e,i){return"map"===e&&console.error(ld),Reflect.get(t,e,i)}}));var vd=Date.now;function cd(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=Fu.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=Fu.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 fd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function gd(t){return t?t.nodeType===t.ELEMENT_NODE?t:Fu.parentElement(t):null}function md(t,e,i,r){if(!t)return!1;var n=gd(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(Gh(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 yd(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function bd(t,e){if(lh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Fu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||bd(r,e))}function _d(t){return Boolean(t.changedTouches)}function wd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function kd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Sd(t){return!!t&&(t instanceof rd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Fu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(vd=()=>(new Date).getTime());var xd=class{constructor(){oh(this,"id",1),oh(this,"styleIDMap",new WeakMap),oh(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 Cd(t){var e,i=null;return"getRootNode"in t&&(null===(e=Fu.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Fu.host(Fu.getRootNode(t))&&(i=Fu.host(Fu.getRootNode(t))),i}function Td(t){var e=t.ownerDocument;if(!e)return!1;if(Fu.contains(e,t))return!0;var i=Fu.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=Cd(i);)i=e;return i}(t);return Fu.contains(e,i)}(t)}function Md(t){return"__ln"in t}var Id,Ed=class{constructor(){oh(this,"length",0),oh(this,"head",null),oh(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&&Md(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&&Md(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--)}},Rd=(t,e)=>t+"@"+e,Ad=class{constructor(){oh(this,"frozen",!1),oh(this,"locked",!1),oh(this,"texts",[]),oh(this,"attributes",[]),oh(this,"attributeMap",new WeakMap),oh(this,"generatedAttributes",new WeakMap),oh(this,"removes",[]),oh(this,"mapRemoves",new Set),oh(this,"movedMap",{}),oh(this,"addedSet",new Set),oh(this,"movedSet",new Set),oh(this,"droppedSet",new Set),oh(this,"removesSubTreeCache",new Set),oh(this,"mutationCb",void 0),oh(this,"blockClass",void 0),oh(this,"blockSelector",void 0),oh(this,"maskTextClass",void 0),oh(this,"maskTextSelector",void 0),oh(this,"inlineStylesheet",void 0),oh(this,"maskInputOptions",void 0),oh(this,"maskTextFn",void 0),oh(this,"maskInputFn",void 0),oh(this,"maskAllElementAttributes",void 0),oh(this,"maskAttributeFn",void 0),oh(this,"keepIframeSrcFn",void 0),oh(this,"recordCanvas",void 0),oh(this,"canvasMaskingConfigured",void 0),oh(this,"inlineImages",void 0),oh(this,"slimDOMOptions",void 0),oh(this,"dataURLOptions",void 0),oh(this,"doc",void 0),oh(this,"mirror",void 0),oh(this,"iframeManager",void 0),oh(this,"stylesheetManager",void 0),oh(this,"shadowDomManager",void 0),oh(this,"canvasManager",void 0),oh(this,"processedNodeManager",void 0),oh(this,"unattachedDoc",void 0),oh(this,"canvasManagerReleased",!1),oh(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),oh(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=Ou(),r=Lu();try{this.processBufferedMutations()}finally{t=Ou()-i,e=r,qu>0||Nu(t,null!=e?e:$u)||t>Zu.slowestBatchMs&&(Zu.slowestBatchMs=t)}}}),oh(this,"processBufferedMutations",()=>{var t,e=[],i=new Set,r=new Ed,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=Fu.parentNode(s);if(o&&Td(s)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=lh(o)?this.mirror.getId(Cd(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=>{wd(t,this.mirror)&&this.iframeManager.addIframe(t),kd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Sd(t)&&!md(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Fu.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=ed(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)Fd(this.removesSubTreeCache,a)&&!this.movedSet.has(Fu.parentNode(a))||s(a);for(var l of this.addedSet)Od(this.droppedSet,l)||Fd(this.removesSubTreeCache,l)?Od(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(Fu.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(Fu.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=Fu.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=Fu.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=Fu.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]=Ch({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)}),oh(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),oh(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(Fu.childNodes(t),t=>Fu.textContent(t)||"").join("");e.attributes.value=kh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Mh(t),value:i,maskInputFn:this.maskInputFn})}),oh(this,"processMutation",t=>{if(!yd(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Fu.textContent(t.target);md(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Zh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,gd(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=Mh(l);a=kh({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(md(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"),!Vh(r.tagName,o)){var v,c=Wh(this.doc,Sh(r.tagName),Sh(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(md(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=lh(t.target)?this.mirror.getId(Fu.host(t.target)):this.mirror.getId(t.target);md(t.target,this.blockClass,this.blockSelector,!1)||yd(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Pd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||bd(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Rd(i,r)]?Pd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!lh(t.target)||!uh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Fu.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),oh(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(yd(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[Rd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!md(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var r=Fu.childNodes(t),n=0,s=r.length;s>n;n++){var o=r[n];o&&this.genAdds(o)}if(Sd(t))for(var a=Fu.childNodes(Fu.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),md(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?Fu.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?Fu.host(r):null}return!1}};function Pd(t,e){for(var i=[e];i.length;){var r=i.pop();if(t.delete(r),r.nodeType!==r.TEXT_NODE)for(var n=Fu.childNodes(r),s=0,o=n.length;o>s;s++){var a=n[s];a&&i.push(a)}}}function Fd(t,e,i){return 0!==t.size&&function(t,e){var i=Fu.parentNode(e);return!!i&&t.has(i)}(t,e)}function Od(t,e){if(0===t.size)return!1;for(var i=Fu.parentNode(e);i;){if(t.has(i))return!0;i=Fu.parentNode(i)}return!1}var $d=function(t,e){return void 0===e&&(e="rrweb"),Id?function(){try{return t(...arguments)}catch(t){if(Id&&!0===Id(t,e))return;throw t}}:t},Dd=[];function Ld(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 Nd(t,e){var i,r=new Ad;r.init(t);try{i=new(Au())($d(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),Dd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function qd(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=Ld(t);if(o&&!md(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=cd(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=[nd("scroll",$d(hd($d(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(nd("scrollend",$d(l),i)),()=>u.forEach(t=>t())}function jd(t,e){for(var i=Dd.length-1;i>=0;i--){var r=Dd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Dd.splice(i,1))}}}var Bd=["INPUT","TEXTAREA","SELECT"],Hd=new WeakMap;function zd(t){return function t(e,i){if(Gd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Gd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Gd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Gd("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 Ud(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function Wd(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Fu.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}}),$d(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Vd(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=$d(()=>{try{if(r)try{r.destroy(),r.reset()}finally{var e=Dd.indexOf(r);-1!==e&&Dd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{ad(o)}});try{if(t.recordDOM){var l=Nd(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=hd($d(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=$d(hd($d(t=>{var e=Ld(t),i=_d(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=vd()),l.push({x:r,y:o,id:n.getId(e),timeOffset:vd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?pu.Drag:t instanceof MouseEvent?pu.MouseMove:pu.TouchMove)}),o,{trailing:!1})),d=[nd("mousemove",h,r),nd("touchmove",h,r),nd("drag",h,r)];return $d(()=>{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(gu).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Sh(t),l=(t=>i=>{var a=Ld(i);if(!md(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=mu.Mouse;break;case"touch":l=mu.Touch;break;case"pen":l=mu.Pen}l===mu.Touch&&(gu[t]===gu.MouseDown?u="TouchStart":gu[t]===gu.MouseUp&&(u="TouchEnd"))}else _d(i)&&(l=mu.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===mu.Touch||u.startsWith("Mouse")&&l===mu.Mouse)&&(l=null)):gu[t]===gu.Click&&(l=h,h=null);var d=_d(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;$d(e)(n({type:gu[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(gu[t]){case gu.MouseDown:case gu.MouseUp:a=a.replace("mouse","pointer");break;case gu.TouchStart:case gu.TouchEnd:return}u.push(nd(a,l,i))}),$d(()=>{u.forEach(t=>t())})}(t)),o.push(qd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return nd("resize",$d(hd($d(()=>{var t=fd(),e=pd();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=Ld(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=Fu.parentElement(e)),e&&v&&Bd.indexOf(v)>=0&&!md(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Mh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=kh({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=Hd.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Hd.set(t,i);var o=r.getId(t);$d(e)(n({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>nd(t,$d(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=>dd(t[0],t[1],{set(){$d(v)({target:this,isTrusted:!1})}},!1,p))),$d(()=>{ad(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=$d(t=>hd($d(s=>{var o=Ld(s);if(o&&!md(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=[nd("play",a(bu.Play),o),nd("pause",a(bu.Pause),o),nd("seeked",a(bu.Seeked),o),nd("volumechange",a(bu.VolumeChange),o),nd("ratechange",a(bu.RateChange),o)];return $d(()=>{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:$d((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(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:$d((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(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:$d((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=Ud(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=ch(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:$d((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(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={};Zd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Zd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Zd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Zd("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:$d((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ud(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(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:$d((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ud(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),$d(()=>{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(Wd(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:$d((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=Ud(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=zd(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:$d((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=Ud(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=zd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),$d(()=>{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=Pu(i.fonts,"add",function(t){return function(i){return setTimeout($d(()=>{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),$d(()=>{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=$d(()=>{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;md(d,r,n,!0)||md(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),nd("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Pu(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 Gd(t){return void 0!==window[t]}function Zd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var Jd=class{constructor(t){oh(this,"generateIdFn",void 0),oh(this,"iframeRemoteIdToLocalIdMap",new WeakMap),oh(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}},Qd=class{constructor(t){oh(this,"iframes",new WeakMap),oh(this,"crossOriginIframeMap",new WeakMap),oh(this,"crossOriginIframeMirror",new Jd(Nh)),oh(this,"crossOriginIframeStyleMirror",void 0),oh(this,"crossOriginIframeRootIdMap",new WeakMap),oh(this,"mirror",void 0),oh(this,"mutationCb",void 0),oh(this,"wrappedEmit",void 0),oh(this,"loadListener",void 0),oh(this,"pageHideListener",void 0),oh(this,"stylesheetManager",void 0),oh(this,"recordCrossOriginIframes",void 0),oh(this,"messageHandler",void 0),oh(this,"nestedIframeListeners",new Map),oh(this,"attachedWindows",new WeakMap),oh(this,"attachedDocuments",new WeakMap),oh(this,"attachedIframes",new Map),oh(this,"loadListenerDisposers",new WeakMap),oh(this,"iframeElementsById",new Map),oh(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jd(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=>od(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{sd(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);od(()=>{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)})}od(()=>{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 fu.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:fu.IncrementalSnapshot,data:{source:pu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case fu.Meta:case fu.Load:case fu.DomContentLoaded:return!1;case fu.Plugin:return e;case fu.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case fu.IncrementalSnapshot:switch(e.data.source){case pu.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 pu.Drag:case pu.TouchMove:case pu.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case pu.ViewportResize:return!1;case pu.MediaInteraction:case pu.MouseInteraction:case pu.Scroll:case pu.CanvasMutation:case pu.Input:return this.replaceIds(e.data,t,["id"]),e;case pu.StyleSheetRule:case pu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case pu.Font:return e;case pu.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case pu.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===_u.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&&(sd(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(sd(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=>{od(()=>this.mirror.removeNodeFromMap(t))}),od(()=>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&&sd(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{sd(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}},Kd=class{constructor(t){oh(this,"shadowDoms",new WeakSet),oh(this,"mutationCb",void 0),oh(this,"scrollCb",void 0),oh(this,"bypassOptions",void 0),oh(this,"mirror",void 0),oh(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(uh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(r=Fu.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=Nd(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=Dd.indexOf(l);-1!==t&&Dd.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:qd(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(Fu.host(t))),this.restoreHandlers.push({doc:s,handler:Wd({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:Pu(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=Fu.shadowRoot(this);return s&&Td(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}},Xd="skip-frame";function Yd(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 tv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ev="undefined"==typeof Uint8Array?[]:new Uint8Array(256),iv=0;64>iv;iv++)ev[tv.charCodeAt(iv)]=iv;var rv=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=tv[i[e]>>2],n+=tv[(3&i[e])<<4|i[e+1]>>4],n+=tv[(15&i[e+1])<<2|i[e+2]>>6],n+=tv[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},nv=new Map,sv=(t,e,i)=>{if(t&&(lv(t,e)||"object"==typeof t)){var r=function(t,e){var i=nv.get(t);return i||nv.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 ov(t,e,i,r){return t instanceof Array?t.map(t=>ov(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:rv(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[ov(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:[ov(t.data,e,i,r),t.width,t.height]}:lv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:sv(t,e,i)}:t}var av=(t,e,i,r)=>t.map(t=>ov(t,e,i,r)),lv=(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]))},uv=["webgl","webgl2"];function hv(t){return"nodeType"in t}function dv(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 Pu(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||hv(o)&&md(o,e,i,!0))return r.call(this,s);hv(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=Pu(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(!md(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&uv.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 vv(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=Pu(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(sv(d,s,this),this.canvas&&"tagName"in this.canvas&&!md(this.canvas,r,n,!0)){var v={type:e,property:l,args:av(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=dd(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!md(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 cv='(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',fv="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",cv],{type:"text/javascript;charset=utf-8"});function pv(t){var e;try{if(!(e=fv&&(self.URL||self.webkitURL).createObjectURL(fv)))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(cv),{name:null==t?void 0:t.name})}}var gv,mv,yv,bv=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){oh(this,"pendingCanvasMutations",new Map),oh(this,"rafStamps",{latestId:0,invokeId:null}),oh(this,"mirror",void 0),oh(this,"mutationCb",void 0),oh(this,"resetObservers",void 0),oh(this,"frozen",!1),oh(this,"locked",!1),oh(this,"rafIdTimestamp",null),oh(this,"rafIdFlush",null),oh(this,"refCount",0),oh(this,"torndown",!1),oh(this,"resetFrameDedup",null),oh(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=dv(e,i,r,!0),h=new Map;try{a=new pv}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:yu["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=>{md(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 Xd}if(void 0!==o){if(!Array.isArray(o)||!o.every(Yd))return Xd;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=dv(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=Pu(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 md(this.canvas,i,r,!0)||setTimeout(()=>{var i=av(l,e,this,n);t(this.canvas,{type:yu["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=dd(e.CanvasRenderingContext2D.prototype,o,{set(e){md(this.canvas,i,r,!0)||t(this.canvas,{type:yu["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(...vv(e.WebGLRenderingContext.prototype,yu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...vv(e.WebGL2RenderingContext.prototype,yu.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)}}}},_v=class{constructor(t){var e;oh(this,"trackedLinkElements",new WeakSet),oh(this,"pendingDeferredSheets",new Set),oh(this,"mutationCb",void 0),oh(this,"adoptedStyleSheetCb",void 0),oh(this,"maskAllElementAttributes",void 0),oh(this,"maskAttributeFn",void 0),oh(this,"styleMirror",new xd),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=_h(r))}catch(t){}if(!i||!r)return rh(),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=Ou(),d=Lu(),v=!0;try{if(s)return a=!0,rh(),!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?(rh(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(rh(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),Nu(l=Ou()-h,null!=(u=d)?u:$u)||(Ju.totalMs+=l,l>Ju.slowestSliceMs&&(Ju.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:Ch({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=Ou();try{th(()=>{try{var e=t.rules||t.cssRules;e&&Yu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:fh(e,t.href),index:i}))})})}finally{eh(Ou()-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(),Qh.forEach(t=>t.abort()),Qh.clear()}trackStylesheetInLinkElement(t){}},wv=class{constructor(){oh(this,"nodeMap",new WeakMap),oh(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(){}},kv=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Sv,xv=document.createElement("iframe");document.body.appendChild(xv),Array.from=(null===(Sv=xv.contentWindow)||void 0===Sv?void 0:Sv.Array.from)||Array.from,document.body.removeChild(xv)}}catch(t){console.debug("Unable to override Array.from",t)}var Cv=new wh,Tv=new Set([pu.Mutation,pu.MediaInteraction,pu.StyleSheetRule,pu.CanvasMutation,pu.Font,pu.Log,pu.StyleDeclaration,pu.AdoptedStyleSheet]);function Mv(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 Iv(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;Id=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),Cv.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=id(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};gv=(t,e)=>{var i,n=t;if(n.timestamp=vd(),!(null===(i=Dd[0])||void 0===i?void 0:i.isFrozen())||n.type===fu.FullSnapshot||n.type===fu.IncrementalSnapshot&&Tv.has(n.data.source)||Dd.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===fu.FullSnapshot)ut=n,ft=0;else if(n.type===fu.IncrementalSnapshot){if(n.data.source===pu.Mutation&&n.data.isAttachIframe)return;ft++,(o&&ft>=o||s&&n.timestamp-ut.timestamp>s)&&mv(!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=Cv.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()}gv({type:fu.IncrementalSnapshot,data:n({source:pu.Mutation},t)})},yt=t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.Scroll},t)}),bt=t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.CanvasMutation},t)}),_t=new _v({mutationCb:mt,adoptedStyleSheetCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new Qd({mirror:Cv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:gv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Cv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new wv,xt=null==N?void 0:N.configured;yv=new bv({recordCanvas:z,mutationCb:bt,win:window,blockClass:l,blockSelector:h,mirror:Cv,sampling:F.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new Kd({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:yv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Cv});mv=function(t){if(void 0===t&&(t=!1),B){Qu(w);try{gv({type:fu.Meta,data:{href:window.location.href,width:pd(),height:fd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Dd.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new wh: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=id(void 0!==M&&M);Qu(j);try{return ed(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{Ku()}}(document,{mirror:Cv,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){wd(t,Cv)&&wt.addIframe(t),kd(t,Cv)&&_t.trackLinkElement(t),Sd(t)&&Ct.addShadowRoot(Fu.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=Wu,Wu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(gv({type:fu.FullSnapshot,data:{node:r,initialOffset:cd(window)}},t),Dd.forEach(t=>t.unlock()),yv.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&&od(()=>{o=e.beginDeferredLinkInlining(i,Cv.getId(i))})},u=()=>{if(o){var t=o,e=!0;od(()=>{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,nh(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Mv(d):i())}};return n=Mv(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);nh(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,Cv.getId(document))}finally{Ku()}var s}};try{var Tt=[];for(var Mt of(Tt.push(nd("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(nd(Mt,Du,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{od(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=Cv.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 $d(Vd)({mutationCb:mt,mousemoveCb:(t,e)=>gv({type:fu.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.ViewportResize},t)}),inputCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.Input},t)}),mediaInteractionCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.MediaInteraction},t)}),styleSheetRuleCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.StyleSheetRule},t)}),styleDeclarationCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>gv({type:fu.IncrementalSnapshot,data:n({source:pu.Font},t)}),selectionCb(t){gv({type:fu.IncrementalSnapshot,data:n({source:pu.Selection},t)})},customElementCb(t){gv({type:fu.IncrementalSnapshot,data:n({source:pu.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:Cv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:yv,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=>gv({type:fu.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Cv.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=Cv.getId(t);null==vt||vt(e),jd(t)});var Et=-1,Rt=t=>gv({type:fu.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?Cv.getId(s):-1;o!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{mv();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(nd("fullscreenchange",At)),Tt.push(nd("webkitfullscreenchange",At)),Tt.push(nd("mozfullscreenchange",At)),Tt.push(nd("MSFullscreenChange",At)),kv=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(nd("DOMContentLoaded",()=>{gv({type:fu.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(nd("load",()=>{gv({type:fu.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,ad(Tt),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Cv.reset(),kv=!1,Id=void 0}}catch(t){console.warn(t)}}Iv.addCustomEvent=(t,e)=>{if(!kv)throw new Error("please add custom event after start recording");gv({type:fu.Custom,data:{tag:t,payload:e}})},Iv.freezePage=()=>{Dd.forEach(t=>t.freeze())},Iv.takeFullSnapshot=t=>{if(!kv)throw new Error("please take full snapshot after start recording");mv(t)},Iv.mirror=Cv,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Ev=Object.create(null);function Rv(t){return Rv="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},Rv(t)}function Av(t,e,i){return(e=function(t){var e=function(t){if("object"!=Rv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Rv(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Ev.Node=Object.create(null),Ev.ShadowRoot=Object.create(null),Ev.MutationObserver=Object.create(null),Ev.Element=Object.create(null);var Pv=class{constructor(t){Av(this,"fileName",void 0),Av(this,"functionName",void 0),Av(this,"lineNumber",void 0),Av(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}},Fv=/(^|@)\S+:\d+/,Ov=/^\s*at .*(\S+:\d+|\(native\))/m,$v=/^(eval@)?(\[native code])?$/,Dv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ov)?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(Ov)},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 Pv({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($v)},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 Pv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Pv({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 Pv({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 Pv({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(Fv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new Pv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function Lv(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 Nv(t){return Array.isArray(t)}function qv(t){return"object"==typeof t&&null!==t&&!Nv(t)}function jv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(qv(t[i])&&jv(t[i],e-1))return!0;return!1}function Bv(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(qv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||qv(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]=Nv(u)?Lv(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 Hv={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 zv(t,e,i){var r,n=i?Object.assign({},Hv,i):Hv,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:Dv.parse(e.error).map(t=>t.toString()),payload:[Bv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[Bv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Bv("Uncaught (in promise)",n.stringifyOptions),Bv(e.reason,n.stringifyOptions)]),t({level:"error",trace:Dv.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=Dv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>Bv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Bv("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 Uv=t=>({name:"rrweb/console@1",observer:zv,options:t}),Wv=()=>{},Vv=t=>{var e;if(Ce(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Gv(t,e,i){try{if(!(e in t))return Wv;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 Ce(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=Vv(i);s;){if(s.next===n)return void(s.next=r.next);s=Vv(i=s.next)}else t[e]=r.next}}catch(t){return Wv}}function Zv(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 Jv=Cn("[Recorder]"),Qv=t=>"navigation"===t.entryType,Kv=t=>"resource"===t.entryType;function Xv(t,e){return!!e&&($e(e)||e[t])}function Yv(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 tc=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function ec(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:!!Yv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(tc))return!1;if($e(i))return!0;if(xe(i))return n(i);var s=i[e];return $e(s)?s:n(s)}function ic(t,e,i,r,n,s){return rc.apply(this,arguments)}function rc(){return rc=o(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(Jv.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=>Kv(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),ic(t,e,i,r,n,s+1))}),rc.apply(this,arguments)}function nc(t){var e=t.body,i=t.options,r=t.url;if(Pe(e))return null;var n=Zv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Ee(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(De(e))return Bn(e);if(Te(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 sc=t=>!Ae(t)&&("navigation"===t.entryType||"resource"===t.entryType);function oc(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:Ie(a)?void 0:Math.round(a),endTime:Ie(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(sc(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 ac=["video/","audio/"];function lc(t){return Te(t)&&Ce(t.getReader)&&Ce(t.tee)}var uc="[SessionReplay] Timeout while trying to read body",hc="[SessionReplay] Failed to read body";function dc(t){return hc+": "+t}function vc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function cc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(uc),500);try{t.clone().text().then(t=>e(t),t=>e(dc(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(hc)}})}(t);var i=$s(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(vc(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(uc),500);try{a=t.clone()}catch(t){return void o(hc)}var u=a.body;if(lc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(hc)}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(vc(e));d+=a.byteLength,h.push(a)}t()}},t=>o(dc(t)))}()}else try{a.text().then(t=>o(t),t=>o(dc(t)))}catch(t){o(hc)}})}(t,i)}function fc(){return fc=o(function*(t){var e=t.r,i=t.options,r=Zv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):cc(e,i)}),fc.apply(this,arguments)}function pc(){return pc=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=ac.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=Zv(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Ae(r)?cc(e,i):Promise.resolve(r)}),pc.apply(this,arguments)}var gc=null;function mc(t,e,i){if(!("performance"in e))return()=>{};if(gc)return Jv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Ds,i):Ds,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&&Us.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=>Qv(t)||Kv(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>oc({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=>Qv(t)||Kv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>oc({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=Xv("request",i.recordHeaders),n=Xv("response",i.recordHeaders),s=Gv(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=>(ec({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=nc({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),ec({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=nc({body:d.response,options:i,url:a})),ic(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:oc({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){Jv.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=Xv("request",i.recordHeaders),n=Xv("response",i.recordHeaders),s=Gv(e,"fetch",s=>function(){var a=o(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return Jv.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),!lc(null==a?void 0:a.body)&&ec({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return fc.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){Jv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Yv(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),ec({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return pc.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){Jv.error("Failed to record fetch response for network capture",t)}return u}finally{ic(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:oc({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)),gc=()=>{a(),l(),u(),gc=null}}var yc,bc,_c,wc,kc,Sc,xc,Cc,Tc,Mc,Ic,Ec,Rc,Ac,Pc,Fc=t=>({name:"rrweb/network@1",observer:mc,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Uv,getRecordNetworkPlugin:Fc},b.__PosthogExtensions__.rrweb={record:Iv,version:"v2",wasMaxDepthReached:()=>td,resetMaxDepthState(){td=!1,Yh=!1},getLastSnapshotCost:()=>zu,getMutationCost:()=>n({},Zu),resetSnapshotCostState(){qu=0,ju=0,Bu=0,$u=0,Hu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},zu=null,Uu=null,Wu=[],Vu=0,Gu=0,Zu={slowestBatchMs:0},Ju={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Iv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:Uv},b.getRecordNetworkPlugin=Fc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new cu(t,e);var Oc,$c,Dc,Lc,Nc={},qc=[],jc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Bc=Array.isArray;function Hc(t,e){for(var i in e)t[i]=e[i];return t}function zc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Uc(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?yc.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 Wc(t,o,r,n,null)}function Wc(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?++_c:n,__i:-1,__u:0};return null==n&&null!=bc.vnode&&bc.vnode(s),s}function Vc(t){return t.children}function Gc(t,e){this.props=t,this.context=e}function Zc(t,e){if(null==e)return t.__?Zc(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?Zc(t):null}function Jc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Hc({},e);s.__v=e.__v+1,bc.vnode&&bc.vnode(s),of(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Zc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,lf(r,s,n),e.__e=e.__=null,s.__e!=i&&Qc(s)}}function Qc(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}),Qc(t)}function Kc(t){(!t.__d&&(t.__d=!0)&&wc.push(t)&&!Xc.__r++||kc!=bc.debounceRendering)&&((kc=bc.debounceRendering)||Sc)(Xc)}function Xc(){try{for(var t,e=1;wc.length;)wc.length>e&&wc.sort(xc),t=wc.shift(),e=wc.length,Jc(t)}finally{wc.length=Xc.__r=0}}function Yc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||qc,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]=Wc(null,o,null,null,null):Bc(o)?o=t.__k[s]=Wc(Vc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Wc(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=ef(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=Zc(a)),df(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]||Nc,c.__i=d,g=of(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&hf(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=tf(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 tf(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=tf(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Zc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function ef(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 rf(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 nf(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||rf(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||rf(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ic,"$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[Mc]=r[Mc]:(i[Mc]=Ec,t.addEventListener(e,s?Ac:Rc,s)):t.removeEventListener(e,s?Ac:Rc,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 sf(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Tc])e[Tc]=Ec++;else if(i[Mc]>e[Tc])return;return i(bc.event?bc.event(e):e)}}}function of(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=bc.__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 Gc(y,_),v.constructor=C,v.render=vf),$&&$.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=Hc({},v.__s)),Hc(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)}),qc.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=bc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),qc.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=Hc(Hc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Vc&&null==h.key?uf(h.props.children):h,a=Yc(t,Bc(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--;)zc(s[x]);af(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||af(e);bc.__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||Nc,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&&(bc.__m&&bc.__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&&yc.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||nf(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||nf(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=""),Yc("template"==e.type?t.content:t,Bc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&Zc(i,0),a,l),null!=s)for(u=s.length;u--;)zc(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])&&nf(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&nf(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=bc.diffed)&&h(e),128&e.__u?void 0:a}function af(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(af))}function lf(t,e,i){for(var r=0;i.length>r;r++)hf(i[r],i[++r],i[++r]);bc.__c&&bc.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){bc.__e(t,e.__v)}})}function uf(t){return"object"!=typeof t||null==t||t.__b>0?t:Bc(t)?t.map(uf):void 0!==t.constructor?null:Hc({},t)}function hf(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){bc.__e(t,i)}}function df(t,e,i){var r,n;if(bc.unmount&&bc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||hf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){bc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&df(r[n],e,i||"function"!=typeof t.type);i||zc(t.__e),t.__c=t.__=t.__e=void 0}function vf(t,e,i){return this.constructor(t,i)}function cf(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),bc.__&&bc.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],of(e,t=(!r&&i||e).__k=Uc(Vc,null,[t]),n||Nc,Nc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?yc.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),lf(s,t,o),t.props.children=null}yc=qc.slice,bc={__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}},_c=0,Gc.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Hc({},this.state);"function"==typeof t&&(t=t(Hc({},i),this.props)),t&&Hc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Kc(this))},Gc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Kc(this))},Gc.prototype.render=Vc,wc=[],Sc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xc=function(t,e){return t.__v.__b-e.__v.__b},Xc.__r=0,Cc=Math.random().toString(8),Tc="__d"+Cc,Mc="__a"+Cc,Ic=/(PointerCapture)$|Capture$/i,Ec=0,Rc=sf(!1),Ac=sf(!0),Pc=0;var ff=0,pf=[],gf=bc,mf=gf.__b,yf=gf.__r,bf=gf.diffed,_f=gf.__c,wf=gf.unmount,kf=gf.__;function Sf(t,e){gf.__h&&gf.__h($c,t,ff||e),ff=0;var i=$c.__H||($c.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function xf(t){return ff=1,function(t,e){var i=Sf(Oc++,2);if(i.t=t,!i.__c&&(i.__=[$f(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=$c,!$c.__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};$c.__f=!0;var n=$c.shouldComponentUpdate,s=$c.componentWillUpdate;$c.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)},$c.shouldComponentUpdate=r}return i.__N||i.__}($f,t)}function Cf(t,e){var i=Sf(Oc++,3);!gf.__s&&Of(i.__H,e)&&(i.__=t,i.u=e,$c.__H.__h.push(i))}function Tf(t){return ff=5,Mf(function(){return{current:t}},[])}function Mf(t,e){var i=Sf(Oc++,7);return Of(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function If(t){var e,i=$c.context[t.__c],r=Sf(Oc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub($c)),i.props.value):t.__}function Ef(){for(var t;t=pf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Pf),e.__h.some(Ff),e.__h=[]}catch(i){e.__h=[],gf.__e(i,t.__v)}}}gf.__b=function(t){$c=null,mf&&mf(t)},gf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),kf&&kf(t,e)},gf.__r=function(t){yf&&yf(t),Oc=0;var e=($c=t.__c).__H;e&&(Dc===$c?(e.__h=[],$c.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Ef(),Oc=0)),Dc=$c},gf.diffed=function(t){bf&&bf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==pf.push(e)&&Lc===gf.requestAnimationFrame||((Lc=gf.requestAnimationFrame)||Af)(Ef)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Dc=$c=null},gf.__c=function(t,e){e.some(function(t){try{t.__h.some(Pf),t.__h=t.__h.filter(function(t){return!t.__||Ff(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],gf.__e(i,t.__v)}}),_f&&_f(t,e)},gf.unmount=function(t){wf&&wf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{Pf(t)}catch(t){e=t}}),i.__H=void 0,e&&gf.__e(e,i.__v))};var Rf="function"==typeof requestAnimationFrame;function Af(t){var e,i=function(){clearTimeout(r),Rf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Rf&&(e=requestAnimationFrame(i))}function Pf(t){var e=$c,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),$c=e}function Ff(t){var e=$c;t.__c=t.__(),$c=e}function Of(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function $f(t,e){return"function"==typeof e?e(t):e}var Df="gzip-js",Lf="base64",Nf="events",qf="cancelEvents",jf="tab",Bf="left",Hf="center",zf="right",Uf="next_to_trigger",Wf="popover",Vf="widget",Gf="external_survey",Zf="open",Jf="multiple_choice",Qf="single_choice",Kf="rating",Xf="end",Yf="always",tp="survey shown",ep="survey dismissed",ip="survey sent",rp="$survey_id",np="$survey_name",sp="$survey_iteration",op="$survey_iteration_start_date",ap="$survey_partially_completed",lp="$survey_submission_id",up="$survey_completed",hp="$survey_last_seen_date",dp="$survey_language",vp="popover";function cp(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Ce(i.then)&&i.then(void 0,()=>{})}}}}var fp=Cn("[Surveys]");function pp(t){return!(!t.start_date||t.end_date)}function gp(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var mp=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),yp=t=>mp("seenSurvey_",t),bp=t=>{try{var e=yp(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){fp.error("Failed to persist survey seen state",t)}},_p=[Wf,Vf,"api"],wp={ignoreConditions:!1,ignoreDelay:!1,displayType:vp},kp="logs",Sp=Cn("[Stylesheet Loader]"),xp=a,Cp=h,Tp="#020617",Mp={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:zf,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:Tp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Ip=[Hf,Bf,zf];function Ep(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 Rp(t){var e;void 0===t&&(t=Mp.backgroundColor),"#"===t[0]&&(e=Ep(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=Ep(i)),!e)return Tp;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?Tp:"white"}return Tp}var Ap=(t,e,i)=>{var r=Qp(t),s=Cp.querySelector("."+r);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Cp.createElement("div");((t,e,i)=>{var r=n({},Mp,i),s=t.style,o=!Ip.includes(r.position)||e===Vf&&(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)||Rp(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",Rp(r.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Rp(r.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),s.setProperty("--ph-widget-color",r.widgetColor),s.setProperty("--ph-widget-text-color",Rp(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)||Rp(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 Ce(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Sp.error("prepare_external_dependency_stylesheet returned null"),null)})(Cp,':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||Cp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},Pp=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?(bp(i),s.capture(ip,n({[np]:i.name,[rp]:i.id,[sp]:i.current_iteration,[op]:i.current_iteration_start_date,[lp]:r,[up]:o},l&&{[dp]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},$a(e,i,u),a,{$set:{[Da(i,"responded")]:!0}})),o&&(xp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Jp(i),s.reloadFeatureFlags())):fp.error("[survey sent] event not captured, PostHog instance not found.")},Fp=(t,e,i)=>{return n({[np]:t.name,[rp]:t.id,[sp]:t.current_iteration,[op]:t.current_iteration_start_date,[ap]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Pe(t)))},(null==e?void 0:e.surveyLanguage)&&{[dp]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[lp]:null==e?void 0:e.surveySubmissionId},$a(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Op=(t,e,i,r)=>{if(e){if(!i){var s=Gp(t),o=s?s.surveyLanguage:r;e.capture(ep,n({},Fp(t,s,e),o&&{[dp]:o},{$set:{[Da(t,"dismissed")]:!0}})),Jp(t),bp(t),xp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else fp.error("[survey dismissed] event not captured, PostHog instance not found.")},$p=(t,e)=>{if(e){var i=(t=>mp("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Gp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture("survey abandoned",Fp(t,r,e),{transport:"sendBeacon"})}}else fp.error("[survey abandoned] event not captured, PostHog instance not found.")},Dp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Lp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,Np=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?Lp(t.questions,Dp(t.questions)):t.questions},jp=t=>za(t)||Zp(t),Bp=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,Kc(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"+Pc++,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}),Hp=()=>If(Bp),zp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=Hc({},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?yc.call(arguments,2):i),Wc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Up(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=Zn(e);return!!s&&Va[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var Wp=t=>mp("inProgressSurvey_",t),Vp=(t,e)=>{try{localStorage.setItem(Wp(t),JSON.stringify(e))}catch(t){fp.error("Error setting in-progress survey state in localStorage",t)}},Gp=t=>{try{var e=localStorage.getItem(Wp(t));if(e)return JSON.parse(e)}catch(t){fp.error("Error getting in-progress survey state from localStorage",t)}return null},Zp=t=>{var e=Gp(t);return!Pe(null==e?void 0:e.surveySubmissionId)},Jp=t=>{try{localStorage.removeItem(Wp(t))}catch(t){fp.error("Error clearing in-progress survey state from localStorage",t)}};function Qp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Kp(t,e,i){if(void 0===e&&(e=zf),t===Gf)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 Bf:return{left:"30px"};case Hf:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Vf&&i===jf?"60px":"30px"}}}var Xp=0;function Yp(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:--Xp,__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 bc.vnode&&bc.vnode(u),u}var tg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("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"})}),eg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("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"})}),ig=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("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"})}),rg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("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"})}),ng=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("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"})}),sg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yp("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"})}),og=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yp("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"})}),ag=Yp("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Yp("g",{"clip-path":"url(#clip0_2415_6911)",children:[Yp("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Yp("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Yp("g",{mask:"url(#mask0_2415_6911)",children:[Yp("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"}),Yp("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"}),Yp("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"}),Yp("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"}),Yp("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"}),Yp("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"})]})]}),Yp("defs",{children:Yp("clipPath",{id:"clip0_2415_6911",children:Yp("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function lg(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Yp("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",ag]})}function ug(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=If(Bp).isPreviewMode,v=!!u&&!!h,c=!l&&Yp("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 Yp("div",{className:"bottom-section",children:[v?Yp("div",{className:"form-buttons form-buttons-with-back",children:[Yp("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&Yp(lg,{urlParams:{utm_source:"survey-footer"}})]})}function hg(t){var e=t.question,i=t.forceDisableHtml;return Yp("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Yp(e.type===Zf?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&zp({component:Uc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function dg(t){var e,i,r;return Yp("button",{className:"form-cancel",onClick:t.onClick,disabled:If(Bp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,Yp("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:[Yp("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Yp("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 vg=a;function cg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=If(Bp).isPopup;return Cf(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Dn(vg,"keydown",t),()=>{vg.removeEventListener("keydown",t)}},[o]),Yp("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Yp(dg,{onClick:()=>o()}),Yp("h3",{className:"thank-you-message-header",children:e}),i&&zp({component:Uc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Yp(ug,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function fg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=If(Bp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Yp("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Yp(dg,{onClick:()=>u()}),e&&Yp("h3",{className:"intro-screen-header",children:e}),i&&zp({component:Uc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Yp(ug,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var pg=t=>xe(t)&&t.every(t=>Ee(t));function gg(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=Hp().isPreviewMode,d=Tf(null),v=xf(()=>Ee(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Cf(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Mf(()=>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 me: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 ye: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=_n(e.validation,me),b=_n(e.validation,ye),_=Mf(()=>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 Yp(Vc,{children:[Yp("div",{className:"question-container",children:[Yp(hg,{question:e,forceDisableHtml:i,htmlFor:g}),Yp("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}),_&&Yp("div",{className:"validation-hint",children:_})]}),Yp(ug,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function mg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Yp(Vc,{children:[Yp("div",{className:"question-container",children:Yp(hg,{question:e,forceDisableHtml:t.forceDisableHtml})}),Yp(ug,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function yg(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=xf(()=>Fe(l)?l:xe(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Ee(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Hp().isPreviewMode,y=t=>m?a(t):o(t);return Yp(Vc,{children:[Yp("div",{className:"question-container",children:[Yp(hg,{question:i,forceDisableHtml:r}),Yp("div",{className:"rating-section",children:[Yp("div",{className:"rating-options",children:["emoji"===i.display&&Yp("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=xg[i.scale])?void 0:e.map((t,e)=>Yp("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&&Yp("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Cg(i.scale).map((t,e)=>Yp(bg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&Yp("div",{className:"rating-text",children:[Yp("div",{children:i.lowerBoundLabel}),Yp("div",{children:i.upperBoundLabel})]})]})]}),Yp(ug,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ae(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function bg(t){var e=t.num,i=t.setActiveNumber;return Yp("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 _g(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=Tf(null),v=Mf(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Lp(e,Dp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=xf(()=>((t,e)=>Ee(t)||pg(t)?t:e===Qf?null:[])(l,e.type)),f=c[0],p=c[1],g=xf(()=>((t,e)=>{if(Ee(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(pg(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=Hp().isPreviewMode,_=e.type===Qf,w=e.type===Jf,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&&xe(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||!Ae(f)&&(!xe(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?xe(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return Yp(Vc,{children:[Yp("div",{className:"question-container",children:[Yp(hg,{question:e,forceDisableHtml:i}),Yp("fieldset",{className:"multiple-choice-options limit-height",children:[Yp("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:xe(f)&&f.includes(t);return Yp("label",{className:n?"choice-option-open":"",children:[Yp("div",{className:"response-choice",children:[Yp("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Yp("span",{children:n?t+":":t})]}),n&&Yp("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)})]})]}),Yp(ug,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var wg=[1,2,3,4,5],kg=[1,2,3,4,5,6,7],Sg=[0,1,2,3,4,5,6,7,8,9,10],xg={2:[sg,og],3:[ig,eg,tg],5:[rg,ig,eg,tg,ng]};function Cg(t){switch(t){case 5:default:return wg;case 7:return kg;case 10:return Sg}}var Tg=Cn("[Surveys]");function Mg(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?Xf:s;if(n.branching.type===Xf)return Xf;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===Qf){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===Xf?Xf:s}}else if(n.type===Kf){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===Xf?Xf:s}}return s}return Tg.warn("Falling back to next question index due to unexpected branching type"),s}var Ig=Cn("[SurveyTranslations]");function Eg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=La(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?La(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=La(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:Ce(t.get_property)?t.get_property(vt):void 0,locale:ul()},Ig)}(e);if(!i)return Ig.info("No user language detected"),{survey:t,language:null};var r=Ba(t,i,Ig);return{survey:r.survey,language:r.matchedKey}}var Rg=a,Ag=h,Pg="ph:show_survey_widget",Fg="PHWidgetSurveyClickListener";function Og(t,e){try{var i=t.getBoundingClientRect(),r=Rg.innerHeight,n=Rg.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:Mp.zIndex}}catch(t){return fp.warn("Failed to calculate trigger position:",t),null}}var $g=class{constructor(t){var e=this;this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Mi=null,this.Ti=!1,this.Ii=null,this.Ri=null,this.Ai=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(pt);if(t)for(var e of t)Zp(e)&&$p(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,v=e.Ei(t),c=v.survey,f=v.language;e.Mi=f,e.Ai=null,e.Oi=i;var p=e.Li(c,i);e.Di(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Pi(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.Ni(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===Uf&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=Ag.querySelector(p.appearance.widgetSelector);k&&(_=Og(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||Mp.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=Ap(p,e._posthog).shadow;e.xi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Fi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Ai=C,0>=S)return e.Ti=!0,cf(Yp(jg,n({},C)),x);var T=()=>{if(!e.qi(p))return fp.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Fi(p);(()=>{e.Ti=!0;var r=e.Ei(t),s=r.survey,o=r.language;e.Mi=o;var a=e.Li(s,i),l=n({},C,{survey:a,surveyLanguage:o});e.Ai=l,cf(Yp(jg,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=Fe(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Rg.setTimeout(()=>{e.ki.delete(p.id),T()},E);e.ki.set(p.id,R)}},this.ji=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=Ap(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.xi.set(s,s.host),o&&cf(Yp(Hg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Bi=t=>{var e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Fg),this.Si.delete(t),fp.info("Removed click listener for survey "+t))},this.Hi=t=>{this.$i(t)||(this.zi(t),this.Bi(t.id))},this.$i=t=>{try{var e;return!(null==(e=Ag.querySelector(Qp(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ui=(t,e)=>{var i=Ag.querySelector(e),r=this.Si.get(t.id);if(i){if(this.ji(t),r){if(i===r.element)return;fp.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Bi(t.id)}if(!i.hasAttribute(Fg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Uf?Og(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Mp.maxWidth)):{};Rg.dispatchEvent(new CustomEvent(Pg,{detail:{surveyId:t.id,position:n}}))};Dn(i,"click",n),i.setAttribute(Fg,"true"),this.Si.set(t.id,{element:i,listener:n,survey:t}),fp.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Hi(t)},this.renderPopover=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=Ap(i,this._posthog).shadow;this.xi.set(n,n.host),cf(Yp(jg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Fi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.Ei(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.Wi(s,o,i)),cf(Yp(jg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Fi,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.qi(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=t.filter(t=>t.type===Wf||t.type===Vf),r=new Set(i.map(t=>t.id));for(var n of Array.from(e.ki.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Vi(i),o=new Set;s.forEach(t=>{if(t.type===Vf){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===jf)return void e.ji(t);"selector"===(null==(r=t.appearance)?void 0:r.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ui(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ae(e.Zi)&&t.type===Wf&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.Si.forEach(t=>{var i=t.survey;o.has(i.id)||e.Hi(i)})},t)},this.Ni=t=>{Ae(this.Zi)||fp.error("Survey "+this.Zi+" already in focus. Cannot add survey "+t.id+"."),this.Zi=t.id},this.Fi=t=>{this.Zi!==t.id&&fp.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Di(t.id),this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0,this.zi(t)},this._posthog=t,this.Zi=null,this.Ii=()=>this.Gi(),Dn(Rg,"languagechange",this.Ii),this.Ri=t.onFeatureFlags(()=>this.Gi())}Gi(){var t;if(!Ae(this.Zi)){var e=null==(t=this._posthog.get_property(pt))?void 0:t.find(t=>t.id===this.Zi);if(e){var i=this.Ei(e),r=i.survey,s=i.language;if(s!==this.Mi&&(this.Mi=s,this.Ti)){var o=this.Li(r,this.Oi),a=Ap(o,this._posthog).shadow;cf(Yp(jg,n({},this.Ai,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Fi,surveyLanguage:s})),a)}}}}get Qi(){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}Li(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}Di(t){var e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(fp.info("Cancelled pending survey "+t),this.Di(t),this.Zi===t&&(this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0))}setAutomaticDisplayDispose(t){this.Ji=t}dispose(){var t;null==(t=this.Ji)||t.call(this),this.Ji=void 0,this.Ii&&(Rg.removeEventListener("languagechange",this.Ii),this.Ii=null),this.Ri&&(this.Ri(),this.Ri=null),this.ki.forEach((t,e)=>this.Di(e)),this.Si.forEach((t,e)=>this.Bi(e)),this.xi.forEach((t,e)=>{cf(null,e),null==t||t.remove()}),this.xi.clear(),this.Zi=null}Vi(t){return t.sort((t,e)=>{var i,r,n=Zp(t),s=Zp(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Yf,a=e.schedule===Yf;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)})}Ei(t){return Eg(t,this._posthog)}Wi(t,e,i){if(this.Ci.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&&!Ie(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}}(Rg.location.search).params;if(0===Object.keys(r).length)return!1;fp.info("[Survey Prefill] Detected URL prefill parameters");var n=this.Ki(t,r,e);return!!n&&(this.Xi(t,n,i,e),this.Ci.add(t.id),n.isSurveyCompleted)}Xi(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)&&Pp({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Pi(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=xe(o)?o.map(String):[String(o)]}fp.info("[Survey] Processing initial responses");var a=this.Ki(t,n,r);return!!a&&(this.Xi(t,a,i,r),a.isSurveyCompleted)}Ki(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=Fa(t.id);try{switch(t.type){case Qf:if(!t.choices||0===t.choices.length)return void xn.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 xn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case Jf:if(!t.choices||0===t.choices.length)return void xn.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 xn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&xn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Kf:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void xn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:xn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){xn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return fp.warn("[Survey Prefill] No valid responses after conversion"),null;var n=la(),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=Fa(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=Mg(t,r,l.id?i[Fa(l.id)]:null);if(h===Xf)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 Vp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Np(t.questions),visitedIndices:l,surveyLanguage:i}),fp.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return fp.error("[Survey Prefill] Error handling prefill:",t),null}}Yi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Qi,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}tn(t){return!t.conditions||Up(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 Va[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==Cp||!Cp.querySelector(t.conditions.selector))}(t)}en(t){var e;return jp(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.Qi)&&e.hasLoadedFlags?{satisfied:this.Yi(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(!pp(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!_p.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.Yi(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.Yi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.en(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,pa.Lt("lastSeenSurveyDate"))?(t=>!!pa.Lt(yp(t))&&!jp(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)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.rn(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}rn(t){var e;return!Ha(t)&&!gp(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}nn(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.Yi(e)})}qi(t){return this.checkSurveyEligibility(t).eligible&&this.tn(t)&&this.rn(t)&&this.nn(t)}zi(t){try{var e=Ag.querySelector(Qp(t,!0));null!=e&&e.shadowRoot&&(cf(null,e.shadowRoot),this.xi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){fp.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Zi,surveyTimeouts:this.ki,handleWidget:this.ji,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ui,sortSurveysByAppearanceDelay:this.Vi,checkFlags:this.nn.bind(this),isSurveyFeatureFlagEnabled:this.Yi.bind(this),onLanguageChange:this.Gi.bind(this),currentLanguage:this.Mi,surveyIsRendered:this.Ti}}};function Dg(t,e){if(Ag&&Rg){var i,r=new $g(t);if(t.config.disable_surveys_automatic_display)return fp.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return fp.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{Ag.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Dn(Ag,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),Ag.removeEventListener("visibilitychange",o)}),r}}function Lg(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;Cf(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Vf,s=Up(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===jf&&i;if(!s)return fp.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(fp.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Dn(Rg,"popstate",i),Dn(Rg,"hashchange",i);var s=Rg.history.pushState,l=Rg.history.replaceState;return Rg.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()},Rg.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()},()=>{Rg.removeEventListener("popstate",i),Rg.removeEventListener("hashchange",i),Rg.history.pushState=s,Rg.history.replaceState=l}}},[o,e,r,n,a])}var Ng=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 jg(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=Tf(null),N=Number.isInteger(b),q=function(t,e,i,r,s,o,a,l,u){var h=xf(r||0===i||t.type===Gf),d=h[0],v=h[1],c=xf(!1),f=c[0],p=c[1],g=Tf(!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 "+Ng+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Cf(()=>{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(Up(t,e)){v(!0),Rg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(tp,n({[np]:t.name,[rp]:t.id,[sp]:t.current_iteration,[op]:t.current_iteration_start_date},u&&{[dp]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Dn(Rg,"PHSurveyClosed",y),Dn(Rg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(s)||clearTimeout(s),Rg.removeEventListener("PHSurveyClosed",y),Rg.removeEventListener("PHSurveySent",o)}}}else fp.error("usePopupVisibility hook called without a PostHog instance.")},[]),Lg({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=xf(!1),U=z[0],W=z[1],V=Mf(()=>!!Gp(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=Mf(()=>{var t,e=(null==(t=Gp(f))?void 0:t.surveySubmissionId)||la();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){D?Op(f,g,N,D):Op(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?Yp(Bp.Provider,{value:J,children:Yp("div",{className:"ph-survey",style:n({},Kp(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:H?Yp(cg,{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||Mp,onClose(){B(),A()}}):Z?Yp(fg,{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||Mp,onStart:()=>W(!0)}):Yp(Bg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Bg(t){var e,i,r=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Mf(()=>{var t=Gp(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Jp(r),null)},[r]),l=xf(()=>(null!=a&&a.responses&&fp.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=If(Bp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=xf(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Fe(t)&&t>=0&&r.questions.length>t?t:0;return Fe(v)&&v>=0?v:e}),k=w[0],S=w[1],x=xf(()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&r.questions.length>t)}),C=x[0],T=x[1],M=xf(()=>{var t,e;return null!==(t=null==(e=Gp(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),I=M[0],E=M[1],R=Mf(()=>Np(qp(r,a)),[r.id,a]),A=Mf(()=>{if(!R||new Set(R).size!==R.length)return qp(r,a);var t=new Map(r.questions.map(t=>[t.id,t])),e=R.map(e=>t.get(e)).filter(t=>!!t);return e.length===R.length?e:r.questions},[R,r.questions,r,a]);Cf(()=>{!y||Ie(v)||0>v||S(v)},[v,y]);var P=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),F=A.at(k);return F?Yp("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Yp(dg,{onClick(){c()}}),Yp("div",{className:"survey-box","data-question-index":k,children:zg({question:F,forceDisableHtml:s,displayQuestionIndex:k,appearance:r.appearance||Mp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=Fa(s),l=n({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?n({},I,{[d.id]:d.question}):I;E(v);var c=Mg(r,i,e),f=c===Xf,p=[...C,i];if(f||(T(p),S(c),Vp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:Np(A),visitedIndices:p,surveyLanguage:_,questionSnapshots:v})),r.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=A[t])?void 0:e.id}).filter(t=>!!t).map(t=>Fa(t)));Pp({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:b,surveyLanguage:_,questionSnapshots:v})}}else fp.error("onNextButtonClick called without a questionId.");else fp.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:p,initialValue:F.id?u[Fa(F.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Vp(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:Np(A),visitedIndices:e,surveyLanguage:_,questionSnapshots:I})}}})})]}):null}function Hg(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=xf(!0),f=c[0],p=c[1],g=xf(!1),m=g[0],y=g[1],b=xf({}),_=b[0],w=b[1],k=Tf(void 0),S=()=>{y(!m)};if(Cf(()=>{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&&(fp.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Dn(Rg,Pg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),Rg.removeEventListener(Pg,e)}}}else fp.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]),Lg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Yf&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return Yp(Vc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Yp("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&&Yp(jg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var zg=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 Zf:return Uc(gg,n({},o,{question:e,key:e.id}));case"link":return Uc(mg,n({},o,{question:e,key:e.id}));case Kf:return Uc(yg,n({},o,{question:e,key:e.id}));case Qf:case Jf:return Uc(_g,n({},o,{question:e,key:e.id}));default:return fp.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=Dg,b.extendPostHogWithSurveys=Dg;var Ug=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Wg=1e4,Vg=(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),Gg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Vg(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 Vg(e,JSON.stringify(t.slice(0,n)),i)},Zg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Jg=(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}},Qg=(t,e,i)=>{if(!i.truncated)if(Te(t)){if(i.seen.has(t))return void Jg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Qg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Jg(e,t,i)},Kg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Zg(t))return!n||Vg(e,"null",i);if(Ae(t)||(t=>{try{return Fe(t)||$e(t)}catch(t){return!1}})(t))return Vg(e,JSON.stringify(t),i);if("string"==typeof t)return Gg(t,e,i);if(!Te(t)&&!xe(t))return Vg(e,JSON.stringify(t),i);if(r.has(t))return Gg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Ce(o))return Kg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return Gg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return Vg(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 Kg(l,e,i,r,n,s)}if(xe(t)){if(!Vg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Vg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Kg(d,e,i,r,!0))return!1}return Vg(e,"]",i)}if(!Vg(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{Qg(f,c,s)}catch(t){}if(Zg(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(!Vg(e,p,i))return!1;var b=e.length,_=Kg(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 Vg(e,"}",i)},Xg=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Te(t[0])?{result:{},keysRemaining:50,sizeRemaining:Wg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Vg(i," ",r))&&Kg(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)||{}}},Yg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},tm=t=>"canCapture"in t,em=t=>tm(t)?t.canCapture?t.getExtension(kp):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(Gv(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=em(h);if(d){s=!0,o=!0;var v=Xg(l,Wg),c=v.body,f=v.attributes,p=n({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(tm(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;Ce(n)&&n.call(e,i)}})(h,d,{level:Yg[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__=Ug(o),a}))};for(var a of Object.keys(Yg))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=em(t);if(i)for(var r of e)try{var s=Xg(r.args,Wg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Yg[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 im=t=>Be(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),rm=Cn("[Error tracking]"),nm="webkit-masked-url:",sm=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],om=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",nm],am=["__firefox__","__gCrWeb"];function lm(){return new vr([new Sr,new Fr,new Cr,new xr,new Ar,new Rr,new Mr,new Pr],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=r;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=kr.test(l)?l.replace(kr,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=50)break}}}return 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 um=Cn("[ExceptionAutocapture]"),hm=lm(),dm=(t,e)=>{try{return t()}catch(t){return e}},vm=(t,e)=>dm(()=>t(e()),void 0),cm=t=>dm(()=>Ce(t)&&Ce(t.call),!1),fm=(t,e)=>dm(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),pm=(t,e,i)=>{dm(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),dm(()=>{t[e]=i},void 0)},gm=t=>{var e=a;e||um.info("window not available, cannot wrap onerror");var i=dm(()=>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 vm(t,()=>hm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Ee(e)&&Ee(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}})),!!cm(i)&&null!==(e=i(...n))&&void 0!==e&&e},fm(e,"onerror"),()=>pm(e,"onerror",i)},mm=function(t,e){void 0===e&&(e=!1);var i=a;i||um.info("window not available, cannot wrap onUnhandledRejection");var r=dm(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return vm(t,()=>hm.buildFromUnknown(i,{mechanism:{handled:!1}})),cm(r)?null!==(n=r(i))&&void 0!==n&&n:e},fm(i,"onunhandledrejection"),()=>pm(i,"onunhandledrejection",r)},ym={wrapOnError:gm,wrapUnhandledRejection:mm,wrapConsoleError(t){var e=console;e||um.info("console not available, cannot wrap console.error");var i=dm(()=>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];vm(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return hm.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),cm(i)&&i(...r)},fm(e,"error"),()=>pm(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=ym,b.posthogErrorWrappingFunctions=ym;var bm=(t,e)=>{if(Ce(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Ae(i)&&"object"==typeof i&&xe(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){um.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){um.error("Failed to capture exception for a legacy client",t)}};gm(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),mm(n,!0)}};b.extendPostHogWithExceptionAutoCapture=bm,b.extendPostHogWithExceptionAutocapture=bm;var _m="X-POSTHOG-SESSION-ID",wm="X-POSTHOG-WINDOW-ID",km="X-POSTHOG-DISTINCT-ID",Sm=[_m,wm,km],xm=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Cm=(t,e)=>({}.hasOwnProperty.call(t,e)),Tm=t=>"object"==typeof t&&!Ae(t)||Ce(t),Mm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Im=t=>{try{var e;return Mm(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}},Em=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(xe(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(_m,a.sessionId),n.set(wm,l),o=!0}var u=(t=>Ce(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(km,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var Rm={_patchFetch:(t,e,i)=>Gv(a,"fetch",r=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=Im(s);if(u)if(Mm(s)){var h=new Request(s,o);Em(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Tm(o)?o.headers:void 0);if(Em(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Ae(t))return{headers:e};if(Tm(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)=>Cm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Cm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),xm.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&&xm.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)=>Gv(a.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=Im(s);d&&Em(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return Sm.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=Rm,b.postHogTracingHeadersPatchFns=Rm,"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 Am=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)}}},Pm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Fm=t=>{if("loading"===document.readyState)return"loading";var e=Pm();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"},Om=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},$m=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Om(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},Dm=new WeakMap;function Lm(t,e){var i=Dm.get(e);return i||Dm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Nm,qm=-1,jm=()=>qm,Bm=t=>{addEventListener("pageshow",e=>{e.persisted&&(qm=e.timeStamp,t(e))},!0)},Hm=(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))}},zm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Um=()=>{var t,e;return null!==(t=null==(e=Pm())?void 0:e.activationStart)&&void 0!==t?t:0},Wm=-1,Vm=new Set,Gm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Zm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Vm)e();isFinite(Wm)||(Wm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Zm,!0))}},Jm=function(t){if(void 0===t&&(t=!1),t&&(Wm=1/0),0>Wm){var e,i,r=Um();Wm=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:Gm(),addEventListener("visibilitychange",Zm,!0),addEventListener("prerenderingchange",Zm,!0),Bm(()=>{setTimeout(()=>{Wm=Gm()})})}return{get firstHiddenTime(){return Wm},onHidden(t){Vm.add(t)}}},Qm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Pm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>jm()?a&&(document.prerendering||Um()>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}},Km=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){}},Xm=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},Ym=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},ty=t=>{var e=!1;return()=>{e||(t(),e=!0)}},ey=class{constructor(){this.u=void 0}},iy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ry=[1800,3e3],ny=function(t,e){void 0===e&&(e={});var i=Xm(e);iy(()=>{var r,n=Lm(e,ey),s=Jm(),o=Qm("FCP"),a=Km(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Um(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Hm(t,o,ry,e.reportAllChanges),Bm(i=>{o=Qm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,jm()),r=Hm(t,o,ry,e.reportAllChanges),zm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Km(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&Ym(n.u,i),o=Qm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Hm(t,o,ry,e.reportAllChanges))(!0)})},e)})},sy=[.1,.25],oy=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],ay=function(t,e){void 0===e&&(e={});var i=Lm(e=Object.assign({},e),Am),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=oy(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:$m(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Jm();ny(ty(()=>{var r,n=Qm("CLS",0),s=Lm(e,Am),o=(i,o,a,l,u)=>{n=Qm("CLS",0,i,o,a,l,u),s.o=0,r=Hm(t,n,sy,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"];Xm(e)&&h.push("soft-navigation");var d=Km(h,u);d&&(r=Hm(t,n,sy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Bm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,jm()),zm(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=oy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Fm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},ly=function(t,e){void 0===e&&(e={});var i=Lm(e=Object.assign({},e),ey);Xm(e)&&(i.u=new Map),ny(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Fm(jm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Pm(),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:Fm(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)},uy=0,hy=1/0,dy=0,vy=t=>{for(var e of t)e.interactionId&&(hy=Math.min(hy,e.interactionId),dy=Math.max(dy,e.interactionId),uy=dy?(dy-hy)/7+1:0)},cy=()=>{var t;return Nm?uy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},fy=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return cy()-this.h}D(){this.h=cy(),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)}}}},py=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=ty(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},gy=[200,500],my=function(t,e){void 0===e&&(e={});var i=Lm(e=Object.assign({},e),fy),r=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(py(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:$m(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};Km(["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=Jm();iy(()=>{var r;"interactionCount"in performance||Nm||(Nm=Km(["event"],vy,{durationThreshold:0}));var s,o=Qm("INP"),a=Lm(e,fy),l=(i,r,n,l,u)=>{a.D(),o=Qm("INP",-1,i,r,n,l,u),s=Hm(t,o,gy,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),py(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Xm(e)&&v.push("soft-navigation");var c=Km(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Hm(t,o,gy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Bm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,jm())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Fm(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:Fm(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)},yy=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],by=50,_y=[];Km(["resource"],t=>{for(var e of t)_y.push(e),_y.length>by&&_y.shift()});var wy=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(by=e.resourceBufferSize);var i=Lm(e,yy),r=new WeakMap;Xm(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:$m(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Xm(e);iy(()=>{var n,s=Jm(),o=Qm("LCP"),a=Lm(e,yy),l=(r,a,l,u,h)=>{o=Qm("LCP",-1,r,a,l,u,h),n=Hm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Jm(!0))},u=t=>{a.u&&t.navigationId&&Ym(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-Um(),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=Km(d,h);if(v){n=Hm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;py(()=>{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});Bm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,jm()),n=Hm(t,o,$,e.reportAllChanges),zm(()=>{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&&(_y.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=Pm())?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)},ky=-1,Sy=()=>ky,xy=t=>{addEventListener("pageshow",e=>{e.persisted&&(ky=e.timeStamp,t(e))},!0)},Cy=(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()))},My=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Iy=()=>{var t,e;return null!==(t=null==(e=My())?void 0:e.activationStart)&&void 0!==t?t:0},Ey=-1,Ry=new Set,Ay=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Py=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ry)e();isFinite(Ey)||(Ey="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Py,!0))}},Fy=function(t){if(void 0===t&&(t=!1),t&&(Ey=1/0),0>Ey){var e,i,r=Iy();Ey=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:Ay(),addEventListener("visibilitychange",Py,!0),addEventListener("prerenderingchange",Py,!0),xy(()=>{setTimeout(()=>{Ey=Ay()})})}return{get firstHiddenTime(){return Ey},onHidden(t){Ry.add(t)}}},Oy=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=My(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Sy()?a&&(document.prerendering||Iy()>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}},$y=new WeakMap;function Dy(t,e){var i=$y.get(e);return i||$y.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Ly,Ny=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){}},jy=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},By=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Hy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},zy=class{constructor(){this.l=void 0}},Uy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Wy=[1800,3e3],Vy=function(t,e){void 0===e&&(e={});var i=jy(e);Uy(()=>{var r,n=Dy(e,zy),s=Fy(),o=Oy("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-Iy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Cy(t,o,Wy,e.reportAllChanges),xy(i=>{o=Oy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Sy()),r=Cy(t,o,Wy,e.reportAllChanges),Ty(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&qy(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&By(n.l,i),o=Oy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Cy(t,o,Wy,e.reportAllChanges))(!0)})},e)})},Gy=[.1,.25],Zy=function(t,e){void 0===e&&(e={});var i=Fy();Vy(Hy(()=>{var r,n=Oy("CLS",0),s=Dy(e,Ny),o=(i,o,a,l,u)=>{n=Oy("CLS",0,i,o,a,l,u),s.i=0,r=Cy(t,n,Gy,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"];jy(e)&&h.push("soft-navigation");var d=qy(h,u);d&&(r=Cy(t,n,Gy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),xy(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Sy()),Ty(r)}),setTimeout(r))}))},Jy=0,Qy=1/0,Ky=0,Xy=t=>{for(var e of t)e.interactionId&&(Qy=Math.min(Qy,e.interactionId),Ky=Math.max(Ky,e.interactionId),Jy=Ky?(Ky-Qy)/7+1:0)},Yy=()=>{var t;return Ly?Jy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},tb=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Yy()-this.u}M(){this.u=Yy(),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)}}}},eb=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Hy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},ib=[200,500],rb=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Fy();Uy(()=>{var r;"interactionCount"in performance||Ly||(Ly=qy(["event"],Xy,{durationThreshold:0}));var s,o=Oy("INP"),a=Dy(e,tb),l=(i,r,n,l,u)=>{a.M(),o=Oy("INP",-1,i,r,n,l,u),s=Cy(t,o,ib,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),eb(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];jy(e)&&v.push("soft-navigation");var c=qy(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Cy(t,o,ib,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),xy(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Sy())}))})}},nb=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},sb=[2500,4e3],ob=function(t,e){void 0===e&&(e={});var i=!1,r=jy(e);Uy(()=>{var n,s=Fy(),o=Oy("LCP"),a=Dy(e,nb),l=(r,a,l,u,h)=>{o=Oy("LCP",-1,r,a,l,u,h),n=Cy(t,o,sb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Fy(!0))},u=t=>{a.l&&t.navigationId&&By(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-Iy(),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=Cy(t,o,sb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;eb(()=>{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});xy(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Sy()),n=Cy(t,o,sb,e.reportAllChanges),Ty(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},ab={onLCP:wy,onCLS:ay,onFCP:ly,onINP:my,withoutAttribution:{onLCP:ob,onCLS:Zy,onFCP:Vy,onINP:rb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=ab,b.__PosthogExtensions__.postHogWebVitalsCallbacks=ab,b.postHogWebVitalsCallbacks=ab;var lb={onLCP:ob,onCLS:Zy,onFCP:Vy,onINP:rb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=lb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=lb,b.postHogWebVitalsCallbacks=lb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>lb;var ub={onLCP:wy,onCLS:ay,onFCP:ly,onINP:my,withoutAttribution:{onLCP:ob,onCLS:Zy,onFCP:Vy,onINP:rb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=ub,b.__PosthogExtensions__.postHogWebVitalsCallbacks=ub,b.postHogWebVitalsCallbacks=ub;var hb={onLCP:ob,onCLS:Zy,onFCP:Vy,onINP:rb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=hb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=hb,b.postHogWebVitalsCallbacks=hb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>hb;var db=class{constructor(t){this.disabled=!1===t;var e=Te(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}},vb="$copy_autocapture",cb=Cn("[AutoCapture]");function fb(t,e){return e.length>t?e.slice(0,t)+"...":e}function pb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Qn(e));return e}function gb(t,e){var i,r,s=e.e,o=e.maskAllElementAttributes,l=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Qn(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!Kn(f,"body")&&1e3>v.length;)if(Yn(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!Qn(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=>Kn(t,"button")||Kn(t,"a")):-1;g>0&&(l=l||v.slice(0,g+1).some(t=>!_s(t)||ws(t)));var m,y,b,_=[],w={},k=!1,S=!1;if(Mn(v,t=>{var e=_s(t);if(Kn(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Es(i))&&(d?ar(i):i)}de(is(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};os.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?fb(1024,Rs(t)):fb(1024,ns(t)));var a=is(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),Mn(t.attributes,function(i){var s;if((!ws(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Es(i.value)&&(!Ee(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=ts(a).join(" ")),o["attr__"+i.name]=fb(1024,"href"===i.name&&n?ar(a):a)}});for(var l=1,u=1,h=t;h=pb(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,l,u,d)),Mn(function(t){if(!_s(t))return{};var e={};return Mn(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&&Es(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=Kn(t,"a")||Kn(t,"button")?Rs(t):ns(t)),k){var x,C;_[0].attr__href=k;var T=null==(x=jn(k))?void 0:x.host,M=null==a||null==(C=a.location)?void 0:C.host;T&&M&&T!==M&&(m=k)}return{props:In((y=s.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:_},{$elements_chain:(b=_,xe(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 En(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[Ps(t[0].toString())]=Ps(e.toString())}),(r+=":")+En(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:Fs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return En(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 mb=class{zs(){this.Us=void 0,clearTimeout(this.Ws),this.Ws=void 0}Vs(t){var e;if(!_s(t))return!0;for(var i,r=null!==(e=this.Gs().css_selector_ignorelist)&&void 0!==e?e:hs,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=is(t);if(de(e,"ph-no-capture")||de(e,"ph-sensitive")||ws(t)||r.some(e=>as(t,e)))return{v:!0};var i=s.parentNode;s=Yn(i)?i.host:i&&Qn(i)?i:null};s;)if(i=o())return i.v;return!1}Zs(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Us;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.zs():"pointerup"===t.type&&(e.released=!0,this.Ws=setTimeout(()=>this.zs(),0)))}else{var i;this.zs();var r=ss(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&Qn(r)&&(this.Us={target:r,excluded:this.Vs(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.Js)?void 0:i.distinctId})}else this.zs()}Qs(t){var e,i=this.Us;this.zs();var r=ss(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.Js)?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&&(Kn(r,"html")||Kn(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.Gs().css_selector_ignorelist)&&void 0!==n?n:hs;return[r,null==h?void 0:h.documentElement,null==h?void 0:h.body].some(t=>{if(!t)return!1;var e=is(t);return de(e,"ph-no-capture")||de(e,"ph-sensitive")||!_s(t)||ws(t)||s.some(e=>as(t,e))})?null:i.target}}constructor(t){this.Ks=t,this.name="autocapture",this.Xs=!1,this.Ys=null,this.eo=!1,this.io=!1,this.Rn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.ro=!1,this.Ks.refresh(this.Rn),this.rageclicks=new db(this.Rn.rageclick),this.no=null}setup(t){this.so(),this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.ro?e.dispose():(this.oo=e,this.startIfEnabled())}dispose(){var t;this.ro||(this.ro=!0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,this.ao())}Gs(){return this.Ks.refresh(this.Rn),this.Rn}so(){var t,e;return this.Gs(),this.Rn.url_allowlist=null==(t=this.Rn.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this.Rn.url_ignorelist=null==(e=this.Rn.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this.Rn}lo(){if(this.isBrowserSupported()){if(a&&h){var t=this.uo=t=>{t=t||(null==a?void 0:a.event);try{if("blur"===t.type)return void this.zs();if(0===t.type.indexOf("pointer"))return void this.Zs(t);var e="click"===t.type?this.Qs(t):void 0;if(Ae(e))return;this.ho(t,"$autocapture",e)}catch(t){cb.error("Failed to capture event",t)}};if(Dn(a,"blur",t),Dn(h,"submit",t,{capture:!0}),Dn(h,"change",t,{capture:!0}),Dn(h,"click",t,{capture:!0}),Mn(["pointerdown","pointermove","pointerup","pointercancel"],e=>{Dn(h,e,t,{capture:!0})}),this.Gs().capture_copied_text){var e=this.do=t=>{t=t||(null==a?void 0:a.event);try{this.ho(t,vb)}catch(t){cb.error("Failed to capture clipboard event",t)}};Dn(h,"copy",e,{capture:!0}),Dn(h,"cut",e,{capture:!0}),Dn(h,"paste",e,{capture:!0})}}}else cb.info("Disabling Automatic Event Collection because this browser is not supported")}ao(){this.zs(),this.uo&&(null==a||a.removeEventListener("blur",this.uo),Mn(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==h||h.removeEventListener(t,this.uo,!0)}),null==h||h.removeEventListener("submit",this.uo,!0),null==h||h.removeEventListener("change",this.uo,!0),null==h||h.removeEventListener("click",this.uo,!0),this.uo=void 0),this.do&&(null==h||h.removeEventListener("copy",this.do,!0),null==h||h.removeEventListener("cut",this.do,!0),null==h||h.removeEventListener("paste",this.do,!0),this.do=void 0),this.Xs=!1}startIfEnabled(){this.isEnabled||this.zs(),!this.ro&&this.Js&&this.isEnabled&&!this.Xs&&(this.lo(),this.Xs=!0)}onRemoteConfig(t){if(!this.ro)if(this.eo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.io=e.elementsChainAsString);var i,r=e.autocapture_opt_out;$e(r)&&(null==(i=this.Js)||i.kv.set(E,r),this.Ys=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.no=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.no)||i.forEach(i=>{var n;null==h||null==(n=h.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||de(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.ro)return!1;var i=null==(t=this.Js)?void 0:t.kv.get(E),r=this.Ys,n=this.Gs();if(!n.remoteRequestsDisabled&&!this.eo)return!1;var s=n.remoteRequestsDisabled&&!this.eo;if(Ae(r)&&!$e(i)&&!s)return!1;var o=null!==(e=this.Ys)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ho(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||ss(t);Xn(r)&&(r=r.parentNode||null);var s,o=this.so();"$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())&&ms(r,o.rageclick)&&this.ho(t,"$rageclick",i);var l=e===vb,u=l?n({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!a||ys(t))return!1;if(null!=i&&i.url_allowlist&&!es(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&es(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=bs(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Ie(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(!ls(d,null==i?void 0:i.css_selector_allowlist))return!1;if(ls(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:hs))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&&(os.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=gb(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.io,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===vb){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==a||null==(p=a.getSelection())?void 0:p.toString(),y=rs(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.Js)||h.capture(e,v).catch(t=>cb.error("Failed to capture event",t)),!0}}else this.zs()}isBrowserSupported(){return Ce(null==h?void 0:h.querySelectorAll)}},yb={};function bb(t,e){var i=ss(t);return i?n({node:i,originalEvent:t,timestamp:Date.now()},e):null}function _b(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function wb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var kb="canvas,video,audio,embed,object";function Sb(t,e){return Fe(t)&&t>=e}function xb(t){return t>=0&&1e3>t?t:void 0}function Cb(t,e){return e?xb(t-e):void 0}var Tb=class{un(t){var e,i,r,n,s,o,a,l,u=this.ln((null==t?void 0:t.__onCapture)||this.hn.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.cn=[],this.dn=0,this.ln=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.vn=t=>{var e=bb(t,{type:"click"});Ae(e)||this.fn(e)||this.pn(e),this.gn()},this.mn=()=>{var t=Date.now();this.yn=t,t%50==0&&this.cn.forEach(e=>{Ie(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.bn=()=>{this.wn=Date.now()},this.ar=()=>{var t=Date.now();this.kn=t,this._n("visibilityChangedDelayMs",t)},this.Sn=()=>{var t=Date.now();this.xn=t,this._n("focusChangedDelayMs",t)},this.Cn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Mn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Tn=()=>{this.Mn=void 0},this.In=t=>{var e,i=this.Mn;if(this.Mn=void 0,!Ie(i)&&this.Rn.max_dead_swipes_per_page_load>this.dn){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.Rn.swipe_threshold_px;if(a>=l*l&&![this.yn,this.An,this.wn].some(t=>Fe(t)&&t>=i.timestamp)){var u;if(this.En()&&(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(kb)))return;var d=bb(r,{type:"swipe",swipeDirection:_b(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ae(d)||this.fn(d)||this.pn(d),this.gn()}}}},this.Rn=this.un(e),this._onCapture=this.Rn.__onCapture}start(t){this.On(),this.Ln(),this.Dn(),this.Pn(),this.Nn(),this.Fn(t),this.Rn.capture_dead_swipes&&this.qn()}Fn(t){if(!this.jn){var e=function(t){return function(t,e){var i=yb[t];if(i)return i;var r=e[t];if((t=>Ce(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==a||!a.Zone))return yb[t]=r.bind(e);var n=e.document;if(n&&Ce(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 de(t,"AppleWebKit")&&!de(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){xn.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&&Ce(r)?yb[t]=r.bind(e):r}("MutationObserver",t)}(b);this.jn=new e(t=>{this.Bn(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.vn),b.removeEventListener("scroll",this.mn,{capture:!0}),b.removeEventListener("selectionchange",this.bn),b.removeEventListener("touchstart",this.Cn,{capture:!0}),b.removeEventListener("touchend",this.In,{capture:!0}),b.removeEventListener("touchcancel",this.Tn,{capture:!0}),null==h||h.removeEventListener("visibilitychange",this.ar),b.removeEventListener("blur",this.Sn),b.removeEventListener("focus",this.Sn),this.Mn=void 0}Bn(t){this.An=Date.now()}On(){Dn(b,"click",this.vn)}pn(t){t.visibilityChangedDelayMs=Cb(t.timestamp,this.kn),t.focusChangedDelayMs=Cb(t.timestamp,this.xn),this.cn.push(t)}gn(){this.cn.length&&Ie(this.Hn)&&(this.Hn=b.setTimeout(()=>{this.$n()},1e3))}Ln(){Dn(b,"scroll",this.mn,{capture:!0})}Dn(){Dn(b,"selectionchange",this.bn)}Pn(){Dn(h,"visibilitychange",this.ar)}Nn(){Dn(b,"blur",this.Sn),Dn(b,"focus",this.Sn)}_n(t,e){this.cn.forEach(i=>{var r=xb(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}qn(){Dn(b,"touchstart",this.Cn,{capture:!0,passive:!0}),Dn(b,"touchend",this.In,{capture:!0,passive:!0}),Dn(b,"touchcancel",this.Tn,{capture:!0,passive:!0})}En(){var t=Ie(this.zn)||Fe(this.An)&&this.An>this.zn;return(Ie(this.Un)||t)&&(this.zn=Date.now(),this.Un=!(null==h||!h.querySelector(kb))),!!this.Un}fn(t){return!t||("swipe"===t.type?this.Wn(t):this.Vn(t))}Wn(t){return!(!Jn(t.node)&&!this.cn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!Kn(t.node,"html")&&Qn(t.node)&&function(t,e){var i;if(!a||ys(t))return!1;var r=$e(e)?fs:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:fs;return!ls(bs(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.Rn.css_selector_ignorelist}))}Vn(t){return!(this.Rn.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Wn(t)||(i=t.node,!(!a||ys(i))&&bs(i,!1).targetElementList.some(t=>Kn(t,"a")));var e,i}$n(){if(this.cn.length){clearTimeout(this.Hn),this.Hn=void 0;var t=this.cn;for(var e of(this.cn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.An&&this.An>=e.timestamp?this.An-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.wn&&this.wn>=e.timestamp?this.wn-e.timestamp:void 0;var r=Sb(e.scrollDelayMs,this.Rn.scroll_threshold_ms),n=Sb(e.selectionChangedDelayMs,this.Rn.selection_change_threshold_ms),s=Sb(e.mutationDelayMs,this.Rn.mutation_threshold_ms),o=Sb(e.absoluteDelayMs,1.1*this.Rn.mutation_threshold_ms),a=Fe(e.scrollDelayMs)&&this.Rn.scroll_threshold_ms>e.scrollDelayMs,l=Fe(e.mutationDelayMs)&&this.Rn.mutation_threshold_ms>e.mutationDelayMs,u=Fe(e.selectionChangedDelayMs)&&this.Rn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Fe(e.visibilityChangedDelayMs),d=Fe(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=wb(e);if("$dead_swipe"===v){if(this.dn>=this.Rn.max_dead_swipes_per_page_load)continue;this.dn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.An,[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.Rn.mutation_threshold_ms>e.absoluteDelayMs&&this.cn.push(e)}this.gn()}}hn(t,e){var i=wb(t);this.instance.capture(i,n({},e,gb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rn.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 Tb(t,e);var Mb=Cn("[ExternalScriptsLoader]"),Ib=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]},Eb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Mb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=Ib(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(Ib(e))return Eb(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)},Rb={},Ab=(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=Rb[n];if("fallback"===r&&s){if(Ib(s))return void Eb(t,s,i);delete Rb[n]}Eb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=Ab(t,e);Rb[n]=a;var l=Ib(n);null==l||null==(o=l.parentNode)||o.removeChild(l),Eb(t,a,i)}else i(void 0,s)}:i)}else Eb(t,Ab(t,e),i)}else Eb(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{Eb(t,t.requestRouter.endpointFor("api",e),i)};var Pb=class{constructor(t){this._instance=t}get Rn(){return this._instance.config}get consent(){return this.vo()?0:this.co}isOptedOut(){return"always"===this.Rn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rn.opt_out_capturing_by_default}optInOut(t){this.fo.Ot(this.po,t?1:0,this.Rn.cookie_expiration,this.Rn.cross_subdomain_cookie,this.Rn.secure_cookie)}reset(){this.fo.Dt(this.po,this.Rn.cross_subdomain_cookie)}get po(){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.fo.Lt(this.po);return We(t)?1:de(Ve,t)?0:-1}get fo(){var t=this.Rn.opt_out_capturing_persistence_type,e="localStorage"===t?pa:ca,i=e.Et()?e:Ma;if(!this.mo||this.mo!==i){this.mo=i;var r="localStorage"===t?ca:pa;r.Lt(this.po)&&(this.mo.Lt(this.po)||this.optInOut(We(r.Lt(this.po))),r.Dt(this.po,this.Rn.cross_subdomain_cookie))}return this.mo}vo(){return!!this.Rn.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,b.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(t=>We(t))}},Fb=Cn("[Dead Clicks]"),Ob=()=>!0,$b=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(D)),r=t.instance.config.capture_dead_clicks;return $e(r)?r:!!Te(r)||i},Db=class{get lazyLoadedDeadClicksAutocapture(){return this.yo}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.bo(()=>{this._o()}):this.stop()}bo(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?Fb.error("failed to load script",e):t()})}_o(){var t;if(h){if(!this.yo&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Te(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.yo=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.yo.start(h),Fb.info("starting...")}}else Fb.error("`document` not found. Cannot start.")}stop(){this.yo&&(this.yo.stop(),this.yo=void 0,Fb.info("stopping..."))}},Lb=Cn("[SegmentIntegration]");function Nb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||la();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(At,ee)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Ce(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Lb.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Lb.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Lb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,se)},identify(t){return i(t,ae)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{Lb.error("Failed to register the Segment integration",t),e()})},i)}var qb="posthog-js";function jb(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 Bb=class{constructor(t,e,i,r,n,s){this.name=qb,this.setupOnce=function(o){o(jb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},Hb=class{constructor(t){this.wo=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(xn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ko=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.So()}So(){var t;this.xo=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.wo)}destroy(){var t;null==(t=this.xo)||t.call(this),this.xo=void 0}doPageView(t,e){var i,r=this.Co(t,e);return this.ko={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.Co(t,null==(e=this.ko)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ko)?void 0:t.pageViewId}}Co(t,e){var i=this.ko;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(!(Ie(s)||Ie(o)||Ie(a)||Ie(l)||Ie(u)||Ie(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,xn):1,v=s>1?Ge(a/s,0,1,xn):1,c=l>1?Ge(u/l,0,1,xn):1,f=l>1?Ge(h/l,0,1,xn):1;r=In(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}},zb=["flags","surveys"],Ub={[_]:{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=>Ae(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"}},Wb=[[X,{exposure:"hidden"}],[Y,{exposure:"hidden"}],[tt,{exposure:"hidden"}]],Vb=t=>{var e=Ub[t];if(e)return e;for(var i of Wb){var r=i[1];if(0===t.indexOf(i[0]))return r}},Gb={flags:Rt,surveys:gt},Zb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Jb=t=>t+"_cookie_identity_change_pending",Qb=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},Kb="main",Xb=[rt,nt,ot,at,lt,Rt,ut,vt],Yb=t=>-1!==Xb.indexOf(t),t_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},e_=t=>{if(!t)return{};var e=JSON.parse(t);return Te(e)?e:{}},i_=(t,e)=>{Mn(t,(i,r)=>{var n=Vb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},r_=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.To={},this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=!1,this.Ao=!1,this.Po=new Map,this.Fo=!1,this.Oo=!1,this.$o=!1,this.Do=!1,this.Lo=new Set,this.Rn=t,this.No=i,this.props={},this.qo=void 0,this.jo=(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.fo=this.Bo(t),this.Eo=this.Ho(t),this.load(),this.zo(),t.debug&&xn.info("Persistence loaded",t.persistence,n({},this.props)),this.update_config(t,t,e),this.save(),a){var r=()=>this.flush();Dn(a,"beforeunload",r,{capture:!1}),Dn(a,"pagehide",r,{capture:!1}),this.Uo=t=>{if(this.Mo&&(!t.storageArea||t.storageArea===(null==a?void 0:a.localStorage))&&t.key)if(t.key!==this.jo){if(this.Eo){var e=zb.find(e=>t.key===this.Wo(e));e&&this.Vo(t.key,e)}}else this.Vo(t.key,Kb)},Dn(a,"storage",this.Uo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Po.get(e);if(Yb(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.Go(e,n)}else this.Go(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Lo.add(t),()=>this.Lo.delete(t)}destroy(){this.Uo&&a&&(a.removeEventListener("storage",this.Uo),this.Uo=void 0),this.Lo.clear()}Vo(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,n;try{if(n=pa.Lt(t),Ae(n)){var s=this.Zo(e);return s.storageValue=null,e!==Kb&&(s.persisted=!1),!1}r=e_(n)}catch(t){return!1}var o=e===Kb?r:pa.Nt(this.jo);if(o&&this.Jo(o))return!1;var a=this.Qo(r,e,i);return e===Kb&&this.Eo&&!t_(this.Ko().main,r)||this.Xo(r,e,!0,n),a}Jo(t){var e=this.props[w],i=t[w];return!Ie(e)&&!Ie(i)&&e!==i}Xo(t,e,i,r){var n=this.Zo(e);n.storageValue=r,e!==Kb&&(n.persisted=i);try{n.fingerprint=this.Yo(t,e)}catch(t){n.fingerprint=void 0}}Qo(t,e,i){var r=!1;return Xb.forEach(i=>{var n,s=null==(n=Vb(i))?void 0:n.storageGroup;if(!(e===Kb&&this.Eo&&s||e!==Kb&&s!==e)){var o=i in t,a=this.ta(i,o?t[i]:void 0),l=this.Po.has(i)?i in this.props:o;l===i in this.props&&t_(a,this.props[i])||(l?this.ea(i,a,!1):this.ia(i,!1),r=!0)}}),r&&i&&this.Lo.forEach(t=>t()),r}ra(){if(!this.Mo)return!1;try{this.$o=!1;var t,e=pa.Lt(this.jo),i=this.Zo(Kb),r=!1,n=!1;if(e!==i.storageValue)if(Ae(e))i.storageValue=null;else{if(t=e_(e),this.$o=!this.Oo&&this.Jo(t),this.$o)return!1;n=this.Qo(t,Kb,!1),!this.Eo||t_(this.Ko().main,t)?this.Xo(t,Kb,!0,e):i.storageValue=e,r=!0}return this.Eo&&zb.forEach(e=>{var i=pa.Lt(this.Wo(e)),s=this.Zo(e),o=t||{},a=r&&Xb.some(t=>{var i;return(null==(i=Vb(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Ae(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Qo(o,e,!1)||n));var l=e_(i);n=this.Qo(l,e,!1)||n,this.Xo(l,e,!0,i)}}),n}catch(t){return!1}}Go(t,e){this.Po.set(t,e);var i=Vb(t);null!=i&&i.volatile||(this.Zo((this.Eo?null==i?void 0:i.storageGroup:void 0)||Kb).fingerprint=void 0,this.na(t))}sa(){Xb.forEach(t=>this.Po.set(t,!0))}zo(){if(this.Mo)try{var t=pa.Lt(this.jo),e=e_(t);this.Zo(Kb).storageValue=t,Xb.forEach(t=>{var i,r=this.Eo?null==(i=Vb(t))?void 0:i.storageGroup:void 0,n=r?pa.Lt(this.Wo(r)):null;if(r){var s=this.Zo(r);s.storageValue=n,s.persisted=!Ae(n)}var o=r&&!Ae(n)?e_(n):e;t in this.props?this.oa(t,o[t],this.props[t]):t in o&&this.Go(t,!0)})}catch(t){}}ta(t,e){var i=this.Po.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(xe(e)?e:[]),s=new Set(xe(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Te(e)?n({},e):{},a=Te(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}oa(t,e,i){if(Yb(t)){var r=this.Po.get(t);if(!0!==r){var n=e;if(this.Mo)try{var s,o=this.Eo?null==(s=Vb(t))?void 0:s.storageGroup:void 0,a=o?this.Wo(o):this.jo;n=e_(pa.Lt(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!xe(e)||!Ie(n)&&!xe(n)||!xe(i))return void this.Go(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(!Te(i))return void(t_(n,i)?this.Po.delete(t):this.Go(t,!0));if(!Ie(e)&&!Te(e)||Ie(e)&&Me(i)&&Ie(n))return void this.Go(t,!0);var v=Te(e)?e:{},c=Te(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&t_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&t_(c[t],i[t])&&l.delete(t)})}l.size?this.Go(t,l):this.Po.delete(t)}}}aa(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return Fe(e)&&e>0?e:0}la(t){if(this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase())if(t)try{var e=wa(t,this.Rn.cookie_persisted_properties||[]),i=Sa(e,this.Rn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=ca.Lt(this.jo)||void 0;n&&Ca(this.jo,n)===r&&(this.ua=r,this.ha=n)}catch(t){}else try{var s=ca.Lt(this.jo)||void 0;this.ua=s?Ca(this.jo,s):void 0,this.ha=s}catch(t){}}syncCookieProperties(){return this.da(this.Rn)}da(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.Ao||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=ca.Lt(this.jo)||void 0}catch(t){}if(!i||i===this.ha)return!1;var r,n=Ca(this.jo,i);try{r=_a(JSON.parse(i))}catch(t){return!1}if((ca.Lt(this.jo)||void 0)!==i)return!1;this.ua=n,this.ha=i;var s=xa(this.jo,i),o=[...ma,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Ae(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Me(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=In({},u);[...ma,...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===ma.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=In(v,r),Xb.forEach(t=>{var e=t in this.props;t in u===e&&t_(u[t],this.props[t])||(e?this.oa(t,u[t],this.props[t]):this.Go(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.ea(At,te);var c=this.props[w],f=this.props[At];return!l||c===h&&f===d||(this.Oo=!0,this.Ro=!0,Ea.Ot(Jb(this.jo),!0),this.ia(vt),this.ia(nt),this.ia(rt),this.ia(ot),this.ia(at),this.ia(lt),this.ia(Rt),this.ia(Et),this.ia(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(i_(this.props,r),this.ia(ct)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.ia(x)),!0}consumeCookieIdentityChange(){var t=Jb(this.jo),e=this.Ro||!!Ea.Lt(t);return this.Ro=!1,e&&Ea.Dt(t),e}va(t){return void 0===t&&(t=!1),!(this.Ao||this.gi&&!t||!this.Rn.cookieWinsOnConflict||"localstorage+cookie"!==this.Rn.persistence.toLowerCase()||(this.Ao=!0,0))}ca(){this.Ao&&(Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),delete this.To[Kb],this.pa(!0))}ga(t){if(void 0===t&&(t=!0),this.Ao)try{t?this.ca():Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0)}finally{this.Ao=!1}}isDisabled(){return!!this.gi}Bo(t){-1===Zb.indexOf(t.persistence.toLowerCase())&&(xn.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=[...ma,...t];return n({},pa,{Nt(t){try{var r,n={};try{r=ca.Lt(t)||void 0,n=r?_a(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(pa.Lt(t)||"{}");if(e){var a=xa(t,r),l=[...ma,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Ae(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===ma.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||(ga.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=In(o,u)}else s=In(n,o);return pa.Ot(t,s),s}catch(t){}return null},Ot(i,r,n,s,o,a){var l=pa.Ot(i,r,void 0,void 0,a);try{var u=wa(r,t);if(Object.keys(u).length){if(e){var h=ya(i),d=Sa(u,t);if(ca.Ot(h,d,n,s,o,a),ca.Lt(h)!==JSON.stringify(d)){ca.Dt(h,s);var v=wa(r);return ca.Ot(i,v,n,s,o,a),l}}ca.Ot(i,u,n,s,o,a)}}catch(t){pa.Pt(t)}return l},Dt(t,e){try{null==a||a.localStorage.removeItem(t),ca.Dt(t,e),ca.Dt(ya(t),e)}catch(t){pa.Pt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,s=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&pa.Et()?(e=pa,s=!0):"localstorage+cookie"===o&&i.Et()?(e=i,s=!0,r=!0):"sessionstorage"===o&&Ea.Et()?e=Ea:"memory"===o?e=Ma:"cookie"===o&&ca.Et()?(e=ca,r=!0):i.Et()?(e=i,s=!0,r=!0):ca.Et()?(e=ca,r=!0):e=Ma,this.Mo=s,this.Io=r,e}Wo(t){return this.jo+"__"+t}Ho(t){return this.Mo&&!!t.split_storage}properties(){var t={};return Mn(this.props,(e,i)=>{var r=Vb(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.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase(),i=e?pa.Nt(this.jo):null,r={};if(e)try{Mn(r=_a(ca.Nt(this.jo)),(t,e)=>{(Ie(t)||Ae(t)||""===t)&&delete r[e]})}catch(t){}var n=this.fo.Nt(this.jo);if(n&&(this.props=In({},n)),this.Eo&&this.ma(),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.Ro=!0,Ea.Ot(Jb(this.jo),!0);var d=In({},this.props);ga.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(i_(d,r),delete d[ct]),this.props=d;var v=new Set;ga.forEach(t=>{var e,i=null==(e=Vb(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};Mn(this.props,(i,r)=>{var n;(null==(n=Vb(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(pa.Dt(this.Wo(t)),this.To[t]={}):pa.Ot(this.Wo(t),e)&&(this.To[t]={persisted:!0,fingerprint:this.Yo(e,t)})})}}Ea.Lt(Jb(this.jo))&&(this.Ro=!0)}}ma(){for(var t of zb){var e=pa.Nt(this.Wo(t));if(e&&!Me(e)){var i=this.Zo(t);i.persisted=!0,this.ya(t)||(i.fingerprint=this.Yo(e,t)),this.ba(t,e)||In(this.props,e)}}}ya(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=Vb(e))?void 0:i.storageGroup)===t})}ba(t,e){var i=Gb[t];if(!i)return!1;var r=e[i],n=this.props[i];return Fe(r)&&Fe(n)&&n>r}refreshKey(t){var e;if(!(this.gi||"$fbc_persistence"===t&&this.Do)){var i=this.Eo?null==(e=Vb(t))?void 0:e.storageGroup:void 0,r=i?pa.Nt(this.Wo(i)):this.fo.Nt(this.jo);if(r&&t in r)this.ea(t,r[t],!1);else{if(i){var n=this.fo.Nt(this.jo);if(n&&t in n)return void this.ea(t,n[t],!1)}this.ia(t,!1)}}}save(){if(!this.gi){var t=this.aa();t>0?Ie(this.fa)&&(this.fa=setTimeout(()=>{this.fa=void 0,this.pa()},t)):this.pa()}}flush(){Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0,this.pa())}pa(t){if(void 0===t&&(t=!1),!(this.gi||this.Ao&&!t)){t||(this.syncCookieProperties(),this.Do||this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.Fo;e||(this.$o=!1);var i=!!e&&this.ra();if(this.$o)this.Rn.debug&&xn.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.Eo)return this._a(),void(i&&this.Lo.forEach(t=>t()));var r=this.wa(this.fo,this.jo,this.props,Kb);"written"===r&&this.la(this.props),"failed"!==r&&(this.Po.clear(),this.Oo=!1,this.Do=!1),i&&this.Lo.forEach(t=>t())}}}_a(){var t=this,e=this.Ko(),i=e.main,r=e.groups,n=this.wa(this.fo,this.jo,i,Kb);"written"===n&&this.la(i),"failed"!==n&&(this.Oo=!1,this.Do=!1,Xb.forEach(t=>{var e;null!=(e=Vb(t))&&e.storageGroup||this.Po.delete(t)}));var s=function(e){var i,n=r[e];if(Me(n)&&(null==(i=t.To[e])||!i.persisted))return Xb.forEach(i=>{var r;(null==(r=Vb(i))?void 0:r.storageGroup)===e&&t.Po.delete(i)}),1;var s=t.wa(pa,t.Wo(e),n,e);"failed"!==s&&Xb.forEach(i=>{var r=Vb(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Po.delete(i)})};for(var o of zb)if(s(o))continue}Ko(){var t={},e={flags:{},surveys:{}};return Mn(this.props,(i,r)=>{var n,s=null==(n=Vb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Yo(t,e){if(e===Kb)return JSON.stringify(t)+"|"+this.ka+"|"+this.Sa+"|"+this.xa;var i={};return Mn(t,(t,e)=>{var r;i[e]=null!=(r=Vb(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}wa(t,e,i,r){var n,s=this.Zo(r);if(r!==Kb&&!s.dirty&&!Ie(s.fingerprint))return"skipped";try{if((n=this.Yo(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.Ot(e,i,this.ka,this.Sa,this.xa,this.Rn.debug)?(s.dirty=!1,r!==Kb&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this.Mo&&(s.storageValue=pa.Lt(e)),"written"):(this.Rn.debug&&xn.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.sa(),Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),this.fo.Dt(this.jo,!1),this.fo.Dt(this.jo,!0),!i&&this.No)for(var r of zb)pa.Dt(this.Wo(r));i?delete this.To[Kb]:this.To={},this.ua=void 0,this.ha=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Te(t)){this.syncCookieProperties(),Ie(e)&&(e="None"),this.ka=Ie(i)?this.Ca:i;var r=!1;if(Mn(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ea(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(Te(t)){this.syncCookieProperties(),this.ka=Ie(e)?this.Ca:e;var i=!1;if(Mn(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Te(e)||xe(e))&&(this.ea(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.ia(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.qo){var e=ol(this.Rn.custom_campaign_params,this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties),i=!Me(Pn(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)?ll(t):{})}update_referrer_info(){var t;this.register_once({$referrer:dl(),$referring_domain:null!=h&&h.referrer&&(null==(t=jn(h.referrer))?void 0:t.host)||hl},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=vl(this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties,this.Rn.disable_capture_url_hashes);this.register_once({[Dt]:this.Io?{r:Qb(t.r),u:t.u?Qb(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Mn([$t,Ot],e=>{var i=this.props[e];i&&Mn(i,function(e,i){t["$initial_"+ce(i)]=e})});var e=this.props[Dt];return e&&In(t,function(t,e){void 0===e&&(e=!1);var i=cl(t,e),r={};return Mn(i,function(t,e){r["$initial_"+ce(e)]=t}),r}(e,this.Rn.disable_capture_url_hashes)),t}safe_merge(t){return Mn(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.da(e,u),this.Rn=t,!l&&(r||s||a)&&(this.ua=void 0,this.ha=void 0,this.da(n({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Bo(t):this.fo;this.Ta();var d=this.Ho(t),v=o||d!==this.Eo,c=!l&&(v||t.cross_subdomain_cookie!==this.Sa||t.secure_cookie!==this.xa)&&this.va(u);this.Fo=v;try{if(this.Ca=this.ka=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.fo=h,this.Eo=d,this.props=f,this.save()}else a&&(this.fo=h,l||(delete this.To[Kb],this.pa()))}finally{this.Fo=!1,c&&this.ga()}}Ta(){var t=this.props[Dt];if(this.Io&&Te(t)&&"string"==typeof t.r){var e=Qb(t.r),i="string"==typeof t.u?Qb(t.u):t.u;e===t.r&&i===t.u||this.ea(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.Sa&&(this.Sa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.xa&&(this.xa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.ea(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Ie(i)||(delete e[t],this.ea(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ea(t,e),this.save()}ea(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.Oo=!0),"$fbc_persistence"!==t||t_(n,e)||(this.Do=!0),this.oa(t,n,e),null!=(r=Vb(t))&&r.volatile||this.na(t))}ia(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(Yb(t)&&this.Go(t,!0),"$fbc_persistence"===t&&(this.Do=!0),this.na(t))}na(t){var e,i=null==(e=Vb(t))?void 0:e.storageGroup;i&&(this.Zo(i).dirty=!0)}Zo(t){return this.To[t]||(this.To[t]={})}},n_=Cn("[RateLimiter]"),s_=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=>{n_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void n_.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=(Fe(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ma(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}Ia(t){var e=this.instance.config.property_denylist;return!xe(e)||!e.includes(t)}Ea(){var t;if(this.Ia("$current_url")&&this.Ia("$pathname")&&null!=d&&d.pathname)return""+(null!==(t=d.origin)&&void 0!==t?t:"")+d.pathname}Ma(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Ea(),o=this.Ia("$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}},o_=Cn("[RemoteConfig]"),a_=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}Ra(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()}Aa(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 o_.info("Using preloaded remote config",this.remoteConfig),void this.Pa(this.remoteConfig);if(this._instance.Fa())return void o_.warn("Remote config is disabled. Falling back to local config.");this.Ra(t=>{if(!t)return o_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Aa(t=>{this.Pa(t.json,t)});this.Pa(t)})}catch(t){o_.error("Error loading remote config",t),this.Pa()}}Pa(t,e){!t&&e&&(0===e.statusCode?e.error||o_.warn("Failed to fetch remote config from PostHog."):o_.error("Failed to fetch remote config from PostHog."));try{this._instance.Pa(t?{ok:!0,config:t}:{ok:!1})}catch(t){o_.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){o_.error("Error loading feature flags",t)}}},l_=!!c||!!v,u_="text/plain",h_=!1,d_=(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:"")},v_=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=Bn(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},c_=t=>{if(t.Oa)return t.Oa;var e=t.data,i=t.compression;if(e){if(i===Df){var r=Xo(Yo(qn(e)),{mtime:0});return{contentType:u_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Lf){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:qn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(qn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=qn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},f_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:v_(t.url,{compression:Lf}),encodedBody:c_(n({},t,{compression:Lf,Oa:void 0}))}:{url:d_(t.url,"compression"),encodedBody:c_(n({},t,{compression:void 0,Oa:void 0}))};try{e=c_(t)}catch(e){if(Zr(t.compression,Hn(t.url,"compression")))return xn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Zr(t.compression,Hn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Gr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Gr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(h_=!0,r()):{url:t.url,encodedBody:e}},p_=t=>{try{return f_(t)}catch(e){return xn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},g_=function(){var t=o(function*(t){var e=yield Yr(qn(t.data),Ra.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return n({},t,{Oa:{contentType:u_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),m_=/Failed to fetch|NetworkError|Load failed/i,y_=t=>"TypeError"===(null==t?void 0:t.name)&&m_.test((null==t?void 0:t.message)||""),b_=t=>{var e=p_(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;Mn(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)}},__=t=>{var e=p_(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;Mn(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)||y_(e)?xn.warn(e):xn.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.$a&&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){xn.error(t)}null==t.callback||t.callback(r)})).catch(p).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),p(t)}}},w_=t=>{try{var e,i=f_(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=xe(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(xe(d)&&d.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(d.length/2),f=e=>xe(t.data)?e:n({},t.data,{batch:e});return w_(n({},t,{data:f(d.slice(0,c))})),void w_(n({},t,{data:f(d.slice(c))}))}xn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(v?"fetch":"XHR")),v?__(n({},t,{$a:!0})):b_(t)}catch(t){xn.warn("Beacon send failed",t)}},k_=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return v_(i===Df?d_(t,"compression"):t,n({},s?{[s]:Date.now().toString()}:{},i===Df?{}:{compression:i}))},S_=[];v&&S_.push({transport:"fetch",method:__}),c&&S_.push({transport:"XHR",method:b_}),null!=u&&u.sendBeacon&&S_.push({transport:"sendBeacon",method:w_});var x_=class{constructor(t,e){this.Da=!0,this.La=[],this.Na=Ge((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,xn.createLogger("flush interval"),3e3),this.qa=t}enqueue(t){this.La.push(t),this.ja||this.Ba()}unload(){this.Ha();var t=this.La.length>0?this.za():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Ua(n({},t,{transport:"sendBeacon"}))})}enable(){this.Da=!1,this.Ba()}Ba(){var t=this;this.Da||(this.ja=setTimeout(()=>{if(this.Ha(),this.La.length>0){var e=this.za(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&xe(i.data)&&Mn(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.Ua(i)};for(var r in e)i()}},this.Na))}Ua(t){try{this.qa(t)}catch(t){xn.error(t)}}Ha(){clearTimeout(this.ja),this.ja=void 0}za(){var t={};return Mn(this.La,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;Ie(t[s])&&(t[s]=n({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.La=[],t}},C_=class{constructor(t){this._instance=t,this.Wa=!1,this.Va=3e3,this.La=[],this.La=[],this.Ga=!0,!Ie(a)&&"onLine"in a.navigator&&(this.Ga=a.navigator.onLine,this.Za=()=>{this.Ga=!0,this.Ja()},this.Qa=()=>{this.Ga=!1},Dn(a,"online",this.Za),Dn(a,"offline",this.Qa))}get length(){return this.La.length}retriableRequest(t){var i=t.retriesPerformedSoFar,s=r(t,e);Oe(i)&&(s.url=v_(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.ws(n({retriesPerformedSoFar:i},s));0===t.statusCode&&xn.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)}}))}ws(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.La.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),xn.warn(n),this.Wa||(this.Wa=!0,this.Ka())}Ka(){if(this.Xa&&clearTimeout(this.Xa),0===this.La.length)return this.Wa=!1,void(this.Xa=void 0);this.Xa=setTimeout(()=>{this.Ga&&this.La.length>0&&this.Ja(),this.Ka()},this.Va)}Ja(){var t=Date.now(),e=[],i=this.La.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.La=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Xa&&(clearTimeout(this.Xa),this.Xa=void 0),this.Wa=!1,Ie(a)||(this.Za&&(a.removeEventListener("online",this.Za),this.Za=void 0),this.Qa&&(a.removeEventListener("offline",this.Qa),this.Qa=void 0)),this.La)){var e=t.requestOptions;try{this._instance._send_request(n({},e,{transport:"sendBeacon"}))}catch(t){xn.error(t)}}this.La=[]}},T_=class{constructor(t){this._instance=t,this.Ya=()=>{var t,e,i,r;this.tl||(this.tl={});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.tl.lastScrollY=Math.ceil(s),this.tl.maxScrollY=Math.max(s,null!==(t=this.tl.maxScrollY)&&void 0!==t?t:0),this.tl.maxScrollHeight=Math.max(o,null!==(e=this.tl.maxScrollHeight)&&void 0!==e?e:0),this.tl.lastContentY=a,this.tl.maxContentY=Math.max(a,null!==(i=this.tl.maxContentY)&&void 0!==i?i:0),this.tl.maxContentHeight=Math.max(l,null!==(r=this.tl.maxContentHeight)&&void 0!==r?r:0)}}get el(){return this._instance.config.scroll_root_selector}getContext(){return this.tl}resetContext(){var t=this.tl;return setTimeout(this.Ya,0),t}startMeasuringScrollPosition(){Dn(a,"scroll",this.Ya,{capture:!0}),Dn(a,"scrollend",this.Ya,{capture:!0}),Dn(a,"resize",this.Ya)}scrollElement(){var t;if(!this.el)return null==a||null==(t=a.document)?void 0:t.documentElement;for(var e of xe(this.el)?this.el:[this.el]){var i,r=null==a||null==(i=a.document)?void 0:i.querySelector(e);if(r)return r}}il(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.el){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.il("y")}scrollX(){return this.il("x")}},M_=t=>vl(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),I_=class{constructor(t,e,i,r){this.Be=t=>{var e=this.rl();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.nl(this._instance)};this.sl.register({[Pt]:i})}},this._instance=t,this.ol=e,this.sl=i,this.nl=r||M_,this.ol.onSessionId(this.Be)}rl(){return this.sl.props[Pt]}getSetOnceProps(){var t,e=null==(t=this.rl())?void 0:t.props;return e?"r"in e?cl(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 Mn(Pn(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ce(i)]=e}),t}},E_=class{on(t,e){return this.al[t]||(this.al[t]=[]),this.al[t].push(e),()=>{this.al[t]=this.al[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.al[t]||[])i(e);for(var r of this.al["*"]||[])r(t,e)}constructor(){this.al={}}},R_=Cn("[SessionId]"),A_=864e5,P_=class{on(t,e){return this.ll.on(t,e)}constructor(t,e,i){var r;if(this.ul=null,this.hl=null,this.dl=[],this.vl=void 0,this.cl=!1,this.ll=new E_,this.fl=(t,e)=>!(!Oe(t)||!Oe(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.Rn=t.config,this.sl=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.pl=void 0,this._sessionActivityTimestamp=null,this.gl=e||la,this.ml=i||la;var n=this.Rn.persistence_name||this.Rn.token;if(this._sessionTimeoutMs=1e3*Ge(this.Rn.session_idle_timeout_seconds||1800,60,36e3,R_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.yl(),this.bl="ph_"+n+"_window_id",this._l="ph_"+n+"_primary_window_exists",this.wl()){var s=Ea.Nt(this.bl),o=Ea.Nt(this._l);s&&!o?this.He=s:Ea.Dt(this.bl),Ea.Ot(this._l,!0)}null!=(r=this.Rn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Rn.bootstrap.sessionID),this.kl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ie(this.dl)&&(this.dl=[]),this.dl.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.dl=this.dl.filter(e=>e!==t)}}wl(){return"memory"!==this.Rn.persistence&&!this.sl.gi&&Ea.Et()}Sl(t){t!==this.He&&(this.He=t,this.wl()&&Ea.Ot(this.bl,t))}xl(){return this.He?this.He:this.wl()?Ea.Nt(this.bl):null}Cl(t){var e=this.ul;return!Ae(e)&&!Ae(t)&&5e3>Math.abs(t-e)}Tl(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.Cl(e)||(this.ul=e,this.sl.register({[G]:[e,t,i]}))}Ml(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return Oe(e)&&e>0}Il(){this.Ml()?this.sl.refreshKey(G):(this.sl.flush(),this.sl.load())}El(){var t;if(!Ae(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ul){this.Il();var e=this.Rl();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this.ul=this._sessionActivityTimestamp,this.sl.register({[G]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.sl.flush())}}Al(){var t=this.Rl()[0],e=Oe(t)?t:0,i=Oe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Pl(t){return this.Il(),this.fl(t,this.Al())}Rl(){var t=this.sl.props[G];return xe(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ul=null,this.pl=void 0,clearTimeout(this.Fl),this.Fl=void 0,this.Tl(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 R_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void R_.error("Invalid sessionID in bootstrap",t)}}(t);return!Ie(i)&&(e?this.pl={sessionId:t,sessionStartTimestamp:i}:this.Tl(t,(new Date).getTime(),i),!0)}destroy(){this.cl=!0,this.El(),clearTimeout(this.Fl),this.Fl=void 0,this.vl&&a&&(a.removeEventListener(ne,this.vl,{capture:!1}),this.vl=void 0),this.dl=[]}kl(){this.vl=()=>{this.El(),this.wl()&&Ea.Dt(this._l)},Dn(a,ne,this.vl,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.Rn.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.hl=r;else if(Ae(this.hl)||this.hl>r||r-this.hl>=1e3){var s,o;null==(s=(o=this.sl).syncCookieProperties)||s.call(o),this.hl=r}var a=this.Rl(),l=a[1],u=a[2],h=!Ie(n)&&l!==n,d=this.Al(),v=this.xl(),c=this.pl,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>A_),p=c?f:Oe(u)&&Math.abs(r-u)>A_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.fl(r,d);if(_){(_=this.Pl(r))||R_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Rl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.gl(),v=this.ml(),R_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.pl=void 0,g=!0}else v||(v=this.ml(),g=!0),(m=m||l!==b)&&(R_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=Oe(d)&&t&&!p?d:r,x=Oe(u)?u:(new Date).getTime();this.Sl(v),this.Tl(l,S,x),t||this.yl();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.dl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}yl(){this.cl||(clearTimeout(this.Fl),this.Fl=setTimeout(()=>{if(!this.cl)if(this.Pl((new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.ll.emit("forcedIdleReset",{idleSessionId:t})}else this.yl()},1.1*this.sessionTimeoutMs))}},F_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&he(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>he(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function O_(){return O_=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 Ee(i)&&i.length>0?i:void 0}catch(t){return void xn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),O_.apply(this,arguments)}var $_="custom",D_="i.posthog.com",L_=/^\/static\//,N_=["/s/","/e/","/i/"],q_=class{constructor(t){this.Ol={},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("."+D_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ol[this.apiHost]||(this.Ol[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":$_),this.Ol[this.apiHost]}$l(t){if(L_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Dl(t){var e=jn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ll(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=jn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&N_.some(t=>0===e.indexOf(t))){var a=this.Dl(r);if(a){var l,u=this.apiHost,h=this.Nl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Nl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Nl,i=this.Dl(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.Ll(t,e,this.uiHost+e);if("flags"===t)return this.Ll(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.$l(e);if(i)return this.Ll(t,e,""+i+e)}if(this.region===$_)return this.Ll(t,e,this.apiHost+e);var r=D_+e;switch(t){case"assets":return this.Ll(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ll(t,e,"https://"+this.region+"."+r)}}},j_=Cn("[PostHog ExternalIntegrations]"),B_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},H_=class{constructor(t){this._instance=t}bo(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return j_.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.bo(B_[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()}}},z_=class{constructor(t,e){this.A=t,this.Js=e,this.ql=new Map,this.ro=!1}add(t){var e=this;return o(function*(){if(e.ro)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.Js);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.jl(t)}})()}getExtension(t){return this.ql.get(t)}dispose(){if(!this.ro){this.ro=!0;var t=Array.from(this.ql.values()).reverse();for(var e of(this.ql.clear(),t))this.jl(e)}}jl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Ce(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)}}},U_=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);Ie(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)}},W_="extensionsRemoteConfig",V_=class{constructor(t){this.instance=t,this.ro=!1,this.A=xn,this.Bl=t.Hl,this.kv=new U_(t),this.onEvent=t=>cp(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.ro)return cp(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.zl.on(W_,e);return this.Bl&&e(this.Bl),cp(i)},this.Ul=new z_(xn.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:Ra.LIB_NAME,version:Ra.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.Ul.add(t)}getExtension(t){return this.Ul.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 cp(this.instance.Wl(t))}handleRemoteConfig(t){this.ro||(this.Bl=t,this.instance.zl.emit(W_,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?v_(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?ge.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.ro||(this.ro=!0,this.Ul.dispose())}},G_={},Z_=0,J_=()=>{},Q_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',K_="Surveys module not available",X_="sanitize_properties is deprecated. Use before_send instead",Y_="Invalid value for property_denylist config: ",tw=/^[A-Za-z0-9_-]{1,400}$/,ew=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,iw=["token","distinct_id",qt],rw="posthog",nw=!l_&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),sw=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},ow=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:$n(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:J_,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&&Ee(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){xn.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:J_},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:vs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:sw(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))},aw=[["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"]],lw=t=>{var e={};for(var i of aw){var r=i[0],n=i[1];Ie(t[r])||(e[n]=t[r])}var s=In({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ie(o)||(Ie(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Ee(o)&&Ie(t.asset_host)&&(s.asset_host=o)),xe(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:xe(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:xn.error(Y_+t.property_denylist)),s},uw=class{constructor(){this.__forceAllowLocalhost=!1}get Vl(){return this.__forceAllowLocalhost}set Vl(t){xn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},hw=(s=class t{Gl(t){if(t){var e=this.ql.indexOf(t);-1!==e&&this.ql.splice(e,1)}}Zl(t,e){return this.Gl(t),this.ql.push(e),null==e.initialize||e.initialize(),e}Jl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ql(){if(!(this.Kl||this.config.reuseAnonymousId||this.config.segment||this.Jl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Xl||(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.Kl=!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)))}}Yl(){if(!this.Jl()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.tu()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(la());this.register({distinct_id:i,$device_id:i}),t.set_property(At,te)}this.eu()}}}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.iu=!1,this.webPerformance=new uw,this.ru=!1,this.version=Ra.LIB_VERSION,this.nu=new Set,this.su="",this.zl=new E_,this.ql=[],this.ou=[],this.Xl=!1,this.Kl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ow(),this.SentryIntegration=Bb,this.sentryIntegration=t=>function(t,e){var i=jb(t,e);return{name:qb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.au=!1,this.lu=null,this.uu=null,this.hu=null,this.scrollManager=new T_(this),this.pageViewManager=new Hb(this),this.rateLimiter=new s_(this),this.requestRouter=new q_(this),this.consent=new Pb(this),this.externalIntegrations=new H_(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=Ee(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Ee(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>xn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==rw){var n,s=null!==(n=G_[r])&&void 0!==n?n:new t;return s._init(e,i,r),G_[r]=s,G_[rw][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,s,o;void 0===e&&(e={});var l,u=Ee(t)?t.trim():"";if(!u)return xn.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=ow(e.defaults),e.debug=this.du(e.debug),this.vu=e,this.cu=[],e.person_profiles?this.uu=e.person_profiles:e.process_person&&(this.uu=e.process_person);var h=ow(e.defaults),d=lw(e),v=In({},h,d,{name:i,token:u});Te(h.rageclick)&&Te(d.rageclick)&&(v.rageclick=In({},h.rageclick,d.rageclick)),Te(h.session_recording)&&Te(d.session_recording)&&(v.session_recording=In({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&xn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Df;var c=this.tu();if(this.persistence=new r_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r_(n({},this.config,{persistence:"sessionStorage"}),c,!1),this.su="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&Ea.Et()){var f=Ea.Nt(this.su);xe(f)&&f.forEach(t=>{Ee(t)&&this.nu.add(t)})}else Ea.Dt(this.su);var p=n({},this.persistence.props),g=n({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.fu=new x_(t=>this.pu(t),this.config.request_queue_config),this.gu=new C_(this),this.__request_queue=[];var m=this.Jl();m||(this.sessionManager=new P_(this),this.sessionPropsManager=new I_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.mu()})),this.yu(),this.config.__preview_deferred_init_extensions?(xn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.bu(m)},0)):(xn.info("Initializing extensions synchronously"),this.bu(m)),Ra.DEBUG=Ra.DEBUG||this.config.debug,Ra.DEBUG&&xn.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.Xl=!!y&&!Re(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)xn.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(la()),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(la());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(At,te)}return Dn(a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Dn(a,"pageshow",()=>{this.iu=!1}),e.segment?Nb(this,()=>this._u()):this._u(),Ce(this.config._onCapture)&&this.config._onCapture!==J_&&(xn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&xn.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 O_.apply(this,arguments)}().then(t=>{t&&this.register({[S]:t})}).catch(J_),this}wu(t){var e=t;return Ee(e.name)&&Ce(e.setup)}ku(t,e){this.wu(t)?e.push(()=>{this.Su().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{xn.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.ql.push(t)}yu(){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.xu)||o.call(this),this.xu=void 0,this.featureFlags=new a(this)),Ce(this.featureFlags.onReloading)&&Ce(this.featureFlags.setup)?this.xu||(this.xu=this.featureFlags.onReloading(()=>{this.zl.emit("featureFlagsReloading",!0)}),this.Su().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}bu(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.ku(this.autocapture=new d.autocapture(this),v),d.surveys&&this.ku(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.ku(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,$b)),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.Cu){var t=this.Cu;this.Cu=void 0,this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Tu(v,h)}Tu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Tu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){xn.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&&xn.info("PostHog extensions initialized ("+r+"ms)")}Pa(t){var e;if(!h||!h.body)return xn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Pa(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Cu=t),this.Hl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=de(r.supportedCompression,Df)?Df:de(r.supportedCompression,Lf)?Lf:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.uu?this.uu:ie}),null==(e=this.Mu)||e.handleRemoteConfig(t),this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}_u(){try{this.config.loaded(this)}catch(t){xn.critical("`loaded` function failed",t)}if(this.Iu(),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.Jl())&&this.Eu()},1),this.Ru=new a_(this),this.Ru.load()}Iu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.fu)||t.enable())}_dom_loaded(){this.is_capturing()&&Tn(this.__request_queue,t=>this.pu(t)),this.__request_queue=[],this.Iu()}_handle_unload(){var t,e,i,r,n;this.iu=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Au()&&this.capture(oe),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.fu)||r.unload(),null==(n=this.gu)||n.unload()):this.Au()&&this.capture(oe,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?nw?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,(Ie(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&&Ie(s.compression)&&s.data&&(s.compression=Lf),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=(xe(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()),xe(t)?t.map(t=>n({},t,{sent_at:e})):n({},t,{sent_at:e})}(s.data))),s.url=k_(s.url,s.method,s.compression,s.timestampMode);var v=S_.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){y_(t)?xn.warn(t):xn.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===Df&&p&&"undefined"!=typeof Promise&&!h_?g_(s).then(t=>{f(t)}).catch(e=>{if(Jr(e))return h_=!0,void f(n({},s,{compression:void 0,url:k_(t.url,t.method,void 0,t.timestampMode)}));Qr(e)&&(h_=!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}))}pu(t){this.gu?this.gu.retriableRequest(t):this._send_request(t)}_execute_array(t){Z_++;try{var e,i=[],r=[],n=[];Tn(t,t=>{if(t)if(xe(e=t[0]))n.push(t);else if(Ce(t))try{t.call(this)}catch(e){xn.error("Error executing queued PostHog call",t,e)}else xe(t)&&"alias"===e?i.push(t):xe(t)&&-1!==e.indexOf("capture")&&Ce(this[e])?n.push(t):r.push(t)});var s=function(t,e){Tn(t,function(t){try{if(xe(t[0])){var i=e;Mn(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){xn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{Z_--}}push(e){if(Z_>0&&xe(e)&&Ee(e[0])){var i=t.prototype[e[0]];Ce(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Pu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Ee(e)&&ew.test(e)?{value:e,delivered:!1}:Te(e)&&Ee(e.value)&&ew.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Fu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Pu();if(!r){if(i)return Ee(e)&&ew.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(Ee(t)&&tw.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)}}Ou(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Pu();(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.fu){if(this.is_capturing())if(!Ie(t)&&Ee(t)){this.Yl();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&&!Ee(null==e?void 0:e.$current_url)&&(xn.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.$u||xn.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,la),_={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=Te(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=xe(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.Fu(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.Du(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=>Ee(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),xe(e))r=[],Tn(e,e=>{r.push(t(e))});else{var n={};Mn(Be(e)?Fn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),_.timestamp=y,Ie(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 Wr.forEach(r),e.forEach(r),i}(_.properties,iw)),t===ep||t===ip){var F=null==e?void 0:e[rp],O=null==e?void 0:e[sp];bp({id:F,current_iteration:O}),_.$set=n({},_.$set,{[Da({id:F,current_iteration:O},t===ip?"responded":"dismissed")]:!0})}else t===tp&&(_.$set=n({},_.$set,{[hp]:(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(Me(L)||this.setPersonPropertiesForFlags(L),!Pe(this.config.before_send)){var N=this.bs(_);if(!N)return;(_=N).uuid=sr(_.uuid,la)}var q=null!==(o=null==(a=_.$set)?void 0:a.$fbc)&&void 0!==o?o:Te(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.zl.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.Ou(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?(!z.transport&&!z.callback&&Me(null!==(B=this.config.request_headers)&&void 0!==B?B:{})&&this.iu&&(z.transport="sendBeacon"),this.pu(z)):this.fu.enqueue(z),_}xn.critical("This capture call is ignored due to client rate limiting.")}}else xn.error("No event name provided to posthog.capture")}else xn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.Mu)?void 0:e.getExtension(t)}Su(){var t;return null!==(t=this.Mu)&&void 0!==t?t:this.Mu=new V_(this)}Wl(t){this.ou.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.ou.indexOf(t);-1!==i&&this.ou.splice(i,1)}}}Lu(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.hu=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.nu.clear(),this.Nu()),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.Lu();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.Jl()&&(l[qt]=!0),"$snapshot"===t){var u=n({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Ee(l.distinct_id)&&!Fe(l.distinct_id)||Re(l.distinct_id))&&xn.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?[...il,...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}:{},_={};Ie(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;Ie(k)||(w.userAgentDataPlatform=k),Ie(S)||(w.maxTouchPoints=S),Ie(x)||(w.screenWidth=x),Ie(C)||(w.screenHeight=C),Ie(T)||(w.devicePixelRatio=T);var M,I=In(Pn({$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:fl(),$timezone_offset:pl()}),{$current_url:zn(r?ar(null==d?void 0:d.href):null==d?void 0:d.href,h,nl),$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:ul(),$browser_language_prefix:(M=ul(),"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:kn.LIB_NAME,$lib_version:kn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return kn.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=kn.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&&In(l,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&In(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(m=this.gu)?void 0:m.length}catch(t){l.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===$_&&(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=In(l,v),"$pageview"===t&&h&&(l.title=h.title),!Ie(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;Te(w)&&!Me(w)&&(l.$groups=n({},Te(k)?k:{},w)),Mn(["$referrer","$referring_domain"],t=>{t in b&&delete _[t]});var S={};if(this.ou.length>0)for(var x of this.ou.slice())try{In(S,x())}catch(t){xn.error("Failed to produce browser extension event properties",t)}(l=In({},c,b,_,n({},S,l))).$is_identified=this._isIdentified(),xe(this.config.property_denylist)?Mn(this.config.property_denylist,function(t){delete l[t]}):xn.error(Y_+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(xn.error(X_),l=C(l,t));var T=this.qu();return l.$process_person_profile=T,T&&!s&&this.ju("_calculate_event_properties"),l}Du(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.qu())return t;if(this.ru&&!i)return t;var n=In({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(xn.error(X_),n=s(n,"$set_once")),e&&(this.ru=!0),Me(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.Lu(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.nu.add(t)),this.Nu()}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.nu.delete(t),this.Nu()}Bu(t,e){this.register({[t]:e})}mu(){this.nu.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.nu.clear(),this.Nu()}Nu(){var t;if(this.su)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!Ea.Et())Ea.Dt(this.su);else{var e=[];this.nu.forEach(t=>e.push(t)),e.length>0?Ea.Ot(this.su,e):Ea.Dt(this.su)}}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.zl.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:K_}),()=>{})}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:K_})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:K_})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=wp),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:K_}}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:K_})}Hu(t){return!t||Re(t)?(xn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(xn.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())||(xn.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 xn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),xn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Hu(t)&&this.ju("posthog.identify")){this.Yl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Lu(!1),o=this.persistence.va(),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.ca(),this.capture(ae,c,{$set:e||{},$set_once:i||{}}),this.hu=Za(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.ca(),this.capture("$set",{$set:f,$set_once:p}),this.hu=Za(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.ga(a)}}}setPersonProperties(t,e){if((t||e)&&this.ju("posthog.setPersonProperties")){var i=Za(this.get_distinct_id(),t,e);this.hu!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.hu=i):xn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(xe(t)?t:[t]).filter(t=>Ee(t)&&t.length>0);0!==i.length&&this.ju("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.hu=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Lu();var s=this.getGroups(),o=s[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:n({},s,{[t]:e})}),(o||i)&&this.qu()){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 xn.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.ju("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=$e(t)?t:null==t?void 0:t.resetDeviceID,i=$e(t)||null==t?void 0:t.bootstrap;this.zu(e,!1,i)}zu(t,e,i){var r,s,o,a;if(void 0===e&&(e=!1),xn.info("reset"),!this.__loaded)return xn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.vu)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Fa());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.va?void 0:a.va(),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.nu.clear(),this.Nu(),Ie(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.hu=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Nt,$device_id:null},"");else{var R=this.config.get_device_id(la());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[S]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Jl()||(null==(E=this.persistence)||E.set_property(At,i.isIdentifiedID?ee:te),this.register({distinct_id:i.distinctID})),null==(M=this.featureFlags)||M.initialize(),!(Ie(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.ga||P.ga(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return o(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.Su().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.fu)||n.unload(),null==(s=e.gu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){xn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else xn.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.Uu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Wu()}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")?(xn.critical("Attempting to create alias for existing People user - aborting."),-2):this.ju("posthog.alias")?(Ie(e)&&(e=this.get_distinct_id()),t!==e?(this.Bu(x,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(xn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=n({},this.config);if(Te(t)){var i,r,s,o,a,l,u,h,d,v,c,f,p;In(this.config,lw(t));var g=this.tu();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r_(n({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.du(this.config.debug);$e(m)&&(this.config.debug=m),$e(this.config.debug)&&(this.config.debug?(Ra.DEBUG=!0,pa.Et()&&pa.Ot("ph_debug",!0),xn.info("set_config",{config:t,oldConfig:e,newConfig:n({},this.config)})):(Ra.DEBUG=!1,pa.Et()&&pa.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Fa()),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.eu(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Nb(this,J_,!1)}}_overrideSDKInfo(t,e){Ra.LIB_NAME=t,Ra.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.Vu}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:rw;return e!==rw&&(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"))}qu(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Me(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}Au(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.qu()||this.ju("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ju("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ju(t){return"never"===this.config.person_profiles?(xn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ql(),this.Bu(Lt,!0),!0)}tu(){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)}eu(){var t,e,i,r,n,s=this.tu();return this.is_capturing()||null==(t=this.logs)||t.Gu(),(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.nu.clear(),this.Nu()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.Jl()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.zu(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new P_(this),this.pageViewManager=new Hb(this),this.persistence&&(this.sessionPropsManager=new I_(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.Zl(this.sessionRecording,new v(this)),this.Hl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Hl)))}this.consent.optInOut(!0),this.eu(),this.Iu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Ie(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.Eu()}else xn.warn(Q_)}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.zu(!0,!0),this.consent.optInOut(!1),this.eu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Nt,$device_id:null}),this.Gl(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.Eu(),this.Iu())}else xn.warn(Q_)}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.eu()}_is_bot(){return u?F_(u,this.config.custom_blocked_useragents):void 0}Eu(){h&&("visible"===h.visibilityState?this.au||(this.au=!0,this.capture(se,{title:h.title},{send_instantly:!0}),this.lu&&(h.removeEventListener(re,this.lu),this.lu=null)):this.lu||(this.lu=this.Eu.bind(this),Dn(h,re,this.lu)))}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}))}Fa(){var t=this.vu||{};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?(xn.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&&!Pe(t[e]),o=i in t&&!Pe(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,xn)}bs(t){var e;if(Pe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Ne),r=xe(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Pe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Le(t.event)?xn.warn(o+". This can cause unexpected behavior."):xn.info(o),null}n.properties&&!Me(n.properties)||xn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return xn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Pe(n.properties[a]))return xn.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.ko)?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)})}du(t){var e=$e(t)&&!t,i=pa.Et()&&"true"===pa.Lt("ph_debug");return!e&&(!!i||t)}},s.__defaultExtensionClasses={},s.Vu=(()=>{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]]=An(t.prototype[e[i]])}(hw,["identify"]);var dw=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Te(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.Fa(),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}},vw=Cn("[ExceptionAutocapture]"),cw=Cn("[TracingHeaders]"),fw=Cn("[Web Vitals]"),pw=9e5,gw=["CLS","FCP","INP","LCP"],mw=["INP","LCP"],yw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],bw=Cn("[SessionRecording]"),_w=Cn("[Heatmaps]");function ww(t){return Te(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var kw=Cn("[Product Tours]"),Sw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(L))},xw=Cn("[SiteApps]"),Cw="Error while initializing PostHog app with config id ",Tw=(t,e)=>null!=t&&t.then?t.then(e):e(t),Mw="SDK is not enabled or survey functionality is not yet loaded",Iw="Disabled. Not loading surveys.",Ew=class{constructor(t,e){this.Ks=t,this.Zu=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ju=!1,this.Qu=[],this.Ku=null,this.Xu=null,this.ro=!1,this.Yu=new Set,this.onRemoteConfig=t=>{if(!this.ro&&!this.Rn.disableSurveys){if(!t.ok)return fp.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Pe(e))return fp.warn("Flags not loaded yet. Not loading surveys.");this.th=$e(e)?e:e.length>0,fp.info("flags response received, isSurveysEnabled: "+this.th),this.loadIfEnabled()}}}setup(t){if(!this.ro)return this.eh=t,Tw(t.kv.initialize(),()=>{if(this.eh===t&&!this.ro){this.eh=void 0,this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.ro?e.dispose():(this.oo=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.ro||(this.ro=!0,this.eh=void 0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Qu=[],this.Ku=null,this.Yu.forEach(t=>clearTimeout(t)),this.Yu.clear())}get Rn(){return this.Ks.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.ro&&this.Js){var t=this.Rn;if(!this._surveyManager)if(this.Ju)fp.info("Already initializing surveys, skipping...");else if(t.disableSurveys)fp.info(Iw);else if(t.cookielessMode&&this.Ks.isOptedOut())fp.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ks.getExtensions();if(e){if(!Ie(this.th)||t.advancedEnableSurveys){var i=this.th||t.advancedEnableSurveys;this.Ju=!0;try{var r=e.generateSurveys;if(r)return this.ih(r,i),void(this.Ju=!1);var n=e.loadExternalDependency;if(!n)return this.rh(Yt),void(this.Ju=!1);n(t=>{try{if(this.ro)return;var e=this.Ks.getExtensions();t||null==e||!e.generateSurveys?this.rh("Could not load surveys script",t):this.ih(e.generateSurveys,i)}finally{this.Ju=!1}})}catch(t){throw this.Ju=!1,this.rh("Error initializing surveys",t),t}}}else fp.error("PostHog Extensions not found.")}}}ih(t,e){this.ro||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ks.createEventReceiver(),fp.info("Surveys loaded successfully"),this.nh({isLoaded:!0}))}rh(t,e){fp.error(t,e),this.nh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Qu.push(t),this._surveyManager&&this.nh({isLoaded:!0}),()=>{this.Qu=this.Qu.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Js)&&void 0!==i?i:this.Zu;if(r&&!this.ro){if(this.Rn.disableSurveys)return fp.info(Iw),t([]);var n=r.kv.get(pt);if(n&&!e)return t(n,{isLoaded:!0}),void(this.sh()&&this.getSurveys(()=>{},!0));if(this.Ku)this.Ku.then(e=>{this.ro||t(e.surveys,e.context)}).catch(t=>fp.error("Error in survey callback",t));else{var s=this.oh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{try{return this.ah(r,t)}catch(t){return fp.error("Error processing surveys response",t),this.ah(r,{statusCode:0,error:t})}},t=>this.ah(r,{statusCode:0,error:t}));this.Ku=s;var o=()=>{this.Ku===s&&(this.Ku=null)};s.then(e=>{o(),this.ro||t(e.surveys,e.context)},o).catch(t=>fp.error("Error in survey callback",t))}}}oh(t,e){var i=this.Js;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(Mw)}))}ah(t,e){var i;if(this.ro)return{surveys:[],context:{isLoaded:!1,error:Mw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?fp.error(n):e.error||fp.warn(n),this.Xu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Xu=null;var s=e.json.surveys||[],o=s.filter(t=>pp(t)&&(Ha(t)||gp(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}}}sh(){return this.uh()&&!this.Ku&&!this.hh()}uh(){var t,e,i=null==(t=null!==(e=this.Js)&&void 0!==e?e:this.Zu)?void 0:t.kv.get(gt);return Fe(i)&&Date.now()-i>3e5}hh(){return Fe(this.Xu)&&3e5>Date.now()-this.Xu}markSurveyAsSeen(t,e){var i;bp({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){}}nh(t){for(var e of this.Qu)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){fp.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Pe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);fp.warn("init was not called")}dh(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}fh(t){if(Pe(this._surveyManager))return{eligible:!1,reason:Mw};var e="string"==typeof t?this.dh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}ph(t){if(Pe(this._surveyManager))return{eligible:!1,reason:Mw};var e="string"==typeof t?this.dh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Pe(this._surveyManager))return fp.warn("init was not called"),{visible:!1,disabledReason:Mw};var e=this.ph(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Pe(this._surveyManager)?(fp.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Mw})):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.ph(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(Pe(this._surveyManager))fp.warn("init was not called");else{var n="string"==typeof t?this.dh(t):t;if(null!=n&&n.id)if(_p.includes(n.type)){var s=null==h?void 0:h.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){fp.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.Yu.delete(o),this.ro||(fp.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),fp.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.Yu.add(o)}else this._surveyManager.renderSurvey(n,s,i);else fp.warn("Survey element not found")}else fp.warn("Surveys of type "+n.type+" cannot be rendered in the app");else fp.warn("Survey not found")}}displaySurvey(t,e){var i;if(Pe(this._surveyManager))fp.warn("init was not called");else{var r=this.dh(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!==vp&&e.initialResponses&&fp.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.fh(r);if(!o.eligible)return void fp.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 fp.warn("Survey not found")}}cancelPendingSurvey(t){Pe(this._surveyManager)?fp.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function Rw(t,e,i){if(Pe(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 Aw=class{constructor(t){this._instance=t,this.gh=new Set,this.mh=new Set,this.yh=new E_,this.bh=(t,e)=>this._h(t,e)&&this.wh(t,e)&&this.kh(t,e)&&this.Sh(t,e),this._h=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Ie(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.xh=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.xh)||t.call(this),this.xh=void 0,this.yh=new E_}register(t){var e,i;if(!Ie(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.gh.add(t),null==(e=t.steps)||e.forEach(t=>{this.mh.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.gh.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.gh.clear(),this.mh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.mh.has(t)||this.mh.has(e.event))&&this.gh.forEach(t=>{this.Ch(e,t)&&this.yh.emit("actionCaptured",t.name)})}Th(t){this.onAction("actionCaptured",e=>t(e))}Ch(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.bh(t,i))return!0;return!1}onAction(t,e){return this.yh.on(t,e)}wh(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(!Rw(r,e.url,e.url_matching||"contains"))return!1}return!0}kh(t,e){return!!this.Mh(t,e)&&!!this.Ih(t,e)&&!!this.Eh(t,e)}Mh(t,e){var i;if(null==e||!e.href)return!0;var r=this.Rh(t);if(r.length>0)return r.some(t=>Rw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Rw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Ih(t,e){var i;if(null==e||!e.text)return!0;var r=this.Rh(t);if(r.length>0)return r.some(t=>Rw(t.text,e.text,e.text_matching||"exact")||Rw(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;!Pe(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=>Rw(t,s,o)))}Eh(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}Rh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Sh(t,e){return null==e||!e.properties||0===e.properties.length||Ga(e.properties.reduce((t,e)=>{var i=xe(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)}},Pw=class{constructor(t){var e;this.Ah=[],this._instance=t,this.Ph=new Map,this.Fh=new Map,this.Oh=new Map,this.$h=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Dh(t))}Lh(t){return!1}Nh(){return null}qh(t){}jh(){}Bh(t,e){return!!t&&Ga(t.propertyFilters,null==e?void 0:e.properties)}Hh(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}zh(t,e,i){var r=(i===Nf?this.Ph:this.Fh).get(t),n=[];return this.Uh(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.Bh(s,e)})}register(t){this.Wh(t,!1)}replace(t){this.Wh(t,!0)}Wh(t,e){var i;Ie(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Vh(t,e),this.Gh(t,e))}Gh(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.Oh.clear(),0!==i.length){this.Zh||(this.Zh=new Aw(this._instance),this.Zh.init(),this.Zh.Th(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.Oh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.Oh.set(e.name,n)}})}),e?this.Zh.replace(r):this.Zh.register(r)}else{var n;e&&(null==(n=this.Zh)||n.replace([]))}}Jh(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)})}Vh(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.Hh(t,Nf),a=this.Hh(t,qf);e?(this.Ph=o,this.Fh=a):(this.Jh(this.Ph,o),this.Jh(this.Fh,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.xh)&&void 0!==i||(this.xh=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.Qh(),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.Kh(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Xh([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Yh(s),void this.td([s])}if(this.Fh.has(t)){var a=this.zh(t,e,qf);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.Xh(a.map(t=>t.id)),a.forEach(t=>this.ed(t.id)))}if(this.Ph.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Ph.get(t)});var l=this.zh(t,e,Nf);this.rd(l.map(t=>t.id))}}onAction(t){this.Oh.has(t)&&this.rd(this.Oh.get(t)||[])}rd(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.Lh(n)?this.Yh(n)&&this.nd(n):r.push(n);r.length>0&&(this.Ah=[...new Set([...this.Ah,...r])]),this.Qh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Yh(t){this.Ah=this.Ah.filter(e=>e!==t);var e=this.sd();return!e.includes(t)&&(this.od([...e,t]),this.ad(),!0)}Xh(t){var e=new Set(t);this.Ah=this.Ah.filter(t=>!e.has(t));var i=this.ld(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.od(r),0===r.length&&this.ud()),this.td(t)}hd(){var t,e=this.Nh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}nd(t){if(this.Nh()){var e=this.hd();this.qh(n({},e,{[t]:Date.now()}))}}td(t){if(this.Nh()){var e=this.hd(),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&&(Me(i)?this.jh():this.qh(i))}}dd(){this.Nh()&&this.jh()}getActivationTimestamp(t){if(this.sd().includes(t)){var e=this.hd()[t];return Fe(e)?e:void 0}}ld(){var t,e=this.vd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}sd(){var t,e,i=this.ld();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.fd()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}ad(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.pd(e)}ud(){this.gd()}Dh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.fd()];if(i&&i!==t){var r=this.ld(),n=this.hd();r.length>0&&(this.od([]),r.filter(t=>Fe(n[t])).forEach(t=>this.ed(t))),this.ud(),this.dd()}}getActivatedIds(){return[...new Set([...this.sd(),...this.Ah])].filter(t=>!this.md(t))}dispose(){var t,e,i;null==(t=this.$h)||t.call(this),this.$h=void 0,null==(e=this.xh)||e.call(this),this.xh=void 0,null==(i=this.Zh)||i.dispose(),this.Zh=void 0}reset(){this.Ah=[],this.ld().length>0&&this.od([]),this.ud(),this.dd()}getEventToItemsMap(){return this.Ph}yd(){return this.Zh}},Fw=class extends Pw{constructor(t){super(t)}vd(){return mt}fd(){return yt}Nh(){return bt}qh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}jh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Lh(t){var e,i;this.Uh(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Fe(r)&&r>0}bd(){return tp}Uh(t){var e;null==(e=this._instance)||e.getSurveys(t)}ed(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Qh(){return fp}od(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[mt]:t})}pd(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}gd(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(yt)}md(){return!1}Kh(t,e){var i;return this.Uh(t=>{i=t.find(t=>t.id===e)}),!i||za(i)?t===tp?"consume":"ignore":t===tp?"persist":t===ep||t===ip?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Ow=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);Ie(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)}},$w=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()}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 Fw(this._instance)}},Dw=null!=a&&a.location?Un(a.location.hash,"__posthog")||Un(location.hash,"state"):null,Lw="_postHogToolbarParams",Nw=Cn("[Toolbar]"),qw=Cn("[FeatureFlags]"),jw=class{constructor(t,e){void 0===e&&(e=!1),this._d=!1,this.update(t,e)}update(t,e){this.wd=((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:xe(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this._d||(qw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._d=!0),Ie(t.flag_keys)||xe(t.flag_keys)||qw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.wd}},Bw=Cn("[FeatureFlags]"),Hw=Cn("[FeatureFlags]",{debugEnabled:!0}),zw="\" failed. Feature flags didn't load in time.",Uw="connection_error",Ww=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Vw=t=>{var e={};for(var i of En(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Gw="Refusing to render web experiment since the viewer is a likely bot",Zw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Ua(e,t),not_regex:(t,e)=>!Ua(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Jw=Cn("[Conversations]"),Qw="Conversations not available yet.";function Kw(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=Ie(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(ln,t)?ln[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 Xw=["debug","log","warn","error","info"],Yw="console",tk="__posthogHandledLogsRequestError",ek=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[tk]=!0,i},ik=t=>!!t&&"object"==typeof t&&!0===t[tk],rk={featureFlags:class{constructor(t){this.name="featureFlags",this.kd=!1,this.featureFlagEventHandlers=[],this.A=Bw,this.Sd={},this.xd={},this.Cd=[],this.Td=!1,this.Md=!1,this.Id=0,this.Ed=!1,this.Rd=!1,this.Ad=!1,this.Pd=!1,this.Fd=0,this.nr=()=>{var t=this.Od();this.Fd=0,t&&this.reloadFeatureFlags()},this.$d=()=>{var t,e=this.Dd;Ie(e)||this.Rn.remoteRequestsDisabled||!h||"hidden"===h.visibilityState||Date.now()-(null!==(t=this.Ld)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Nd())},this.ar=()=>{"visible"===(null==h?void 0:h.visibilityState)&&this.$d()},"get"in t?this.Ks=t:(this._instance=t,this.qd=new jw(t.config,t.Fa()),this.Ks=this.qd)}updateConfig(t,e){var i;null==(i=this.qd)||i.update(t,e),this.Js&&this.jd()}setup(t){return this.eh=t,this.A=t.logger.createLogger("[FeatureFlags]"),Tw(t.kv.initialize(),()=>{this.eh===t&&(this.eh=void 0,this.Js=t,this.Bd(t))})}Bd(t){var e;if(this.Js===t)return a&&Dn(a,"online",this.nr),this.jd(),this.Hd=t.registerDynamicEventProperties(()=>this.zd()?this.Sd:this.xd),this.Ud=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Wd(),this.Vd(),this.Gd()}),this.Vd(),this.initialize()}jd(){var t=this.Rn.refreshIntervalMs,e=!this.Rn.remoteRequestsDisabled&&h&&!Ie(t)&&t>0?t:void 0;e!==this.Dd&&(this.Zd(),Ie(e)||(this.Dd=e,this.Nd(),null!=h&&h.addEventListener&&Dn(h,re,this.ar)))}Nd(){Ie(this.Dd)||(Ie(this.Jd)||clearInterval(this.Jd),this.Ld=Date.now(),this.Jd=setInterval(this.$d,this.Dd))}Zd(){Ie(this.Jd)||(clearInterval(this.Jd),this.Jd=void 0,null==h||null==h.removeEventListener||h.removeEventListener(re,this.ar)),this.Dd=void 0,this.Ld=void 0}destroy(){this.Qd()}dispose(){this.Qd()}Qd(){var t,e;this.Zd(),this.Id++,this.Rd=!1,this.eh=void 0,this.Js&&(this.Kd(),null==(t=this.Hd)||t.dispose(),this.Hd=void 0,null==(e=this.Ud)||e.call(this),this.Ud=void 0,this.Cd=[],null==a||a.removeEventListener("online",this.nr),this.Js=void 0)}get Rn(){return this.Ks.get()}Xd(t){var e;return this.Yd&&t in this.Yd?this.Yd[t]:null==(e=this.Js)?void 0:e.kv.get(t)}Wd(){return!!this.Yd&&(this.Yd=void 0,!0)}tv(){var t;return!Ie(null==(t=this.Js)?void 0:t.kv.get("$enabled_feature_flags"))&&this.Wd()}Ot(t){this.ev(()=>{var e;return null==(e=this.Js)?void 0:e.kv.set(t)})}iv(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.Xd("$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&&!xe(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Xd("$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]))Ie(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}Dt(t){this.ev(()=>{var e;return null==(e=this.Js)?void 0:e.kv.remove(t)})}ev(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Vd(){var t={};for(var e of[nt,at,lt,ht]){var i=this.Xd(e);Ie(i)||(t[e]=i)}this.Sd=t;var r=n({},t),s=this.Xd(rt);if(s)for(var o of Object.entries(s))r["$feature/"+o[0]]=o[1];this.xd=r}zd(){var t=this.Rn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Xd(Rt);return"number"!=typeof e||Date.now()-e>t}rv(){return!!this.zd()&&(this.Pd||this.Md||(this.Pd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}nv(){var t=this.Rn.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}):[]}sv(){var t=this.Rn.flagKeys;if(!Ie(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.Rn,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=>!Ie(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.ov({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,s,o=null!=i&&i.merge&&null!==(r=this.Xd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.Xd("$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:Hr(c),variant:zr(c),reason:void 0,metadata:Ie(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.ov({flags:h})}get hasLoadedFlags(){return this.Td}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Xd(ot),e=this.Xd(ht),i=this.Xd(dt);if(!i&&!e)return t||{};var r=In({},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=Ie(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Ie(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.kd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.kd=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Hr(r),variant:zr(r),payload:Br(e[i])}})}getFlagVariants(){var t=this.Xd(rt),e=this.Xd(ht);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.kd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.kd=!0),i}getFlagPayloads(){var t=this.Xd(at),e=this.Xd(dt);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.kd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.kd=!0),i}reloadFeatureFlags(){this.Ed||this.Rn.featureFlagsDisabled||this.Od()||(this.Md&&(this.Rd=!0),this.av||(this.Cd.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.av=setTimeout(()=>{this.lv()},5)))}Kd(){clearTimeout(this.av),this.av=void 0}onReloading(t){return this.Cd.push(t),()=>{this.Cd=this.Cd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Td||this.Md||this.av||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ed=t}resetFlagCallReported(){this.Dt(Mt)}lv(t){this.Kd();var e=this.Js;if(e&&!this.Rn.remoteRequestsDisabled&&!this.Od())if(this.Md)this.Rd=!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.Xd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Xd(ct),timezone:fl()};Ie(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.Rn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.nv();r.length&&(i.evaluation_contexts=r);var s=this.sv();Ie(s)||(i.flag_keys=s);var o=this.Rn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.Id;this.Md=!0;var u=()=>{this.Rd&&(this.Rd=!1,this.lv())},h=t=>{this.Md=!1,l===this.Id?(this.Ot({[Et]:[Uw]}),this.A.error("Feature flag request failed",t),this.tv()&&this.Gd(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.Rn.compression,sentAt:"body",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this.Md=!1,l===this.Id){if(this.uv(t.statusCode),s||this.Rd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Rd){this.Ad=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Uw:"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.ov(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}Od(){return Wn(this.Fd,3)}uv(t){this.Fd=Vn(t,this.Fd,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.Ad)if(this.Td||this.getFlags()&&this.getFlags().length>0){if(!this.rv()){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+zw)}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.Ad)if(this.Td||this.getFlags()&&this.getFlags().length>0){if(!this.rv()){var i,r=this.getFlagVariants(),s=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.Xd("$feature_flag_request_id")||void 0,h=this.Xd("$feature_flag_evaluated_at")||void 0,d=this.Xd("$flag_call_reported")||{};if(this.Rn.deduplicateCallsPerSession){var v,c=null==(v=this.Js)?void 0:v.session.sessionId,f=this.Xd(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;xe(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.Xd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(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.Rn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.Rn.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.Ad};Ie(null==I||null==(_=I.metadata)?void 0:_.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Ie(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),Ie(null==I?void 0:I.original_variant)&&Ie(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Ie(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.hv(R)}else i&&this.Ot({[Mt]:d,[It]:i});if(s)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Br(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+zw)}hv(t){try{var e;null==(e=this.Js)||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.dv(t,e)}dv(t,e){var i=this;return o(function*(){var r=i.Js;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.nv();s.length&&(n.evaluation_contexts=s);var o,a=i.sv();Ie(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.Rn.compression,sentAt:"body",timeoutMs:i.Rn.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.Ad)return e.defaultValue;if(!(this.Td||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+zw),e.defaultValue;var i=this.getFeatureFlag(t,e);return Ie(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.ov(t,e,i)}ov(t,e,i){if(this.Js){this.Td=!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=Bw);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!Ie(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(xe(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(Vw(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=!Ie(this.Js.kv.get(rt));this.Yd=r,s||this.Ot(r)}else this.Wd(),this.iv(r,t,!(null==i||!i.partialResponse)),this.Ot(r);else e&&this.tv();e||(this.Pd=!1),this.Gd(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.vv(t)}vv(t){if(this.Js){if(!1===t)return this.Dt([ht,dt]),this.Gd(),void Hw.info("All overrides cleared");if(xe(t))return this.Ot({[ht]:Ww(t)}),this.Gd(),void Hw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.kd=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ht]=xe(n)?Ww(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.Gd(),!1===n?Hw.info("Flag overrides cleared"):n&&Hw.info("Flag overrides set",{flags:n}),void(!1===s?Hw.info("Payload overrides cleared"):s&&Hw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ot({[ht]:t}),this.Gd(),void Hw.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.Td){var e=this.fv(),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.Xd("$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(Vw(l)),[rt]:l,[vt]:n({},this.Xd("$stored_person_properties")||{},o)}),this.Gd();try{var u;null==(u=this.Js)||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.Xd(st);!r||e?this.pv(t,i):t(r)}pv(t,e){var i=this;return o(function*(){var r=i.Js;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)}}})()}fv(){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),{})}}Gd(t){this.Vd();var e=this.fv(),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.gv(t,e)}gv(t,e){void 0===e&&(e=!0);var i=this.Xd("$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.Xd("$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.Xd("$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.Xd("$stored_group_properties")||{};this.Ot({[ct]:n({},e,{[t]:{}})})}else this.Dt(ct)}reset(){this.Id++,this.Rd=!1,this.Sd={},this.xd={},this.Yd=void 0,this.Td=!1,this.Ed=!1,this.Ad=!1,this.$anon_distinct_id=void 0,this.Kd(),this.kd=!1,this.Fd=0}}},nk={sessionRecording:class{get Rn(){return this._instance.config}get sl(){return this._instance.persistence}get started(){var t;return!(null==(t=this.mv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.yv||"missing_config"===this.yv?this.yv:null!==(t=null==(e=this.mv)?void 0:e.status)&&void 0!==t?t:this.yv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.yv=Ws,this.bv=void 0,this._v=!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.mv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw bw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rn.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=h&&h.addEventListener&&Dn(h,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this._v=!0,null==h||null==h.removeEventListener||h.removeEventListener("visibilitychange",this.ar),i?this.wv(!0):this.stopRecording()}get Sv(){var t,e=!(null==(t=this._instance.get_property(j))||!t.enabled),i=!this.Rn.disable_session_recording,r=this.Rn.disable_session_recording||this._instance.consent.isOptedOut();return a&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this._v||this.Sv&&null!=(e=this.mv)&&e.isStarted)){var i=!Ie(Object.assign)&&!Ie(Array.from);this.Sv&&i?(this.xv(t),bw.info("starting")):(this.yv=Ws,this.stopRecording())}}xv(t){var e,i;if(this.Sv)if("awaiting_config"!==this.yv&&"missing_config"!==this.yv&&(this.yv=Qs),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.Cv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Tv,e=>{if(!this._v&&this.Sv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),bw.error("could not load recorder",e)):void this.Cv(t);this.yv=Ws})}}stopRecording(){var t,e;null==(t=this.bv)||t.call(this),this.bv=void 0,null==(e=this.mv)||e.stop()}wv(t){var e,i;void 0===t&&(t=!1),null==(e=this.bv)||e.call(this),this.bv=void 0,null==(i=this.mv)||i.discard({discardProducerEvents:t})}Mv(){var t,e;null==(t=this.sl)||t.unregister(Z),null==(e=this.sl)||e.unregister(H)}Iv(t,e){if(Pe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(bw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Ev(t){if(this.sl){var e,i,r=this.sl,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Iv(null==(e=this.Rn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Iv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Pe(a)&&this.Mv();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:Ie(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.bv)||e.call(this),this.bv=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.Ev(e),void this.wv()):(this.Ev(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.yv&&(this.yv="missing_config",bw.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.mv)&&i.log?this.mv.log(t,e):bw.warn("log called before recorder was ready")}get Tv(){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"}Rv(){var t,e=this._instance.get_property(j);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return bw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Pe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Cv(t){var e,i,r;if(!this._v&&this.Sv&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return bw.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.mv||(this.mv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Ke),this.mv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Rv()){if("missing_config"===this.yv||"awaiting_config"===this.yv)return;return this.yv="awaiting_config",bw.info("persisted remote config is stale, requesting fresh config before starting"),void new a_(this._instance).load()}this.yv=Qs,null==(i=(r=this.mv).setDocumentWasEverVisible)||i.call(r,this.Ke),this.mv.start(t)}else this.yv=Ws}onRRwebEmit(t){var e;null==(e=this.mv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.mv||null==(t=this.sl)||t.register({[U]:!0}),null==(e=this.mv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.mv||null==(t=this.sl)||t.register({[z]:!0}),null==(e=this.mv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.mv||null==(e=this.sl)||e.register({["url"===t?W:V]:!0}),null==(i=this.mv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.mv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.mv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.mv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},sk={autocapture:class extends mb{constructor(t){super(new dw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Av=this.Pv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Fv();return!!(t.path||t.search||this.Ov(t))}startIfEnabled(){this.isEnabled&&(xn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Av=this.Pv(),this.startIfEnabled()}stop(){this.$v&&this.$v(),this.$v=void 0,this.Dv&&this.Dv(),this.Dv=void 0,xn.info("History API monitoring stopped")}monitorHistoryChanges(){a&&a.history&&(this.Lv("pushState"),this.Lv("replaceState"),this.Nv(),this.Ov()&&this.qv())}Lv(t){var e;if(a&&(null==(e=a.history[t])||!e.__posthog_wrapped__)){var i=this;Gv(a.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.jv(t)})}}Pv(){var t=null==a?void 0:a.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Fv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Te(t)?t:{}}Ov(t){return void 0===t&&(t=this.Fv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Bv(t){var e=this.Fv(),i=this.Av;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.Ov(e)&&t.hash!==i.hash))}jv(t){try{var e=this.Pv();if(!e)return;this.Bv(e)&&this._instance.capture(se,{navigation_type:t}),this.Av=e}catch(e){xn.error("Error capturing "+t+" pageview",e)}}Nv(){if(!this.$v){var t=()=>{this.jv("popstate")};Dn(a,"popstate",t),this.$v=()=>{a&&a.removeEventListener("popstate",t)}}}qv(){if(!this.Dv){var t=()=>{this.jv("hashchange")};Dn(a,"hashchange",t),this.Dv=()=>{a&&a.removeEventListener("hashchange",t)}}}},heatmaps:class{get Rn(){return this.instance.config}constructor(t){var e;this.Hv=!1,this.Xs=!1,this.zv=null,this.instance=t,this.Hv=!(null==(e=this.instance.persistence)||!e.props[R]),this.rageclicks=new db(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Te(this.Rn.capture_heatmaps)&&this.Rn.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Pe(this.Rn.capture_heatmaps)?Pe(this.Rn.enable_heatmaps)?this.Hv:this.Rn.enable_heatmaps:!1!==this.Rn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Xs)return;_w.info("starting..."),this.Uv(),this.ar()}else{var t;clearInterval(null!==(t=this.zv)&&void 0!==t?t:void 0),this.Wv(),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.Hv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Rt;return this.Rt=void 0,t}Vv(t){ww(t.originalEvent)&&this.vn(t.originalEvent,"deadclick")}ar(){this.zv&&clearInterval(this.zv),this.zv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(h)?setInterval(this.Ja.bind(this),this.flushIntervalMilliseconds):null}Uv(){a&&h&&(this.Gv=this.Ja.bind(this),Dn(a,ne,this.Gv),this.Zv=t=>this.vn(t||(null==a?void 0:a.event)),Dn(h,"click",this.Zv,{capture:!0}),this.Jv=t=>this.Qv(t||(null==a?void 0:a.event)),Dn(h,"mousemove",this.Jv,{capture:!0}),this.Kv=new Db(this.instance,Ob,this.Vv.bind(this)),this.Kv.startIfEnabledOrStop(),this.Xv=this.ar.bind(this),Dn(h,re,this.Xv),this.Xs=!0)}Wv(){var t;a&&h&&(this.Gv&&a.removeEventListener(ne,this.Gv),this.Zv&&h.removeEventListener("click",this.Zv,{capture:!0}),this.Jv&&h.removeEventListener("mousemove",this.Jv,{capture:!0}),this.Xv&&h.removeEventListener(re,this.Xv),clearTimeout(this.Yv),null==(t=this.Kv)||t.stop(),this.Xs=!1)}tc(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&&Qn(r)&&!Kn(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(de(e,n))return!0;r=us(r)}return!1}(ss(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}vn(t,e){var i;if(void 0===e&&(e="click"),!Jn(t.target)&&ww(t)){var r=this.tc(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ms(ss(t),this.instance.config.rageclick)&&this.$s(n({},r,{type:"rageclick"})),this.$s(r)}}Qv(t){!Jn(t.target)&&ww(t)&&(clearTimeout(this.Yv),this.Yv=setTimeout(()=>{this.$s(this.tc(t,"mousemove"))},500))}$s(t){if(a){var e=this.Rn.disable_capture_url_hashes?ar(a.location.href):a.location.href,i=this.Rn.custom_personal_data_properties,r=zn(e,this.Rn.mask_personal_data_properties?[...il,...i||[]]:[],nl);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}}Ja(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Db,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Hv=!1,this.Xs=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ec=()=>{clearTimeout(this.rc),this.rc=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.nc=t=>{var e;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Pe(null==t?void 0:t.name)||Pe(null==t?void 0:t.value))fw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.sc(i);if(!Ie(r)){var s=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.oc||this.oc>t.value){this.Rt.navigationKey!==s&&(this.ec(),this.rc=setTimeout(this.ec,this.flushToCaptureTimeoutMs)),Ie(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=Ie(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,Te(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of yw){var h="url"===u&&"string"==typeof t.attribution[u]?this.sc(t.attribution[u]):t.attribution[u];Ie(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Ie(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.ec()}else fw.error("Ignoring metric with value >= "+this.oc,t)}}},this.ac=()=>{if(!this.Xs){var t,e,i,r,s=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.lc])||("web-vitals"===this.lc&&Ie(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ie(l)){var u=l.withoutAttribution,h=this.attributionMetrics;s=!Ie(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.nc.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.nc.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.nc.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.nc.bind(this),v),this.Xs=!0}else fw.error("web vitals callbacks not loaded - not starting")}},this.Hv=!(null==(e=this._instance.persistence)||!e.props[O]),this.startIfEnabled()}get uc(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Te(this.uc)?null==(t=this.uc)?void 0:t.web_vitals_allowed_metrics:void 0;return Pe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||gw:i}get flushToCaptureTimeoutMs(){return(Te(this.uc)?this.uc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Te(this.uc)?this.uc.web_vitals_attribution:void 0;return $e(t)?t?gw:[]:xe(t)?t:mw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Te(this.uc)?this.uc.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get oc(){var t=Te(this.uc)&&Fe(this.uc.__web_vitals_max_value)?this.uc.__web_vitals_max_value:pw;return t>0&&6e4>=t?pw:t}get isEnabled(){var t=null==d?void 0:d.protocol;if("http:"!==t&&"https:"!==t)return fw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Te(this.uc)?this.uc.web_vitals:$e(this.uc)?this.uc:void 0;return $e(e)?e:this.Hv}startIfEnabled(){this.isEnabled&&!this.Xs&&(fw.info("enabled, starting..."),this.bo(this.ac))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Te(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Te(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.Hv=i,this.startIfEnabled()}}}get lc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}bo(t){var e=b.__PosthogExtensions__,i=this.lc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Ie(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?fw.error("failed to load script",e):t()})}sc(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 zn(i,this._instance.config.mask_personal_data_properties?[...il,...r||[]]:[],nl)}fw.error("Could not determine current URL")}}},ok={exceptionObserver:class{constructor(t){var e;this.ac=()=>{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.hc&&this.Rn.capture_unhandled_errors&&(this.hc=e(this.captureException.bind(this))),!this.dc&&this.Rn.capture_unhandled_rejections&&(this.dc=i(this.captureException.bind(this))),!this.vc&&this.Rn.capture_console_errors&&(this.vc=r(this.captureException.bind(this)))}catch(t){vw.error("failed to start",t),this.cc()}}},this._instance=t,this.fc=!(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:vw})),this.Rn=this.gc(),this.startIfEnabledOrStop()}gc(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Te(t)?e=n({},e,t):(Ie(t)?this.fc:t)&&(e=n({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rn.capture_console_errors||this.Rn.capture_unhandled_errors||this.Rn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vw.info("enabled"),this.cc(),this.bo(this.ac)):this.cc()}bo(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 vw.error("failed to load script",e);t()})}cc(){var t,e,i;null==(t=this.hc)||t.call(this),this.hc=void 0,null==(e=this.dc)||e.call(this),this.dc=void 0,null==(i=this.vc)||i.call(this),this.vc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.fc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A]:this.fc}),this.Rn=this.gc(),this.startIfEnabledOrStop())}}onConfigChange(){this.Rn=this.gc()}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 vw.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.mc=[],this.yc=lm(),this._instance=t,this.mc=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this.bc=Nr(this._c()),this.wc=new qr(this.bc)}onConfigChange(){this.bc=Nr(this._c()),this.wc.setConfig(this.bc)}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.mc=s,this._instance.persistence&&this._instance.persistence.register({[P]:this.mc,[F]:o})}}}get kc(){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.yc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.bc.enabled)try{if(!Ee(t)||0===t.trim().length)return void rm.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)=>Dr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.Sc(e)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&rm.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.wc.add(n({[Or]:t,[$r]:(new Date).toISOString()},r))}catch(t){rm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.xc(e)){if(this.Cc(e))return this.Tc("Exception dropped: matched a suppression rule"),void rm.info("Skipping exception capture because a suppression rule matched");if(!this.kc&&this.Mc(e))return this.Tc("Exception dropped: thrown by a browser extension"),void rm.info("Skipping exception capture because it was thrown by an extension");if(!this.kc&&this.Ic(e))return this.Tc("Exception dropped: thrown by an injected browser script"),void rm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ec(e))return this.Tc("Exception dropped: thrown by the PostHog SDK"),void rm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.bc.enabled&&Pe(t.$exception_steps)?this.Rc(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",$u:!0});return n&&this.wc.clear(),n}catch(t){return im(t)||rm.error("Failed to capture exception event. Dropping this exception.",t),void this.wc.clear()}}catch(t){return void(im(t)||rm.error("Failed to process exception event. Ignoring this exception.",t))}var s}Rc(t){try{var e=this.wc.getAttachable();return 0===e.length?t:n({},t,{$exception_steps:e})}catch(e){return rm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Tc(t){this.bc.enabled&&this.wc.add({[Or]:t,[$r]:(new Date).toISOString()})}Sc(t){return Te(t)?n({},t):{}}_c(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Cc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Ee(i)&&i.length>0&&t.$exception_types.push(i),Ee(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.mc.some(t=>{var i=t.values.map(t=>{var i=Va[t.operator],r=e[t.key];if(!i||!r)return!1;var n=xe(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 rm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Mc(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&&om.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(nm)})||t.some(t=>{var e=t.value;return"NoResponse"===t.type||Ee(e)&&sm.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(nm))}))}Ic(t){return t.some(t=>{var e=t.value;return Ee(e)&&am.some(t=>e.includes(t))})}Ec(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}xc(t){return!Pe(t)&&xe(t)}}},ak=n({productTours:class{get sl(){return this._instance.persistence}constructor(t){this.Ac=null,this.Pc=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.sl&&this.sl.register({[L]:!!e.productTours}),!Sw(this._instance))return!this.Ac&&Pe(null==(i=this.sl)?void 0:i.props.ph_product_tours)||kw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Ac)||r.stop(),this.Ac=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Ac&&Sw(this._instance)&&this.bo(()=>this.Fc())}bo(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?kw.error("Could not load product tours script",e):t()})}Fc(){var t;!this.Ac&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.Ac=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!xe(this.Pc)||e){var i=this.sl;if(i){var r=i.props[_t];if(xe(r)&&!e)return this.Pc=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(Sw(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||kw.warn(n):kw.error(n),void t([],{isLoaded:!1,error:n})}var s=xe(e.json.product_tours)?e.json.product_tours:[];this.Pc=s,i&&i.register({[_t]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Pc,{isLoaded:!0})}getActiveProductTours(t){Pe(this.Ac)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ac.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Ac)||e.showTourById(t)}previewTour(t){this.Ac?this.Ac.previewTour(t):this.bo(()=>{var e;this.Fc(),null==(e=this.Ac)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.Ac)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Ac)||t.nextStep()}previousStep(){var t;null==(t=this.Ac)||t.previousStep()}clearCache(){var t;this.Pc=null,null==(t=this.sl)||t.unregister(_t)}resetTour(t){var e;null==(e=this.Ac)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Ac)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Ac)||e.cancelPendingTour(t)}}},rk),lk={siteApps:class{constructor(t){this._instance=t,this.Oc=0,this.$c=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Dc(t,e){if(e){var i=this.globalsForEvent(e);this.$c.push(i),this.$c.length>1e3&&(this.$c=this.$c.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.Dc.bind(this));this.Lc=()=>{t(),this.$c=[],this.Lc=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}}Nc(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)||(xw.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)||(xw.error("prepare_external_dependency_script returned null"),null):t}qc(){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.Oc++,this.jc)return this.Bc();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.Nc(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Ae(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.jc=()=>{d.forEach(t=>t()),this.jc=void 0},this.Bc()}Bc(){var t=!1;return()=>{var e;t||(t=!0,this.Oc--,0===this.Oc&&(null==(e=this.jc)||e.call(this)))}}Hc(t,e){void 0===e&&(e=!0);var i=this.qc();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.$c.length&&(xw.info("Processing "+this.$c.length+" events for site app with id "+t.id),this.$c.forEach(t=>this.Hc(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Lc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,xw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Hc(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){xw.error(Cw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){xw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}zc(){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)}Uc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Hc(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){xw.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.zc(),void this._instance.on("eventCaptured",t=>this.Uc(t))):void xw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Lc)||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 xw.error(Cw+e,t)})};for(var a of s.siteApps)o()}else xw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},uk={tracingHeaders:class{constructor(t){this._instance=t,this.Wc=void 0,this.Vc=void 0,this.Gc=void 0,this.ac=()=>{var t,e,i=this.Zc();i?(Ie(this.Wc)&&(this.Wc=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Ie(this.Vc)&&(this.Vc=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.cc()}}initialize(){this.startIfEnabledOrStop()}bo(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 cw.error("failed to load script",e);t()})}Jc(){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}Zc(){var t=this.Jc();return xe(t)?(xe(this.Gc)?this.Gc.splice(0,this.Gc.length,...t):this.Gc=[...t],t.length>0?this.Gc:void 0):(xe(this.Gc)&&this.Gc.splice(0),this.Gc=t||void 0,this.Gc)}cc(){var t,e;null==(t=this.Wc)||t.call(this),null==(e=this.Vc)||e.call(this),this.Wc=void 0,this.Vc=void 0}startIfEnabledOrStop(){this.Zc()?this.bo(this.ac):this.cc()}}},hk=n({surveys:class extends Ew{constructor(t){var e;super(new $w(t),(e=t,{get projectToken(){return e.config.token},kv:new Ow(e)})),this._instance=t}oh(t,e){var i=e.query?v_(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})})}}},rk),dk={toolbar:class{constructor(t){this.instance=t}Qc(t){b.ph_toolbar_state=t}Kc(){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),Ln(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=Dw||Un(t.hash,"__posthog")||Un(t.hash,"state"),s=n?Rn(()=>JSON.parse(atob(decodeURIComponent(n))))||Rn(()=>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(Lw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Xc(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Pe(e)&&Ce(e)?e(t,this.instance):Nw.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(Lw,JSON.stringify(n({},r,{source:void 0}))),2===this.Kc())this.Xc(r);else if(0===this.Kc()){var s;this.Qc(1),null==(s=b.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Nw.error("[Toolbar] Failed to load",t),void this.Qc(0);this.Qc(2),this.Xc(r)}),Dn(a,"turbolinks:load",()=>{this.Qc(0),this.loadToolbar(r)})}return!0}Yc(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)}}},vk=n({experiments:class t{get Rn(){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.tf("retrieved web experiments from the server"),i.ef=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.ef&&(t.tf("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.ef)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Ee(n)&&e.variants[n]&&i.if(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.rf(o,i._instance)&&i.if(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.tf(Gw);else if(!this.Rn.disable_web_experiments){if(Pe(this.ef))return this.ef=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.tf("applying feature flags",e),e.forEach(t=>{var e;if(this.ef&&null!=(e=this.ef)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ef)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.if(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Hn(null==e?void 0:e.search,"__experiment_id"),r=Hn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.tf("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.nf(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this.Rn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Rn.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.Rn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}nf(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.tf("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.if(n[0].name,i,n[0].variants[i].transforms))}static rf(e,i){return!Pe(e.conditions)&&t.sf(e,i)&&t.af(e)}static sf(e,i){var r;if(Pe(e.conditions)||Pe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=Gn(i,n.href);return null==(s=e.conditions)||!s.url||Zw[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 af(t){var e;if(Pe(t.conditions)||Pe(null==(e=t.conditions)?void 0:e.utm))return!0;var i=ol();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 tf(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];xn.info("[WebExperiments] "+t,i)}if(e,i,r){this._is_bot()?t.tf(Gw):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.tf("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.tf("Control variants leave the page unmodified.")}_is_bot(){return u&&this._instance?F_(u,this.Rn.custom_blocked_useragents):void 0}}},rk),ck=n({},rk,nk,sk,ok,ak,lk,hk,uk,dk,vk,{conversations:class{constructor(t){this._instance=t,this.lf=void 0,this._conversationsManager=null,this.uf=!1,this.re=null,this.hf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.df=t.ok,t.ok)){var e=t.config.conversations;Pe(e)||($e(e)?this.lf=e:(this.lf=e.enabled,this.re=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.lf=void 0,this.re=null,this.df=void 0,this.hf=!1}loadIfEnabled(){if(!(this._conversationsManager||this.uf||this._instance.config.disable_conversations||Ln(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Ie(this.lf)&&this.lf)if(this.re&&this.re.token){this.uf=!0;try{var e=t.initConversations;if(e)return this.vf(e),void(this.uf=!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.vf(t.initConversations),this.uf=!1})}catch(t){this.cf("Error initializing conversations",t),this.uf=!1}}else Jw.error("Conversations enabled but missing token in remote config.")}}vf(t){if(this.re)try{this._conversationsManager=t(this.re,this._instance),this.hf=!1,Jw.info("Conversations loaded successfully")}catch(t){this.cf("Error completing conversations initialization",t)}else Jw.error("Cannot complete initialization: remote config is null")}cf(t,e){Jw.error(t,e),this._conversationsManager=null,this.uf=!1,this.hf=!0}show(){this._conversationsManager?this._conversationsManager.show():Jw.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.lf&&!Ae(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ln(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.df?"remote_config_failed":Ie(this.lf)?this.df?"disabled_in_project":"remote_config_pending":this.lf?Pe(this.re)||!this.re.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.uf?"initializing":this.hf?"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):(Jw.warn(Qw),null)})()}getMessages(t,e){var i=this;return o(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Jw.warn(Qw),null)})()}markAsRead(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Jw.warn(Qw),null)})()}getTickets(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Jw.warn(Qw),null)})()}requestRestoreLink(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Jw.warn(Qw),null)})()}restoreFromToken(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Jw.warn(Qw),null)})()}restoreFromUrlToken(){var t=this;return o(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Jw.warn(Qw),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}Uu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Wu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=kp,this.ff=!1,this.pf=!1,this.gf=!1,this.A=Cn("[logs]"),this.mf=n({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(ik)||i.A.error(...e)}}),this.La=[],this.yf=[],this.Fd=0,this.ro=!1,this.bf=[],this._f=[],this.wf=!1,this.kf=!1,this.Sf=()=>{var t,e;this.ro||(this.Fd=0,null==(t=this.xf)||t.onReconnect(),null==(e=this.Cf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.ff=!0),a&&Dn(a,"online",this.Sf)}Tf(t,e,i,r){var n,s=Kw(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new pn(this.Mf(t,e),s,this.mf,()=>this.If(),t=>t(),void 0,r),s]}Ef(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.xf||this.Rf!==e){var i;null==(i=this.xf)||i.reset(),this.Rf=e;var r=this.Tf(()=>this.La,t=>{this.La=t});this.xf=r[0],this.Af=r[1]}return this.xf}Pf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Cf||this.Ff!==e){var i;null==(i=this.Cf)||i.reset(),this.Ff=e;var r=this.Tf(()=>this.yf,t=>{this.yf=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Yw);this.Cf=r[0],this.Of=r[1]}return this.Cf}setup(t){var e;if(!this.ro){this.Js=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.ff=!0),(this.ff||this.$f()&&this.Df())&&this.Lf();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.ro?r.dispose():(this.oo=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.ro||(this.ro=!0,this.Nf(),null==(t=this.oo)||t.dispose(),this.oo=void 0,this.Js=void 0,this.gf=!1,null==a||a.removeEventListener("online",this.Sf),null==(e=this.qf)||e.call(this),this.qf=void 0,null==(i=this.xf)||i.reset(),null==(r=this.Cf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.ro){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Pe(r)?this.jf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[N]:!!r}),r?(this.ff=!0,this.pf||this.Lf(),this.loadIfEnabled()):this.jf())}}reset(){var t,e,i,r;this.Nf(),null==(t=this.xf)||t.clearQueue(),this.La=[],null==(e=this.xf)||e.reset(),null==(i=this.Cf)||i.clearQueue(),this.yf=[],null==(r=this.Cf)||r.reset(),this.Fd=0}captureLog(t){this.ro||this.Ef().captureLog(t)}captureConsoleLog(t){this.ro||this.Pf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.ro||this.Pf().captureLog(t,{context:e,occurredAtMs:i})}Df(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[N])}$f(){var t,e;return null==(t=this._instance)||null==t.Fa||!t.Fa()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Gu(){var t;this.Nf(),null==(t=this.Cf)||t.clearQueue(),this.yf=[]}jf(){this.ff||this.Nf()}Lf(){var t,e=this;if(!this.wf&&null!=b&&b.console){var i=Kw(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Ug(b.console[t])}catch(t){return 0}if(!r)return 0;e._f.push(Gv(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.Bf(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of Xw)r(n);this.wf=!0,this.Hf=setTimeout(()=>{this.Nf()},3e4)}}Bf(t,e,i){var r;if(this.wf&&!this.kf&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.bf.length){this.kf=!0;try{this.bf.push({level:t,args:e,occurredAtMs:Date.now(),context:this.If()})}finally{this.kf=!1}}}else this.Nf()}Nf(){if(this.bf=[],this.wf){for(var t of(this.wf=!1,this.Hf&&(clearTimeout(this.Hf),this.Hf=void 0),this._f))t();this._f=[]}}zf(){var t=this.bf;return this.Nf(),t}get logger(){return this.Uf||(this.Uf={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.Uf}flushLogs(t){t?this.Wf(t):(this.xf&&this.xf.flush().catch(t=>this.Vf(t)),this.Cf&&this.Cf.flush().catch(t=>this.Vf(t)))}Vf(t){ik(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.ro&&this.ff&&!this.pf&&!this.gf){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Nf();var e=t.loadExternalDependency;if(!e)return this.A.error(Yt),void this.Nf();this.gf=!0;try{e(this._instance,"logs",e=>{if(this.gf=!1,!this.ro&&this.ff){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.Nf();else{var r,n,s=this.zf();this.qf=i.initializeLogs(null!==(r=this.Js)&&void 0!==r?r:this._instance),this.pf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Js)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.gf=!1,t}}}Mf(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===pe.LogsQueue?t():void 0,setPersistedProperty(t,i){t===pe.LogsQueue&&e(null!=i?i:[])},xs:t=>this.xs(t),getLibraryId:()=>Ra.LIB_NAME,getLibraryVersion:()=>Ra.LIB_VERSION}}xs(t){return new Promise(e=>{if(Wn(this.Fd,3))e({kind:"fatal",error:ek(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:ek(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Gf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Zf(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:ek(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)})}}})}})}Zf(t){(0!==t||this._instance.__loaded)&&(this.Fd=Vn(t,this.Fd,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.")))}Wf(t){this.La.length>0&&this.Jf(t,this.La,this.Af,Ra.LIB_NAME,t=>{this.La=t}),this.yf.length>0&&this.Jf(t,this.yf,this.Of,Yw,t=>{this.yf=t})}Jf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=fn(s,cn(i,Ra.LIB_NAME,Ra.LIB_VERSION),r,Ra.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Gf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Gf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}If(){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,Pe(n)||(e.sessionStartTimestamp=n),Pe(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=Cn("[metrics]")}initialize(){}Ef(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.xf&&this.Rf===i||(null==(e=this.xf)||e.reset(),this.Rf=i,this.xf=new bn(this.Mf(),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.xf}count(t,e,i){void 0===e&&(e=1),this.Ef().count(t,e,i)}gauge(t,e,i){this.Ef().gauge(t,e,i)}histogram(t,e,i){this.Ef().histogram(t,e,i)}flush(t){if(!this.xf)return Promise.resolve();if(t){var e=this.xf.drainWindow();return e&&this.js(e,t),Promise.resolve()}return this.xf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.xf)||t.reset()}Mf(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},js:t=>e.js(t),getLibraryId:()=>Ra.LIB_NAME,getLibraryVersion:()=>Ra.LIB_VERSION}}js(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.Qf(),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)})}}))})}Qf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});hw.__defaultExtensionClasses=n({},ck),function(){Ra.SDK_DIST_CHANNEL="cdn";var t=b.posthog;if(!t||xe(t._i)){var e=G_[rw]=new hw;if(t){var i=[];Mn(t._i,function(r){if(r&&xe(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,nw=!1,Mn(G_,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():Dn(h,"DOMContentLoaded",t,{capture:!1}):a&&xn.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=["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"],he=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return ue.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function de(t,e){return-1!==t.indexOf(e)}var ve=function(t){return t.trim()},ce=function(t){return t.replace(/^\$/,"")};function fe(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 pe=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}({}),ge=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),me="min_length",ye="max_length",be=["$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"],_e=["token"],we=Object.prototype,ke=we.hasOwnProperty,Se=we.toString,xe=Array.isArray||function(t){return"[object Array]"===Se.call(t)},Ce=t=>"function"==typeof t,Te=t=>t===Object(t)&&!xe(t),Me=t=>{if(Te(t)){for(var e in t)if(ke.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Ee=t=>"[object String]"==Se.call(t),Re=t=>Ee(t)&&0===t.trim().length,Ae=t=>null===t,Pe=t=>Ie(t)||Ae(t),Fe=t=>"[object Number]"==Se.call(t)&&t==t,Oe=t=>Fe(t)&&t>0,$e=t=>"[object Boolean]"===Se.call(t),De=t=>t instanceof FormData,Le=t=>de(be,t),Ne=t=>de(_e,t);function qe(t){return null===t||"object"!=typeof t}function je(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Be(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 ze(t,Error)}}function He(t){return"u">typeof Event&&ze(t,Event)}function ze(t,e){try{return t instanceof e}catch(t){return!1}}var Ue=[!0,"true",1,"1","yes"],We=t=>de(Ue,t),Ve=[!1,"false",0,"0","no"];function Ge(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Fe(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&&de(t,"GSA/")?$i:de(t," OPR/")&&de(t,"Mini")?"Opera Mini":de(t," OPR/")?li:Bi.test(t)?ii:de(t,"IEMobile")||de(t,"WPDesktop")?ai:de(t,"OculusBrowser")?xi:de(t,"SamsungBrowser")?ri:de(t,"Edge")||de(t,"Edg/")?ui:de(t,"Vivaldi/")?Ci:de(t,"YaBrowser/")?Ti:de(t,"Whale/")?Mi:de(t,"DuckDuckGo/")||de(t,"Ddg/")?Ii:de(t,"Claude/")?Pi:de(t,"Codex/")?Fi:de(t,"ChatGPT/")?Oi:de(t,"FBIOS")?"Facebook Mobile":de(t,"UCWEB")||de(t,"UCBrowser")?"UC Browser":de(t,"CriOS")?si:de(t,"CrMo")||de(t,ni)?ni:de(t,Qe)&&de(t,ei)?pi:de(t,"FxiOS")?di:de(t.toLowerCase(),Si.toLowerCase())?Si:de(t,"Brave/")?Ai:((t,e)=>e&&de(e,"Apple")||function(t){return de(t,ei)&&!de(t,ni)&&!de(t,Qe)}(t))(t,e)?de(t,Je)?gi:ei:de(t,"PaleMoon/")?Ei:de(t,"Waterfox/")?Ri:de(t,hi)?hi:de(t,"MSIE")||de(t,"Trident/")?oi:de(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(Ie(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=Ie(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&&(Ce(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&&xe(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 Ie(r)||(s.lineno=r),Ie(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=Ee(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 je(t,"DOMException")}isDOMError(t){return je(t,"DOMError")}},Ar=class{match(t){return Be(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!!je(t,"ErrorEvent")&&(null!=t.error||this.an(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.sn(t))&&void 0!==i?i:r.stack,synthetic:!0})}an(t){return Ee(t.message)&&t.message.length>0}sn(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(Ee(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(He(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Ee(e)&&!Re(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 Ee(t)&&!Re(t)&&$r.indexOf(t)>=0}getStack(t){try{return Ee(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Ee(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(Be(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 He(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 qe(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 je(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!He(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 qe(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.Gn=[],this.Zn=0,this.Rn=Wr(t)}setConfig(t){this.Rn=Wr(t),this.Jn()}add(t){var e=function(t){var e;try{e=fe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Te(i))return;var r=i,n=r[Br],s=r[Hr];if(!Ee(n)||0===n.trim().length)return;if(!Ee(s)&&!Fe(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.Rn.max_bytes||(this.Gn.push({step:e.step,bytes:i}),this.Zn+=i,this.Jn())}}getAttachable(){return this.Gn.map(t=>t.step)}clear(){this.Gn=[],this.Zn=0}size(){return this.Gn.length}Jn(){for(;this.Zn>this.Rn.max_bytes&&this.Gn.length>0;){var t=this.Gn.shift();t&&(this.Zn-=t.bytes)}}};function Gr(t,e){if(!Fe(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===ge.GZipJS||e===ge.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--,$e(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 xe(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(Pe(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(Ae(o)||Ie(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=Fe(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),Pe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Pe(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),Ie(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.Rn=e,this.A=i,this.Qn=r,this.Kn=n,this.Xn=s,this.Yn=o,this.ts=null,this.es=0,this.rs=0,this.ns=0,this.ss=0,this.ls=0,this.us=!1,this.hs=e.maxBufferSize,this.ds=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.vs=e.flushIntervalMs,this.cs=e.maxBatchRecordsPerPost,this.fs=e.rateCapWindowMs,this.ps=e.maxLogsPerInterval}clearQueue(){this.rs++,this._instance.setPersistedProperty(pe.LogsQueue,[])}reset(){this.gs(),this.ss=0,this.ls=0,this.us=!1,this.ns=0,this.cs=this.Rn.maxBatchRecordsPerPost}onReconnect(){this.ns=0,this.ys()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.bs(t);if(null!==r)if(r.body){if(this._s()){var n={record:bn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Qn(),this.A,null==e?void 0:e.occurredAtMs)};this.Kn(()=>this.ws(n))}}else this.A.info("Log was rejected in beforeSend function")}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=xe(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}_s(){if(void 0===this.ps)return!0;var t=Date.now(),e=t-this.ss;return this.fs>e&&e>=0||(this.ss=t,this.ls=0,this.us=!1),this.ps>this.ls?(this.ls++,!0):(this.us||(this.A.warn("captureLog dropping logs: exceeded "+this.ps+" logs per "+this.fs+"ms"),this.us=!0),!1)}flush(){var t=this;return o(function*(){if(!t._instance.isDisabled)return t.ts||(t.ts=t.ks().finally(()=>{t.ts=null})),t.ts})()}ks(){var t=this;return o(function*(){var e;t.gs();var i=null!==(e=t._instance.getPersistedProperty(pe.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.rs;t.es=0;var l=Math.min(i.length,t.cs),u=i.slice(0,l),h=wn(u.map(t=>t.record),t.Ss(),null!==(s=t.Yn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.xs(h);if(t.rs!==a)return;if("too-large"===d.kind&&u.length>1)t.cs=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.cs);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.Rn.maxBatchRecordsPerPost>t.cs&&(t.cs=Math.min(t.Rn.maxBatchRecordsPerPost,t.cs+1)),yield t.Cs(u.length),i=null!==(o=t._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}Cs(t){var e=this;return o(function*(){var i,r=Math.max(0,t-e.es),n=null!==(i=e._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(pe.LogsQueue,n.slice(r)),yield e.Xn()})()}Ss(){return _n(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}ws(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(pe.LogsQueue))&&void 0!==e?e:[];this.ds>i.length||(i.shift(),this.es++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(pe.LogsQueue,i),this.hs>i.length?this.Ts():this.ys()}}Ts(t){void 0===t&&(t=this.vs),this.Ms||(this.Ms=lr(()=>{this.Ms=void 0,this.ys()},t))}Is(){var t=Math.min(Math.max(0,this.ns-1),6);return this.vs*Math.pow(2,t)}Es(){var t=this._instance.getPersistedProperty(pe.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return o(function*(){e.gs();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(()=>{})})})()}ys(){this.flush().then(()=>{this.ns=0},t=>{this.ns++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Es()&&this.Ts(this.Is())})}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=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.Rn=e,this.A=i,this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Os=0}count(t,e,i){void 0===e&&(e=1),this.$s({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.$s({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.$s({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.ts,i=function(){var i=o(function*(){e&&(yield e.catch(()=>{})),yield t.Ds()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.ts===i&&(this.ts=null)});return this.ts=i,i}drainWindow(){if(0===this.Rs.size)return null;var t=this.Rs;return this.Rs=new Map,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Ls(t)}reset(){this.Os++,this.gs(),this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set}$s(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.bs(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.Rs.get(r);if(!s){if(!this.Ns())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Rs.set(r,s)}var o=this.Ps.get(e.name);void 0===o?this.Ps.set(e.name,e.type):o===e.type||this.Fs.has(e.name)||(this.Fs.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.qs(s,e.value),this.Ts()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ns(){return this.Rn.maxSeriesPerFlush>this.Rs.size||(this.As||(this.As=!0,this.A.warn("Metric series cap reached ("+this.Rn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}qs(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}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=xe(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}Ts(){this.Ms||(this.Ms=lr(()=>{this.Ms=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this.Rn.flushIntervalMs))}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}Ds(){var t=this;return o(function*(){if(0!==t.Rs.size){var e=t.Rs;t.Rs=new Map,t.As=!1,t.Ps=new Map,t.Fs=new Set;var i=t.Os,r=yield t._instance.js(t.Ls(e));if(i===t.Os)switch(r.kind){case"ok":return;case"retry-later":return t.Bs(e),void t.Ts();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)}}})()}Ls(t){return e=this.Hs(t),i=function(t,e,i){return fn(t,e,i)}(this.Rn,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}Hs(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())}Bs(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Rs.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.Ns()&&this.Rs.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)&&!Ie(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){xe(t)&&t.forEach(e)}function On(t,e){if(!Pe(t))if(xe(t))t.forEach(e);else if(De(t))t.forEach((t,i)=>e(t,i));else for(var i in t)ke.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){(Ee(t)&&t.length>0||Fe(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(!Ee(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)=>Be(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 fe(t)}},Gn=t=>{var e=null==h?void 0:h.createElement("a");return Ie(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){Ie(t)||Ie(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(!xe(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("=");xe(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(!Ce(r))return e;try{var n=r(e);return Ee(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 Ie(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?ve(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 Pe(t)?null:ve(t).split(/(\s+)/).filter(t=>Ds(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ds(t){var e="";return Ms(t)&&!Is(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:"")}),ve(e)}function vs(t){var e;return Ie(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(Ie(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,e){if(!a||Cs(t))return!1;var i,r,n,s,o;if($e(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&&function(t){return!(!t||!rs(t))&&(!!ns(t,"textarea")||(ns(t,"input")?de(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)))}(t))return!1;var l=Ts(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=ys;else{if(!xe(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 Cs=t=>!t||ns(t,"html")||!rs(t),Ts=(t,e)=>{if(!a||Cs(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 Ms(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(de(n,"ph-sensitive")||de(n,"ph-no-capture"))return!1}if(de(us(t),"ph-include"))return!0;var s=t.type||"";if(Ee(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Ee(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 Is(t){return!!(ns(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ns(t,"select")||ns(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Es=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}))$"),Rs=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,As=[16,15,14,13],Ps=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Fs=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Os=/[0-9A-Za-z_]/;function $s(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 Ds(t,e){if(void 0===e&&(e=!0),Pe(t))return!1;if(Ee(t)){if(t=ve(t),e?Es.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Rs.lastIndex=0;e=Rs.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of As){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Es.test(a)&&$s(a))return!0}}}return!1}(t))return!1;if(e?Ps.test(t):function(t){var e;for(Fs.lastIndex=0;e=Fs.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Os.test(i)&&Os.test(r)))return!0}return!1}(t))return!1}return!0}function Ls(t){var e=ds(t);return Ds(e=(e+" "+Ns(t)).trim())?e:""}function Ns(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+" "+Ns(t)).trim())}catch(t){An.error("[AutoCapture]",t)}}),e}function qs(t){return t.replace(/"|\\"/g,'\\"')}function js(t){var e=t.attr__class;if(e)return xe(e)?e:as(e)}var Bs=1e6;function Hs(t){var e;return Math.min(Bs,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var zs={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:Bs,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},Us=["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"],Ws=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Vs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Gs=t=>{Pe(t)||On(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Us.includes(e)||Vs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Zs=["/s/","/e/","/i/"];function Js(t,e,i,r){if(Pe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Ee(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function Qs(t,e){if(Pe(t))return t;var i=t;return Ds(i,!1)||(i="[SessionRecording] "+e+" body redacted"),On(Ws,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 Ks=new WeakSet,Xs="disabled",Ys="sampled",to="active",eo="buffering",io="paused",ro="lazy_loading",no="rrweb_error",so="trigger_activated",oo="trigger_pending",ao="trigger_disabled";function lo(t,e,i,r,n,s){return 0===e?ao:(null==t?void 0:t.get_property(i?r+i:n))===s?so:oo}function uo(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 ho(t){return t.includes("trigger_activated")?so:t.includes("trigger_pending")?oo:ao}function vo(t){var e=new Set(t);switch(e.delete(ao),e.size){case 0:return ao;case 1:return Array.from(e)[0];default:return oo}}var co=class{constructor(t){this.j=t}triggerStatus(t){return ho(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return ho(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},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{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return so}stop(){}},go=t=>"sessionRecording"in t,mo=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=(go(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(go(t)?Te(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 lo(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 uo(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=uo(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=uo(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===so,l=uo(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},yo=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=oo;return Pe(this.linkedFlag)&&(t=ao),this.linkedFlagSeen&&(t=so),t}onConfig(t,e){var i;if(this.linkedFlag=(go(t)?Te(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Pe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Ee(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Ee(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Te(i)&&r in i){var o=i[r];s=$e(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()}},bo=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(go(t)?Te(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return lo(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)===so,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},_o=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new mo(t,e.id),this.tt=new bo(t,e.id),this.et=new yo(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 co(s):new fo(s)}else this.rt=new po}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===oo).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 wo(t){if(t.rrwebError)return no;if(!t.receivedFlags)return eo;if(!t.isRecordingEnabled)return Xs;if(t.urlTriggerMatching.urlBlocked)return io;var e=!0===t.isSampled,i=new co([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ys:"trigger_activated"===i?to:"trigger_pending"===i?eo:!1===t.isSampled?Xs:to}function ko(t){if(t.rrwebError)return no;if(!t.receivedFlags)return eo;if(!t.isRecordingEnabled)return Xs;if(t.urlTriggerMatching.urlBlocked)return io;var e=new fo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==ao,r=$e(t.isSampled);return i&&"trigger_pending"===e?eo:i&&"trigger_disabled"===e||r&&!t.isSampled?Xs:!0===t.isSampled?Ys:to}function So(){var t=[];return function(e,i){if(Te(i)||xe(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function xo(t){var e=JSON.stringify(t,So());return e?new Blob([e]).size:0}function Co(t){if(Ae(t))return 4;if(Ie(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(xe(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Ae(r)?4:Co(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Ie(l)||(o||(s+=1),o=!1,s+=a.length+3+Co(l))}return s;default:return 0}}function To(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[To({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),To({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 Mo=Uint8Array,Io=Uint16Array,Eo=Uint32Array,Ro=new Mo([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]),Ao=new Mo([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]),Po=new Mo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fo=function(t,e){for(var i=new Io(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Eo(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]},Oo=Fo(Ro,2),$o=Oo[1];Oo[0][28]=258,$o[258]=28;for(var Do=Fo(Ao,0)[1],Lo=new Io(32768),No=0;32768>No;++No){var qo=(43690&No)>>>1|(21845&No)<<1;Lo[No]=((65280&(qo=(61680&(qo=(52428&qo)>>>2|(13107&qo)<<2))>>>4|(3855&qo)<<4))>>>8|(255&qo)<<8)>>>1}var jo=function(t,e,i){for(var r=t.length,n=0,s=new Io(e);r>n;++n)++s[t[n]-1];var o,a=new Io(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Io(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[Lo[d]>>>l]=u}else for(o=new Io(r),n=0;r>n;++n)o[n]=Lo[a[t[n]-1]++]>>>15-t[n];return o},Bo=new Mo(288);for(No=0;144>No;++No)Bo[No]=8;for(No=144;256>No;++No)Bo[No]=9;for(No=256;280>No;++No)Bo[No]=7;for(No=280;288>No;++No)Bo[No]=8;var Ho=new Mo(32);for(No=0;32>No;++No)Ho[No]=5;var zo=jo(Bo,9,0),Uo=jo(Ho,5,0),Wo=function(t){return(t/8|0)+(7&t&&1)},Vo=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Io?Io:t instanceof Eo?Eo:Mo)(i-e);return r.set(t.subarray(e,i)),r},Go=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Zo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Jo=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 Mo(0),0];if(1==n){var o=new Mo(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 Io(v+1),f=Qo(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 Mo(c),f]},Qo=function(t,e,i){return-1==t.s?Math.max(Qo(t.l,e,i+1),Qo(t.r,e,i+1)):e[t.s]=i},Ko=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Io(++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]},Xo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Yo=function(t,e,i){var r=i.length,n=Wo(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)},ta=function(t,e,i,r,n,s,o,a,l,u,h){Go(e,h++,i),++n[256];for(var d=Jo(n,15),v=d[0],c=d[1],f=Jo(s,15),p=f[0],g=f[1],m=Ko(v),y=m[0],b=m[1],_=Ko(p),w=_[0],k=_[1],S=new Io(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=Jo(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Po[I-1]];--I);var E,R,A,P,F=u+5<<3,O=Xo(n,Bo)+Xo(s,Ho)+o,D=Xo(n,v)+Xo(s,p)+o+14+3*I+Xo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&D>=F)return Yo(e,h,t.subarray(l,l+u));if(Go(e,h,1+(O>D)),h+=2,O>D){E=jo(v,c,0),R=v,A=jo(p,g,0),P=p;var L=jo(T,M,0);for(Go(e,h,b-257),Go(e,h+5,k-1),Go(e,h+10,I-4),h+=14,x=0;I>x;++x)Go(e,h+3*x,T[Po[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)Go(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(Go(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=zo,R=Bo,A=Uo,P=Ho;for(x=0;a>x;++x)if(r[x]>255){var B;Zo(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Go(e,h,r[x]>>>23&31),h+=Ro[B]);var H=31&r[x];Zo(e,h,A[H]),h+=P[H],H>3&&(Zo(e,h,r[x]>>>5&8191),h+=Ao[H])}else Zo(e,h,E[r[x]]),h+=R[r[x]];return Zo(e,h,E[256]),h+R[256]},ea=new Eo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ia=new Mo(0),ra=function(){for(var t=new Eo(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),na=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function sa(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=ra[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 Mo(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=Yo(l,u,t.subarray(h,d)):(l[h]=s,u=Yo(l,u,t.subarray(h,o)))}else{for(var v=ea[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Io(32768),m=new Io(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 Eo(25e3),k=new Io(288),S=new Io(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=ta(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|$o[O]<<18|Do[D];var G=31&$o[O],Z=31&Do[D];C+=Ro[G]+Ao[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=ta(t,l,s,w,k,S,C,T,I,h-I,u),s||(u=Yo(l,u,ia))}return Vo(a,0,r+Wo(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&&na(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),na(u,h-8,i.d()),na(u,h-4,r),u}function oa(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Mo(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 Mo(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 Vo(r,0,n)}function aa(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 la=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=Co(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=Fe(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}},ua=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 Fe(t)&&isFinite(t)&&Math.floor(t)===t});var ha=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}},da=class{generate(){var t=this.generateOrAbort();if(!Ie(t))return t;this.Ct=0;var e=this.generateOrAbort();if(Ie(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Fe(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 ha.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 fa}},va=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&&!Ie(a.crypto)&&crypto.getRandomValues&&(va=t=>crypto.getRandomValues(t));var ca,fa=class{nextUint32(){return this.Rt.length>this.At||(va(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},pa=()=>ga().toString(),ga=()=>(ca||(ca=new da)).generate(),ma="",ya=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ba=null,_a={Et(){if(!Ae(ba))return ba;if(ba=!1,h)try{var t="__ph_cookie_support_"+pa();_a.Ot(t,"xyz"),ba='"xyz"'===ua(t),_a.Dt(t)}catch(t){ba=!1}return ba},Pt(t){An.error("cookieStore error: "+t)},Lt:ua,Nt(t){var e;try{e=JSON.parse(_a.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),ma)return ma;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_"+pa();!ma&&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",ma=s)}return ma}(t);if(!i){var r=(t=>{var e=t.match(ya);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{_a.Ot(t,"",-1,e)}catch(t){return}}},wa=null,ka={Et(){if(!Ae(wa))return wa;var t=!0;if(Ie(a))t=!1;else try{var e="__mplssupport__";ka.Ot(e,"xyz"),'"xyz"'!==ka.Lt(e)&&(t=!1),ka.Dt(e)}catch(e){t=!1}return t||An.error("localStorage unsupported; falling back to cookie store"),wa=t,t},Pt(t){An.error("localStorage error: "+t)},Lt(t){try{return null==a?void 0:a.localStorage.getItem(t)}catch(t){ka.Pt(t)}return null},Nt(t){try{return JSON.parse(ka.Lt(t))||{}}catch(t){}return null},Ot(t,e){try{return null==a||a.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){ka.Pt(t)}return!1},Dt(t){try{null==a||a.localStorage.removeItem(t)}catch(t){ka.Pt(t)}}},Sa=[vt,nt,rt,ot,at,lt,Rt,Et,Mt],xa=[k,w,G,Z,Lt,Dt,M,At],Ca=t=>t+"_cpm",Ta=["__proto__","constructor","prototype"],Ma=t=>{if(!Te(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Ta.indexOf(i)&&(e[i]=t[i])}),e},Ia=function(t,e){void 0===e&&(e=[]);var i={};return[...xa,...e].forEach(e=>{var r=t[e];Ie(r)||Ae(r)||""===r||(i[e]=r)}),i},Ea=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)},Ra=(t,e)=>({p:e,f:Ea(JSON.stringify(t))}),Aa=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=_a.Nt(Ca(t)),r=(null==i?void 0:i.f)===Ea(e)&&xe(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Pa=(t,e)=>e+"|"+(_a.Lt(Ca(t))||""),Fa={},Oa={Et:()=>!0,Pt(t){An.error("memoryStorage error: "+t)},Lt:t=>t in Fa?Fa[t]:null,Nt:t=>t in Fa?Fa[t]:null,Ot:(t,e)=>(Fa[t]=e,!0),Dt(t){delete Fa[t]}},$a=null,Da={Et(){if(!Ae($a))return $a;if($a=!0,Ie(a))$a=!1;else try{var t="__support__";Da.Ot(t,"xyz"),'"xyz"'!==Da.Lt(t)&&($a=!1),Da.Dt(t)}catch(t){$a=!1}return $a},Pt(t){An.error("sessionStorage error: ",t)},Lt(t){try{return null==a?void 0:a.sessionStorage.getItem(t)}catch(t){Da.Pt(t)}return null},Nt(t){try{return JSON.parse(Da.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==a||a.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Da.Pt(t)}return!1},Dt(t){try{null==a||a.sessionStorage.removeItem(t)}catch(t){Da.Pt(t)}}};En.DEBUG=!1,En.LIB_VERSION="1.428.8",En.LIB_NAME="web";var La=En,Na=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 Te(e=i)&&Ee(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function qa(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 ja(t){return"$survey_response_"+t}function Ba(t,e){if(!e)return null;var i=t[ja(e)];return xe(i)?[...i]:i}function Ha(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Ie(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=Ba(t,e.id);Ie(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:Ba(t,e.id)}})},t,r)}function za(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 Ua(t){return"string"==typeof t&&t.trim()?t.trim():null}function Wa(t){return t.toLowerCase()}function Va(t,e,i){if(!t||!e)return null;var r=Wa(e),n=Object.keys(t).find(t=>Wa(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=>Wa(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var Ga=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Za(t,e,i){var r,s=Va(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),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=n({},o.appearance);for(var d of Ga){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return Ga.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,s=Va(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 Ie(o.question)||(a.question=o.question,l=!0),Ie(o.description)||(a.description=o.description,l=!0),Ie(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ie(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ie(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ie(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return xe(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 Ja(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Qa(t){var e;return Ja(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ka=(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}},Xa=t=>t.toLowerCase(),Ya={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=>Ka(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Ka(e,t))),icontains:(t,e)=>e.map(Xa).some(e=>t.map(Xa).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Xa).every(e=>t.map(Xa).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 tl(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=Ya[i.operator];return!!n&&n(i.values,[String(r)])})}function el(t,e,i){return Vn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var il=new Set(["is_not","not_icontains","not_regex"]);function rl(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(Ie(n)||Ae(n))return il.has(s);var o=Ya[s];return!!o&&!Ie(t.value)&&!Ae(t.value)&&o(xe(t.value)?t.value.map(String):[String(t.value)],xe(n)?n.map(String):[String(n)])})}var nl=Pn("[SessionRecording]");function sl(t,e){return e?t:"!"+t}function ol(t,e){return t===e||t!=="!"+e&&null}var al=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.zt=ko}onRemoteConfig(t){this.$t=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new co([this.tt,this.Y]),this.zt=wo):(this.Ut=new fo([this.tt,this.Y]),this.zt=ko),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.zt({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 Fe(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&&Pe(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){nl.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,i,r,n=this.$t;if(!Fe(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=ol(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!$e(a),d=h?qa(t,n):a;h&&(d?this.jt("sampled"):nl.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]:sl(t,d),[H]:Ae(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.$t)&&($e(ol(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.Ut)?void 0:e.triggerStatus(t))===oo}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===oo).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()}},ll=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)):nl.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return no;if(!t.receivedFlags)return eo;if(!t.isRecordingEnabled)return Xs;if(t.urlTriggerMatching.urlBlocked)return io;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Xs;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);Ie(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?Ys:r?eo:Xs}({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;Fe(r)&&(Ae(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 nl.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||rl(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){nl.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(Te(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Fe(c)&&c!==s,l=v===t&&Fe(c)&&c===s&&$e(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!$e(l),g=p?qa(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||rl(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 _o(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)}},ul=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],hl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ul],dl="<masked>",vl=["li_fat_id"];function cl(t,e,i){if(!h)return{};var r,n=e?[...ul,...i||[]]:[],s=fl(Qn(h.URL,n,dl),t);return $n((r={},On(vl,function(t){var e=ua(t);r[t]=e||null}),r),s)}function fl(t,e){var i=hl.concat(e||[]),r={};return On(i,function(e){var i=Jn(t,e);r[e]=i||null}),r}function pl(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(!Ae(e)){r.$search_engine=e;var n=h?Jn(h.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function gl(){return navigator.language||navigator.userLanguage}var ml="$direct";function yl(){return(null==h?void 0:h.referrer)||ml}function bl(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...ul,...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:yl().substring(0,1e3),u:s?Qn(s,n,dl):void 0}}function _l(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==ml?ml: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,fl(s))}return r&&$n(o,pl(r)),o}function wl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function kl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Sl=1e5,xl=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Cl=[],Tl=()=>!1,Ml="@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(" "),Il="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),El="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(" "),Rl="Accommodation AdministrativeArea Country Place State".split(" "),Al={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:Il,publisher:El},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Cl},Offer:{seller:El},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:El,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:El,areaServed:Rl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Cl}},Pl=[["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(" "),Al.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Al.Event],[El,Al.Organization],[Rl,Al.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Al.Product]];function Fl(t,e){return ke.call(t,e)?t[e]:void 0}function Ol(t){var e=typeof t;return Ae(t)||"string"===e||"number"===e||"boolean"===e}function $l(t){return Ol(t)||xe(t)&&t.every(Ol)?t:void 0}function Dl(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 Ll(t){if(ke.call(Al,t))return Al[t];for(var e of Pl){var i=e[1];if(e[0].includes(t))return i}}function Nl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function ql(t,e,i,r){if(xe(t)){var n=t.map(t=>ql(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return jl(t,e,i,r)||void 0}function jl(t,e,i,r){if(!Te(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Fl(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:xe(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&xl.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!Ll(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Ml){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?Dl(Fl(t,l),e):$l(Fl(t,l));Ie(u)||Nl(a,l,u)}for(var h of o){var d=Ll(h);for(var v of Object.keys(d)){var c=Fl(t,v),f=d[v];if(!0===f){var p=$l(c);Ie(p)||Nl(a,v,p)}else{var g=ql(c,e,i,f);Ie(g)||Nl(a,v,g)}}}var m=ql(Fl(t,"@graph"),e,i);return Ie(m)||Nl(a,"@graph",m),Object.keys(a).length?a:null}function Bl(t,e,i){if(!Te(t))return null;var r=Fl(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var s=jl(t,e,i);return s?n({"@context":"https://schema.org"},s):null}function Hl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function zl(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 Ul(t,e,i){for(var r=t;r;){if(zl(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 Wl(t){return Hl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Hl)}function Vl(t){return Ie(t)?void 0:Math.round(t)}function Gl(t){return Te(t)?t.network_timing:t}var Zl,Jl,Ql=Pn("[SessionRecording]"),Kl=[1,2,3,4,5,6,7,12],Xl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Yl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function tu(){var t;return null==(t=Yl())?void 0:t.record}function eu(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,So())}}function iu(t){return aa(sa(oa(eu(t))),!0)}function ru(t){return nu.apply(this,arguments)}function nu(){return(nu=o(function*(t){var e=yield an(eu(t),La.DEBUG,{rethrow:!0});return aa(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var su="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,ou=!1;function au(t){return xe(t)&&0===t.length?Zl=null!=Zl?Zl:iu([]):iu(t)}function lu(t){return uu.apply(this,arguments)}function uu(){return(uu=o(function*(t){return xe(t)&&0===t.length?Zl||(Jl=null!=Jl?Jl:ru([]).then(t=>(Zl=t,t)).catch(t=>{throw Zl=void 0,Jl=void 0,t})):ru(t)})).apply(this,arguments)}function hu(t){return su&&!ou&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function du(t){return{event:t,size:Co(t)}}function vu(t,e){return n({},t,{data:e,cv:"2024-10"})}function cu(t,e){return n({},t,{cv:"2024-10",data:n({},t.data,e)})}function fu(t){try{if(2===t.type)return du(vu(t,iu(t.data)));if(3===t.type&&0===t.data.source)return du(cu(t,{texts:au(t.data.texts),attributes:au(t.data.attributes),removes:au(t.data.removes),adds:au(t.data.adds)}));if(3===t.type&&8===t.data.source)return du(cu(t,{adds:t.data.adds?iu(t.data.adds):void 0,removes:t.data.removes?iu(t.data.removes):void 0}))}catch(t){Ql.error("could not compress event - will use uncompressed event",t)}return{event:t,size:xo(t)}}function pu(){return pu=o(function*(t){try{if(2===t.type)return du(vu(t,yield ru(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([lu(t.data.texts),lu(t.data.attributes),lu(t.data.removes),lu(t.data.adds)]);return du(cu(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?ru(t.data.adds):void 0,t.data.removes?ru(t.data.removes):void 0]);return du(cu(t,{adds:i[0],removes:i[1]}))}}catch(e){return nn(e)&&(ou=!0),Ql.error("could not compress event asynchronously - trying synchronous compression",e),fu(t)}return{event:t,size:xo(t)}}),pu.apply(this,arguments)}function gu(t,e){return 5===t.type&&t.data.tag===e}function mu(t){return gu(t,"sessionIdle")}function yu(t){return gu(t,"$session_ending")}function bu(t){return gu(t,"$session_starting")}var _u=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 ol(this._instance.get_property(Z),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Fe(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=Yl())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ze(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.Ue(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 Fe(i)&&Fe(r)?r-i:null},this.Ge=()=>{var t,e,i=this.ie;if(!Fe(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 Fe(r)&&r>=0&&i>r}if(this.Ve())return!1;var n,s=this.Ze();return!!Ae(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 yo(this._instance),this.Y=new mo(this._instance),this.tt=new bo(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||Ql.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 Na(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 Ie(d)&&Ie(v)&&Ie(c)&&Ie(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(!Pe(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!Ie(r)&&r!==n});0!==r.length&&(this.xe=!0,Ql.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=Gl(this._instance.config.capture_performance),l=Gl(null==r?void 0:r.capturePerformance),u=!!($e(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&&Ce(s))if(!Wn.includes(d.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Ce(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,s={payloadSizeLimitBytes:zs.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...zs.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...zs.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=Hs(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Js(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Js(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&&Zs.some(t=>0===o.indexOf(t))))return t}})((Gs((r=e).requestHeaders),Gs(r.responseHeaders),r),t.api_host,i));var r},d=Ce(t.session_recording.maskNetworkRequestFn);return d&&Ce(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=Ce(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 Pe(n)&&r?(Ks.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Ie(t))return t.requestBody=Qs(t.requestBody,"Request"),t.responseBody=Qs(t.responseBody,"Response"),t}(h(t)),n({},zs,s,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,o)))}else Ql.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?[...ul,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(Qn(i,r,dl))}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}):Ql.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(Xl(()=>tu().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=tu();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(Xl(()=>tu().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 Fe(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),Ql.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"}),Ql.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=Te(t)?t:JSON.parse(t)}catch(t){return void Ql.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 Ql.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 ll(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new al(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&&Ce(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&Ce(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.ze(),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)})}):Ce(this.Yt.on)||Ql.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Pe(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){Ql.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else Ql.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.zr)||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){Ql.warn("could not stop rrweb",t)}this.ae=void 0}Ur(){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(),Ql.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),Ql.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.Ur())return;this.tr(),this.er(),this.Vr(),this.jr(),Ql.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}Ue(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=Yl())||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=!Ie(t),this.Wr=t,Ie(t))r||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,Ql.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(),Ql.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,Ql.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=Yl())||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||Ql.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&&(Ie(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,Ql.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=xo(t.event);if(t.compressionEnabled)try{var r=fu(t.event);e=r.event,i=r.size}catch(t){Ql.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,i)}catch(t){Ql.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?hu(t)?yield function(t){return pu.apply(this,arguments)}(t):fu(t):{event:t,size:xo(t)};i=o.event,r=o.size}catch(e){Ql.error("could not process queued compression event - will use uncompressed event",e),i=t,r=xo(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,a,l,u;if(this._instance.sessionManager&&(this.Tr(),t&&Te(t))){if(4===t.type){var h=this.mr(t.data.href);if(this.Mr=h,!h)return;t.data.href=h}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 d,v,c;2===t.type&&(null!=(d=Yl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(v=this.zr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[et]:t.timestamp},void 0));var f=2===t.type&&(null==(i=this.ne)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ai();var p=this.zr?this.zr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Te(e)&&6===e.type&&Te(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}(p),m=function(t){return yu(t)?t.data.payload:null}(g),y=function(t){return bu(t)?t.data.payload:null}(g),b=function(t){return mu(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=b&&b.sessionId||this.si(g),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var _=null!==(r=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==r?r:this.Xt,w=null!==(o=null!==(a=null!==(l=null==m?void 0:m.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==a?a:null==b?void 0:b.windowId)&&void 0!==o?o:this.He;if(!0!==this.ce||function(t){return mu(t)||yu(t)||bu(t)}(g)){2===g.type&&(this.de=0),b&&(g.timestamp=b.lastActivityTimestamp+b.threshold);var k=this.se;this.se=!0,f?this._r(!0):k||this._r();var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Le>0||S&&hu(g))this.oi(g,S,_,w);else{var x=S?fu(g):{event:g,size:xo(g)};this.Kr(g,x.event,x.size,_,w)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&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}):Xs}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)&&!yu(t)&&!bu(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 Ie(this.fi)||this._instance.register_for_session({[Vt]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Ie(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}),Ql.info("buffering: "+i))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&Da.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,Da.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=Da.Nt(this.sr);Da.Dt(this.sr),Te(t)&&xe(t.data)&&0!==t.data.length&&xe(t.sizes)&&t.sizes.length===t.data.length&&Fe(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();To(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:La.LIB_NAME,$lib_version:La.LIB_VERSION,$snapshot_host:o})}catch(t){Ql.warn("could not capture snapshot chunk - skipping it",t)}}),Ie(this.yi)||(Da.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}),Ql.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!==Kl.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.Ue(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()}}ze(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=null==(t=Yl())||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:Vl(null==(i=this.Zr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Vl(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:Vl(null==u?void 0:u.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Vl(null==u?void 0:u.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Vl(null==(a=Yl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Yl())||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={};Ie(c.mousemove)||(f.mousemove=c.mousemove),Ie(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 Ce(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(Ce(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Me||(this.Me=!0,Ql.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,Ql.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=tu();if(p){this.zr=null!==(t=this.zr)&&void 0!==t?t:new la(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";Ql.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,Ql.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.ae)return this.we=!0,void Ql.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=Sl,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?Tl:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!Ul(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 Ul(t,e.blockClass,e.blockSelector)||Ul(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=Tl),!t||t.length>Sl)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=xe(i)?i.map(t=>Bl(t,e,r)):Bl(i,e,r);if(r.exceeded||Ae(n)||xe(n)&&(!n.length||n.some(Ae)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,o);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Ae(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 Wl(t))a(e)};for(var i of t)if("childList"===i.type)Hl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&Hl(r)&&a(r)}else"attributes"===i.type&&Hl(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()&&Wl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(h,a.MutationObserver,{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=$e(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 Ql.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}},wu=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}({}),ku=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}({}),Su=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}({}),xu=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Cu=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Tu=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}({}),Mu=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 Iu(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 Eu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Ru={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Au={};function Pu(t){if(Au[t])return Au[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 Eu?Eu[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 Ru?Ru[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 Au[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 Iu(t,"AppleWebKit")&&!Iu(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Au[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Fu=Object.create(null);function Ou(t,e,i){var r,n=Fu[t],s=n[i];if(s)return s.call(e);var o=Pu(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]}Fu.Node=Object.create(null),Fu.ShadowRoot=Object.create(null),Fu.MutationObserver=Object.create(null),Fu.Element=Object.create(null);var $u,Du={};function Lu(t,e,i){var r=t+"."+String(i);if(Du[r])return Du[r].bind(e);var n=Pu(t)[i];return"function"!=typeof n?e[i]:(Du[r]=n,n.bind(e))}function Nu(){return Pu("MutationObserver").constructor}function qu(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 ju={childNodes:t=>Ou("Node",t,"childNodes"),parentNode:t=>Ou("Node",t,"parentNode"),parentElement:t=>Ou("Node",t,"parentElement"),textContent:t=>Ou("Node",t,"textContent"),isConnected(t){if(void 0===$u){var e,i=null===(e=Object.getOwnPropertyDescriptor(Pu("Node"),"isConnected"))||void 0===e?void 0:e.get;$u=(null==i?void 0:i.toString().includes("[native code]"))?i:null}return null==$u?void 0:$u.call(t)},contains:(t,e)=>Lu("Node",t,"contains")(e),getRootNode:t=>Lu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Ou("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Ou("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Lu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Lu("Element",t,"querySelectorAll")(e),mutationObserver:Nu,patch:qu};function Bu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Hu=0;function zu(){Hu+=1}function Uu(){return Hu}function Wu(t,e){return(e!==Hu||t>6e4)&&!0}var Vu=0,Gu=0,Zu=0,Ju={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Qu=null,Ku=null,Xu=[],Yu=0,th=0,eh={slowestBatchMs:0},ih={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function rh(t){(Vu+=1)>1||(Ju={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Xu=[],Yu=0,Ku=(t=>t&&t>0?t:null)(t),Gu=Bu(),Zu=Hu)}function nh(){return 0===Vu?Qu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Vu-=1)>0?Ju:(Ju.durationMs=Bu()-Gu,Ju.deferredStylesheetCount=Yu,ih.deferredCount+=Yu,Ku=null,Wu(Ju.durationMs,Zu)?Ju:Qu=Ju)}function sh(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+=sh(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+=sh(l,e,i+1))}}}catch(t){}}return r}function oh(t){if(0!==Vu){var e=sh(t,null,0);Ju.cssRuleCount+=e,th>0&&(Ju.nonDeferrableCssRuleCount+=e)}}function ah(t){th+=1;try{return t()}finally{th-=1}}function lh(t){Vu>0&&(Ju.stylesheetMs+=t)}function uh(t){if(0===Vu||null===Ku)return!1;var e=Ju.cssRuleCount-Ju.nonDeferrableCssRuleCount;return e>=Ku||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),sh(e,i,0)}catch(t){return 0}}(t)>Ku}function hh(){ih.failedCount+=1}function dh(t){t>0&&(ih.abandonedCount+=t)}function vh(t){return vh="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},vh(t)}function ch(t,e,i){return(e=function(t){var e=function(t){if("object"!=vh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=vh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vh(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function fh(t){return t.nodeType===t.ELEMENT_NODE}function ph(t){var e=t&&"host"in t&&"mode"in t&&ju.host(t)||null;return Boolean(e&&"shadowRoot"in e&&ju.shadowRoot(e)===t)}function gh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function mh(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 yh(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 bh=0;function _h(t){var e=0===bh,i=e?Bu():0;bh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;oh(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),mh(Array.from(r,t=>wh(t,n)).join(""))}catch(t){return null}finally{bh-=1,e&&lh(Bu()-i)}}function wh(t,e){if(Sh(t)){var i;try{i=_h(t.styleSheet)||yh(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return qh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return xh(t)&&t.selectorText.includes(":")&&(n=kh(n)),e?qh(n,e):n}function kh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Sh(t){return"styleSheet"in t}function xh(t){return"selectorText"in t}var Ch=/^-?[A-Za-z_][\w-]*$/,Th=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Mh(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||yh(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=qh(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&&Sh(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(xh(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&&!Ch.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]?Ch.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Th.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?qh(r,n):r,fixColons:"sheet"===i.kind&&xh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&xh(i)&&i.selectorText.includes(":")&&(s=kh(s)),t.parts.push(t.sheetHref?qh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;oh(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,!Sh(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;oh(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=Bu(),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?kh(h):h}else u=mh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{lh(Bu()-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 Ih=class{constructor(){ch(this,"idNodeMap",new Map),ch(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)),fh(t)){var i=ju.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 Eh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Rh(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Rh(t){return t.toLowerCase()}var Ah=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 Ph(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&&Ah.has(Rh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Fh="__rrweb_original__";function Oh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Rh(e):null}catch(t){return null}}var $h=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Dh=/^(?:[a-z+]+:)?\/\//i,Lh=/^www\..*/i,Nh=/^(data:)([^,]*),(.*)/i;function qh(t,e){return(t||"").replace($h,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Dh.test(l)||Lh.test(l))return"url("+u+l+u+")";if(Nh.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 jh,Bh,Hh=new Map,zh=1,Uh=new RegExp("[^a-z0-9-_:]");function Wh(){return zh++}var Vh=/^[^ \t\n\r\u000c]+/,Gh=/^[, \t\n\r\u000c]+/,Zh=new WeakMap;function Jh(t,e){return e&&""!==e.trim()?Qh(t,e):e}function Qh(t,e){var i=Zh.get(t);if(i||(i=t.createElement("a"),Zh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Kh(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 Xh(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=Jh(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=Hh.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(Hh.size>=10){var u=Hh.keys().next().value;void 0!==u&&Hh.delete(u)}return Hh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Kh(u,s)}if("image"===e)return Kh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Jh(t,r);return"image"===e&&h.startsWith("data:")?Kh(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(Gh),e.length>i;){var s=r(Vh);if(","===s.slice(-1))s=Jh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Jh(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?qh(r,Qh(t)):"object"===e&&"data"===i?Jh(t,r):r:Jh(t,r)}function Yh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function td(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&td(ju.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&td(ju.parentNode(t),e,i)}function ed(t,e,i,r){var n;if(fh(t)){if(!ju.childNodes(n=t).length)return!1}else{if(null===ju.parentElement(t))return!1;n=ju.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(td(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 id(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var rd=new Map;function nd(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function sd(t){return null==t?"":t.toLowerCase()}var od=!1,ad=!1;function ld(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 ad=!0,od||(od=!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=ed(t,o,a,void 0===U)),Vu>0&&(Ju.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:Mu.Document,childNodes:[],compatMode:t.compatMode}:{type:Mu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Mu.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=Rh(t.tagName);return Uh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];Yh(_,C.name)||(k[C.name]=Xh(i,_,Rh(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=nd(i,M))&&M.includes(".css")&&(T=nd(i,window.location.origin+"/"+M.replace(window.location.href,"")))}var I=null;T&&(uh(T)?Vu>0&&(Xu.push(t),Yu+=1):I=_h(T)),I&&(delete k.rel,delete k.href,k._cssText=I)}if("style"===_&&t.sheet&&!(t.innerText||ju.textContent(t)||"").trim().length){var E=ah(()=>_h(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=Eh({element:t,type:Oh(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((Fh in n?n[Fh]: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){jh||(jh=i.createElement("canvas"),Bh=jh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Ph({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,H=()=>{id(N,"load",H);try{jh.width=N.naturalWidth,jh.height=N.naturalHeight,Bh.drawImage(N,0,0);var t=jh.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]=Ph({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:Mu.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=ju.parentNode(t),o=s&&s.tagName,a=ju.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(uh(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=_h(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=qh(a,Qh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,ju.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Mu.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Mu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Mu.Comment,textContent:ju.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===Mu.Comment)return!0;if(t.type===Mu.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&&(sd(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===sd(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(sd(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&sd(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(sd(t.attributes.property).match(/^(og|twitter|fb):/)||sd(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===sd(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(sd(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(sd(t.attributes.name))||sd(t.attributes.property).match(/^article:/)||sd(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(sd(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===Mu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Wh();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===Mu.Element){Q=Q&&!J.needBlock,delete J.needBlock;var K=ju.shadowRoot(t);K&&gh(K)&&(J.isShadowHost=!0)}if((J.type===Mu.Document||J.type===Mu.Element)&&Q){b.headWhitespace&&J.type===Mu.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===Mu.Element&&"textarea"===J.tagName&&void 0!==J.attributes.value);else for(var Y of Array.from(ju.childNodes(t))){var tt=ld(Y,X);tt&&J.childNodes.push(tt)}var et=null;if(fh(t)&&(et=ju.shadowRoot(t)))for(var it of Array.from(ju.childNodes(et))){var rt=ld(it,X);rt&&(gh(et)&&(rt.isShadow=!0),J.childNodes.push(rt))}}var nt=ju.parentNode(t);if(nt&&ph(nt)&&gh(nt)&&(J.isShadow=!0),J.type===Mu.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),id(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?id(t,"load",o):(a=!0,id(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),id(t,"load",o)}}return t.addEventListener("load",o),()=>{id(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&I){var i=ld(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===Mu.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,l,u){if(!rd.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=ld(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{rd.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),rd.set(e,v)}}}(t,0,O),J}function ud(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 hd=class t{constructor(){ch(this,"parentElement",null),ch(this,"parentNode",null),ch(this,"ownerDocument",void 0),ch(this,"firstChild",null),ch(this,"lastChild",null),ch(this,"previousSibling",null),ch(this,"nextSibling",null),ch(this,"ELEMENT_NODE",1),ch(this,"TEXT_NODE",3),ch(this,"nodeType",void 0),ch(this,"nodeName",void 0),ch(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 dd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>vd(i,t,e,r)}function vd(t,e,i,r){cd(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function cd(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function fd(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var pd="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.",gd={map:{},getId(){return console.error(pd),-1},getNode(){return console.error(pd),null},removeNodeFromMap(){console.error(pd)},has(){return console.error(pd),!1},reset(){console.error(pd)}};function md(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 yd(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)}}}),()=>yd(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gd=new Proxy(gd,{get(t,e,i){return"map"===e&&console.error(pd),Reflect.get(t,e,i)}}));var bd=Date.now;function _d(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=ju.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=ju.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 wd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Sd(t){return t?t.nodeType===t.ELEMENT_NODE?t:ju.parentElement(t):null}function xd(t,e,i,r){if(!t)return!1;var n=Sd(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(td(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 Cd(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function Td(t,e){if(ph(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=ju.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Td(r,e))}function Md(t){return Boolean(t.changedTouches)}function Id(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ed(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Rd(t){return!!t&&(t instanceof hd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(ju.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bd=()=>(new Date).getTime());var Ad=class{constructor(){ch(this,"id",1),ch(this,"styleIDMap",new WeakMap),ch(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 Pd(t){var e,i=null;return"getRootNode"in t&&(null===(e=ju.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ju.host(ju.getRootNode(t))&&(i=ju.host(ju.getRootNode(t))),i}function Fd(t){var e=t.ownerDocument;if(!e)return!1;if(ju.contains(e,t))return!0;var i=ju.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=Pd(i);)i=e;return i}(t);return ju.contains(e,i)}(t)}function Od(t){return"__ln"in t}var $d,Dd=class{constructor(){ch(this,"length",0),ch(this,"head",null),ch(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&&Od(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&&Od(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--)}},Ld=(t,e)=>t+"@"+e,Nd=class{constructor(){ch(this,"frozen",!1),ch(this,"locked",!1),ch(this,"texts",[]),ch(this,"attributes",[]),ch(this,"attributeMap",new WeakMap),ch(this,"generatedAttributes",new WeakMap),ch(this,"removes",[]),ch(this,"mapRemoves",new Set),ch(this,"movedMap",{}),ch(this,"addedSet",new Set),ch(this,"movedSet",new Set),ch(this,"droppedSet",new Set),ch(this,"removesSubTreeCache",new Set),ch(this,"mutationCb",void 0),ch(this,"blockClass",void 0),ch(this,"blockSelector",void 0),ch(this,"maskTextClass",void 0),ch(this,"maskTextSelector",void 0),ch(this,"inlineStylesheet",void 0),ch(this,"maskInputOptions",void 0),ch(this,"maskTextFn",void 0),ch(this,"maskInputFn",void 0),ch(this,"maskAllElementAttributes",void 0),ch(this,"maskAttributeFn",void 0),ch(this,"keepIframeSrcFn",void 0),ch(this,"recordCanvas",void 0),ch(this,"canvasMaskingConfigured",void 0),ch(this,"inlineImages",void 0),ch(this,"slimDOMOptions",void 0),ch(this,"dataURLOptions",void 0),ch(this,"doc",void 0),ch(this,"mirror",void 0),ch(this,"iframeManager",void 0),ch(this,"stylesheetManager",void 0),ch(this,"shadowDomManager",void 0),ch(this,"canvasManager",void 0),ch(this,"processedNodeManager",void 0),ch(this,"unattachedDoc",void 0),ch(this,"canvasManagerReleased",!1),ch(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),ch(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=Bu(),r=Uu();try{this.processBufferedMutations()}finally{t=Bu()-i,e=r,Vu>0||Wu(t,null!=e?e:Hu)||t>eh.slowestBatchMs&&(eh.slowestBatchMs=t)}}}),ch(this,"processBufferedMutations",()=>{var t,e=[],i=new Set,r=new Dd,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=ju.parentNode(s);if(o&&Fd(s)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=ph(o)?this.mirror.getId(Pd(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=>{Id(t,this.mirror)&&this.iframeManager.addIframe(t),Ed(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Rd(t)&&!xd(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(ju.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=ld(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)jd(this.removesSubTreeCache,a)&&!this.movedSet.has(ju.parentNode(a))||s(a);for(var l of this.addedSet)Bd(this.droppedSet,l)||jd(this.removesSubTreeCache,l)?Bd(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(ju.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(ju.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=ju.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=ju.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=ju.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]=Ph({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)}),ch(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),ch(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(ju.childNodes(t),t=>ju.textContent(t)||"").join("");e.attributes.value=Eh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Oh(t),value:i,maskInputFn:this.maskInputFn})}),ch(this,"processMutation",t=>{if(!Cd(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=ju.textContent(t.target);xd(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:ed(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Sd(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=Oh(l);a=Eh({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(xd(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"),!Yh(r.tagName,o)){var v,c=Xh(this.doc,Rh(r.tagName),Rh(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(xd(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=ph(t.target)?this.mirror.getId(ju.host(t.target)):this.mirror.getId(t.target);xd(t.target,this.blockClass,this.blockSelector,!1)||Cd(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(qd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Td(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ld(i,r)]?qd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!ph(t.target)||!gh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),ju.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),ch(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(Cd(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[Ld(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!xd(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var r=ju.childNodes(t),n=0,s=r.length;s>n;n++){var o=r[n];o&&this.genAdds(o)}if(Rd(t))for(var a=ju.childNodes(ju.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),xd(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?ju.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?ju.host(r):null}return!1}};function qd(t,e){for(var i=[e];i.length;){var r=i.pop();if(t.delete(r),r.nodeType!==r.TEXT_NODE)for(var n=ju.childNodes(r),s=0,o=n.length;o>s;s++){var a=n[s];a&&i.push(a)}}}function jd(t,e,i){return 0!==t.size&&function(t,e){var i=ju.parentNode(e);return!!i&&t.has(i)}(t,e)}function Bd(t,e){if(0===t.size)return!1;for(var i=ju.parentNode(e);i;){if(t.has(i))return!0;i=ju.parentNode(i)}return!1}var Hd=function(t,e){return void 0===e&&(e="rrweb"),$d?function(){try{return t(...arguments)}catch(t){if($d&&!0===$d(t,e))return;throw t}}:t},zd=[];function Ud(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 Wd(t,e){var i,r=new Nd;r.init(t);try{i=new(Nu())(Hd(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),zd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Vd(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=Ud(t);if(o&&!xd(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=_d(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=[dd("scroll",Hd(md(Hd(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(dd("scrollend",Hd(l),i)),()=>u.forEach(t=>t())}function Gd(t,e){for(var i=zd.length-1;i>=0;i--){var r=zd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),zd.splice(i,1))}}}var Zd=["INPUT","TEXTAREA","SELECT"],Jd=new WeakMap;function Qd(t){return function t(e,i){if(tv("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||tv("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||tv("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||tv("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 Kd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function Xd(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:ju.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}}),Hd(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Yd(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=Hd(()=>{try{if(r)try{r.destroy(),r.reset()}finally{var e=zd.indexOf(r);-1!==e&&zd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{fd(o)}});try{if(t.recordDOM){var l=Wd(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=md(Hd(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=Hd(md(Hd(t=>{var e=Ud(t),i=Md(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=bd()),l.push({x:r,y:o,id:n.getId(e),timeOffset:bd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?ku.Drag:t instanceof MouseEvent?ku.MouseMove:ku.TouchMove)}),o,{trailing:!1})),d=[dd("mousemove",h,r),dd("touchmove",h,r),dd("drag",h,r)];return Hd(()=>{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(Su).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Rh(t),l=(t=>i=>{var a=Ud(i);if(!xd(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=xu.Mouse;break;case"touch":l=xu.Touch;break;case"pen":l=xu.Pen}l===xu.Touch&&(Su[t]===Su.MouseDown?u="TouchStart":Su[t]===Su.MouseUp&&(u="TouchEnd"))}else Md(i)&&(l=xu.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===xu.Touch||u.startsWith("Mouse")&&l===xu.Mouse)&&(l=null)):Su[t]===Su.Click&&(l=h,h=null);var d=Md(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;Hd(e)(n({type:Su[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Su[t]){case Su.MouseDown:case Su.MouseUp:a=a.replace("mouse","pointer");break;case Su.TouchStart:case Su.TouchEnd:return}u.push(dd(a,l,i))}),Hd(()=>{u.forEach(t=>t())})}(t)),o.push(Vd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return dd("resize",Hd(md(Hd(()=>{var t=wd(),e=kd();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=Ud(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=ju.parentElement(e)),e&&v&&Zd.indexOf(v)>=0&&!xd(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Oh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Eh({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=Jd.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Jd.set(t,i);var o=r.getId(t);Hd(e)(n({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>dd(t,Hd(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=>yd(t[0],t[1],{set(){Hd(v)({target:this,isTrusted:!1})}},!1,p))),Hd(()=>{fd(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=Hd(t=>md(Hd(s=>{var o=Ud(s);if(o&&!xd(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=[dd("play",a(Tu.Play),o),dd("pause",a(Tu.Pause),o),dd("seeked",a(Tu.Seeked),o),dd("volumechange",a(Tu.VolumeChange),o),dd("ratechange",a(Tu.RateChange),o)];return Hd(()=>{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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Kd(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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Kd(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:Hd((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=Kd(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=_h(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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Kd(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={};ev("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(ev("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),ev("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),ev("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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Kd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Qd(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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Kd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Qd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),Hd(()=>{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(Xd(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:Hd((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=Kd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Qd(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:Hd((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=Kd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Qd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),Hd(()=>{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=qu(i.fonts,"add",function(t){return function(i){return setTimeout(Hd(()=>{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),Hd(()=>{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=Hd(()=>{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;xd(d,r,n,!0)||xd(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),dd("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?qu(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 tv(t){return void 0!==window[t]}function ev(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var iv=class{constructor(t){ch(this,"generateIdFn",void 0),ch(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ch(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}},rv=class{constructor(t){ch(this,"iframes",new WeakMap),ch(this,"crossOriginIframeMap",new WeakMap),ch(this,"crossOriginIframeMirror",new iv(Wh)),ch(this,"crossOriginIframeStyleMirror",void 0),ch(this,"crossOriginIframeRootIdMap",new WeakMap),ch(this,"mirror",void 0),ch(this,"mutationCb",void 0),ch(this,"wrappedEmit",void 0),ch(this,"loadListener",void 0),ch(this,"pageHideListener",void 0),ch(this,"stylesheetManager",void 0),ch(this,"recordCrossOriginIframes",void 0),ch(this,"messageHandler",void 0),ch(this,"nestedIframeListeners",new Map),ch(this,"attachedWindows",new WeakMap),ch(this,"attachedDocuments",new WeakMap),ch(this,"attachedIframes",new Map),ch(this,"loadListenerDisposers",new WeakMap),ch(this,"iframeElementsById",new Map),ch(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new iv(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=>cd(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{vd(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);cd(()=>{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)})}cd(()=>{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 wu.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:wu.IncrementalSnapshot,data:{source:ku.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case wu.Meta:case wu.Load:case wu.DomContentLoaded:return!1;case wu.Plugin:return e;case wu.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case wu.IncrementalSnapshot:switch(e.data.source){case ku.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 ku.Drag:case ku.TouchMove:case ku.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case ku.ViewportResize:return!1;case ku.MediaInteraction:case ku.MouseInteraction:case ku.Scroll:case ku.CanvasMutation:case ku.Input:return this.replaceIds(e.data,t,["id"]),e;case ku.StyleSheetRule:case ku.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ku.Font:return e;case ku.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case ku.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===Mu.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&&(vd(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(vd(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=>{cd(()=>this.mirror.removeNodeFromMap(t))}),cd(()=>Gd(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&&vd(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{vd(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}},nv=class{constructor(t){ch(this,"shadowDoms",new WeakSet),ch(this,"mutationCb",void 0),ch(this,"scrollCb",void 0),ch(this,"bypassOptions",void 0),ch(this,"mirror",void 0),ch(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(gh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null===(r=ju.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=Wd(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=zd.indexOf(l);-1!==t&&zd.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Vd(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(ju.host(t))),this.restoreHandlers.push({doc:s,handler:Xd({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:qu(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=ju.shadowRoot(this);return s&&Fd(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}},sv="skip-frame";function ov(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 av="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),uv=0;64>uv;uv++)lv[av.charCodeAt(uv)]=uv;var hv=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=av[i[e]>>2],n+=av[(3&i[e])<<4|i[e+1]>>4],n+=av[(15&i[e+1])<<2|i[e+2]>>6],n+=av[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},dv=new Map,vv=(t,e,i)=>{if(t&&(pv(t,e)||"object"==typeof t)){var r=function(t,e){var i=dv.get(t);return i||dv.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 cv(t,e,i,r){return t instanceof Array?t.map(t=>cv(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:hv(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[cv(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:[cv(t.data,e,i,r),t.width,t.height]}:pv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:vv(t,e,i)}:t}var fv=(t,e,i,r)=>t.map(t=>cv(t,e,i,r)),pv=(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]))},gv=["webgl","webgl2"];function mv(t){return"nodeType"in t}function yv(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 qu(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||mv(o)&&xd(o,e,i,!0))return r.call(this,s);mv(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=qu(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(!xd(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&gv.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 bv(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=qu(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(vv(d,s,this),this.canvas&&"tagName"in this.canvas&&!xd(this.canvas,r,n,!0)){var v={type:e,property:l,args:fv(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=yd(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!xd(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 _v='(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',wv="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",_v],{type:"text/javascript;charset=utf-8"});function kv(t){var e;try{if(!(e=wv&&(self.URL||self.webkitURL).createObjectURL(wv)))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(_v),{name:null==t?void 0:t.name})}}var Sv,xv,Cv,Tv=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){ch(this,"pendingCanvasMutations",new Map),ch(this,"rafStamps",{latestId:0,invokeId:null}),ch(this,"mirror",void 0),ch(this,"mutationCb",void 0),ch(this,"resetObservers",void 0),ch(this,"frozen",!1),ch(this,"locked",!1),ch(this,"rafIdTimestamp",null),ch(this,"rafIdFlush",null),ch(this,"refCount",0),ch(this,"torndown",!1),ch(this,"resetFrameDedup",null),ch(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=yv(e,i,r,!0),h=new Map;try{a=new kv}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:Cu["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=>{xd(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 sv}if(void 0!==o){if(!Array.isArray(o)||!o.every(ov))return sv;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=yv(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=qu(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 xd(this.canvas,i,r,!0)||setTimeout(()=>{var i=fv(l,e,this,n);t(this.canvas,{type:Cu["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=yd(e.CanvasRenderingContext2D.prototype,o,{set(e){xd(this.canvas,i,r,!0)||t(this.canvas,{type:Cu["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(...bv(e.WebGLRenderingContext.prototype,Cu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...bv(e.WebGL2RenderingContext.prototype,Cu.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)}}}},Mv=class{constructor(t){var e;ch(this,"trackedLinkElements",new WeakSet),ch(this,"pendingDeferredSheets",new Set),ch(this,"mutationCb",void 0),ch(this,"adoptedStyleSheetCb",void 0),ch(this,"maskAllElementAttributes",void 0),ch(this,"maskAttributeFn",void 0),ch(this,"styleMirror",new Ad),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=Mh(r))}catch(t){}if(!i||!r)return hh(),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=Bu(),d=Uu(),v=!0;try{if(s)return a=!0,hh(),!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?(hh(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(hh(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),Wu(l=Bu()-h,null!=(u=d)?u:Hu)||(ih.totalMs+=l,l>ih.slowestSliceMs&&(ih.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:Ph({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=Bu();try{ah(()=>{try{var e=t.rules||t.cssRules;e&&oh(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:wh(e,t.href),index:i}))})})}finally{lh(Bu()-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(),rd.forEach(t=>t.abort()),rd.clear()}trackStylesheetInLinkElement(t){}},Iv=class{constructor(){ch(this,"nodeMap",new WeakMap),ch(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(){}},Ev=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Rv,Av=document.createElement("iframe");document.body.appendChild(Av),Array.from=(null===(Rv=Av.contentWindow)||void 0===Rv?void 0:Rv.Array.from)||Array.from,document.body.removeChild(Av)}}catch(t){console.debug("Unable to override Array.from",t)}var Pv=new Ih,Fv=new Set([ku.Mutation,ku.MediaInteraction,ku.StyleSheetRule,ku.CanvasMutation,ku.Font,ku.Log,ku.StyleDeclaration,ku.AdoptedStyleSheet]);function Ov(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 $v(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;$d=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),Pv.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=ud(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};Sv=(t,e)=>{var i,n=t;if(n.timestamp=bd(),!(null===(i=zd[0])||void 0===i?void 0:i.isFrozen())||n.type===wu.FullSnapshot||n.type===wu.IncrementalSnapshot&&Fv.has(n.data.source)||zd.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===wu.FullSnapshot)ut=n,ft=0;else if(n.type===wu.IncrementalSnapshot){if(n.data.source===ku.Mutation&&n.data.isAttachIframe)return;ft++,(o&&ft>=o||s&&n.timestamp-ut.timestamp>s)&&xv(!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=Pv.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()}Sv({type:wu.IncrementalSnapshot,data:n({source:ku.Mutation},t)})},yt=t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.Scroll},t)}),bt=t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.CanvasMutation},t)}),_t=new Mv({mutationCb:mt,adoptedStyleSheetCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new rv({mirror:Pv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:Sv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Pv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Iv,xt=null==N?void 0:N.configured;Cv=new Tv({recordCanvas:z,mutationCb:bt,win:window,blockClass:l,blockSelector:h,mirror:Pv,sampling:F.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new nv({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:Cv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Pv});xv=function(t){if(void 0===t&&(t=!1),B){rh(w);try{Sv({type:wu.Meta,data:{href:window.location.href,width:kd(),height:wd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),zd.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Ih: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=ud(void 0!==M&&M);rh(j);try{return ld(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{nh()}}(document,{mirror:Pv,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){Id(t,Pv)&&wt.addIframe(t),Ed(t,Pv)&&_t.trackLinkElement(t),Rd(t)&&Ct.addShadowRoot(ju.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=Xu,Xu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Sv({type:wu.FullSnapshot,data:{node:r,initialOffset:_d(window)}},t),zd.forEach(t=>t.unlock()),Cv.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&&cd(()=>{o=e.beginDeferredLinkInlining(i,Pv.getId(i))})},u=()=>{if(o){var t=o,e=!0;cd(()=>{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,dh(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Ov(d):i())}};return n=Ov(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);dh(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,Pv.getId(document))}finally{nh()}var s}};try{var Tt=[];for(var Mt of(Tt.push(dd("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(dd(Mt,zu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{cd(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=Pv.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 Hd(Yd)({mutationCb:mt,mousemoveCb:(t,e)=>Sv({type:wu.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.ViewportResize},t)}),inputCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.Input},t)}),mediaInteractionCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.MediaInteraction},t)}),styleSheetRuleCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.StyleSheetRule},t)}),styleDeclarationCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>Sv({type:wu.IncrementalSnapshot,data:n({source:ku.Font},t)}),selectionCb(t){Sv({type:wu.IncrementalSnapshot,data:n({source:ku.Selection},t)})},customElementCb(t){Sv({type:wu.IncrementalSnapshot,data:n({source:ku.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:Pv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Cv,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=>Sv({type:wu.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Pv.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=Pv.getId(t);null==vt||vt(e),Gd(t)});var Et=-1,Rt=t=>Sv({type:wu.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?Pv.getId(s):-1;o!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{xv();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(dd("fullscreenchange",At)),Tt.push(dd("webkitfullscreenchange",At)),Tt.push(dd("mozfullscreenchange",At)),Tt.push(dd("MSFullscreenChange",At)),Ev=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(dd("DOMContentLoaded",()=>{Sv({type:wu.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(dd("load",()=>{Sv({type:wu.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,fd(Tt),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Pv.reset(),Ev=!1,$d=void 0}}catch(t){console.warn(t)}}$v.addCustomEvent=(t,e)=>{if(!Ev)throw new Error("please add custom event after start recording");Sv({type:wu.Custom,data:{tag:t,payload:e}})},$v.freezePage=()=>{zd.forEach(t=>t.freeze())},$v.takeFullSnapshot=t=>{if(!Ev)throw new Error("please take full snapshot after start recording");xv(t)},$v.mirror=Pv,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Dv=Object.create(null);function Lv(t){return Lv="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},Lv(t)}function Nv(t,e,i){return(e=function(t){var e=function(t){if("object"!=Lv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Lv(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Dv.Node=Object.create(null),Dv.ShadowRoot=Object.create(null),Dv.MutationObserver=Object.create(null),Dv.Element=Object.create(null);var qv=class{constructor(t){Nv(this,"fileName",void 0),Nv(this,"functionName",void 0),Nv(this,"lineNumber",void 0),Nv(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}},jv=/(^|@)\S+:\d+/,Bv=/^\s*at .*(\S+:\d+|\(native\))/m,Hv=/^(eval@)?(\[native code])?$/,zv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Bv)?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(Bv)},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 qv({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(Hv)},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 qv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new qv({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 qv({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 qv({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(jv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new qv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function Uv(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 Wv(t){return Array.isArray(t)}function Vv(t){return"object"==typeof t&&null!==t&&!Wv(t)}function Gv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(Vv(t[i])&&Gv(t[i],e-1))return!0;return!1}function Zv(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(Vv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||Vv(o)&&Gv(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]=Wv(u)?Uv(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 Jv={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 Qv(t,e,i){var r,n=i?Object.assign({},Jv,i):Jv,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:zv.parse(e.error).map(t=>t.toString()),payload:[Zv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[Zv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Zv("Uncaught (in promise)",n.stringifyOptions),Zv(e.reason,n.stringifyOptions)]),t({level:"error",trace:zv.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=zv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>Zv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Zv("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 Kv=t=>({name:"rrweb/console@1",observer:Qv,options:t}),Xv=()=>{},Yv=t=>{var e;if(Ce(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function tc(t,e,i){try{if(!(e in t))return Xv;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 Ce(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=Yv(i);s;){if(s.next===n)return void(s.next=r.next);s=Yv(i=s.next)}else t[e]=r.next}}catch(t){return Xv}}function ec(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 ic=Pn("[Recorder]"),rc=t=>"navigation"===t.entryType,nc=t=>"resource"===t.entryType;function sc(t,e){return!!e&&($e(e)||e[t])}function oc(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 ac=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function lc(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:!!oc(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(ac))return!1;if($e(i))return!0;if(xe(i))return n(i);var s=i[e];return $e(s)?s:n(s)}function uc(t,e,i,r,n,s){return hc.apply(this,arguments)}function hc(){return hc=o(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(ic.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=>nc(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),uc(t,e,i,r,n,s+1))}),hc.apply(this,arguments)}function dc(t){var e=t.body,i=t.options,r=t.url;if(Pe(e))return null;var n=ec(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Ee(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(De(e))return Zn(e);if(Te(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 vc=t=>!Ae(t)&&("navigation"===t.entryType||"resource"===t.entryType);function cc(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:Ie(a)?void 0:Math.round(a),endTime:Ie(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(vc(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 fc=["video/","audio/"];function pc(t){return Te(t)&&Ce(t.getReader)&&Ce(t.tee)}var gc="[SessionReplay] Timeout while trying to read body",mc="[SessionReplay] Failed to read body";function yc(t){return mc+": "+t}function bc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function _c(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(gc),500);try{t.clone().text().then(t=>e(t),t=>e(yc(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(mc)}})}(t);var i=Hs(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(bc(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(gc),500);try{a=t.clone()}catch(t){return void o(mc)}var u=a.body;if(pc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(mc)}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(bc(e));d+=a.byteLength,h.push(a)}t()}},t=>o(yc(t)))}()}else try{a.text().then(t=>o(t),t=>o(yc(t)))}catch(t){o(mc)}})}(t,i)}function wc(){return wc=o(function*(t){var e=t.r,i=t.options,r=ec(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):_c(e,i)}),wc.apply(this,arguments)}function kc(){return kc=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=fc.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=ec(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Ae(r)?_c(e,i):Promise.resolve(r)}),kc.apply(this,arguments)}var Sc=null;function xc(t,e,i){if(!("performance"in e))return()=>{};if(Sc)return ic.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},zs,i):zs,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&&Ks.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=>rc(t)||nc(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>cc({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=>rc(t)||nc(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>cc({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=sc("request",i.recordHeaders),n=sc("response",i.recordHeaders),s=tc(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=>(lc({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=dc({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),lc({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=dc({body:d.response,options:i,url:a})),uc(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:cc({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){ic.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=sc("request",i.recordHeaders),n=sc("response",i.recordHeaders),s=tc(e,"fetch",s=>function(){var a=o(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return ic.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),!pc(null==a?void 0:a.body)&&lc({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return wc.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){ic.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=oc(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),lc({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return kc.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){ic.error("Failed to record fetch response for network capture",t)}return u}finally{uc(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:cc({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)),Sc=()=>{a(),l(),u(),Sc=null}}var Cc,Tc,Mc,Ic,Ec,Rc,Ac,Pc,Fc,Oc,$c,Dc,Lc,Nc,qc,jc=t=>({name:"rrweb/network@1",observer:xc,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Kv,getRecordNetworkPlugin:jc},b.__PosthogExtensions__.rrweb={record:$v,version:"v2",wasMaxDepthReached:()=>ad,resetMaxDepthState(){ad=!1,od=!1},getLastSnapshotCost:()=>Qu,getMutationCost:()=>n({},eh),resetSnapshotCostState(){Vu=0,Gu=0,Zu=0,Hu=0,Ju={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Qu=null,Ku=null,Xu=[],Yu=0,th=0,eh={slowestBatchMs:0},ih={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:$v,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:Kv},b.getRecordNetworkPlugin=jc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new _u(t,e);var Bc,Hc,zc,Uc,Wc={},Vc=[],Gc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zc=Array.isArray;function Jc(t,e){for(var i in e)t[i]=e[i];return t}function Qc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Kc(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?Cc.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 Xc(t,o,r,n,null)}function Xc(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?++Mc:n,__i:-1,__u:0};return null==n&&null!=Tc.vnode&&Tc.vnode(s),s}function Yc(t){return t.children}function tf(t,e){this.props=t,this.context=e}function ef(t,e){if(null==e)return t.__?ef(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?ef(t):null}function rf(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Jc({},e);s.__v=e.__v+1,Tc.vnode&&Tc.vnode(s),cf(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?ef(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,pf(r,s,n),e.__e=e.__=null,s.__e!=i&&nf(s)}}function nf(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}),nf(t)}function sf(t){(!t.__d&&(t.__d=!0)&&Ic.push(t)&&!of.__r++||Ec!=Tc.debounceRendering)&&((Ec=Tc.debounceRendering)||Rc)(of)}function of(){try{for(var t,e=1;Ic.length;)Ic.length>e&&Ic.sort(Ac),t=Ic.shift(),e=Ic.length,rf(t)}finally{Ic.length=of.__r=0}}function af(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Vc,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]=Xc(null,o,null,null,null):Zc(o)?o=t.__k[s]=Xc(Yc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Xc(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=uf(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=ef(a)),yf(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]||Wc,c.__i=d,g=cf(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&mf(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=lf(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 lf(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=lf(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=ef(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function uf(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 hf(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Gc.test(e)?i:i+"px"}function df(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||hf(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||hf(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace($c,"$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[Oc]=r[Oc]:(i[Oc]=Dc,t.addEventListener(e,s?Nc:Lc,s)):t.removeEventListener(e,s?Nc:Lc,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 vf(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Fc])e[Fc]=Dc++;else if(i[Oc]>e[Fc])return;return i(Tc.event?Tc.event(e):e)}}}function cf(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=Tc.__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 tf(y,_),v.constructor=C,v.render=bf),$&&$.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=Jc({},v.__s)),Jc(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)}),Vc.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=Tc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Vc.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=Jc(Jc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Yc&&null==h.key?gf(h.props.children):h,a=af(t,Zc(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--;)Qc(s[x]);ff(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||ff(e);Tc.__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||Wc,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&&(Tc.__m&&Tc.__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&&Cc.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||df(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||df(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=""),af("template"==e.type?t.content:t,Zc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&ef(i,0),a,l),null!=s)for(u=s.length;u--;)Qc(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])&&df(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&df(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Tc.diffed)&&h(e),128&e.__u?void 0:a}function ff(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ff))}function pf(t,e,i){for(var r=0;i.length>r;r++)mf(i[r],i[++r],i[++r]);Tc.__c&&Tc.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){Tc.__e(t,e.__v)}})}function gf(t){return"object"!=typeof t||null==t||t.__b>0?t:Zc(t)?t.map(gf):void 0!==t.constructor?null:Jc({},t)}function mf(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){Tc.__e(t,i)}}function yf(t,e,i){var r,n;if(Tc.unmount&&Tc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||mf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Tc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&yf(r[n],e,i||"function"!=typeof t.type);i||Qc(t.__e),t.__c=t.__=t.__e=void 0}function bf(t,e,i){return this.constructor(t,i)}function _f(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),Tc.__&&Tc.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],cf(e,t=(!r&&i||e).__k=Kc(Yc,null,[t]),n||Wc,Wc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?Cc.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),pf(s,t,o),t.props.children=null}Cc=Vc.slice,Tc={__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}},Mc=0,tf.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Jc({},this.state);"function"==typeof t&&(t=t(Jc({},i),this.props)),t&&Jc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),sf(this))},tf.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),sf(this))},tf.prototype.render=Yc,Ic=[],Rc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ac=function(t,e){return t.__v.__b-e.__v.__b},of.__r=0,Pc=Math.random().toString(8),Fc="__d"+Pc,Oc="__a"+Pc,$c=/(PointerCapture)$|Capture$/i,Dc=0,Lc=vf(!1),Nc=vf(!0),qc=0;var wf=0,kf=[],Sf=Tc,xf=Sf.__b,Cf=Sf.__r,Tf=Sf.diffed,Mf=Sf.__c,If=Sf.unmount,Ef=Sf.__;function Rf(t,e){Sf.__h&&Sf.__h(Hc,t,wf||e),wf=0;var i=Hc.__H||(Hc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Af(t){return wf=1,function(t,e){var i=Rf(Bc++,2);if(i.t=t,!i.__c&&(i.__=[Hf(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=Hc,!Hc.__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};Hc.__f=!0;var n=Hc.shouldComponentUpdate,s=Hc.componentWillUpdate;Hc.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)},Hc.shouldComponentUpdate=r}return i.__N||i.__}(Hf,t)}function Pf(t,e){var i=Rf(Bc++,3);!Sf.__s&&Bf(i.__H,e)&&(i.__=t,i.u=e,Hc.__H.__h.push(i))}function Ff(t){return wf=5,Of(function(){return{current:t}},[])}function Of(t,e){var i=Rf(Bc++,7);return Bf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function $f(t){var e,i=Hc.context[t.__c],r=Rf(Bc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(Hc)),i.props.value):t.__}function Df(){for(var t;t=kf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(qf),e.__h.some(jf),e.__h=[]}catch(i){e.__h=[],Sf.__e(i,t.__v)}}}Sf.__b=function(t){Hc=null,xf&&xf(t)},Sf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ef&&Ef(t,e)},Sf.__r=function(t){Cf&&Cf(t),Bc=0;var e=(Hc=t.__c).__H;e&&(zc===Hc?(e.__h=[],Hc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Df(),Bc=0)),zc=Hc},Sf.diffed=function(t){Tf&&Tf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==kf.push(e)&&Uc===Sf.requestAnimationFrame||((Uc=Sf.requestAnimationFrame)||Nf)(Df)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),zc=Hc=null},Sf.__c=function(t,e){e.some(function(t){try{t.__h.some(qf),t.__h=t.__h.filter(function(t){return!t.__||jf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Sf.__e(i,t.__v)}}),Mf&&Mf(t,e)},Sf.unmount=function(t){If&&If(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{qf(t)}catch(t){e=t}}),i.__H=void 0,e&&Sf.__e(e,i.__v))};var Lf="function"==typeof requestAnimationFrame;function Nf(t){var e,i=function(){clearTimeout(r),Lf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Lf&&(e=requestAnimationFrame(i))}function qf(t){var e=Hc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Hc=e}function jf(t){var e=Hc;t.__c=t.__(),Hc=e}function Bf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function Hf(t,e){return"function"==typeof e?e(t):e}var zf="gzip-js",Uf="base64",Wf="events",Vf="cancelEvents",Gf="tab",Zf="left",Jf="center",Qf="right",Kf="next_to_trigger",Xf="popover",Yf="widget",tp="external_survey",ep="open",ip="multiple_choice",rp="single_choice",np="rating",sp="end",op="always",ap="survey shown",lp="survey dismissed",up="survey sent",hp="$survey_id",dp="$survey_name",vp="$survey_iteration",cp="$survey_iteration_start_date",fp="$survey_partially_completed",pp="$survey_submission_id",gp="$survey_completed",mp="$survey_last_seen_date",yp="$survey_language",bp="popover";function _p(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Ce(i.then)&&i.then(void 0,()=>{})}}}}var wp=Pn("[Surveys]");function kp(t){return!(!t.start_date||t.end_date)}function Sp(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var xp=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Cp=t=>xp("seenSurvey_",t),Tp=t=>{try{var e=Cp(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){wp.error("Failed to persist survey seen state",t)}},Mp=[Xf,Yf,"api"],Ip={ignoreConditions:!1,ignoreDelay:!1,displayType:bp},Ep="logs",Rp=Pn("[Stylesheet Loader]"),Ap=a,Pp=h,Fp="#020617",Op={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Qf,widgetType:Gf,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:Fp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},$p=[Jf,Zf,Qf];function Dp(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 Lp(t){var e;void 0===t&&(t=Op.backgroundColor),"#"===t[0]&&(e=Dp(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=Dp(i)),!e)return Fp;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?Fp:"white"}return Fp}var Np=(t,e,i)=>{var r=rg(t),s=Pp.querySelector("."+r);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Pp.createElement("div");((t,e,i)=>{var r=n({},Op,i),s=t.style,o=!$p.includes(r.position)||e===Yf&&(null==i?void 0:i.widgetType)===Gf;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)||Lp(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",Lp(r.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Lp(r.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),s.setProperty("--ph-widget-color",r.widgetColor),s.setProperty("--ph-widget-text-color",Lp(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)||Lp(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 Ce(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Rp.error("prepare_external_dependency_stylesheet returned null"),null)})(Pp,':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||Pp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},qp=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?(Tp(i),s.capture(up,n({[dp]:i.name,[hp]:i.id,[vp]:i.current_iteration,[cp]:i.current_iteration_start_date,[pp]:r,[gp]:o},l&&{[yp]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Ha(e,i,u),a,{$set:{[za(i,"responded")]:!0}})),o&&(Ap.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),ig(i),s.reloadFeatureFlags())):wp.error("[survey sent] event not captured, PostHog instance not found.")},jp=(t,e,i)=>{return n({[dp]:t.name,[hp]:t.id,[vp]:t.current_iteration,[cp]:t.current_iteration_start_date,[fp]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Pe(t)))},(null==e?void 0:e.surveyLanguage)&&{[yp]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[pp]:null==e?void 0:e.surveySubmissionId},Ha(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Bp=(t,e,i,r)=>{if(e){if(!i){var s=tg(t),o=s?s.surveyLanguage:r;e.capture(lp,n({},jp(t,s,e),o&&{[yp]:o},{$set:{[za(t,"dismissed")]:!0}})),ig(t),Tp(t),Ap.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else wp.error("[survey dismissed] event not captured, PostHog instance not found.")},Hp=(t,e)=>{if(e){var i=(t=>xp("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=tg(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture("survey abandoned",jp(t,r,e),{transport:"sendBeacon"})}}else wp.error("[survey abandoned] event not captured, PostHog instance not found.")},zp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Up=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,Wp=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Vp=(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?Up(t.questions,zp(t.questions)):t.questions},Gp=t=>Qa(t)||eg(t),Zp=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,sf(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"+qc++,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}),Jp=()=>$f(Zp),Qp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=Jc({},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?Cc.call(arguments,2):i),Xc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Kp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=es(e);return!!s&&Ya[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var Xp=t=>xp("inProgressSurvey_",t),Yp=(t,e)=>{try{localStorage.setItem(Xp(t),JSON.stringify(e))}catch(t){wp.error("Error setting in-progress survey state in localStorage",t)}},tg=t=>{try{var e=localStorage.getItem(Xp(t));if(e)return JSON.parse(e)}catch(t){wp.error("Error getting in-progress survey state from localStorage",t)}return null},eg=t=>{var e=tg(t);return!Pe(null==e?void 0:e.surveySubmissionId)},ig=t=>{try{localStorage.removeItem(Xp(t))}catch(t){wp.error("Error clearing in-progress survey state from localStorage",t)}};function rg(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function ng(t,e,i){if(void 0===e&&(e=Qf),t===tp)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 Zf:return{left:"30px"};case Jf:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Yf&&i===Gf?"60px":"30px"}}}var sg=0;function og(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:--sg,__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 Tc.vnode&&Tc.vnode(u),u}var ag=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:og("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"})}),lg=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:og("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"})}),ug=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:og("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"})}),hg=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:og("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"})}),dg=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:og("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"})}),vg=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:og("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"})}),cg=og("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:og("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"})}),fg=og("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[og("g",{"clip-path":"url(#clip0_2415_6911)",children:[og("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:og("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),og("g",{mask:"url(#mask0_2415_6911)",children:[og("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"}),og("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"}),og("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"}),og("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"}),og("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"}),og("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"})]})]}),og("defs",{children:og("clipPath",{id:"clip0_2415_6911",children:og("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function pg(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return og("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",fg]})}function gg(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=$f(Zp).isPreviewMode,v=!!u&&!!h,c=!l&&og("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 og("div",{className:"bottom-section",children:[v?og("div",{className:"form-buttons form-buttons-with-back",children:[og("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&og(pg,{urlParams:{utm_source:"survey-footer"}})]})}function mg(t){var e=t.question,i=t.forceDisableHtml;return og("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[og(e.type===ep?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Qp({component:Kc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function yg(t){var e,i,r;return og("button",{className:"form-cancel",onClick:t.onClick,disabled:$f(Zp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,og("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:[og("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),og("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 bg=a;function _g(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=$f(Zp).isPopup;return Pf(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return zn(bg,"keydown",t),()=>{bg.removeEventListener("keydown",t)}},[o]),og("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&og(yg,{onClick:()=>o()}),og("h3",{className:"thank-you-message-header",children:e}),i&&Qp({component:Kc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&og(gg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function wg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=$f(Zp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return og("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&og(yg,{onClick:()=>u()}),e&&og("h3",{className:"intro-screen-header",children:e}),i&&Qp({component:Kc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),og(gg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var kg=t=>xe(t)&&t.every(t=>Ee(t));function Sg(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=Jp().isPreviewMode,d=Ff(null),v=Af(()=>Ee(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Pf(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Of(()=>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 me: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 ye: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,me),b=Mn(e.validation,ye),_=Of(()=>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 og(Yc,{children:[og("div",{className:"question-container",children:[og(mg,{question:e,forceDisableHtml:i,htmlFor:g}),og("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}),_&&og("div",{className:"validation-hint",children:_})]}),og(gg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function xg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return og(Yc,{children:[og("div",{className:"question-container",children:og(mg,{question:e,forceDisableHtml:t.forceDisableHtml})}),og(gg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Cg(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=Af(()=>Fe(l)?l:xe(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Ee(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Jp().isPreviewMode,y=t=>m?a(t):o(t);return og(Yc,{children:[og("div",{className:"question-container",children:[og(mg,{question:i,forceDisableHtml:r}),og("div",{className:"rating-section",children:[og("div",{className:"rating-options",children:["emoji"===i.display&&og("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Ag[i.scale])?void 0:e.map((t,e)=>og("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&&og("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Pg(i.scale).map((t,e)=>og(Tg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&og("div",{className:"rating-text",children:[og("div",{children:i.lowerBoundLabel}),og("div",{children:i.upperBoundLabel})]})]})]}),og(gg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Ae(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Tg(t){var e=t.num,i=t.setActiveNumber;return og("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 Mg(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=Ff(null),v=Of(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Up(e,zp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Af(()=>((t,e)=>Ee(t)||kg(t)?t:e===rp?null:[])(l,e.type)),f=c[0],p=c[1],g=Af(()=>((t,e)=>{if(Ee(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(kg(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=Jp().isPreviewMode,_=e.type===rp,w=e.type===ip,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&&xe(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||!Ae(f)&&(!xe(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?xe(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return og(Yc,{children:[og("div",{className:"question-container",children:[og(mg,{question:e,forceDisableHtml:i}),og("fieldset",{className:"multiple-choice-options limit-height",children:[og("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:xe(f)&&f.includes(t);return og("label",{className:n?"choice-option-open":"",children:[og("div",{className:"response-choice",children:[og("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),og("span",{children:n?t+":":t})]}),n&&og("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)})]})]}),og(gg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var Ig=[1,2,3,4,5],Eg=[1,2,3,4,5,6,7],Rg=[0,1,2,3,4,5,6,7,8,9,10],Ag={2:[vg,cg],3:[ug,lg,ag],5:[hg,ug,lg,ag,dg]};function Pg(t){switch(t){case 5:default:return Ig;case 7:return Eg;case 10:return Rg}}var Fg=Pn("[Surveys]");function Og(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?sp:s;if(n.branching.type===sp)return sp;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===rp){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===sp?sp:s}}else if(n.type===np){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===sp?sp:s}}return s}return Fg.warn("Falling back to next question index due to unexpected branching type"),s}var $g=Pn("[SurveyTranslations]");function Dg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Ua(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?Ua(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Ua(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:Ce(t.get_property)?t.get_property(vt):void 0,locale:gl()},$g)}(e);if(!i)return $g.info("No user language detected"),{survey:t,language:null};var r=Za(t,i,$g);return{survey:r.survey,language:r.matchedKey}}var Lg=a,Ng=h,qg="ph:show_survey_widget",jg="PHWidgetSurveyClickListener";function Bg(t,e){try{var i=t.getBoundingClientRect(),r=Lg.innerHeight,n=Lg.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:Op.zIndex}}catch(t){return wp.warn("Failed to calculate trigger position:",t),null}}var Hg=class{constructor(t){var e=this;this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Mi=null,this.Ti=!1,this.Ii=null,this.Ri=null,this.Ai=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(pt);if(t)for(var e of t)eg(e)&&Hp(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,v=e.Ei(t),c=v.survey,f=v.language;e.Mi=f,e.Ai=null,e.Oi=i;var p=e.Li(c,i);e.Di(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Pi(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.Ni(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===Kf&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=Ng.querySelector(p.appearance.widgetSelector);k&&(_=Bg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||Op.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=Np(p,e._posthog).shadow;e.xi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Fi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Ai=C,0>=S)return e.Ti=!0,_f(og(Gg,n({},C)),x);var T=()=>{if(!e.qi(p))return wp.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Fi(p);(()=>{e.Ti=!0;var r=e.Ei(t),s=r.survey,o=r.language;e.Mi=o;var a=e.Li(s,i),l=n({},C,{survey:a,surveyLanguage:o});e.Ai=l,_f(og(Gg,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=Fe(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Lg.setTimeout(()=>{e.ki.delete(p.id),T()},E);e.ki.set(p.id,R)}},this.ji=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=Np(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.xi.set(s,s.host),o&&_f(og(Jg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Bi=t=>{var e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(jg),this.Si.delete(t),wp.info("Removed click listener for survey "+t))},this.Hi=t=>{this.$i(t)||(this.zi(t),this.Bi(t.id))},this.$i=t=>{try{var e;return!(null==(e=Ng.querySelector(rg(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ui=(t,e)=>{var i=Ng.querySelector(e),r=this.Si.get(t.id);if(i){if(this.ji(t),r){if(i===r.element)return;wp.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Bi(t.id)}if(!i.hasAttribute(jg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Kf?Bg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Op.maxWidth)):{};Lg.dispatchEvent(new CustomEvent(qg,{detail:{surveyId:t.id,position:n}}))};zn(i,"click",n),i.setAttribute(jg,"true"),this.Si.set(t.id,{element:i,listener:n,survey:t}),wp.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Hi(t)},this.renderPopover=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=Np(i,this._posthog).shadow;this.xi.set(n,n.host),_f(og(Gg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Fi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.Ei(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.Wi(s,o,i)),_f(og(Gg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Fi,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.qi(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=t.filter(t=>t.type===Xf||t.type===Yf),r=new Set(i.map(t=>t.id));for(var n of Array.from(e.ki.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Vi(i),o=new Set;s.forEach(t=>{if(t.type===Yf){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Gf)return void e.ji(t);"selector"===(null==(r=t.appearance)?void 0:r.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ui(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Ae(e.Zi)&&t.type===Xf&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.Si.forEach(t=>{var i=t.survey;o.has(i.id)||e.Hi(i)})},t)},this.Ni=t=>{Ae(this.Zi)||wp.error("Survey "+this.Zi+" already in focus. Cannot add survey "+t.id+"."),this.Zi=t.id},this.Fi=t=>{this.Zi!==t.id&&wp.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Di(t.id),this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0,this.zi(t)},this._posthog=t,this.Zi=null,this.Ii=()=>this.Gi(),zn(Lg,"languagechange",this.Ii),this.Ri=t.onFeatureFlags(()=>this.Gi())}Gi(){var t;if(!Ae(this.Zi)){var e=null==(t=this._posthog.get_property(pt))?void 0:t.find(t=>t.id===this.Zi);if(e){var i=this.Ei(e),r=i.survey,s=i.language;if(s!==this.Mi&&(this.Mi=s,this.Ti)){var o=this.Li(r,this.Oi),a=Np(o,this._posthog).shadow;_f(og(Gg,n({},this.Ai,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Fi,surveyLanguage:s})),a)}}}}get Qi(){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}Li(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}Di(t){var e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(wp.info("Cancelled pending survey "+t),this.Di(t),this.Zi===t&&(this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0))}setAutomaticDisplayDispose(t){this.Ji=t}dispose(){var t;null==(t=this.Ji)||t.call(this),this.Ji=void 0,this.Ii&&(Lg.removeEventListener("languagechange",this.Ii),this.Ii=null),this.Ri&&(this.Ri(),this.Ri=null),this.ki.forEach((t,e)=>this.Di(e)),this.Si.forEach((t,e)=>this.Bi(e)),this.xi.forEach((t,e)=>{_f(null,e),null==t||t.remove()}),this.xi.clear(),this.Zi=null}Vi(t){return t.sort((t,e)=>{var i,r,n=eg(t),s=eg(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===op,a=e.schedule===op;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)})}Ei(t){return Dg(t,this._posthog)}Wi(t,e,i){if(this.Ci.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&&!Ie(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}}(Lg.location.search).params;if(0===Object.keys(r).length)return!1;wp.info("[Survey Prefill] Detected URL prefill parameters");var n=this.Ki(t,r,e);return!!n&&(this.Xi(t,n,i,e),this.Ci.add(t.id),n.isSurveyCompleted)}Xi(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)&&qp({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Pi(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=xe(o)?o.map(String):[String(o)]}wp.info("[Survey] Processing initial responses");var a=this.Ki(t,n,r);return!!a&&(this.Xi(t,a,i,r),a.isSurveyCompleted)}Ki(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=ja(t.id);try{switch(t.type){case rp: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 ip: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 np: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 wp.warn("[Survey Prefill] No valid responses after conversion"),null;var n=pa(),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=ja(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=Og(t,r,l.id?i[ja(l.id)]:null);if(h===sp)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 Yp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Wp(t.questions),visitedIndices:l,surveyLanguage:i}),wp.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return wp.error("[Survey Prefill] Error handling prefill:",t),null}}Yi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Qi,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}tn(t){return!t.conditions||Kp(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 Ya[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==Pp||!Pp.querySelector(t.conditions.selector))}(t)}en(t){var e;return Gp(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.Qi)&&e.hasLoadedFlags?{satisfied:this.Yi(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(!kp(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Mp.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.Yi(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.Yi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.en(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,ka.Lt("lastSeenSurveyDate"))?(t=>!!ka.Lt(Cp(t))&&!Gp(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)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.rn(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}rn(t){var e;return!Ja(t)&&!Sp(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}nn(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.Yi(e)})}qi(t){return this.checkSurveyEligibility(t).eligible&&this.tn(t)&&this.rn(t)&&this.nn(t)}zi(t){try{var e=Ng.querySelector(rg(t,!0));null!=e&&e.shadowRoot&&(_f(null,e.shadowRoot),this.xi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){wp.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Zi,surveyTimeouts:this.ki,handleWidget:this.ji,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ui,sortSurveysByAppearanceDelay:this.Vi,checkFlags:this.nn.bind(this),isSurveyFeatureFlagEnabled:this.Yi.bind(this),onLanguageChange:this.Gi.bind(this),currentLanguage:this.Mi,surveyIsRendered:this.Ti}}};function zg(t,e){if(Ng&&Lg){var i,r=new Hg(t);if(t.config.disable_surveys_automatic_display)return wp.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return wp.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{Ng.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return zn(Ng,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),Ng.removeEventListener("visibilitychange",o)}),r}}function Ug(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;Pf(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Yf,s=Kp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===Gf&&i;if(!s)return wp.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(wp.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};zn(Lg,"popstate",i),zn(Lg,"hashchange",i);var s=Lg.history.pushState,l=Lg.history.replaceState;return Lg.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()},Lg.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()},()=>{Lg.removeEventListener("popstate",i),Lg.removeEventListener("hashchange",i),Lg.history.pushState=s,Lg.history.replaceState=l}}},[o,e,r,n,a])}var Wg=200;function Vg(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 Gg(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=Ff(null),N=Number.isInteger(b),q=function(t,e,i,r,s,o,a,l,u){var h=Af(r||0===i||t.type===tp),d=h[0],v=h[1],c=Af(!1),f=c[0],p=c[1],g=Ff(!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 "+Wg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Pf(()=>{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(Kp(t,e)){v(!0),Lg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(ap,n({[dp]:t.name,[hp]:t.id,[vp]:t.current_iteration,[cp]:t.current_iteration_start_date},u&&{[yp]: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(Lg,"PHSurveyClosed",y),zn(Lg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(s)||clearTimeout(s),Lg.removeEventListener("PHSurveyClosed",y),Lg.removeEventListener("PHSurveySent",o)}}}else wp.error("usePopupVisibility hook called without a PostHog instance.")},[]),Ug({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=Af(!1),U=z[0],W=z[1],V=Of(()=>!!tg(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=Of(()=>{var t,e=(null==(t=tg(f))?void 0:t.surveySubmissionId)||pa();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){D?Bp(f,g,N,D):Bp(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?og(Zp.Provider,{value:J,children:og("div",{className:"ph-survey",style:n({},ng(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:H?og(_g,{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||Op,onClose(){B(),A()}}):Z?og(wg,{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||Op,onStart:()=>W(!0)}):og(Zg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Zg(t){var e,i,r=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Of(()=>{var t=tg(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(ig(r),null)},[r]),l=Af(()=>(null!=a&&a.responses&&wp.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=$f(Zp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Af(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Fe(t)&&t>=0&&r.questions.length>t?t:0;return Fe(v)&&v>=0?v:e}),k=w[0],S=w[1],x=Af(()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&r.questions.length>t)}),C=x[0],T=x[1],M=Af(()=>{var t,e;return null!==(t=null==(e=tg(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),I=M[0],E=M[1],R=Of(()=>Wp(Vp(r,a)),[r.id,a]),A=Of(()=>{if(!R||new Set(R).size!==R.length)return Vp(r,a);var t=new Map(r.questions.map(t=>[t.id,t])),e=R.map(e=>t.get(e)).filter(t=>!!t);return e.length===R.length?e:r.questions},[R,r.questions,r,a]);Pf(()=>{!y||Ie(v)||0>v||S(v)},[v,y]);var P=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),F=A.at(k);return F?og("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&og(yg,{onClick(){c()}}),og("div",{className:"survey-box","data-question-index":k,children:Qg({question:F,forceDisableHtml:s,displayQuestionIndex:k,appearance:r.appearance||Op,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=ja(s),l=n({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?n({},I,{[d.id]:d.question}):I;E(v);var c=Og(r,i,e),f=c===sp,p=[...C,i];if(f||(T(p),S(c),Yp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:Wp(A),visitedIndices:p,surveyLanguage:_,questionSnapshots:v})),r.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=A[t])?void 0:e.id}).filter(t=>!!t).map(t=>ja(t)));qp({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:b,surveyLanguage:_,questionSnapshots:v})}}else wp.error("onNextButtonClick called without a questionId.");else wp.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:p,initialValue:F.id?u[ja(F.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Yp(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:Wp(A),visitedIndices:e,surveyLanguage:_,questionSnapshots:I})}}})})]}):null}function Jg(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=Af(!0),f=c[0],p=c[1],g=Af(!1),m=g[0],y=g[1],b=Af({}),_=b[0],w=b[1],k=Ff(void 0),S=()=>{y(!m)};if(Pf(()=>{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&&(wp.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return zn(Lg,qg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),Lg.removeEventListener(qg,e)}}}else wp.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]),Ug({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==op&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return og(Yc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&og("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:S,disabled:d,style:Vg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&og(Gg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Qg=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 ep:return Kc(Sg,n({},o,{question:e,key:e.id}));case"link":return Kc(xg,n({},o,{question:e,key:e.id}));case np:return Kc(Cg,n({},o,{question:e,key:e.id}));case rp:case ip:return Kc(Mg,n({},o,{question:e,key:e.id}));default:return wp.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=zg,b.extendPostHogWithSurveys=zg;var Kg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Xg=1e4,Yg=(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),tm=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Yg(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 Yg(e,JSON.stringify(t.slice(0,n)),i)},em=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,im=(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}},rm=(t,e,i)=>{if(!i.truncated)if(Te(t)){if(i.seen.has(t))return void im(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(rm(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else im(e,t,i)},nm=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!em(t))return!n||Yg(e,"null",i);if(Ae(t)||(t=>{try{return Fe(t)||$e(t)}catch(t){return!1}})(t))return Yg(e,JSON.stringify(t),i);if("string"==typeof t)return tm(t,e,i);if(!Te(t)&&!xe(t))return Yg(e,JSON.stringify(t),i);if(r.has(t))return tm("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Ce(o))return nm(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return tm(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return Yg(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 nm(l,e,i,r,n,s)}if(xe(t)){if(!Yg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Yg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!nm(d,e,i,r,!0))return!1}return Yg(e,"]",i)}if(!Yg(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{rm(f,c,s)}catch(t){}if(em(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(!Yg(e,p,i))return!1;var b=e.length,_=nm(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 Yg(e,"}",i)},sm=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Te(t[0])?{result:{},keysRemaining:50,sizeRemaining:Xg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Yg(i," ",r))&&nm(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)||{}}},om={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},am=t=>"canCapture"in t,lm=t=>am(t)?t.canCapture?t.getExtension(Ep):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(tc(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=lm(h);if(d){s=!0,o=!0;var v=sm(l,Xg),c=v.body,f=v.attributes,p=n({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(am(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;Ce(n)&&n.call(e,i)}})(h,d,{level:om[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__=Kg(o),a}))};for(var a of Object.keys(om))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=lm(t);if(i)for(var r of e)try{var s=sm(r.args,Xg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:om[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 um=t=>Be(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),hm=Pn("[Error tracking]"),dm="webkit-masked-url:",vm=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],cm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",dm],fm=["__firefox__","__gCrWeb"];function pm(){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 gm=Pn("[ExceptionAutocapture]"),mm=pm(),ym=(t,e)=>{try{return t()}catch(t){return e}},bm=(t,e)=>ym(()=>t(e()),void 0),_m=t=>ym(()=>Ce(t)&&Ce(t.call),!1),wm=(t,e)=>ym(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),km=(t,e,i)=>{ym(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),ym(()=>{t[e]=i},void 0)},Sm=t=>{var e=a;e||gm.info("window not available, cannot wrap onerror");var i=ym(()=>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 bm(t,()=>mm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Ee(e)&&Ee(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}})),!!_m(i)&&null!==(e=i(...n))&&void 0!==e&&e},wm(e,"onerror"),()=>km(e,"onerror",i)},xm=function(t,e){void 0===e&&(e=!1);var i=a;i||gm.info("window not available, cannot wrap onUnhandledRejection");var r=ym(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return bm(t,()=>mm.buildFromUnknown(i,{mechanism:{handled:!1}})),_m(r)?null!==(n=r(i))&&void 0!==n&&n:e},wm(i,"onunhandledrejection"),()=>km(i,"onunhandledrejection",r)},Cm={wrapOnError:Sm,wrapUnhandledRejection:xm,wrapConsoleError(t){var e=console;e||gm.info("console not available, cannot wrap console.error");var i=ym(()=>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];bm(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return mm.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),_m(i)&&i(...r)},wm(e,"error"),()=>km(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=Cm,b.posthogErrorWrappingFunctions=Cm;var Tm=(t,e)=>{if(Ce(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Ae(i)&&"object"==typeof i&&xe(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){gm.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){gm.error("Failed to capture exception for a legacy client",t)}};Sm(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),xm(n,!0)}};b.extendPostHogWithExceptionAutoCapture=Tm,b.extendPostHogWithExceptionAutocapture=Tm;var Mm="X-POSTHOG-SESSION-ID",Im="X-POSTHOG-WINDOW-ID",Em="X-POSTHOG-DISTINCT-ID",Rm=[Mm,Im,Em],Am=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Pm=(t,e)=>({}.hasOwnProperty.call(t,e)),Fm=t=>"object"==typeof t&&!Ae(t)||Ce(t),Om=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),$m=t=>{try{var e;return Om(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}},Dm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(xe(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Mm,a.sessionId),n.set(Im,l),o=!0}var u=(t=>Ce(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(Em,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var Lm={_patchFetch:(t,e,i)=>tc(a,"fetch",r=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=$m(s);if(u)if(Om(s)){var h=new Request(s,o);Dm(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Fm(o)?o.headers:void 0);if(Dm(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Ae(t))return{headers:e};if(Fm(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)=>Pm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Pm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),Am.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&&Am.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)=>tc(a.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=$m(s);d&&Dm(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return Rm.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=Lm,b.postHogTracingHeadersPatchFns=Lm,"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 Nm=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)}}},qm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},jm=t=>{if("loading"===document.readyState)return"loading";var e=qm();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"},Bm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Hm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Bm(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},zm=new WeakMap;function Um(t,e){var i=zm.get(e);return i||zm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Wm,Vm=-1,Gm=()=>Vm,Zm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Vm=e.timeStamp,t(e))},!0)},Jm=(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))}},Qm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Km=()=>{var t,e;return null!==(t=null==(e=qm())?void 0:e.activationStart)&&void 0!==t?t:0},Xm=-1,Ym=new Set,ty=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ey=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ym)e();isFinite(Xm)||(Xm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ey,!0))}},iy=function(t){if(void 0===t&&(t=!1),t&&(Xm=1/0),0>Xm){var e,i,r=Km();Xm=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:ty(),addEventListener("visibilitychange",ey,!0),addEventListener("prerenderingchange",ey,!0),Zm(()=>{setTimeout(()=>{Xm=ty()})})}return{get firstHiddenTime(){return Xm},onHidden(t){Ym.add(t)}}},ry=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=qm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Gm()?a&&(document.prerendering||Km()>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}},ny=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){}},sy=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},oy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},ay=t=>{var e=!1;return()=>{e||(t(),e=!0)}},ly=class{constructor(){this.u=void 0}},uy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},hy=[1800,3e3],dy=function(t,e){void 0===e&&(e={});var i=sy(e);uy(()=>{var r,n=Um(e,ly),s=iy(),o=ry("FCP"),a=ny(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Km(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Jm(t,o,hy,e.reportAllChanges),Zm(i=>{o=ry("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Gm()),r=Jm(t,o,hy,e.reportAllChanges),Qm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&ny(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&oy(n.u,i),o=ry("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Jm(t,o,hy,e.reportAllChanges))(!0)})},e)})},vy=[.1,.25],cy=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],fy=function(t,e){void 0===e&&(e={});var i=Um(e=Object.assign({},e),Nm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=cy(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:Hm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=iy();dy(ay(()=>{var r,n=ry("CLS",0),s=Um(e,Nm),o=(i,o,a,l,u)=>{n=ry("CLS",0,i,o,a,l,u),s.o=0,r=Jm(t,n,vy,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"];sy(e)&&h.push("soft-navigation");var d=ny(h,u);d&&(r=Jm(t,n,vy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Zm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Gm()),Qm(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=cy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:jm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},py=function(t,e){void 0===e&&(e={});var i=Um(e=Object.assign({},e),ly);sy(e)&&(i.u=new Map),dy(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:jm(Gm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=qm(),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:jm(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)},gy=0,my=1/0,yy=0,by=t=>{for(var e of t)e.interactionId&&(my=Math.min(my,e.interactionId),yy=Math.max(yy,e.interactionId),gy=yy?(yy-my)/7+1:0)},_y=()=>{var t;return Wm?gy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},wy=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return _y()-this.h}D(){this.h=_y(),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)}}}},ky=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=ay(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Sy=[200,500],xy=function(t,e){void 0===e&&(e={});var i=Um(e=Object.assign({},e),wy),r=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(ky(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:Hm(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};ny(["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=iy();uy(()=>{var r;"interactionCount"in performance||Wm||(Wm=ny(["event"],by,{durationThreshold:0}));var s,o=ry("INP"),a=Um(e,wy),l=(i,r,n,l,u)=>{a.D(),o=ry("INP",-1,i,r,n,l,u),s=Jm(t,o,Sy,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),ky(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];sy(e)&&v.push("soft-navigation");var c=ny(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Jm(t,o,Sy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Zm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Gm())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:jm(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:jm(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)},Cy=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],Ty=50,My=[];ny(["resource"],t=>{for(var e of t)My.push(e),My.length>Ty&&My.shift()});var Iy=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(Ty=e.resourceBufferSize);var i=Um(e,Cy),r=new WeakMap;sy(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:Hm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=sy(e);uy(()=>{var n,s=iy(),o=ry("LCP"),a=Um(e,Cy),l=(r,a,l,u,h)=>{o=ry("LCP",-1,r,a,l,u,h),n=Jm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=iy(!0))},u=t=>{a.u&&t.navigationId&&oy(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-Km(),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=ny(d,h);if(v){n=Jm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;ky(()=>{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});Zm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Gm()),n=Jm(t,o,$,e.reportAllChanges),Qm(()=>{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&&(My.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=qm())?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)},Ey=-1,Ry=()=>Ey,Ay=t=>{addEventListener("pageshow",e=>{e.persisted&&(Ey=e.timeStamp,t(e))},!0)},Py=(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))}},Fy=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Oy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},$y=()=>{var t,e;return null!==(t=null==(e=Oy())?void 0:e.activationStart)&&void 0!==t?t:0},Dy=-1,Ly=new Set,Ny=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,qy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ly)e();isFinite(Dy)||(Dy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",qy,!0))}},jy=function(t){if(void 0===t&&(t=!1),t&&(Dy=1/0),0>Dy){var e,i,r=$y();Dy=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",qy,!0),addEventListener("prerenderingchange",qy,!0),Ay(()=>{setTimeout(()=>{Dy=Ny()})})}return{get firstHiddenTime(){return Dy},onHidden(t){Ly.add(t)}}},By=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=Oy(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Ry()?a&&(document.prerendering||$y()>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}},Hy=new WeakMap;function zy(t,e){var i=Hy.get(e);return i||Hy.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Uy,Wy=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)}}},Vy=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){}},Gy=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},Zy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Jy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Qy=class{constructor(){this.l=void 0}},Ky=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xy=[1800,3e3],Yy=function(t,e){void 0===e&&(e={});var i=Gy(e);Ky(()=>{var r,n=zy(e,Qy),s=jy(),o=By("FCP"),a=Vy(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-$y(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Py(t,o,Xy,e.reportAllChanges),Ay(i=>{o=By("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ry()),r=Py(t,o,Xy,e.reportAllChanges),Fy(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Vy(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Zy(n.l,i),o=By("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Py(t,o,Xy,e.reportAllChanges))(!0)})},e)})},tb=[.1,.25],eb=function(t,e){void 0===e&&(e={});var i=jy();Yy(Jy(()=>{var r,n=By("CLS",0),s=zy(e,Wy),o=(i,o,a,l,u)=>{n=By("CLS",0,i,o,a,l,u),s.i=0,r=Py(t,n,tb,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"];Gy(e)&&h.push("soft-navigation");var d=Vy(h,u);d&&(r=Py(t,n,tb,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Ay(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Ry()),Fy(r)}),setTimeout(r))}))},ib=0,rb=1/0,nb=0,sb=t=>{for(var e of t)e.interactionId&&(rb=Math.min(rb,e.interactionId),nb=Math.max(nb,e.interactionId),ib=nb?(nb-rb)/7+1:0)},ob=()=>{var t;return Uy?ib:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ab=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return ob()-this.u}M(){this.u=ob(),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)}}}},lb=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Jy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},ub=[200,500],hb=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=jy();Ky(()=>{var r;"interactionCount"in performance||Uy||(Uy=Vy(["event"],sb,{durationThreshold:0}));var s,o=By("INP"),a=zy(e,ab),l=(i,r,n,l,u)=>{a.M(),o=By("INP",-1,i,r,n,l,u),s=Py(t,o,ub,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),lb(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&s(!0)})},v=["event","first-input"];Gy(e)&&v.push("soft-navigation");var c=Vy(v,d,n({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));s=Py(t,o,ub,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Ay(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ry())}))})}},db=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},vb=[2500,4e3],cb=function(t,e){void 0===e&&(e={});var i=!1,r=Gy(e);Ky(()=>{var n,s=jy(),o=By("LCP"),a=zy(e,db),l=(r,a,l,u,h)=>{o=By("LCP",-1,r,a,l,u,h),n=Py(t,o,vb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=jy(!0))},u=t=>{a.l&&t.navigationId&&Zy(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-$y(),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=Vy(d,h);if(v){n=Py(t,o,vb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;lb(()=>{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});Ay(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Ry()),n=Py(t,o,vb,e.reportAllChanges),Fy(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},fb={onLCP:Iy,onCLS:fy,onFCP:py,onINP:xy,withoutAttribution:{onLCP:cb,onCLS:eb,onFCP:Yy,onINP:hb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=fb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=fb,b.postHogWebVitalsCallbacks=fb;var pb={onLCP:cb,onCLS:eb,onFCP:Yy,onINP:hb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=pb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=pb,b.postHogWebVitalsCallbacks=pb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>pb;var gb={onLCP:Iy,onCLS:fy,onFCP:py,onINP:xy,withoutAttribution:{onLCP:cb,onCLS:eb,onFCP:Yy,onINP:hb}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=gb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=gb,b.postHogWebVitalsCallbacks=gb;var mb={onLCP:cb,onCLS:eb,onFCP:Yy,onINP:hb};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=mb,b.__PosthogExtensions__.postHogWebVitalsCallbacks=mb,b.postHogWebVitalsCallbacks=mb,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>mb;var yb=class{constructor(t){this.disabled=!1===t;var e=Te(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}},bb="$copy_autocapture",_b=Pn("[AutoCapture]");function wb(t,e){return e.length>t?e.slice(0,t)+"...":e}function kb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!rs(e));return e}function Sb(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=>!Ms(t)||Is(t)));var m,y,b,_=[],w={},k=!1,S=!1;if(On(v,t=>{var e=Ms(t);if(ns(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Ds(i))&&(d?ar(i):i)}de(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()?wb(1024,Ls(t)):wb(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((!Is(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Ds(i.value)&&(!Ee(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]=wb(1024,"href"===i.name&&n?ar(a):a)}});for(var l=1,u=1,h=t;h=kb(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(!Ms(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&&Ds(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")?Ls(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=_,xe(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[qs(t[0].toString())]=qs(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:js(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 xb=class{zs(){this.Us=void 0,clearTimeout(this.Ws),this.Ws=void 0}Vs(t){var e;if(!Ms(t))return!0;for(var i,r=null!==(e=this.Gs().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(de(e,"ph-no-capture")||de(e,"ph-sensitive")||Is(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}Zs(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Us;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.zs():"pointerup"===t.type&&(e.released=!0,this.Ws=setTimeout(()=>this.zs(),0)))}else{var i;this.zs();var r=vs(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&rs(r)&&(this.Us={target:r,excluded:this.Vs(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.Js)?void 0:i.distinctId})}else this.zs()}Qs(t){var e,i=this.Us;this.zs();var r=vs(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.Js)?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.Gs().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 de(e,"ph-no-capture")||de(e,"ph-sensitive")||!Ms(t)||Is(t)||s.some(e=>fs(t,e))})?null:i.target}}constructor(t){this.Ks=t,this.name="autocapture",this.Xs=!1,this.Ys=null,this.eo=!1,this.io=!1,this.Rn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.ro=!1,this.Ks.refresh(this.Rn),this.rageclicks=new yb(this.Rn.rageclick),this.no=null}setup(t){this.so(),this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.ro?e.dispose():(this.oo=e,this.startIfEnabled())}dispose(){var t;this.ro||(this.ro=!0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,this.ao())}Gs(){return this.Ks.refresh(this.Rn),this.Rn}so(){var t,e;return this.Gs(),this.Rn.url_allowlist=null==(t=this.Rn.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this.Rn.url_ignorelist=null==(e=this.Rn.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this.Rn}lo(){if(this.isBrowserSupported()){if(a&&h){var t=this.uo=t=>{t=t||(null==a?void 0:a.event);try{if("blur"===t.type)return void this.zs();if(0===t.type.indexOf("pointer"))return void this.Zs(t);var e="click"===t.type?this.Qs(t):void 0;if(Ae(e))return;this.ho(t,"$autocapture",e)}catch(t){_b.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.Gs().capture_copied_text){var e=this.do=t=>{t=t||(null==a?void 0:a.event);try{this.ho(t,bb)}catch(t){_b.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 _b.info("Disabling Automatic Event Collection because this browser is not supported")}ao(){this.zs(),this.uo&&(null==a||a.removeEventListener("blur",this.uo),On(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==h||h.removeEventListener(t,this.uo,!0)}),null==h||h.removeEventListener("submit",this.uo,!0),null==h||h.removeEventListener("change",this.uo,!0),null==h||h.removeEventListener("click",this.uo,!0),this.uo=void 0),this.do&&(null==h||h.removeEventListener("copy",this.do,!0),null==h||h.removeEventListener("cut",this.do,!0),null==h||h.removeEventListener("paste",this.do,!0),this.do=void 0),this.Xs=!1}startIfEnabled(){this.isEnabled||this.zs(),!this.ro&&this.Js&&this.isEnabled&&!this.Xs&&(this.lo(),this.Xs=!0)}onRemoteConfig(t){if(!this.ro)if(this.eo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.io=e.elementsChainAsString);var i,r=e.autocapture_opt_out;$e(r)&&(null==(i=this.Js)||i.kv.set(E,r),this.Ys=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.no=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.no)||i.forEach(i=>{var n;null==h||null==(n=h.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||de(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.ro)return!1;var i=null==(t=this.Js)?void 0:t.kv.get(E),r=this.Ys,n=this.Gs();if(!n.remoteRequestsDisabled&&!this.eo)return!1;var s=n.remoteRequestsDisabled&&!this.eo;if(Ae(r)&&!$e(i)&&!s)return!1;var o=null!==(e=this.Ys)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ho(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.so();"$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())&&xs(r,o.rageclick)&&this.ho(t,"$rageclick",i);var l=e===bb,u=l?n({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!a||Cs(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=Ts(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Ie(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=Sb(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.io,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===bb){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.Js)||h.capture(e,v).catch(t=>_b.error("Failed to capture event",t)),!0}}else this.zs()}isBrowserSupported(){return Ce(null==h?void 0:h.querySelectorAll)}},Cb={};function Tb(t,e){var i=vs(t);return i?n({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Mb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Ib(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Eb="canvas,video,audio,embed,object";function Rb(t,e){return Fe(t)&&t>=e}function Ab(t){return t>=0&&1e3>t?t:void 0}function Pb(t,e){return e?Ab(t-e):void 0}var Fb=class{un(t){var e,i,r,n,s,o,a,l,u=this.ln((null==t?void 0:t.__onCapture)||this.hn.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.cn=[],this.dn=0,this.ln=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.vn=t=>{var e=Tb(t,{type:"click"});Ae(e)||this.fn(e)||this.pn(e),this.gn()},this.mn=()=>{var t=Date.now();this.yn=t,t%50==0&&this.cn.forEach(e=>{Ie(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.bn=()=>{this.wn=Date.now()},this.ar=()=>{var t=Date.now();this.kn=t,this._n("visibilityChangedDelayMs",t)},this.Sn=()=>{var t=Date.now();this.xn=t,this._n("focusChangedDelayMs",t)},this.Cn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Mn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Tn=()=>{this.Mn=void 0},this.In=t=>{var e,i=this.Mn;if(this.Mn=void 0,!Ie(i)&&this.Rn.max_dead_swipes_per_page_load>this.dn){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.Rn.swipe_threshold_px;if(a>=l*l&&![this.yn,this.An,this.wn].some(t=>Fe(t)&&t>=i.timestamp)){var u;if(this.En()&&(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(Eb)))return;var d=Tb(r,{type:"swipe",swipeDirection:Mb(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Ae(d)||this.fn(d)||this.pn(d),this.gn()}}}},this.Rn=this.un(e),this._onCapture=this.Rn.__onCapture}start(t){this.On(),this.Ln(),this.Dn(),this.Pn(),this.Nn(),this.Fn(t),this.Rn.capture_dead_swipes&&this.qn()}Fn(t){if(!this.jn){var e=function(t){return function(t,e){var i=Cb[t];if(i)return i;var r=e[t];if((t=>Ce(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==a||!a.Zone))return Cb[t]=r.bind(e);var n=e.document;if(n&&Ce(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 de(t,"AppleWebKit")&&!de(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&&Ce(r)?Cb[t]=r.bind(e):r}("MutationObserver",t)}(b);this.jn=new e(t=>{this.Bn(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.vn),b.removeEventListener("scroll",this.mn,{capture:!0}),b.removeEventListener("selectionchange",this.bn),b.removeEventListener("touchstart",this.Cn,{capture:!0}),b.removeEventListener("touchend",this.In,{capture:!0}),b.removeEventListener("touchcancel",this.Tn,{capture:!0}),null==h||h.removeEventListener("visibilitychange",this.ar),b.removeEventListener("blur",this.Sn),b.removeEventListener("focus",this.Sn),this.Mn=void 0}Bn(t){this.An=Date.now()}On(){zn(b,"click",this.vn)}pn(t){t.visibilityChangedDelayMs=Pb(t.timestamp,this.kn),t.focusChangedDelayMs=Pb(t.timestamp,this.xn),this.cn.push(t)}gn(){this.cn.length&&Ie(this.Hn)&&(this.Hn=b.setTimeout(()=>{this.$n()},1e3))}Ln(){zn(b,"scroll",this.mn,{capture:!0})}Dn(){zn(b,"selectionchange",this.bn)}Pn(){zn(h,"visibilitychange",this.ar)}Nn(){zn(b,"blur",this.Sn),zn(b,"focus",this.Sn)}_n(t,e){this.cn.forEach(i=>{var r=Ab(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}qn(){zn(b,"touchstart",this.Cn,{capture:!0,passive:!0}),zn(b,"touchend",this.In,{capture:!0,passive:!0}),zn(b,"touchcancel",this.Tn,{capture:!0,passive:!0})}En(){var t=Ie(this.zn)||Fe(this.An)&&this.An>this.zn;return(Ie(this.Un)||t)&&(this.zn=Date.now(),this.Un=!(null==h||!h.querySelector(Eb))),!!this.Un}fn(t){return!t||("swipe"===t.type?this.Wn(t):this.Vn(t))}Wn(t){return!(!is(t.node)&&!this.cn.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||Cs(t))return!1;var r=$e(e)?ws:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ws;return!ps(Ts(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.Rn.css_selector_ignorelist}))}Vn(t){return!(this.Rn.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Wn(t)||(i=t.node,!(!a||Cs(i))&&Ts(i,!1).targetElementList.some(t=>ns(t,"a")));var e,i}$n(){if(this.cn.length){clearTimeout(this.Hn),this.Hn=void 0;var t=this.cn;for(var e of(this.cn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.An&&this.An>=e.timestamp?this.An-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.wn&&this.wn>=e.timestamp?this.wn-e.timestamp:void 0;var r=Rb(e.scrollDelayMs,this.Rn.scroll_threshold_ms),n=Rb(e.selectionChangedDelayMs,this.Rn.selection_change_threshold_ms),s=Rb(e.mutationDelayMs,this.Rn.mutation_threshold_ms),o=Rb(e.absoluteDelayMs,1.1*this.Rn.mutation_threshold_ms),a=Fe(e.scrollDelayMs)&&this.Rn.scroll_threshold_ms>e.scrollDelayMs,l=Fe(e.mutationDelayMs)&&this.Rn.mutation_threshold_ms>e.mutationDelayMs,u=Fe(e.selectionChangedDelayMs)&&this.Rn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Fe(e.visibilityChangedDelayMs),d=Fe(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=Ib(e);if("$dead_swipe"===v){if(this.dn>=this.Rn.max_dead_swipes_per_page_load)continue;this.dn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.An,[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.Rn.mutation_threshold_ms>e.absoluteDelayMs&&this.cn.push(e)}this.gn()}}hn(t,e){var i=Ib(t);this.instance.capture(i,n({},e,Sb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rn.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 Fb(t,e);var Ob=Pn("[ExternalScriptsLoader]"),$b=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]},Db=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Ob.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=$b(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($b(e))return Db(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)},Lb={},Nb=(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=Lb[n];if("fallback"===r&&s){if($b(s))return void Db(t,s,i);delete Lb[n]}Db(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=Nb(t,e);Lb[n]=a;var l=$b(n);null==l||null==(o=l.parentNode)||o.removeChild(l),Db(t,a,i)}else i(void 0,s)}:i)}else Db(t,Nb(t,e),i)}else Db(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{Db(t,t.requestRouter.endpointFor("api",e),i)};var qb=class{constructor(t){this._instance=t}get Rn(){return this._instance.config}get consent(){return this.vo()?0:this.co}isOptedOut(){return"always"===this.Rn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rn.opt_out_capturing_by_default}optInOut(t){this.fo.Ot(this.po,t?1:0,this.Rn.cookie_expiration,this.Rn.cross_subdomain_cookie,this.Rn.secure_cookie)}reset(){this.fo.Dt(this.po,this.Rn.cross_subdomain_cookie)}get po(){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.fo.Lt(this.po);return We(t)?1:de(Ve,t)?0:-1}get fo(){var t=this.Rn.opt_out_capturing_persistence_type,e="localStorage"===t?ka:_a,i=e.Et()?e:Oa;if(!this.mo||this.mo!==i){this.mo=i;var r="localStorage"===t?_a:ka;r.Lt(this.po)&&(this.mo.Lt(this.po)||this.optInOut(We(r.Lt(this.po))),r.Dt(this.po,this.Rn.cross_subdomain_cookie))}return this.mo}vo(){return!!this.Rn.respect_dnt&&[null==u?void 0:u.doNotTrack,null==u?void 0:u.msDoNotTrack,b.doNotTrack,null==u?void 0:u.globalPrivacyControl].some(t=>We(t))}},jb=Pn("[Dead Clicks]"),Bb=()=>!0,Hb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(D)),r=t.instance.config.capture_dead_clicks;return $e(r)?r:!!Te(r)||i},zb=class{get lazyLoadedDeadClicksAutocapture(){return this.yo}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.bo(()=>{this._o()}):this.stop()}bo(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?jb.error("failed to load script",e):t()})}_o(){var t;if(h){if(!this.yo&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Te(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.yo=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.yo.start(h),jb.info("starting...")}}else jb.error("`document` not found. Cannot start.")}stop(){this.yo&&(this.yo.stop(),this.yo=void 0,jb.info("stopping..."))}},Ub=Pn("[SegmentIntegration]");function Wb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||pa();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(At,ee)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Ce(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Ub.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Ub.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Ub.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,se)},identify(t){return i(t,ae)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{Ub.error("Failed to register the Segment integration",t),e()})},i)}var Vb="posthog-js";function Gb(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 Zb=class{constructor(t,e,i,r,n,s){this.name=Vb,this.setupOnce=function(o){o(Gb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},Jb=class{constructor(t){this.wo=(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.ko=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.So()}So(){var t;this.xo=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.wo)}destroy(){var t;null==(t=this.xo)||t.call(this),this.xo=void 0}doPageView(t,e){var i,r=this.Co(t,e);return this.ko={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.Co(t,null==(e=this.ko)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ko)?void 0:t.pageViewId}}Co(t,e){var i=this.ko;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(!(Ie(s)||Ie(o)||Ie(a)||Ie(l)||Ie(u)||Ie(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}},Qb=["flags","surveys"],Kb={[_]:{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=>Ae(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"}},Xb=[[X,{exposure:"hidden"}],[Y,{exposure:"hidden"}],[tt,{exposure:"hidden"}]],Yb=t=>{var e=Kb[t];if(e)return e;for(var i of Xb){var r=i[1];if(0===t.indexOf(i[0]))return r}},t_={flags:Rt,surveys:gt},e_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],i_=t=>t+"_cookie_identity_change_pending",r_=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},n_="main",s_=[rt,nt,ot,at,lt,Rt,ut,vt],o_=t=>-1!==s_.indexOf(t),a_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},l_=t=>{if(!t)return{};var e=JSON.parse(t);return Te(e)?e:{}},u_=(t,e)=>{On(t,(i,r)=>{var n=Yb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},h_=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.To={},this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=!1,this.Ao=!1,this.Po=new Map,this.Fo=!1,this.Oo=!1,this.$o=!1,this.Do=!1,this.Lo=new Set,this.Rn=t,this.No=i,this.props={},this.qo=void 0,this.jo=(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.fo=this.Bo(t),this.Eo=this.Ho(t),this.load(),this.zo(),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.Uo=t=>{if(this.Mo&&(!t.storageArea||t.storageArea===(null==a?void 0:a.localStorage))&&t.key)if(t.key!==this.jo){if(this.Eo){var e=Qb.find(e=>t.key===this.Wo(e));e&&this.Vo(t.key,e)}}else this.Vo(t.key,n_)},zn(a,"storage",this.Uo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Po.get(e);if(o_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.Go(e,n)}else this.Go(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Lo.add(t),()=>this.Lo.delete(t)}destroy(){this.Uo&&a&&(a.removeEventListener("storage",this.Uo),this.Uo=void 0),this.Lo.clear()}Vo(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,n;try{if(n=ka.Lt(t),Ae(n)){var s=this.Zo(e);return s.storageValue=null,e!==n_&&(s.persisted=!1),!1}r=l_(n)}catch(t){return!1}var o=e===n_?r:ka.Nt(this.jo);if(o&&this.Jo(o))return!1;var a=this.Qo(r,e,i);return e===n_&&this.Eo&&!a_(this.Ko().main,r)||this.Xo(r,e,!0,n),a}Jo(t){var e=this.props[w],i=t[w];return!Ie(e)&&!Ie(i)&&e!==i}Xo(t,e,i,r){var n=this.Zo(e);n.storageValue=r,e!==n_&&(n.persisted=i);try{n.fingerprint=this.Yo(t,e)}catch(t){n.fingerprint=void 0}}Qo(t,e,i){var r=!1;return s_.forEach(i=>{var n,s=null==(n=Yb(i))?void 0:n.storageGroup;if(!(e===n_&&this.Eo&&s||e!==n_&&s!==e)){var o=i in t,a=this.ta(i,o?t[i]:void 0),l=this.Po.has(i)?i in this.props:o;l===i in this.props&&a_(a,this.props[i])||(l?this.ea(i,a,!1):this.ia(i,!1),r=!0)}}),r&&i&&this.Lo.forEach(t=>t()),r}ra(){if(!this.Mo)return!1;try{this.$o=!1;var t,e=ka.Lt(this.jo),i=this.Zo(n_),r=!1,n=!1;if(e!==i.storageValue)if(Ae(e))i.storageValue=null;else{if(t=l_(e),this.$o=!this.Oo&&this.Jo(t),this.$o)return!1;n=this.Qo(t,n_,!1),!this.Eo||a_(this.Ko().main,t)?this.Xo(t,n_,!0,e):i.storageValue=e,r=!0}return this.Eo&&Qb.forEach(e=>{var i=ka.Lt(this.Wo(e)),s=this.Zo(e),o=t||{},a=r&&s_.some(t=>{var i;return(null==(i=Yb(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Ae(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Qo(o,e,!1)||n));var l=l_(i);n=this.Qo(l,e,!1)||n,this.Xo(l,e,!0,i)}}),n}catch(t){return!1}}Go(t,e){this.Po.set(t,e);var i=Yb(t);null!=i&&i.volatile||(this.Zo((this.Eo?null==i?void 0:i.storageGroup:void 0)||n_).fingerprint=void 0,this.na(t))}sa(){s_.forEach(t=>this.Po.set(t,!0))}zo(){if(this.Mo)try{var t=ka.Lt(this.jo),e=l_(t);this.Zo(n_).storageValue=t,s_.forEach(t=>{var i,r=this.Eo?null==(i=Yb(t))?void 0:i.storageGroup:void 0,n=r?ka.Lt(this.Wo(r)):null;if(r){var s=this.Zo(r);s.storageValue=n,s.persisted=!Ae(n)}var o=r&&!Ae(n)?l_(n):e;t in this.props?this.oa(t,o[t],this.props[t]):t in o&&this.Go(t,!0)})}catch(t){}}ta(t,e){var i=this.Po.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(xe(e)?e:[]),s=new Set(xe(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Te(e)?n({},e):{},a=Te(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}oa(t,e,i){if(o_(t)){var r=this.Po.get(t);if(!0!==r){var n=e;if(this.Mo)try{var s,o=this.Eo?null==(s=Yb(t))?void 0:s.storageGroup:void 0,a=o?this.Wo(o):this.jo;n=l_(ka.Lt(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!xe(e)||!Ie(n)&&!xe(n)||!xe(i))return void this.Go(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(!Te(i))return void(a_(n,i)?this.Po.delete(t):this.Go(t,!0));if(!Ie(e)&&!Te(e)||Ie(e)&&Me(i)&&Ie(n))return void this.Go(t,!0);var v=Te(e)?e:{},c=Te(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&a_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&a_(c[t],i[t])&&l.delete(t)})}l.size?this.Go(t,l):this.Po.delete(t)}}}aa(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return Fe(e)&&e>0?e:0}la(t){if(this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase())if(t)try{var e=Ia(t,this.Rn.cookie_persisted_properties||[]),i=Ra(e,this.Rn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=_a.Lt(this.jo)||void 0;n&&Pa(this.jo,n)===r&&(this.ua=r,this.ha=n)}catch(t){}else try{var s=_a.Lt(this.jo)||void 0;this.ua=s?Pa(this.jo,s):void 0,this.ha=s}catch(t){}}syncCookieProperties(){return this.da(this.Rn)}da(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.Ao||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=_a.Lt(this.jo)||void 0}catch(t){}if(!i||i===this.ha)return!1;var r,n=Pa(this.jo,i);try{r=Ma(JSON.parse(i))}catch(t){return!1}if((_a.Lt(this.jo)||void 0)!==i)return!1;this.ua=n,this.ha=i;var s=Aa(this.jo,i),o=[...xa,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Ae(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Me(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);[...xa,...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===xa.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=$n(v,r),s_.forEach(t=>{var e=t in this.props;t in u===e&&a_(u[t],this.props[t])||(e?this.oa(t,u[t],this.props[t]):this.Go(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.ea(At,te);var c=this.props[w],f=this.props[At];return!l||c===h&&f===d||(this.Oo=!0,this.Ro=!0,Da.Ot(i_(this.jo),!0),this.ia(vt),this.ia(nt),this.ia(rt),this.ia(ot),this.ia(at),this.ia(lt),this.ia(Rt),this.ia(Et),this.ia(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(u_(this.props,r),this.ia(ct)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.ia(x)),!0}consumeCookieIdentityChange(){var t=i_(this.jo),e=this.Ro||!!Da.Lt(t);return this.Ro=!1,e&&Da.Dt(t),e}va(t){return void 0===t&&(t=!1),!(this.Ao||this.gi&&!t||!this.Rn.cookieWinsOnConflict||"localstorage+cookie"!==this.Rn.persistence.toLowerCase()||(this.Ao=!0,0))}ca(){this.Ao&&(Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),delete this.To[n_],this.pa(!0))}ga(t){if(void 0===t&&(t=!0),this.Ao)try{t?this.ca():Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0)}finally{this.Ao=!1}}isDisabled(){return!!this.gi}Bo(t){-1===e_.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=[...xa,...t];return n({},ka,{Nt(t){try{var r,n={};try{r=_a.Lt(t)||void 0,n=r?Ma(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(ka.Lt(t)||"{}");if(e){var a=Aa(t,r),l=[...xa,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Ae(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===xa.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||(Sa.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 ka.Ot(t,s),s}catch(t){}return null},Ot(i,r,n,s,o,a){var l=ka.Ot(i,r,void 0,void 0,a);try{var u=Ia(r,t);if(Object.keys(u).length){if(e){var h=Ca(i),d=Ra(u,t);if(_a.Ot(h,d,n,s,o,a),_a.Lt(h)!==JSON.stringify(d)){_a.Dt(h,s);var v=Ia(r);return _a.Ot(i,v,n,s,o,a),l}}_a.Ot(i,u,n,s,o,a)}}catch(t){ka.Pt(t)}return l},Dt(t,e){try{null==a||a.localStorage.removeItem(t),_a.Dt(t,e),_a.Dt(Ca(t),e)}catch(t){ka.Pt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,s=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&ka.Et()?(e=ka,s=!0):"localstorage+cookie"===o&&i.Et()?(e=i,s=!0,r=!0):"sessionstorage"===o&&Da.Et()?e=Da:"memory"===o?e=Oa:"cookie"===o&&_a.Et()?(e=_a,r=!0):i.Et()?(e=i,s=!0,r=!0):_a.Et()?(e=_a,r=!0):e=Oa,this.Mo=s,this.Io=r,e}Wo(t){return this.jo+"__"+t}Ho(t){return this.Mo&&!!t.split_storage}properties(){var t={};return On(this.props,(e,i)=>{var r=Yb(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.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase(),i=e?ka.Nt(this.jo):null,r={};if(e)try{On(r=Ma(_a.Nt(this.jo)),(t,e)=>{(Ie(t)||Ae(t)||""===t)&&delete r[e]})}catch(t){}var n=this.fo.Nt(this.jo);if(n&&(this.props=$n({},n)),this.Eo&&this.ma(),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.Ro=!0,Da.Ot(i_(this.jo),!0);var d=$n({},this.props);Sa.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(u_(d,r),delete d[ct]),this.props=d;var v=new Set;Sa.forEach(t=>{var e,i=null==(e=Yb(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};On(this.props,(i,r)=>{var n;(null==(n=Yb(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(ka.Dt(this.Wo(t)),this.To[t]={}):ka.Ot(this.Wo(t),e)&&(this.To[t]={persisted:!0,fingerprint:this.Yo(e,t)})})}}Da.Lt(i_(this.jo))&&(this.Ro=!0)}}ma(){for(var t of Qb){var e=ka.Nt(this.Wo(t));if(e&&!Me(e)){var i=this.Zo(t);i.persisted=!0,this.ya(t)||(i.fingerprint=this.Yo(e,t)),this.ba(t,e)||$n(this.props,e)}}}ya(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=Yb(e))?void 0:i.storageGroup)===t})}ba(t,e){var i=t_[t];if(!i)return!1;var r=e[i],n=this.props[i];return Fe(r)&&Fe(n)&&n>r}refreshKey(t){var e;if(!(this.gi||"$fbc_persistence"===t&&this.Do)){var i=this.Eo?null==(e=Yb(t))?void 0:e.storageGroup:void 0,r=i?ka.Nt(this.Wo(i)):this.fo.Nt(this.jo);if(r&&t in r)this.ea(t,r[t],!1);else{if(i){var n=this.fo.Nt(this.jo);if(n&&t in n)return void this.ea(t,n[t],!1)}this.ia(t,!1)}}}save(){if(!this.gi){var t=this.aa();t>0?Ie(this.fa)&&(this.fa=setTimeout(()=>{this.fa=void 0,this.pa()},t)):this.pa()}}flush(){Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0,this.pa())}pa(t){if(void 0===t&&(t=!1),!(this.gi||this.Ao&&!t)){t||(this.syncCookieProperties(),this.Do||this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.Fo;e||(this.$o=!1);var i=!!e&&this.ra();if(this.$o)this.Rn.debug&&An.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.Eo)return this._a(),void(i&&this.Lo.forEach(t=>t()));var r=this.wa(this.fo,this.jo,this.props,n_);"written"===r&&this.la(this.props),"failed"!==r&&(this.Po.clear(),this.Oo=!1,this.Do=!1),i&&this.Lo.forEach(t=>t())}}}_a(){var t=this,e=this.Ko(),i=e.main,r=e.groups,n=this.wa(this.fo,this.jo,i,n_);"written"===n&&this.la(i),"failed"!==n&&(this.Oo=!1,this.Do=!1,s_.forEach(t=>{var e;null!=(e=Yb(t))&&e.storageGroup||this.Po.delete(t)}));var s=function(e){var i,n=r[e];if(Me(n)&&(null==(i=t.To[e])||!i.persisted))return s_.forEach(i=>{var r;(null==(r=Yb(i))?void 0:r.storageGroup)===e&&t.Po.delete(i)}),1;var s=t.wa(ka,t.Wo(e),n,e);"failed"!==s&&s_.forEach(i=>{var r=Yb(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Po.delete(i)})};for(var o of Qb)if(s(o))continue}Ko(){var t={},e={flags:{},surveys:{}};return On(this.props,(i,r)=>{var n,s=null==(n=Yb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Yo(t,e){if(e===n_)return JSON.stringify(t)+"|"+this.ka+"|"+this.Sa+"|"+this.xa;var i={};return On(t,(t,e)=>{var r;i[e]=null!=(r=Yb(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}wa(t,e,i,r){var n,s=this.Zo(r);if(r!==n_&&!s.dirty&&!Ie(s.fingerprint))return"skipped";try{if((n=this.Yo(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.Ot(e,i,this.ka,this.Sa,this.xa,this.Rn.debug)?(s.dirty=!1,r!==n_&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this.Mo&&(s.storageValue=ka.Lt(e)),"written"):(this.Rn.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.sa(),Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),this.fo.Dt(this.jo,!1),this.fo.Dt(this.jo,!0),!i&&this.No)for(var r of Qb)ka.Dt(this.Wo(r));i?delete this.To[n_]:this.To={},this.ua=void 0,this.ha=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Te(t)){this.syncCookieProperties(),Ie(e)&&(e="None"),this.ka=Ie(i)?this.Ca:i;var r=!1;if(On(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ea(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(Te(t)){this.syncCookieProperties(),this.ka=Ie(e)?this.Ca:e;var i=!1;if(On(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Te(e)||xe(e))&&(this.ea(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.ia(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.qo){var e=cl(this.Rn.custom_campaign_params,this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties),i=!Me(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)?pl(t):{})}update_referrer_info(){var t;this.register_once({$referrer:yl(),$referring_domain:null!=h&&h.referrer&&(null==(t=Gn(h.referrer))?void 0:t.host)||ml},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=bl(this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties,this.Rn.disable_capture_url_hashes);this.register_once({[Dt]:this.Io?{r:r_(t.r),u:t.u?r_(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_"+ce(i)]=e})});var e=this.props[Dt];return e&&$n(t,function(t,e){void 0===e&&(e=!1);var i=_l(t,e),r={};return On(i,function(t,e){r["$initial_"+ce(e)]=t}),r}(e,this.Rn.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.da(e,u),this.Rn=t,!l&&(r||s||a)&&(this.ua=void 0,this.ha=void 0,this.da(n({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Bo(t):this.fo;this.Ta();var d=this.Ho(t),v=o||d!==this.Eo,c=!l&&(v||t.cross_subdomain_cookie!==this.Sa||t.secure_cookie!==this.xa)&&this.va(u);this.Fo=v;try{if(this.Ca=this.ka=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.fo=h,this.Eo=d,this.props=f,this.save()}else a&&(this.fo=h,l||(delete this.To[n_],this.pa()))}finally{this.Fo=!1,c&&this.ga()}}Ta(){var t=this.props[Dt];if(this.Io&&Te(t)&&"string"==typeof t.r){var e=r_(t.r),i="string"==typeof t.u?r_(t.u):t.u;e===t.r&&i===t.u||this.ea(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.Sa&&(this.Sa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.xa&&(this.xa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.ea(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Ie(i)||(delete e[t],this.ea(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ea(t,e),this.save()}ea(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.Oo=!0),"$fbc_persistence"!==t||a_(n,e)||(this.Do=!0),this.oa(t,n,e),null!=(r=Yb(t))&&r.volatile||this.na(t))}ia(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(o_(t)&&this.Go(t,!0),"$fbc_persistence"===t&&(this.Do=!0),this.na(t))}na(t){var e,i=null==(e=Yb(t))?void 0:e.storageGroup;i&&(this.Zo(i).dirty=!0)}Zo(t){return this.To[t]||(this.To[t]={})}},d_=Pn("[RateLimiter]"),v_=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=>{d_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void d_.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=(Fe(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ma(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}Ia(t){var e=this.instance.config.property_denylist;return!xe(e)||!e.includes(t)}Ea(){var t;if(this.Ia("$current_url")&&this.Ia("$pathname")&&null!=d&&d.pathname)return""+(null!==(t=d.origin)&&void 0!==t?t:"")+d.pathname}Ma(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Ea(),o=this.Ia("$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}},c_=Pn("[RemoteConfig]"),f_=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}Ra(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()}Aa(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 c_.info("Using preloaded remote config",this.remoteConfig),void this.Pa(this.remoteConfig);if(this._instance.Fa())return void c_.warn("Remote config is disabled. Falling back to local config.");this.Ra(t=>{if(!t)return c_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Aa(t=>{this.Pa(t.json,t)});this.Pa(t)})}catch(t){c_.error("Error loading remote config",t),this.Pa()}}Pa(t,e){!t&&e&&(0===e.statusCode?e.error||c_.warn("Failed to fetch remote config from PostHog."):c_.error("Failed to fetch remote config from PostHog."));try{this._instance.Pa(t?{ok:!0,config:t}:{ok:!1})}catch(t){c_.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){c_.error("Error loading feature flags",t)}}},p_=!!c||!!v,g_="text/plain",m_=!1,y_=(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:"")},b_=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},__=t=>{if(t.Oa)return t.Oa;var e=t.data,i=t.compression;if(e){if(i===zf){var r=sa(oa(Vn(e)),{mtime:0});return{contentType:g_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Uf){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}}},w_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:b_(t.url,{compression:Uf}),encodedBody:__(n({},t,{compression:Uf,Oa:void 0}))}:{url:y_(t.url,"compression"),encodedBody:__(n({},t,{compression:void 0,Oa:void 0}))};try{e=__(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)))?(m_=!0,r()):{url:t.url,encodedBody:e}},k_=t=>{try{return w_(t)}catch(e){return An.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},S_=function(){var t=o(function*(t){var e=yield an(Vn(t.data),La.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return n({},t,{Oa:{contentType:g_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),x_=/Failed to fetch|NetworkError|Load failed/i,C_=t=>"TypeError"===(null==t?void 0:t.name)&&x_.test((null==t?void 0:t.message)||""),T_=t=>{var e=k_(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)}},M_=t=>{var e=k_(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)||C_(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.$a&&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)}}},I_=t=>{try{var e,i=w_(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=xe(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(xe(d)&&d.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(d.length/2),f=e=>xe(t.data)?e:n({},t.data,{batch:e});return I_(n({},t,{data:f(d.slice(0,c))})),void I_(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?M_(n({},t,{$a:!0})):T_(t)}catch(t){An.warn("Beacon send failed",t)}},E_=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return b_(i===zf?y_(t,"compression"):t,n({},s?{[s]:Date.now().toString()}:{},i===zf?{}:{compression:i}))},R_=[];v&&R_.push({transport:"fetch",method:M_}),c&&R_.push({transport:"XHR",method:T_}),null!=u&&u.sendBeacon&&R_.push({transport:"sendBeacon",method:I_});var A_=class{constructor(t,e){this.Da=!0,this.La=[],this.Na=Ge((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,An.createLogger("flush interval"),3e3),this.qa=t}enqueue(t){this.La.push(t),this.ja||this.Ba()}unload(){this.Ha();var t=this.La.length>0?this.za():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Ua(n({},t,{transport:"sendBeacon"}))})}enable(){this.Da=!1,this.Ba()}Ba(){var t=this;this.Da||(this.ja=setTimeout(()=>{if(this.Ha(),this.La.length>0){var e=this.za(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&xe(i.data)&&On(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.Ua(i)};for(var r in e)i()}},this.Na))}Ua(t){try{this.qa(t)}catch(t){An.error(t)}}Ha(){clearTimeout(this.ja),this.ja=void 0}za(){var t={};return On(this.La,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;Ie(t[s])&&(t[s]=n({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.La=[],t}},P_=class{constructor(t){this._instance=t,this.Wa=!1,this.Va=3e3,this.La=[],this.La=[],this.Ga=!0,this.resume()}resume(){if(!Ie(a)&&"onLine"in a.navigator){if(this.Ga=a.navigator.onLine,this.Za)return;this.Za=()=>{this.Ga=!0,this.Ja()},this.Qa=()=>{this.Ga=!1},zn(a,"online",this.Za),zn(a,"offline",this.Qa)}}get length(){return this.La.length}retriableRequest(t){var i=t.retriesPerformedSoFar,s=r(t,e);Oe(i)&&(s.url=b_(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.ws(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)}}))}ws(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.La.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),An.warn(n),this.Wa||(this.Wa=!0,this.Ka())}Ka(){if(this.Xa&&clearTimeout(this.Xa),0===this.La.length)return this.Wa=!1,void(this.Xa=void 0);this.Xa=setTimeout(()=>{this.Ga&&this.La.length>0&&this.Ja(),this.Ka()},this.Va)}Ja(){var t=Date.now(),e=[],i=this.La.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.La=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Xa&&(clearTimeout(this.Xa),this.Xa=void 0),this.Wa=!1,Ie(a)||(this.Za&&(a.removeEventListener("online",this.Za),this.Za=void 0),this.Qa&&(a.removeEventListener("offline",this.Qa),this.Qa=void 0)),this.La)){var e=t.requestOptions;try{this._instance._send_request(n({},e,{transport:"sendBeacon"}))}catch(t){An.error(t)}}this.La=[]}},F_=class{constructor(t){this._instance=t,this.Ya=()=>{var t,e,i,r;this.tl||(this.tl={});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.tl.lastScrollY=Math.ceil(s),this.tl.maxScrollY=Math.max(s,null!==(t=this.tl.maxScrollY)&&void 0!==t?t:0),this.tl.maxScrollHeight=Math.max(o,null!==(e=this.tl.maxScrollHeight)&&void 0!==e?e:0),this.tl.lastContentY=a,this.tl.maxContentY=Math.max(a,null!==(i=this.tl.maxContentY)&&void 0!==i?i:0),this.tl.maxContentHeight=Math.max(l,null!==(r=this.tl.maxContentHeight)&&void 0!==r?r:0)}}get el(){return this._instance.config.scroll_root_selector}getContext(){return this.tl}resetContext(){var t=this.tl;return setTimeout(this.Ya,0),t}startMeasuringScrollPosition(){zn(a,"scroll",this.Ya,{capture:!0}),zn(a,"scrollend",this.Ya,{capture:!0}),zn(a,"resize",this.Ya)}scrollElement(){var t;if(!this.el)return null==a||null==(t=a.document)?void 0:t.documentElement;for(var e of xe(this.el)?this.el:[this.el]){var i,r=null==a||null==(i=a.document)?void 0:i.querySelector(e);if(r)return r}}il(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.el){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.il("y")}scrollX(){return this.il("x")}},O_=t=>bl(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),$_=class{constructor(t,e,i,r){this.Be=t=>{var e=this.rl();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.nl(this._instance)};this.sl.register({[Pt]:i})}},this._instance=t,this.ol=e,this.sl=i,this.nl=r||O_,this.ol.onSessionId(this.Be)}rl(){return this.sl.props[Pt]}getSetOnceProps(){var t,e=null==(t=this.rl())?void 0:t.props;return e?"r"in e?_l(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_"+ce(i)]=e}),t}},D_=class{on(t,e){return this.al[t]||(this.al[t]=[]),this.al[t].push(e),()=>{this.al[t]=this.al[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.al[t]||[])i(e);for(var r of this.al["*"]||[])r(t,e)}constructor(){this.al={}}},L_=Pn("[SessionId]"),N_=864e5,q_=class{on(t,e){return this.ll.on(t,e)}constructor(t,e,i){var r;if(this.ul=null,this.hl=null,this.dl=[],this.vl=void 0,this.cl=!1,this.ll=new D_,this.fl=(t,e)=>!(!Oe(t)||!Oe(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.Rn=t.config,this.sl=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.pl=void 0,this._sessionActivityTimestamp=null,this.gl=e||pa,this.ml=i||pa;var n=this.Rn.persistence_name||this.Rn.token;if(this._sessionTimeoutMs=1e3*Ge(this.Rn.session_idle_timeout_seconds||1800,60,36e3,L_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.yl(),this.bl="ph_"+n+"_window_id",this._l="ph_"+n+"_primary_window_exists",this.wl()){var s=Da.Nt(this.bl),o=Da.Nt(this._l);s&&!o?this.He=s:Da.Dt(this.bl),Da.Ot(this._l,!0)}null!=(r=this.Rn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Rn.bootstrap.sessionID),this.kl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ie(this.dl)&&(this.dl=[]),this.dl.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.dl=this.dl.filter(e=>e!==t)}}wl(){return"memory"!==this.Rn.persistence&&!this.sl.gi&&Da.Et()}Sl(t){t!==this.He&&(this.He=t,this.wl()&&Da.Ot(this.bl,t))}xl(){return this.He?this.He:this.wl()?Da.Nt(this.bl):null}Cl(t){var e=this.ul;return!Ae(e)&&!Ae(t)&&5e3>Math.abs(t-e)}Tl(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.Cl(e)||(this.ul=e,this.sl.register({[G]:[e,t,i]}))}Ml(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return Oe(e)&&e>0}Il(){this.Ml()?this.sl.refreshKey(G):(this.sl.flush(),this.sl.load())}El(){var t;if(!Ae(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ul){this.Il();var e=this.Rl();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this.ul=this._sessionActivityTimestamp,this.sl.register({[G]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.sl.flush())}}Al(){var t=this.Rl()[0],e=Oe(t)?t:0,i=Oe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Pl(t){return this.Il(),this.fl(t,this.Al())}Rl(){var t=this.sl.props[G];return xe(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ul=null,this.pl=void 0,clearTimeout(this.Fl),this.Fl=void 0,this.Tl(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 L_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void L_.error("Invalid sessionID in bootstrap",t)}}(t);return!Ie(i)&&(e?this.pl={sessionId:t,sessionStartTimestamp:i}:this.Tl(t,(new Date).getTime(),i),!0)}destroy(){this.cl=!0,this.El(),clearTimeout(this.Fl),this.Fl=void 0,this.vl&&a&&(a.removeEventListener(ne,this.vl,{capture:!1}),this.vl=void 0),this.dl=[]}kl(){this.vl=()=>{this.El(),this.wl()&&Da.Dt(this._l)},zn(a,ne,this.vl,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.Rn.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.hl=r;else if(Ae(this.hl)||this.hl>r||r-this.hl>=1e3){var s,o;null==(s=(o=this.sl).syncCookieProperties)||s.call(o),this.hl=r}var a=this.Rl(),l=a[1],u=a[2],h=!Ie(n)&&l!==n,d=this.Al(),v=this.xl(),c=this.pl,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>N_),p=c?f:Oe(u)&&Math.abs(r-u)>N_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.fl(r,d);if(_){(_=this.Pl(r))||L_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Rl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.gl(),v=this.ml(),L_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.pl=void 0,g=!0}else v||(v=this.ml(),g=!0),(m=m||l!==b)&&(L_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=Oe(d)&&t&&!p?d:r,x=Oe(u)?u:(new Date).getTime();this.Sl(v),this.Tl(l,S,x),t||this.yl();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.dl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}yl(){this.cl||(clearTimeout(this.Fl),this.Fl=setTimeout(()=>{if(!this.cl)if(this.Pl((new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.ll.emit("forcedIdleReset",{idleSessionId:t})}else this.yl()},1.1*this.sessionTimeoutMs))}},j_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&he(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>he(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function B_(){return B_=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 Ee(i)&&i.length>0?i:void 0}catch(t){return void An.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),B_.apply(this,arguments)}var H_="custom",z_="i.posthog.com",U_=/^\/static\//,W_=["/s/","/e/","/i/"],V_=class{constructor(t){this.Ol={},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("."+z_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ol[this.apiHost]||(this.Ol[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":H_),this.Ol[this.apiHost]}$l(t){if(U_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Dl(t){var e=Gn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ll(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&&W_.some(t=>0===e.indexOf(t))){var a=this.Dl(r);if(a){var l,u=this.apiHost,h=this.Nl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Nl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Nl,i=this.Dl(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.Ll(t,e,this.uiHost+e);if("flags"===t)return this.Ll(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.$l(e);if(i)return this.Ll(t,e,""+i+e)}if(this.region===H_)return this.Ll(t,e,this.apiHost+e);var r=z_+e;switch(t){case"assets":return this.Ll(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ll(t,e,"https://"+this.region+"."+r)}}},G_=Pn("[PostHog ExternalIntegrations]"),Z_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},J_=class{constructor(t){this._instance=t}bo(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return G_.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.bo(Z_[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()}}},Q_=class{constructor(t,e){this.A=t,this.Js=e,this.ql=new Map,this.ro=!1}add(t){var e=this;return o(function*(){if(e.ro)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.Js);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.jl(t)}})()}getExtension(t){return this.ql.get(t)}dispose(){if(!this.ro){this.ro=!0;var t=Array.from(this.ql.values()).reverse();for(var e of(this.ql.clear(),t))this.jl(e)}}jl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Ce(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)}}},K_=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);Ie(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)}},X_="extensionsRemoteConfig",Y_=class{constructor(t){this.instance=t,this.ro=!1,this.A=An,this.Bl=t.Hl,this.kv=new K_(t),this.onEvent=t=>_p(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.ro)return _p(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.zl.on(X_,e);return this.Bl&&e(this.Bl),_p(i)},this.Ul=new Q_(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:La.LIB_NAME,version:La.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.Ul.add(t)}getExtension(t){return this.Ul.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 _p(this.instance.Wl(t))}handleRemoteConfig(t){this.ro||(this.Bl=t,this.instance.zl.emit(X_,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?b_(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?ge.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.ro||(this.ro=!0,this.Ul.dispose())}},tw={},ew=0,iw=()=>{},rw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',nw="Surveys module not available",sw="sanitize_properties is deprecated. Use before_send instead",ow="Invalid value for property_denylist config: ",aw=/^[A-Za-z0-9_-]{1,400}$/,lw=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,uw=["token","distinct_id",qt],hw="posthog",dw=!p_&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),vw=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},cw=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:iw,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&&Ee(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:iw},(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:vw(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))},fw=[["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"]],pw=t=>{var e={};for(var i of fw){var r=i[0],n=i[1];Ie(t[r])||(e[n]=t[r])}var s=$n({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ie(o)||(Ie(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Ee(o)&&Ie(t.asset_host)&&(s.asset_host=o)),xe(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:xe(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:An.error(ow+t.property_denylist)),s},gw=class{constructor(){this.__forceAllowLocalhost=!1}get Vl(){return this.__forceAllowLocalhost}set Vl(t){An.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},mw=(s=class t{Gl(t){if(t){var e=this.ql.indexOf(t);-1!==e&&this.ql.splice(e,1)}}Zl(t,e){return this.Gl(t),this.ql.push(e),null==e.initialize||e.initialize(),e}Jl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ql(){if(!(this.Kl||this.config.reuseAnonymousId||this.config.segment||this.Jl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Xl||(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.Kl=!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)))}}Yl(){if(!this.Jl()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.tu()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(pa());this.register({distinct_id:i,$device_id:i}),t.set_property(At,te)}this.eu()}}}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.iu=!1,this.ru=!1,this.webPerformance=new gw,this.nu=!1,this.version=La.LIB_VERSION,this.su=new Set,this.ou="",this.zl=new D_,this.ql=[],this.au=[],this.Xl=!1,this.Kl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=cw(),this.SentryIntegration=Zb,this.sentryIntegration=t=>function(t,e){var i=Gb(t,e);return{name:Vb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.lu=!1,this.uu=null,this.hu=null,this.du=null,this.scrollManager=new F_(this),this.pageViewManager=new Jb(this),this.rateLimiter=new v_(this),this.requestRouter=new V_(this),this.consent=new qb(this),this.externalIntegrations=new J_(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=Ee(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Ee(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!==hw){var n,s=null!==(n=tw[r])&&void 0!==n?n:new t;return s._init(e,i,r),tw[r]=s,tw[hw][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,s,o;void 0===e&&(e={});var l,u=Ee(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=cw(e.defaults),e.debug=this.vu(e.debug),this.cu=e,this.fu=[],e.person_profiles?this.hu=e.person_profiles:e.process_person&&(this.hu=e.process_person);var h=cw(e.defaults),d=pw(e),v=$n({},h,d,{name:i,token:u});Te(h.rageclick)&&Te(d.rageclick)&&(v.rageclick=$n({},h.rageclick,d.rageclick)),Te(h.session_recording)&&Te(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:zf;var c=this.tu();if(this.persistence=new h_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new h_(n({},this.config,{persistence:"sessionStorage"}),c,!1),this.ou="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&Da.Et()){var f=Da.Nt(this.ou);xe(f)&&f.forEach(t=>{Ee(t)&&this.su.add(t)})}else Da.Dt(this.ou);var p=n({},this.persistence.props),g=n({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.pu=new A_(t=>this.gu(t),this.config.request_queue_config),this.mu=new P_(this),this.__request_queue=[];var m=this.Jl();m||(this.sessionManager=new q_(this),this.sessionPropsManager=new $_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.yu()})),this.bu(),this.config.__preview_deferred_init_extensions?(An.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this._u(m)},0)):(An.info("Initializing extensions synchronously"),this._u(m)),La.DEBUG=La.DEBUG||this.config.debug,La.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.Xl=!!y&&!Re(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(pa()),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(pa());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.iu=!1,this.ru||null==(t=this.mu)||t.resume()}),e.segment?Wb(this,()=>this.wu()):this.wu(),Ce(this.config._onCapture)&&this.config._onCapture!==iw&&(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 B_.apply(this,arguments)}().then(t=>{t&&this.register({[S]:t})}).catch(iw),this}ku(t){var e=t;return Ee(e.name)&&Ce(e.setup)}Su(t,e){this.ku(t)?e.push(()=>{this.xu().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)}bu(){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.Cu)||o.call(this),this.Cu=void 0,this.featureFlags=new a(this)),Ce(this.featureFlags.onReloading)&&Ce(this.featureFlags.setup)?this.Cu||(this.Cu=this.featureFlags.onReloading(()=>{this.zl.emit("featureFlagsReloading",!0)}),this.xu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}_u(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.Su(this.autocapture=new d.autocapture(this),v),d.surveys&&this.Su(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.Su(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,Hb)),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.Tu){var t=this.Tu;this.Tu=void 0,this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Mu(v,h)}Mu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Mu(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)")}Pa(t){var e;if(!h||!h.body)return An.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Pa(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Tu=t),this.Hl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=de(r.supportedCompression,zf)?zf:de(r.supportedCompression,Uf)?Uf:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.hu?this.hu:ie}),null==(e=this.Iu)||e.handleRemoteConfig(t),this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}wu(){try{this.config.loaded(this)}catch(t){An.critical("`loaded` function failed",t)}if(this.Eu(),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.Jl())&&this.Ru()},1),this.Au=new f_(this),this.Au.load()}Eu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.pu)||t.enable())}_dom_loaded(){this.is_capturing()&&Fn(this.__request_queue,t=>this.gu(t)),this.__request_queue=[],this.Eu()}_handle_unload(){var t,e,i,r,n;this.iu=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Pu()&&this.capture(oe),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.pu)||r.unload(),null==(n=this.mu)||n.unload()):this.Pu()&&this.capture(oe,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?dw?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,(Ie(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&&Ie(s.compression)&&s.data&&(s.compression=Uf),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=(xe(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()),xe(t)?t.map(t=>n({},t,{sent_at:e})):n({},t,{sent_at:e})}(s.data))),s.url=E_(s.url,s.method,s.compression,s.timestampMode);var v=R_.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){C_(t)?An.warn(t):An.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===zf&&p&&"undefined"!=typeof Promise&&!m_?S_(s).then(t=>{f(t)}).catch(e=>{if(rn(e))return m_=!0,void f(n({},s,{compression:void 0,url:E_(t.url,t.method,void 0,t.timestampMode)}));nn(e)&&(m_=!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}))}gu(t){this.mu?this.mu.retriableRequest(t):this._send_request(t)}_execute_array(t){ew++;try{var e,i=[],r=[],n=[];Fn(t,t=>{if(t)if(xe(e=t[0]))n.push(t);else if(Ce(t))try{t.call(this)}catch(e){An.error("Error executing queued PostHog call",t,e)}else xe(t)&&"alias"===e?i.push(t):xe(t)&&-1!==e.indexOf("capture")&&Ce(this[e])?n.push(t):r.push(t)});var s=function(t,e){Fn(t,function(t){try{if(xe(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{ew--}}push(e){if(ew>0&&xe(e)&&Ee(e[0])){var i=t.prototype[e[0]];Ce(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Fu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Ee(e)&&lw.test(e)?{value:e,delivered:!1}:Te(e)&&Ee(e.value)&&lw.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Ou(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Fu();if(!r){if(i)return Ee(e)&&lw.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(Ee(t)&&aw.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)}}$u(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Fu();(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.pu){if(this.is_capturing())if(!Ie(t)&&Ee(t)){this.Yl();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&&!Ee(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.Du||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,pa),_={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=Te(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=xe(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.Ou(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.Lu(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=>Ee(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),xe(e))r=[],Fn(e,e=>{r.push(t(e))});else{var n={};On(Be(e)?jn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),_.timestamp=y,Ie(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,uw)),t===lp||t===up){var F=null==e?void 0:e[hp],O=null==e?void 0:e[vp];Tp({id:F,current_iteration:O}),_.$set=n({},_.$set,{[za({id:F,current_iteration:O},t===up?"responded":"dismissed")]:!0})}else t===ap&&(_.$set=n({},_.$set,{[mp]:(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(Me(L)||this.setPersonPropertiesForFlags(L),!Pe(this.config.before_send)){var N=this.bs(_);if(!N)return;(_=N).uuid=sr(_.uuid,pa)}var q=null!==(o=null==(a=_.$set)?void 0:a.$fbc)&&void 0!==o?o:Te(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.zl.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.$u(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?(!z.transport&&!z.callback&&Me(null!==(B=this.config.request_headers)&&void 0!==B?B:{})&&this.iu&&(z.transport="sendBeacon"),this.gu(z)):this.pu.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.Iu)?void 0:e.getExtension(t)}xu(){var t;return null!==(t=this.Iu)&&void 0!==t?t:this.Iu=new Y_(this)}Wl(t){this.au.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.au.indexOf(t);-1!==i&&this.au.splice(i,1)}}}Nu(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.du=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.su.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.Nu();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.Jl()&&(l[qt]=!0),"$snapshot"===t){var u=n({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Ee(l.distinct_id)&&!Fe(l.distinct_id)||Re(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?[...ul,...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}:{},_={};Ie(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;Ie(k)||(w.userAgentDataPlatform=k),Ie(S)||(w.maxTouchPoints=S),Ie(x)||(w.screenWidth=x),Ie(C)||(w.screenHeight=C),Ie(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:wl(),$timezone_offset:kl()}),{$current_url:Qn(r?ar(null==d?void 0:d.href):null==d?void 0:d.href,h,dl),$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:gl(),$browser_language_prefix:(M=gl(),"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.mu)?void 0:m.length}catch(t){l.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===H_&&(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),!Ie(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;Te(w)&&!Me(w)&&(l.$groups=n({},Te(k)?k:{},w)),On(["$referrer","$referring_domain"],t=>{t in b&&delete _[t]});var S={};if(this.au.length>0)for(var x of this.au.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(),xe(this.config.property_denylist)?On(this.config.property_denylist,function(t){delete l[t]}):An.error(ow+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(An.error(sw),l=C(l,t));var T=this.ju();return l.$process_person_profile=T,T&&!s&&this.Bu("_calculate_event_properties"),l}Lu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.ju())return t;if(this.nu&&!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(sw),n=s(n,"$set_once")),e&&(this.nu=!0),Me(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.Nu(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.su.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.su.delete(t),this.qu()}Hu(t,e){this.register({[t]:e})}yu(){this.su.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.su.clear(),this.qu()}qu(){var t;if(this.ou)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!Da.Et())Da.Dt(this.ou);else{var e=[];this.su.forEach(t=>e.push(t)),e.length>0?Da.Ot(this.ou,e):Da.Dt(this.ou)}}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.zl.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:nw}),()=>{})}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:nw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:nw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Ip),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:nw}}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:nw})}zu(t){return!t||Re(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(Fe(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.zu(t)&&this.Bu("posthog.identify")){this.Yl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Nu(!1),o=this.persistence.va(),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.ca(),this.capture(ae,c,{$set:e||{},$set_once:i||{}}),this.du=el(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.ca(),this.capture("$set",{$set:f,$set_once:p}),this.du=el(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.ga(a)}}}setPersonProperties(t,e){if((t||e)&&this.Bu("posthog.setPersonProperties")){var i=el(this.get_distinct_id(),t,e);this.du!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.du=i):An.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(xe(t)?t:[t]).filter(t=>Ee(t)&&t.length>0);0!==i.length&&this.Bu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.du=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Nu();var s=this.getGroups(),o=s[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:n({},s,{[t]:e})}),(o||i)&&this.ju()){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.Bu("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=$e(t)?t:null==t?void 0:t.resetDeviceID,i=$e(t)||null==t?void 0:t.bootstrap;this.Uu(e,!1,i)}Uu(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.cu)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Fa());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.va?void 0:a.va(),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.su.clear(),this.qu(),Ie(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.du=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Nt,$device_id:null},"");else{var R=this.config.get_device_id(pa());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[S]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Jl()||(null==(E=this.persistence)||E.set_property(At,i.isIdentifiedID?ee:te),this.register({distinct_id:i.distinctID})),null==(M=this.featureFlags)||M.initialize(),!(Ie(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.ga||P.ga(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return o(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.ru=!0,e.xu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.pu)||n.unload(),null==(s=e.mu)||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.Wu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Vu()}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.Bu("posthog.alias")?(Ie(e)&&(e=this.get_distinct_id()),t!==e?(this.Hu(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(Te(t)){var i,r,s,o,a,l,u,h,d,v,c,f,p;$n(this.config,pw(t));var g=this.tu();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new h_(n({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.vu(this.config.debug);$e(m)&&(this.config.debug=m),$e(this.config.debug)&&(this.config.debug?(La.DEBUG=!0,ka.Et()&&ka.Ot("ph_debug",!0),An.info("set_config",{config:t,oldConfig:e,newConfig:n({},this.config)})):(La.DEBUG=!1,ka.Et()&&ka.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Fa()),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.eu(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Wb(this,iw,!1)}}_overrideSDKInfo(t,e){La.LIB_NAME=t,La.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.Gu}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:hw;return e!==hw&&(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"))}ju(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Me(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}Pu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.ju()||this.Bu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Bu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Bu(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.Ql(),this.Hu(Lt,!0),!0)}tu(){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)}eu(){var t,e,i,r,n,s=this.tu();return this.is_capturing()||null==(t=this.logs)||t.Zu(),(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.su.clear(),this.qu()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.Jl()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.Uu(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new q_(this),this.pageViewManager=new Jb(this),this.persistence&&(this.sessionPropsManager=new $_(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.Zl(this.sessionRecording,new v(this)),this.Hl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Hl)))}this.consent.optInOut(!0),this.eu(),this.Eu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Ie(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.Ru()}else An.warn(rw)}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.Uu(!0,!0),this.consent.optInOut(!1),this.eu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Nt,$device_id:null}),this.Gl(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.Ru(),this.Eu())}else An.warn(rw)}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.eu()}_is_bot(){return u?j_(u,this.config.custom_blocked_useragents):void 0}Ru(){h&&("visible"===h.visibilityState?this.lu||(this.lu=!0,this.capture(se,{title:h.title},{send_instantly:!0}),this.uu&&(h.removeEventListener(re,this.uu),this.uu=null)):this.uu||(this.uu=this.Ru.bind(this),zn(h,re,this.uu)))}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}))}Fa(){var t=this.cu||{};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&&!Pe(t[e]),o=i in t&&!Pe(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)}bs(t){var e;if(Pe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Ne),r=xe(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Pe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Le(t.event)?An.warn(o+". This can cause unexpected behavior."):An.info(o),null}n.properties&&!Me(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&&Pe(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.ko)?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)})}vu(t){var e=$e(t)&&!t,i=ka.Et()&&"true"===ka.Lt("ph_debug");return!e&&(!!i||t)}},s.__defaultExtensionClasses={},s.Gu=(()=>{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]])}(mw,["identify"]);var yw=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Te(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.Fa(),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}},bw=Pn("[ExceptionAutocapture]"),_w=Pn("[TracingHeaders]"),ww=Pn("[Web Vitals]"),kw=9e5,Sw=["CLS","FCP","INP","LCP"],xw=["INP","LCP"],Cw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Tw=Pn("[SessionRecording]"),Mw=Pn("[Heatmaps]");function Iw(t){return Te(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var Ew=Pn("[Product Tours]"),Rw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(L))},Aw=Pn("[SiteApps]"),Pw="Error while initializing PostHog app with config id ",Fw=(t,e)=>null!=t&&t.then?t.then(e):e(t),Ow="SDK is not enabled or survey functionality is not yet loaded",$w="Disabled. Not loading surveys.",Dw=class{constructor(t,e){this.Ks=t,this.Ju=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Qu=!1,this.Ku=[],this.Xu=null,this.Yu=null,this.ro=!1,this.th=new Set,this.onRemoteConfig=t=>{if(!this.ro&&!this.Rn.disableSurveys){if(!t.ok)return wp.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Pe(e))return wp.warn("Flags not loaded yet. Not loading surveys.");this.eh=$e(e)?e:e.length>0,wp.info("flags response received, isSurveysEnabled: "+this.eh),this.loadIfEnabled()}}}setup(t){if(!this.ro)return this.ih=t,Fw(t.kv.initialize(),()=>{if(this.ih===t&&!this.ro){this.ih=void 0,this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.ro?e.dispose():(this.oo=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.ro||(this.ro=!0,this.ih=void 0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ku=[],this.Xu=null,this.th.forEach(t=>clearTimeout(t)),this.th.clear())}get Rn(){return this.Ks.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.ro&&this.Js){var t=this.Rn;if(!this._surveyManager)if(this.Qu)wp.info("Already initializing surveys, skipping...");else if(t.disableSurveys)wp.info($w);else if(t.cookielessMode&&this.Ks.isOptedOut())wp.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ks.getExtensions();if(e){if(!Ie(this.eh)||t.advancedEnableSurveys){var i=this.eh||t.advancedEnableSurveys;this.Qu=!0;try{var r=e.generateSurveys;if(r)return this.rh(r,i),void(this.Qu=!1);var n=e.loadExternalDependency;if(!n)return this.nh(Yt),void(this.Qu=!1);n(t=>{try{if(this.ro)return;var e=this.Ks.getExtensions();t||null==e||!e.generateSurveys?this.nh("Could not load surveys script",t):this.rh(e.generateSurveys,i)}finally{this.Qu=!1}})}catch(t){throw this.Qu=!1,this.nh("Error initializing surveys",t),t}}}else wp.error("PostHog Extensions not found.")}}}rh(t,e){this.ro||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ks.createEventReceiver(),wp.info("Surveys loaded successfully"),this.sh({isLoaded:!0}))}nh(t,e){wp.error(t,e),this.sh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ku.push(t),this._surveyManager&&this.sh({isLoaded:!0}),()=>{this.Ku=this.Ku.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Js)&&void 0!==i?i:this.Ju;if(r&&!this.ro){if(this.Rn.disableSurveys)return wp.info($w),t([]);var n=r.kv.get(pt);if(n&&!e)return t(n,{isLoaded:!0}),void(this.oh()&&this.getSurveys(()=>{},!0));if(this.Xu)this.Xu.then(e=>{this.ro||t(e.surveys,e.context)}).catch(t=>wp.error("Error in survey callback",t));else{var s=this.ah("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{try{return this.uh(r,t)}catch(t){return wp.error("Error processing surveys response",t),this.uh(r,{statusCode:0,error:t})}},t=>this.uh(r,{statusCode:0,error:t}));this.Xu=s;var o=()=>{this.Xu===s&&(this.Xu=null)};s.then(e=>{o(),this.ro||t(e.surveys,e.context)},o).catch(t=>wp.error("Error in survey callback",t))}}}ah(t,e){var i=this.Js;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(Ow)}))}uh(t,e){var i;if(this.ro)return{surveys:[],context:{isLoaded:!1,error:Ow}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?wp.error(n):e.error||wp.warn(n),this.Yu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Yu=null;var s=e.json.surveys||[],o=s.filter(t=>kp(t)&&(Ja(t)||Sp(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}}}oh(){return this.hh()&&!this.Xu&&!this.dh()}hh(){var t,e,i=null==(t=null!==(e=this.Js)&&void 0!==e?e:this.Ju)?void 0:t.kv.get(gt);return Fe(i)&&Date.now()-i>3e5}dh(){return Fe(this.Yu)&&3e5>Date.now()-this.Yu}markSurveyAsSeen(t,e){var i;Tp({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){}}sh(t){for(var e of this.Ku)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){wp.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Pe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);wp.warn("init was not called")}fh(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}ph(t){if(Pe(this._surveyManager))return{eligible:!1,reason:Ow};var e="string"==typeof t?this.fh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}gh(t){if(Pe(this._surveyManager))return{eligible:!1,reason:Ow};var e="string"==typeof t?this.fh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Pe(this._surveyManager))return wp.warn("init was not called"),{visible:!1,disabledReason:Ow};var e=this.gh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Pe(this._surveyManager)?(wp.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ow})):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.gh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(Pe(this._surveyManager))wp.warn("init was not called");else{var n="string"==typeof t?this.fh(t):t;if(null!=n&&n.id)if(Mp.includes(n.type)){var s=null==h?void 0:h.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){wp.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.th.delete(o),this.ro||(wp.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),wp.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.th.add(o)}else this._surveyManager.renderSurvey(n,s,i);else wp.warn("Survey element not found")}else wp.warn("Surveys of type "+n.type+" cannot be rendered in the app");else wp.warn("Survey not found")}}displaySurvey(t,e){var i;if(Pe(this._surveyManager))wp.warn("init was not called");else{var r=this.fh(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!==bp&&e.initialResponses&&wp.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.ph(r);if(!o.eligible)return void wp.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 wp.warn("Survey not found")}}cancelPendingSurvey(t){Pe(this._surveyManager)?wp.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function Lw(t,e,i){if(Pe(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 Nw=class{constructor(t){this._instance=t,this.mh=new Set,this.yh=new Set,this.bh=new D_,this._h=(t,e)=>this.wh(t,e)&&this.kh(t,e)&&this.Sh(t,e)&&this.xh(t,e),this.wh=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Ie(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Ch=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.Ch)||t.call(this),this.Ch=void 0,this.bh=new D_}register(t){var e,i;if(!Ie(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.mh.add(t),null==(e=t.steps)||e.forEach(t=>{this.yh.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.mh.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.mh.clear(),this.yh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.yh.has(t)||this.yh.has(e.event))&&this.mh.forEach(t=>{this.Th(e,t)&&this.bh.emit("actionCaptured",t.name)})}Mh(t){this.onAction("actionCaptured",e=>t(e))}Th(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this._h(t,i))return!0;return!1}onAction(t,e){return this.bh.on(t,e)}kh(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(!Lw(r,e.url,e.url_matching||"contains"))return!1}return!0}Sh(t,e){return!!this.Ih(t,e)&&!!this.Eh(t,e)&&!!this.Rh(t,e)}Ih(t,e){var i;if(null==e||!e.href)return!0;var r=this.Ah(t);if(r.length>0)return r.some(t=>Lw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Lw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Eh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Ah(t);if(r.length>0)return r.some(t=>Lw(t.text,e.text,e.text_matching||"exact")||Lw(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;!Pe(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=>Lw(t,s,o)))}Rh(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}Ah(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}xh(t,e){return null==e||!e.properties||0===e.properties.length||tl(e.properties.reduce((t,e)=>{var i=xe(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)}},qw=class{constructor(t){var e;this.Ph=[],this._instance=t,this.Fh=new Map,this.Oh=new Map,this.$h=new Map,this.Dh=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Lh(t))}Nh(t){return!1}qh(){return null}jh(t){}Bh(){}Hh(t,e){return!!t&&tl(t.propertyFilters,null==e?void 0:e.properties)}zh(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}Uh(t,e,i){var r=(i===Wf?this.Fh:this.Oh).get(t),n=[];return this.Wh(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.Hh(s,e)})}register(t){this.Vh(t,!1)}replace(t){this.Vh(t,!0)}Vh(t,e){var i;Ie(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Gh(t,e),this.Zh(t,e))}Zh(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.$h.clear(),0!==i.length){this.Jh||(this.Jh=new Nw(this._instance),this.Jh.init(),this.Jh.Mh(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.$h.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.$h.set(e.name,n)}})}),e?this.Jh.replace(r):this.Jh.register(r)}else{var n;e&&(null==(n=this.Jh)||n.replace([]))}}Qh(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)})}Gh(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.zh(t,Wf),a=this.zh(t,Vf);e?(this.Fh=o,this.Oh=a):(this.Qh(this.Fh,o),this.Qh(this.Oh,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Ch)&&void 0!==i||(this.Ch=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.Kh(),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.Xh(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Yh([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.td(s),void this.ed([s])}if(this.Oh.has(t)){var a=this.Uh(t,e,Vf);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.Yh(a.map(t=>t.id)),a.forEach(t=>this.rd(t.id)))}if(this.Fh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Fh.get(t)});var l=this.Uh(t,e,Wf);this.nd(l.map(t=>t.id))}}onAction(t){this.$h.has(t)&&this.nd(this.$h.get(t)||[])}nd(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.Nh(n)?this.td(n)&&this.sd(n):r.push(n);r.length>0&&(this.Ph=[...new Set([...this.Ph,...r])]),this.Kh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}td(t){this.Ph=this.Ph.filter(e=>e!==t);var e=this.od();return!e.includes(t)&&(this.ad([...e,t]),this.ld(),!0)}Yh(t){var e=new Set(t);this.Ph=this.Ph.filter(t=>!e.has(t));var i=this.ud(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.ad(r),0===r.length&&this.hd()),this.ed(t)}dd(){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:{}}sd(t){if(this.qh()){var e=this.dd();this.jh(n({},e,{[t]:Date.now()}))}}ed(t){if(this.qh()){var e=this.dd(),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&&(Me(i)?this.Bh():this.jh(i))}}vd(){this.qh()&&this.Bh()}getActivationTimestamp(t){if(this.od().includes(t)){var e=this.dd()[t];return Fe(e)?e:void 0}}ud(){var t,e=this.fd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}od(){var t,e,i=this.ud();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.pd()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}ld(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.gd(e)}hd(){this.md()}Lh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.pd()];if(i&&i!==t){var r=this.ud(),n=this.dd();r.length>0&&(this.ad([]),r.filter(t=>Fe(n[t])).forEach(t=>this.rd(t))),this.hd(),this.vd()}}getActivatedIds(){return[...new Set([...this.od(),...this.Ph])].filter(t=>!this.yd(t))}dispose(){var t,e,i;null==(t=this.Dh)||t.call(this),this.Dh=void 0,null==(e=this.Ch)||e.call(this),this.Ch=void 0,null==(i=this.Jh)||i.dispose(),this.Jh=void 0}reset(){this.Ph=[],this.ud().length>0&&this.ad([]),this.hd(),this.vd()}getEventToItemsMap(){return this.Fh}bd(){return this.Jh}},jw=class extends qw{constructor(t){super(t)}fd(){return mt}pd(){return yt}qh(){return bt}jh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Bh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Nh(t){var e,i;this.Wh(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Fe(r)&&r>0}_d(){return ap}Wh(t){var e;null==(e=this._instance)||e.getSurveys(t)}rd(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Kh(){return wp}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[mt]:t})}gd(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}md(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(yt)}yd(){return!1}Xh(t,e){var i;return this.Wh(t=>{i=t.find(t=>t.id===e)}),!i||Qa(i)?t===ap?"consume":"ignore":t===ap?"persist":t===lp||t===up?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Bw=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);Ie(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)}},Hw=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()}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 jw(this._instance)}},zw=null!=a&&a.location?Kn(a.location.hash,"__posthog")||Kn(location.hash,"state"):null,Uw="_postHogToolbarParams",Ww=Pn("[Toolbar]"),Vw=Pn("[FeatureFlags]"),Gw=class{constructor(t,e){void 0===e&&(e=!1),this.wd=!1,this.update(t,e)}update(t,e){this.kd=((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:xe(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.wd||(Vw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.wd=!0),Ie(t.flag_keys)||xe(t.flag_keys)||Vw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.kd}},Zw=Pn("[FeatureFlags]"),Jw=Pn("[FeatureFlags]",{debugEnabled:!0}),Qw="\" failed. Feature flags didn't load in time.",Kw="connection_error",Xw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Yw=t=>{var e={};for(var i of Dn(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},tk="Refusing to render web experiment since the viewer is a likely bot",ek={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Ka(e,t),not_regex:(t,e)=>!Ka(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},ik=Pn("[Conversations]"),rk="Conversations not available yet.";function nk(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=Ie(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 sk=["debug","log","warn","error","info"],ok="console",ak="__posthogHandledLogsRequestError",lk=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[ak]=!0,i},uk=t=>!!t&&"object"==typeof t&&!0===t[ak],hk={featureFlags:class{constructor(t){this.name="featureFlags",this.Sd=!1,this.featureFlagEventHandlers=[],this.A=Zw,this.xd={},this.Cd={},this.Td=[],this.Md=!1,this.Id=!1,this.Ed=0,this.Rd=!1,this.Ad=!1,this.Pd=!1,this.Fd=!1,this.Od=0,this.nr=()=>{var t=this.$d();this.Od=0,t&&this.reloadFeatureFlags()},this.Dd=()=>{var t,e=this.Ld;Ie(e)||this.Rn.remoteRequestsDisabled||!h||"hidden"===h.visibilityState||Date.now()-(null!==(t=this.Nd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.qd())},this.ar=()=>{"visible"===(null==h?void 0:h.visibilityState)&&this.Dd()},"get"in t?this.Ks=t:(this._instance=t,this.jd=new Gw(t.config,t.Fa()),this.Ks=this.jd)}updateConfig(t,e){var i;null==(i=this.jd)||i.update(t,e),this.Js&&this.Bd()}setup(t){return this.ih=t,this.A=t.logger.createLogger("[FeatureFlags]"),Fw(t.kv.initialize(),()=>{this.ih===t&&(this.ih=void 0,this.Js=t,this.Hd(t))})}Hd(t){var e;if(this.Js===t)return a&&zn(a,"online",this.nr),this.Bd(),this.zd=t.registerDynamicEventProperties(()=>this.Ud()?this.xd:this.Cd),this.Wd=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Vd(),this.Gd(),this.Zd()}),this.Gd(),this.initialize()}Bd(){var t=this.Rn.refreshIntervalMs,e=!this.Rn.remoteRequestsDisabled&&h&&!Ie(t)&&t>0?t:void 0;e!==this.Ld&&(this.Jd(),Ie(e)||(this.Ld=e,this.qd(),null!=h&&h.addEventListener&&zn(h,re,this.ar)))}qd(){Ie(this.Ld)||(Ie(this.Qd)||clearInterval(this.Qd),this.Nd=Date.now(),this.Qd=setInterval(this.Dd,this.Ld))}Jd(){Ie(this.Qd)||(clearInterval(this.Qd),this.Qd=void 0,null==h||null==h.removeEventListener||h.removeEventListener(re,this.ar)),this.Ld=void 0,this.Nd=void 0}destroy(){this.Kd()}dispose(){this.Kd()}Kd(){var t,e;this.Jd(),this.Ed++,this.Ad=!1,this.ih=void 0,this.Js&&(this.Xd(),null==(t=this.zd)||t.dispose(),this.zd=void 0,null==(e=this.Wd)||e.call(this),this.Wd=void 0,this.Td=[],null==a||a.removeEventListener("online",this.nr),this.Js=void 0)}get Rn(){return this.Ks.get()}Yd(t){var e;return this.tv&&t in this.tv?this.tv[t]:null==(e=this.Js)?void 0:e.kv.get(t)}Vd(){return!!this.tv&&(this.tv=void 0,!0)}ev(){var t;return!Ie(null==(t=this.Js)?void 0:t.kv.get("$enabled_feature_flags"))&&this.Vd()}Ot(t){this.iv(()=>{var e;return null==(e=this.Js)?void 0:e.kv.set(t)})}rv(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.Yd("$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&&!xe(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Yd("$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]))Ie(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}Dt(t){this.iv(()=>{var e;return null==(e=this.Js)?void 0:e.kv.remove(t)})}iv(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Gd(){var t={};for(var e of[nt,at,lt,ht]){var i=this.Yd(e);Ie(i)||(t[e]=i)}this.xd=t;var r=n({},t),s=this.Yd(rt);if(s)for(var o of Object.entries(s))r["$feature/"+o[0]]=o[1];this.Cd=r}Ud(){var t=this.Rn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Yd(Rt);return"number"!=typeof e||Date.now()-e>t}nv(){return!!this.Ud()&&(this.Fd||this.Id||(this.Fd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}sv(){var t=this.Rn.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}):[]}ov(){var t=this.Rn.flagKeys;if(!Ie(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.Rn,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=>!Ie(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.av({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,s,o=null!=i&&i.merge&&null!==(r=this.Yd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.Yd("$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:Ie(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.av({flags:h})}get hasLoadedFlags(){return this.Md}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Yd(ot),e=this.Yd(ht),i=this.Yd(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=Ie(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Ie(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.Sd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Sd=!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.Yd(rt),e=this.Yd(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.Sd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Sd=!0),i}getFlagPayloads(){var t=this.Yd(at),e=this.Yd(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.Sd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Sd=!0),i}reloadFeatureFlags(){this.Rd||this.Rn.featureFlagsDisabled||this.$d()||(this.Id&&(this.Ad=!0),this.lv||(this.Td.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.lv=setTimeout(()=>{this.uv()},5)))}Xd(){clearTimeout(this.lv),this.lv=void 0}onReloading(t){return this.Td.push(t),()=>{this.Td=this.Td.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Md||this.Id||this.lv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Rd=t}resetFlagCallReported(){this.Dt(Mt)}uv(t){this.Xd();var e=this.Js;if(e&&!this.Rn.remoteRequestsDisabled&&!this.$d())if(this.Id)this.Ad=!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.Yd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Yd(ct),timezone:wl()};Ie(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.Rn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.sv();r.length&&(i.evaluation_contexts=r);var s=this.ov();Ie(s)||(i.flag_keys=s);var o=this.Rn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.Ed;this.Id=!0;var u=()=>{this.Ad&&(this.Ad=!1,this.uv())},h=t=>{this.Id=!1,l===this.Ed?(this.Ot({[Et]:[Kw]}),this.A.error("Feature flag request failed",t),this.ev()&&this.Zd(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.Rn.compression,sentAt:"body",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this.Id=!1,l===this.Ed){if(this.hv(t.statusCode),s||this.Ad||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ad){this.Pd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Kw:"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.av(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}$d(){return Xn(this.Od,3)}hv(t){this.Od=Yn(t,this.Od,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.Pd)if(this.Md||this.getFlags()&&this.getFlags().length>0){if(!this.nv()){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+Qw)}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.Pd)if(this.Md||this.getFlags()&&this.getFlags().length>0){if(!this.nv()){var i,r=this.getFlagVariants(),s=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.Yd("$feature_flag_request_id")||void 0,h=this.Yd("$feature_flag_evaluated_at")||void 0,d=this.Yd("$flag_call_reported")||{};if(this.Rn.deduplicateCallsPerSession){var v,c=null==(v=this.Js)?void 0:v.session.sessionId,f=this.Yd(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;xe(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.Yd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(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.Rn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.Rn.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.Pd};Ie(null==I||null==(_=I.metadata)?void 0:_.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Ie(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),Ie(null==I?void 0:I.original_variant)&&Ie(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Ie(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.dv(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+Qw)}dv(t){try{var e;null==(e=this.Js)||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.vv(t,e)}vv(t,e){var i=this;return o(function*(){var r=i.Js;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.sv();s.length&&(n.evaluation_contexts=s);var o,a=i.ov();Ie(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.Rn.compression,sentAt:"body",timeoutMs:i.Rn.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.Pd)return e.defaultValue;if(!(this.Md||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Qw),e.defaultValue;var i=this.getFeatureFlag(t,e);return Ie(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.av(t,e,i)}av(t,e,i){if(this.Js){this.Md=!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=Zw);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!Ie(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(xe(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(Yw(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=!Ie(this.Js.kv.get(rt));this.tv=r,s||this.Ot(r)}else this.Vd(),this.rv(r,t,!(null==i||!i.partialResponse)),this.Ot(r);else e&&this.ev();e||(this.Fd=!1),this.Zd(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.fv(t)}fv(t){if(this.Js){if(!1===t)return this.Dt([ht,dt]),this.Zd(),void Jw.info("All overrides cleared");if(xe(t))return this.Ot({[ht]:Xw(t)}),this.Zd(),void Jw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Sd=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ht]=xe(n)?Xw(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.Zd(),!1===n?Jw.info("Flag overrides cleared"):n&&Jw.info("Flag overrides set",{flags:n}),void(!1===s?Jw.info("Payload overrides cleared"):s&&Jw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ot({[ht]:t}),this.Zd(),void Jw.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.Md){var e=this.pv(),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.Yd("$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(Yw(l)),[rt]:l,[vt]:n({},this.Yd("$stored_person_properties")||{},o)}),this.Zd();try{var u;null==(u=this.Js)||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.Yd(st);!r||e?this.gv(t,i):t(r)}gv(t,e){var i=this;return o(function*(){var r=i.Js;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)}}})()}pv(){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),{})}}Zd(t){this.Gd();var e=this.pv(),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.mv(t,e)}mv(t,e){void 0===e&&(e=!0);var i=this.Yd("$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.Yd("$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.Yd("$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.Yd("$stored_group_properties")||{};this.Ot({[ct]:n({},e,{[t]:{}})})}else this.Dt(ct)}reset(){this.Ed++,this.Ad=!1,this.xd={},this.Cd={},this.tv=void 0,this.Md=!1,this.Rd=!1,this.Pd=!1,this.$anon_distinct_id=void 0,this.Xd(),this.Sd=!1,this.Od=0}}},dk={sessionRecording:class{get Rn(){return this._instance.config}get sl(){return this._instance.persistence}get started(){var t;return!(null==(t=this.yv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.bv||"missing_config"===this.bv?this.bv:null!==(t=null==(e=this.yv)?void 0:e.status)&&void 0!==t?t:this.bv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.bv=Xs,this._v=void 0,this.wv=!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.yv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Tw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rn.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.wv=!0,null==h||null==h.removeEventListener||h.removeEventListener("visibilitychange",this.ar),i?this.Sv(!0):this.stopRecording()}get xv(){var t,e=!(null==(t=this._instance.get_property(j))||!t.enabled),i=!this.Rn.disable_session_recording,r=this.Rn.disable_session_recording||this._instance.consent.isOptedOut();return a&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.wv||this.xv&&null!=(e=this.yv)&&e.isStarted)){var i=!Ie(Object.assign)&&!Ie(Array.from);this.xv&&i?(this.Cv(t),Tw.info("starting")):(this.bv=Xs,this.stopRecording())}}Cv(t){var e,i;if(this.xv)if("awaiting_config"!==this.bv&&"missing_config"!==this.bv&&(this.bv=ro),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.Tv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Mv,e=>{if(!this.wv&&this.xv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),Tw.error("could not load recorder",e)):void this.Tv(t);this.bv=Xs})}}stopRecording(){var t,e;null==(t=this._v)||t.call(this),this._v=void 0,null==(e=this.yv)||e.stop()}Sv(t){var e,i;void 0===t&&(t=!1),null==(e=this._v)||e.call(this),this._v=void 0,null==(i=this.yv)||i.discard({discardProducerEvents:t})}Iv(){var t,e;null==(t=this.sl)||t.unregister(Z),null==(e=this.sl)||e.unregister(H)}Ev(t,e){if(Pe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Tw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Rv(t){if(this.sl){var e,i,r=this.sl,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Ev(null==(e=this.Rn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ev(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Pe(a)&&this.Iv();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:Ie(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._v)||e.call(this),this._v=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.Rv(e),void this.Sv()):(this.Rv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.bv&&(this.bv="missing_config",Tw.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.yv)&&i.log?this.yv.log(t,e):Tw.warn("log called before recorder was ready")}get Mv(){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"}Av(){var t,e=this._instance.get_property(j);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Tw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Pe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Tv(t){var e,i,r;if(!this.wv&&this.xv&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return Tw.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.yv||(this.yv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Ke),this.yv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Av()){if("missing_config"===this.bv||"awaiting_config"===this.bv)return;return this.bv="awaiting_config",Tw.info("persisted remote config is stale, requesting fresh config before starting"),void new f_(this._instance).load()}this.bv=ro,null==(i=(r=this.yv).setDocumentWasEverVisible)||i.call(r,this.Ke),this.yv.start(t)}else this.bv=Xs}onRRwebEmit(t){var e;null==(e=this.yv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.yv||null==(t=this.sl)||t.register({[U]:!0}),null==(e=this.yv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.yv||null==(t=this.sl)||t.register({[z]:!0}),null==(e=this.yv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.yv||null==(e=this.sl)||e.register({["url"===t?W:V]:!0}),null==(i=this.yv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.yv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.yv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.yv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},vk={autocapture:class extends xb{constructor(t){super(new yw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Pv=this.Fv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Ov();return!!(t.path||t.search||this.$v(t))}startIfEnabled(){this.isEnabled&&(An.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Pv=this.Fv(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,An.info("History API monitoring stopped")}monitorHistoryChanges(){a&&a.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.$v()&&this.jv())}Nv(t){var e;if(a&&(null==(e=a.history[t])||!e.__posthog_wrapped__)){var i=this;tc(a.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Bv(t)})}}Fv(){var t=null==a?void 0:a.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Ov(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Te(t)?t:{}}$v(t){return void 0===t&&(t=this.Ov()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Hv(t){var e=this.Ov(),i=this.Pv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.$v(e)&&t.hash!==i.hash))}Bv(t){try{var e=this.Fv();if(!e)return;this.Hv(e)&&this._instance.capture(se,{navigation_type:t}),this.Pv=e}catch(e){An.error("Error capturing "+t+" pageview",e)}}qv(){if(!this.Dv){var t=()=>{this.Bv("popstate")};zn(a,"popstate",t),this.Dv=()=>{a&&a.removeEventListener("popstate",t)}}}jv(){if(!this.Lv){var t=()=>{this.Bv("hashchange")};zn(a,"hashchange",t),this.Lv=()=>{a&&a.removeEventListener("hashchange",t)}}}},heatmaps:class{get Rn(){return this.instance.config}constructor(t){var e;this.zv=!1,this.Xs=!1,this.Uv=null,this.instance=t,this.zv=!(null==(e=this.instance.persistence)||!e.props[R]),this.rageclicks=new yb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Te(this.Rn.capture_heatmaps)&&this.Rn.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Pe(this.Rn.capture_heatmaps)?Pe(this.Rn.enable_heatmaps)?this.zv:this.Rn.enable_heatmaps:!1!==this.Rn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Xs)return;Mw.info("starting..."),this.Wv(),this.ar()}else{var t;clearInterval(null!==(t=this.Uv)&&void 0!==t?t:void 0),this.Vv(),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.zv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Rt;return this.Rt=void 0,t}Gv(t){Iw(t.originalEvent)&&this.vn(t.originalEvent,"deadclick")}ar(){this.Uv&&clearInterval(this.Uv),this.Uv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(h)?setInterval(this.Ja.bind(this),this.flushIntervalMilliseconds):null}Wv(){a&&h&&(this.Zv=this.Ja.bind(this),zn(a,ne,this.Zv),this.Jv=t=>this.vn(t||(null==a?void 0:a.event)),zn(h,"click",this.Jv,{capture:!0}),this.Qv=t=>this.Kv(t||(null==a?void 0:a.event)),zn(h,"mousemove",this.Qv,{capture:!0}),this.Xv=new zb(this.instance,Bb,this.Gv.bind(this)),this.Xv.startIfEnabledOrStop(),this.Yv=this.ar.bind(this),zn(h,re,this.Yv),this.Xs=!0)}Vv(){var t;a&&h&&(this.Zv&&a.removeEventListener(ne,this.Zv),this.Jv&&h.removeEventListener("click",this.Jv,{capture:!0}),this.Qv&&h.removeEventListener("mousemove",this.Qv,{capture:!0}),this.Yv&&h.removeEventListener(re,this.Yv),clearTimeout(this.tc),null==(t=this.Xv)||t.stop(),this.Xs=!1)}ec(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(de(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}}vn(t,e){var i;if(void 0===e&&(e="click"),!is(t.target)&&Iw(t)){var r=this.ec(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&xs(vs(t),this.instance.config.rageclick)&&this.$s(n({},r,{type:"rageclick"})),this.$s(r)}}Kv(t){!is(t.target)&&Iw(t)&&(clearTimeout(this.tc),this.tc=setTimeout(()=>{this.$s(this.ec(t,"mousemove"))},500))}$s(t){if(a){var e=this.Rn.disable_capture_url_hashes?ar(a.location.href):a.location.href,i=this.Rn.custom_personal_data_properties,r=Qn(e,this.Rn.mask_personal_data_properties?[...ul,...i||[]]:[],dl);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}}Ja(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zb,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.zv=!1,this.Xs=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rc=()=>{clearTimeout(this.nc),this.nc=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.sc=t=>{var e;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Pe(null==t?void 0:t.name)||Pe(null==t?void 0:t.value))ww.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.oc(i);if(!Ie(r)){var s=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.ac||this.ac>t.value){this.Rt.navigationKey!==s&&(this.rc(),this.nc=setTimeout(this.rc,this.flushToCaptureTimeoutMs)),Ie(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=Ie(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,Te(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of Cw){var h="url"===u&&"string"==typeof t.attribution[u]?this.oc(t.attribution[u]):t.attribution[u];Ie(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Ie(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.rc()}else ww.error("Ignoring metric with value >= "+this.ac,t)}}},this.lc=()=>{if(!this.Xs){var t,e,i,r,s=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.uc])||("web-vitals"===this.uc&&Ie(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ie(l)){var u=l.withoutAttribution,h=this.attributionMetrics;s=!Ie(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.sc.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.sc.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.sc.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.sc.bind(this),v),this.Xs=!0}else ww.error("web vitals callbacks not loaded - not starting")}},this.zv=!(null==(e=this._instance.persistence)||!e.props[O]),this.startIfEnabled()}get hc(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Te(this.hc)?null==(t=this.hc)?void 0:t.web_vitals_allowed_metrics:void 0;return Pe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||Sw:i}get flushToCaptureTimeoutMs(){return(Te(this.hc)?this.hc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Te(this.hc)?this.hc.web_vitals_attribution:void 0;return $e(t)?t?Sw:[]:xe(t)?t:xw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Te(this.hc)?this.hc.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get ac(){var t=Te(this.hc)&&Fe(this.hc.__web_vitals_max_value)?this.hc.__web_vitals_max_value:kw;return t>0&&6e4>=t?kw:t}get isEnabled(){var t=null==d?void 0:d.protocol;if("http:"!==t&&"https:"!==t)return ww.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Te(this.hc)?this.hc.web_vitals:$e(this.hc)?this.hc:void 0;return $e(e)?e:this.zv}startIfEnabled(){this.isEnabled&&!this.Xs&&(ww.info("enabled, starting..."),this.bo(this.lc))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Te(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Te(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.zv=i,this.startIfEnabled()}}}get uc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}bo(t){var e=b.__PosthogExtensions__,i=this.uc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Ie(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?ww.error("failed to load script",e):t()})}oc(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?[...ul,...r||[]]:[],dl)}ww.error("Could not determine current URL")}}},ck={exceptionObserver:class{constructor(t){var e;this.lc=()=>{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.dc&&this.Rn.capture_unhandled_errors&&(this.dc=e(this.captureException.bind(this))),!this.vc&&this.Rn.capture_unhandled_rejections&&(this.vc=i(this.captureException.bind(this))),!this.cc&&this.Rn.capture_console_errors&&(this.cc=r(this.captureException.bind(this)))}catch(t){bw.error("failed to start",t),this.fc()}}},this._instance=t,this.gc=!(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:bw})),this.Rn=this.mc(),this.startIfEnabledOrStop()}mc(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Te(t)?e=n({},e,t):(Ie(t)?this.gc:t)&&(e=n({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rn.capture_console_errors||this.Rn.capture_unhandled_errors||this.Rn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(bw.info("enabled"),this.fc(),this.bo(this.lc)):this.fc()}bo(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 bw.error("failed to load script",e);t()})}fc(){var t,e,i;null==(t=this.dc)||t.call(this),this.dc=void 0,null==(e=this.vc)||e.call(this),this.vc=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.gc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[A]:this.gc}),this.Rn=this.mc(),this.startIfEnabledOrStop())}}onConfigChange(){this.Rn=this.mc()}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 bw.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.yc=[],this.bc=pm(),this._instance=t,this.yc=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this._c=Wr(this.wc()),this.kc=new Vr(this._c)}onConfigChange(){this._c=Wr(this.wc()),this.kc.setConfig(this._c)}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.yc=s,this._instance.persistence&&this._instance.persistence.register({[P]:this.yc,[F]:o})}}}get Sc(){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.bc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this._c.enabled)try{if(!Ee(t)||0===t.trim().length)return void hm.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.xc(e)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&hm.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.kc.add(n({[Br]:t,[Hr]:(new Date).toISOString()},r))}catch(t){hm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Cc(e)){if(this.Tc(e))return this.Mc("Exception dropped: matched a suppression rule"),void hm.info("Skipping exception capture because a suppression rule matched");if(!this.Sc&&this.Ic(e))return this.Mc("Exception dropped: thrown by a browser extension"),void hm.info("Skipping exception capture because it was thrown by an extension");if(!this.Sc&&this.Ec(e))return this.Mc("Exception dropped: thrown by an injected browser script"),void hm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rc(e))return this.Mc("Exception dropped: thrown by the PostHog SDK"),void hm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this._c.enabled&&Pe(t.$exception_steps)?this.Ac(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",Du:!0});return n&&this.kc.clear(),n}catch(t){return um(t)||hm.error("Failed to capture exception event. Dropping this exception.",t),void this.kc.clear()}}catch(t){return void(um(t)||hm.error("Failed to process exception event. Ignoring this exception.",t))}var s}Ac(t){try{var e=this.kc.getAttachable();return 0===e.length?t:n({},t,{$exception_steps:e})}catch(e){return hm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Mc(t){this._c.enabled&&this.kc.add({[Br]:t,[Hr]:(new Date).toISOString()})}xc(t){return Te(t)?n({},t):{}}wc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Tc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Ee(i)&&i.length>0&&t.$exception_types.push(i),Ee(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.yc.some(t=>{var i=t.values.map(t=>{var i=Ya[t.operator],r=e[t.key];if(!i||!r)return!1;var n=xe(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 hm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Ic(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&&cm.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(dm)})||t.some(t=>{var e=t.value;return"NoResponse"===t.type||Ee(e)&&vm.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(dm))}))}Ec(t){return t.some(t=>{var e=t.value;return Ee(e)&&fm.some(t=>e.includes(t))})}Rc(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}Cc(t){return!Pe(t)&&xe(t)}}},fk=n({productTours:class{get sl(){return this._instance.persistence}constructor(t){this.Pc=null,this.Fc=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.sl&&this.sl.register({[L]:!!e.productTours}),!Rw(this._instance))return!this.Pc&&Pe(null==(i=this.sl)?void 0:i.props.ph_product_tours)||Ew.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Pc)||r.stop(),this.Pc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Pc&&Rw(this._instance)&&this.bo(()=>this.Oc())}bo(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?Ew.error("Could not load product tours script",e):t()})}Oc(){var t;!this.Pc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.Pc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!xe(this.Fc)||e){var i=this.sl;if(i){var r=i.props[_t];if(xe(r)&&!e)return this.Fc=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(Rw(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||Ew.warn(n):Ew.error(n),void t([],{isLoaded:!1,error:n})}var s=xe(e.json.product_tours)?e.json.product_tours:[];this.Fc=s,i&&i.register({[_t]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Fc,{isLoaded:!0})}getActiveProductTours(t){Pe(this.Pc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Pc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Pc)||e.showTourById(t)}previewTour(t){this.Pc?this.Pc.previewTour(t):this.bo(()=>{var e;this.Oc(),null==(e=this.Pc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.Pc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Pc)||t.nextStep()}previousStep(){var t;null==(t=this.Pc)||t.previousStep()}clearCache(){var t;this.Fc=null,null==(t=this.sl)||t.unregister(_t)}resetTour(t){var e;null==(e=this.Pc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Pc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Pc)||e.cancelPendingTour(t)}}},hk),pk={siteApps:class{constructor(t){this._instance=t,this.$c=0,this.Dc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Lc(t,e){if(e){var i=this.globalsForEvent(e);this.Dc.push(i),this.Dc.length>1e3&&(this.Dc=this.Dc.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.Lc.bind(this));this.Nc=()=>{t(),this.Dc=[],this.Nc=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)||(Aw.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)||(Aw.error("prepare_external_dependency_script returned null"),null):t}jc(){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.$c++,this.Bc)return this.Hc();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=>!Ae(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.Bc=()=>{d.forEach(t=>t()),this.Bc=void 0},this.Hc()}Hc(){var t=!1;return()=>{var e;t||(t=!0,this.$c--,0===this.$c&&(null==(e=this.Bc)||e.call(this)))}}zc(t,e){void 0===e&&(e=!0);var i=this.jc();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.Dc.length&&(Aw.info("Processing "+this.Dc.length+" events for site app with id "+t.id),this.Dc.forEach(t=>this.zc(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Nc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Aw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.zc(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Aw.error(Pw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Aw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Uc(){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)}Wc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.zc(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){Aw.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.Uc(),void this._instance.on("eventCaptured",t=>this.Wc(t))):void Aw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Nc)||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 Aw.error(Pw+e,t)})};for(var a of s.siteApps)o()}else Aw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},gk={tracingHeaders:class{constructor(t){this._instance=t,this.Vc=void 0,this.Gc=void 0,this.Zc=void 0,this.lc=()=>{var t,e,i=this.Jc();i?(Ie(this.Vc)&&(this.Vc=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Ie(this.Gc)&&(this.Gc=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.fc()}}initialize(){this.startIfEnabledOrStop()}bo(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 _w.error("failed to load script",e);t()})}Qc(){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}Jc(){var t=this.Qc();return xe(t)?(xe(this.Zc)?this.Zc.splice(0,this.Zc.length,...t):this.Zc=[...t],t.length>0?this.Zc:void 0):(xe(this.Zc)&&this.Zc.splice(0),this.Zc=t||void 0,this.Zc)}fc(){var t,e;null==(t=this.Vc)||t.call(this),null==(e=this.Gc)||e.call(this),this.Vc=void 0,this.Gc=void 0}startIfEnabledOrStop(){this.Jc()?this.bo(this.lc):this.fc()}}},mk=n({surveys:class extends Dw{constructor(t){var e;super(new Hw(t),(e=t,{get projectToken(){return e.config.token},kv:new Bw(e)})),this._instance=t}ah(t,e){var i=e.query?b_(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})})}}},hk),yk={toolbar:class{constructor(t){this.instance=t}Kc(t){b.ph_toolbar_state=t}Xc(){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=zw||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(Uw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Yc(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Pe(e)&&Ce(e)?e(t,this.instance):Ww.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(Uw,JSON.stringify(n({},r,{source:void 0}))),2===this.Xc())this.Yc(r);else if(0===this.Xc()){var s;this.Kc(1),null==(s=b.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Ww.error("[Toolbar] Failed to load",t),void this.Kc(0);this.Kc(2),this.Yc(r)}),zn(a,"turbolinks:load",()=>{this.Kc(0),this.loadToolbar(r)})}return!0}tf(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)}}},bk=n({experiments:class t{get Rn(){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.ef("retrieved web experiments from the server"),i.if=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.if&&(t.ef("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.if)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Ee(n)&&e.variants[n]&&i.rf(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.nf(o,i._instance)&&i.rf(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.ef(tk);else if(!this.Rn.disable_web_experiments){if(Pe(this.if))return this.if=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.ef("applying feature flags",e),e.forEach(t=>{var e;if(this.if&&null!=(e=this.if)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.if)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.rf(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.ef("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.sf(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this.Rn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Rn.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.Rn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}sf(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.ef("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.rf(n[0].name,i,n[0].variants[i].transforms))}static nf(e,i){return!Pe(e.conditions)&&t.af(e,i)&&t.lf(e)}static af(e,i){var r;if(Pe(e.conditions)||Pe(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||ek[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 lf(t){var e;if(Pe(t.conditions)||Pe(null==(e=t.conditions)?void 0:e.utm))return!0;var i=cl();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 ef(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)}rf(e,i,r){this._is_bot()?t.ef(tk):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.ef("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.ef("Control variants leave the page unmodified.")}_is_bot(){return u&&this._instance?j_(u,this.Rn.custom_blocked_useragents):void 0}}},hk),_k=n({},hk,dk,vk,ck,fk,pk,mk,gk,yk,bk,{conversations:class{constructor(t){this._instance=t,this.uf=void 0,this._conversationsManager=null,this.hf=!1,this.re=null,this.df=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.vf=t.ok,t.ok)){var e=t.config.conversations;Pe(e)||($e(e)?this.uf=e:(this.uf=e.enabled,this.re=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.uf=void 0,this.re=null,this.vf=void 0,this.df=!1}loadIfEnabled(){if(!(this._conversationsManager||this.hf||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&&!Ie(this.uf)&&this.uf)if(this.re&&this.re.token){this.hf=!0;try{var e=t.initConversations;if(e)return this.cf(e),void(this.hf=!1);var i=t.loadExternalDependency;if(!i)return void this.ff(Yt);i(this._instance,"conversations",e=>{e||!t.initConversations?this.ff("Could not load conversations script",e):this.cf(t.initConversations),this.hf=!1})}catch(t){this.ff("Error initializing conversations",t),this.hf=!1}}else ik.error("Conversations enabled but missing token in remote config.")}}cf(t){if(this.re)try{this._conversationsManager=t(this.re,this._instance),this.df=!1,ik.info("Conversations loaded successfully")}catch(t){this.ff("Error completing conversations initialization",t)}else ik.error("Cannot complete initialization: remote config is null")}ff(t,e){ik.error(t,e),this._conversationsManager=null,this.hf=!1,this.df=!0}show(){this._conversationsManager?this._conversationsManager.show():ik.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.uf&&!Ae(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.vf?"remote_config_failed":Ie(this.uf)?this.vf?"disabled_in_project":"remote_config_pending":this.uf?Pe(this.re)||!this.re.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.hf?"initializing":this.df?"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):(ik.warn(rk),null)})()}getMessages(t,e){var i=this;return o(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(ik.warn(rk),null)})()}markAsRead(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ik.warn(rk),null)})()}getTickets(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ik.warn(rk),null)})()}requestRestoreLink(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ik.warn(rk),null)})()}restoreFromToken(t){var e=this;return o(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ik.warn(rk),null)})()}restoreFromUrlToken(){var t=this;return o(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ik.warn(rk),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}Wu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Vu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=Ep,this.pf=!1,this.gf=!1,this.mf=!1,this.A=Pn("[logs]"),this.yf=n({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(uk)||i.A.error(...e)}}),this.La=[],this.bf=[],this.Od=0,this.ro=!1,this._f=[],this.wf=[],this.kf=!1,this.Sf=!1,this.xf=()=>{var t,e;this.ro||(this.Od=0,null==(t=this.Cf)||t.onReconnect(),null==(e=this.Tf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.pf=!0),a&&zn(a,"online",this.xf)}Mf(t,e,i,r){var n,s=nk(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new kn(this.If(t,e),s,this.yf,()=>this.Ef(),t=>t(),void 0,r),s]}Rf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Cf||this.Af!==e){var i;null==(i=this.Cf)||i.reset(),this.Af=e;var r=this.Mf(()=>this.La,t=>{this.La=t});this.Cf=r[0],this.Pf=r[1]}return this.Cf}Ff(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Tf||this.Of!==e){var i;null==(i=this.Tf)||i.reset(),this.Of=e;var r=this.Mf(()=>this.bf,t=>{this.bf=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ok);this.Tf=r[0],this.$f=r[1]}return this.Tf}setup(t){var e;if(!this.ro){this.Js=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.pf=!0),(this.pf||this.Df()&&this.Lf())&&this.Nf();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.ro?r.dispose():(this.oo=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.ro||(this.ro=!0,this.qf(),null==(t=this.oo)||t.dispose(),this.oo=void 0,this.Js=void 0,this.mf=!1,null==a||a.removeEventListener("online",this.xf),null==(e=this.jf)||e.call(this),this.jf=void 0,null==(i=this.Cf)||i.reset(),null==(r=this.Tf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.ro){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Pe(r)?this.Bf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[N]:!!r}),r?(this.pf=!0,this.gf||this.Nf(),this.loadIfEnabled()):this.Bf())}}reset(){var t,e,i,r;this.qf(),null==(t=this.Cf)||t.clearQueue(),this.La=[],null==(e=this.Cf)||e.reset(),null==(i=this.Tf)||i.clearQueue(),this.bf=[],null==(r=this.Tf)||r.reset(),this.Od=0}captureLog(t){this.ro||this.Rf().captureLog(t)}captureConsoleLog(t){this.ro||this.Ff().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.ro||this.Ff().captureLog(t,{context:e,occurredAtMs:i})}Lf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[N])}Df(){var t,e;return null==(t=this._instance)||null==t.Fa||!t.Fa()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Zu(){var t;this.qf(),null==(t=this.Tf)||t.clearQueue(),this.bf=[]}Bf(){this.pf||this.qf()}Nf(){var t,e=this;if(!this.kf&&null!=b&&b.console){var i=nk(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Kg(b.console[t])}catch(t){return 0}if(!r)return 0;e.wf.push(tc(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.Hf(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of sk)r(n);this.kf=!0,this.zf=setTimeout(()=>{this.qf()},3e4)}}Hf(t,e,i){var r;if(this.kf&&!this.Sf&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this._f.length){this.Sf=!0;try{this._f.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Ef()})}finally{this.Sf=!1}}}else this.qf()}qf(){if(this._f=[],this.kf){for(var t of(this.kf=!1,this.zf&&(clearTimeout(this.zf),this.zf=void 0),this.wf))t();this.wf=[]}}Uf(){var t=this._f;return this.qf(),t}get logger(){return this.Wf||(this.Wf={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.Wf}flushLogs(t){t?this.Vf(t):(this.Cf&&this.Cf.flush().catch(t=>this.Gf(t)),this.Tf&&this.Tf.flush().catch(t=>this.Gf(t)))}Gf(t){uk(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.ro&&this.pf&&!this.gf&&!this.mf){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.mf=!0;try{e(this._instance,"logs",e=>{if(this.mf=!1,!this.ro&&this.pf){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.Uf();this.jf=i.initializeLogs(null!==(r=this.Js)&&void 0!==r?r:this._instance),this.gf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Js)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.mf=!1,t}}}If(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===pe.LogsQueue?t():void 0,setPersistedProperty(t,i){t===pe.LogsQueue&&e(null!=i?i:[])},xs:t=>this.xs(t),getLibraryId:()=>La.LIB_NAME,getLibraryVersion:()=>La.LIB_VERSION}}xs(t){return new Promise(e=>{if(Xn(this.Od,3))e({kind:"fatal",error:lk(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:lk(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jf(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:lk(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)})}}})}})}Jf(t){(0!==t||this._instance.__loaded)&&(this.Od=Yn(t,this.Od,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.")))}Vf(t){this.La.length>0&&this.Qf(t,this.La,this.Pf,La.LIB_NAME,t=>{this.La=t}),this.bf.length>0&&this.Qf(t,this.bf,this.$f,ok,t=>{this.bf=t})}Qf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=wn(s,_n(i,La.LIB_NAME,La.LIB_VERSION),r,La.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ef(){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,Pe(n)||(e.sessionStartTimestamp=n),Pe(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(){}Rf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Cf&&this.Af===i||(null==(e=this.Cf)||e.reset(),this.Af=i,this.Cf=new Tn(this.If(),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.Cf}count(t,e,i){void 0===e&&(e=1),this.Rf().count(t,e,i)}gauge(t,e,i){this.Rf().gauge(t,e,i)}histogram(t,e,i){this.Rf().histogram(t,e,i)}flush(t){if(!this.Cf)return Promise.resolve();if(t){var e=this.Cf.drainWindow();return e&&this.js(e,t),Promise.resolve()}return this.Cf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.Cf)||t.reset()}If(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},js:t=>e.js(t),getLibraryId:()=>La.LIB_NAME,getLibraryVersion:()=>La.LIB_VERSION}}js(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.Kf(),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)})}}))})}Kf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});mw.__defaultExtensionClasses=n({},_k),function(){La.SDK_DIST_CHANNEL="cdn";var t=b.posthog;if(!t||xe(t._i)){var e=tw[hw]=new mw;if(t){var i=[];On(t._i,function(r){if(r&&xe(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,dw=!1,On(tw,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
|