posthog-js 1.423.2 → 1.424.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.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/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/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.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- 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.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.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/lib/src/logs-defaults.js +52 -1
- package/lib/src/logs-defaults.js.map +1 -1
- package/package.json +5 -5
package/dist/array.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,n=null==e?void 0:e.location,s=null==e?void 0:e.fetch,a=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,o=null==e?void 0:e.AbortController,l=null==e?void 0:e.CompressionStream,u=null==i?void 0:i.userAgent;function h(){return!(!t||!1===t.navigator.onLine)}var d="undefined"!=typeof globalThis?globalThis:t;d&&"undefined"==typeof self&&(d.self=d),d&&"undefined"==typeof File&&(d.File=function(){});var v=null!=t?t:{};function c(t,e,i,r,n,s,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function f(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var s=t.apply(e,i);function a(t){c(s,r,n,a,o,"next",t)}function o(t){c(s,r,n,a,o,"throw",t)}a(void 0)}))}}function p(){return p=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},p.apply(null,arguments)}function g(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}var m={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},y={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},b=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function _(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k=["$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"],S=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}({}),x=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),C="min_length",T="max_length",M=["$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"],I=20,R=1e3,P=1e4,A="[Circular]",F="[Truncated]",O="[Unserializable]",L="[Function]";function D(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}var N=["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"],q=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return N.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function j(t,e){return-1!==t.indexOf(e)}var B=function(t){return t.trim()},H=function(t){return t.replace(/^\$/,"")};function z(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 U=Object.prototype,W=U.hasOwnProperty,V=U.toString,G=Array.isArray||function(t){return"[object Array]"===V.call(t)},Z=t=>"function"==typeof t,Q=t=>t===Object(t)&&!G(t),J=t=>{if(Q(t)){for(var e in t)if(W.call(t,e))return!1;return!0}return!1},K=t=>void 0===t,Y=t=>"[object String]"==V.call(t),X=t=>Y(t)&&0===t.trim().length,tt=t=>null===t,et=t=>K(t)||tt(t),it=t=>"[object Number]"==V.call(t)&&t==t,rt=t=>it(t)&&t>0,nt=t=>"[object Boolean]"===V.call(t),st=t=>t instanceof FormData,at=t=>j(M,t),ot=t=>j(E,t);function lt(t){return null===t||"object"!=typeof t}function ut(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ht(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 vt(t,Error)}}function dt(t){return"undefined"!=typeof Event&&vt(t,Event)}function vt(t,e){try{return t instanceof e}catch(t){return!1}}var ct=[!0,"true",1,"1","yes"],ft=t=>j(ct,t),pt=[!1,"false",0,"0","no"];function gt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),it(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),gt(n||i,e,i,r))}class mt{constructor(t){this.C={},this.I=t.I,this.R=gt(t.bucketSize,0,100,t.A),this.O=gt(t.refillRate,0,this.R,t.A),this.N=gt(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={}}}var yt="Mobile",bt="iOS",_t="Android",wt="Tablet",kt=_t+" "+wt,St="iPad",xt="Apple",Ct=xt+" Watch",Tt="Safari",Mt="BlackBerry",Et="Samsung",It=Et+"Browser",Rt=Et+" Internet",Pt="Chrome",At=Pt+" OS",Ft=Pt+" "+bt,Ot="Internet Explorer",Lt=Ot+" "+yt,Dt="Opera",$t=Dt+" Mini",Nt="Edge",qt="Microsoft "+Nt,jt="Firefox",Bt=jt+" "+bt,Ht="Nintendo",zt="PlayStation",Ut="Xbox",Wt=_t+" "+yt,Vt=yt+" "+Tt,Gt="Windows",Zt=Gt+" Phone",Qt="Nokia",Jt="Ouya",Kt="Generic",Yt=Kt+" "+yt.toLowerCase(),Xt=Kt+" "+wt.toLowerCase(),te="Konqueror",ee="Oculus Browser",ie="Vivaldi",re="Yandex",ne="Whale",se="DuckDuckGo",ae="Pale Moon",oe="Waterfox",le="Brave",ue="Claude",he="Codex",de="ChatGPT",ve="Google Search App",ce="(\\d+(\\.\\d+)?)",fe=new RegExp("Version/"+ce),pe=new RegExp("("+ue+"|"+he+"|"+de+")\\/"+ce),ge=new RegExp(Ut,"i"),me=new RegExp(zt+" \\w+","i"),ye=new RegExp(Ht+" \\w+","i"),be=new RegExp(Mt+"|PlayBook|BB10","i"),_e={"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"},we=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?le:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&j(t,"GSA/")?ve:j(t," OPR/")&&j(t,"Mini")?$t:j(t," OPR/")?Dt:be.test(t)?Mt:j(t,"IE"+yt)||j(t,"WPDesktop")?Lt:j(t,"OculusBrowser")?ee:j(t,It)?Rt:j(t,Nt)||j(t,"Edg/")?qt:j(t,ie+"/")?ie:j(t,"YaBrowser/")?re:j(t,ne+"/")?ne:j(t,se+"/")||j(t,"Ddg/")?se:j(t,ue+"/")?ue:j(t,he+"/")?he:j(t,de+"/")?de:j(t,"FBIOS")?"Facebook "+yt:j(t,"UCWEB")||j(t,"UCBrowser")?"UC Browser":j(t,"CriOS")?Ft:j(t,"CrMo")||j(t,Pt)?Pt:j(t,_t)&&j(t,Tt)?Wt:j(t,"FxiOS")?Bt:j(t.toLowerCase(),te.toLowerCase())?te:j(t,le+"/")?le:((t,e)=>e&&j(e,xt)||function(t){return j(t,Tt)&&!j(t,Pt)&&!j(t,_t)}(t))(t,e)?j(t,yt)?Vt:Tt:j(t,"PaleMoon/")?ae:j(t,oe+"/")?oe:j(t,jt)?jt:j(t,"MSIE")||j(t,"Trident/")?Ot:j(t,"Gecko")?jt:"")},ke={[Lt]:[new RegExp("rv:"+ce)],[qt]:[new RegExp(Nt+"?\\/"+ce)],[Pt]:[new RegExp("("+Pt+"|CrMo)\\/"+ce)],[Ft]:[new RegExp("CriOS\\/"+ce)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ce)],[Tt]:[fe],[Vt]:[fe],[Dt]:[new RegExp("(Opera|OPR)\\/"+ce)],[jt]:[new RegExp(jt+"\\/"+ce)],[Bt]:[new RegExp("FxiOS\\/"+ce)],[te]:[new RegExp("Konqueror[:/]?"+ce,"i")],[Mt]:[new RegExp(Mt+" "+ce),fe],[Wt]:[new RegExp("android\\s"+ce,"i")],[Rt]:[new RegExp(It+"\\/"+ce)],[ee]:[new RegExp("OculusBrowser\\/"+ce)],[ie]:[new RegExp(ie+"\\/"+ce)],[re]:[new RegExp("YaBrowser\\/"+ce)],[ne]:[new RegExp(ne+"\\/"+ce)],[le]:[new RegExp(le+"\\/"+ce)],[ue]:[pe],[he]:[pe],[de]:[pe],[se]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ce)],[ae]:[new RegExp("PaleMoon\\/"+ce)],[oe]:[new RegExp(oe+"\\/"+ce)],[ve]:[new RegExp("GSA\\/"+ce)],[Ot]:[new RegExp("(rv:|MSIE )"+ce)],Mozilla:[new RegExp("rv:"+ce)]},Se=function(t,e,i,r){var n=we(t,e,i,r),s=ke[n];if(K(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},xe=[[new RegExp(Ut+"; "+Ut+" (.*?)[);]","i"),t=>[Ut,t&&t[1]||""]],[new RegExp(Ht,"i"),[Ht,""]],[new RegExp(zt,"i"),[zt,""]],[be,[Mt,""]],[new RegExp(Gt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zt,""];if(new RegExp(yt).test(e)&&!/IEMobile\b/.test(e))return[Gt+" "+yt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=_e[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Gt,r]}return[Gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[bt,[t[3],t[4],t[5]||"0"].join(".")]:[bt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=K(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_t+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_t+")","i"),t=>t&&t[2]?[_t,[t[2],t[3],t[4]||"0"].join(".")]:[_t,""]],[/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/,[At,""]],[/Linux|debian/i,["Linux",""]]],Ce=function(t){return ye.test(t)?Ht:me.test(t)?zt:ge.test(t)?Ut:new RegExp(Jt,"i").test(t)?Jt:new RegExp("("+Zt+"|WPDesktop)","i").test(t)?Zt:/iPad/.test(t)?St:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ct:be.test(t)?Mt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Qt,"i").test(t)?Qt:/(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(yt).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)?_t:kt:new RegExp("(pda|"+yt+")","i").test(t)?Yt:new RegExp(wt,"i").test(t)&&!new RegExp(wt+" pc","i").test(t)?Xt:""},Te=function(t,e){var i,r,n,s,a=Ce(t);return a===St||a===kt||"Kobo"===a||"Kindle Fire"===a||a===Xt?wt:a===Ht||a===Ut||a===zt||a===Jt?"Console":a===Ct?"Wearable":a?yt:"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)?yt:wt:"Desktop"},Me=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ee(t,e){return"string"==typeof(i=t)&&Me.test(i)?t:e();var i}function Ie(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 Re(t){return t?t.split("#")[0]:t}function Pe(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Ae(t,e,i){return Fe.apply(this,arguments)}function Fe(){return(Fe=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Pe((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Oe,Le="NativeGzipValidationError",De=t=>t.length>=2&&31===t[0]&&139===t[1],$e=(t,e)=>t===x.GZipJS||e===x.GZipJS||"gzip"===e,Ne=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),qe=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Ne(t)||e===Le},je=t=>{throw Ie(Le,"Native gzip produced invalid output: "+t)},Be=function(){var t=f((function*(t,e){18>t.size&&je("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());De(i)&&8===i[2]||je("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Oe)return Oe;Oe=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Oe[t]=e>>>0}return Oe})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&je("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&je("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function He(t,e,i){return ze.apply(this,arguments)}function ze(){return ze=f((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=f((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),o=new Response(n.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield Be(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),ze.apply(this,arguments)}var Ue=0x8000000000000000,We="9223372036854775808",Ve={}.propertyIsEnumerable;function Ge(t,e){try{return Je(t,e,{ancestors:new WeakSet,remainingNodes:P},0)}catch(t){return[]}}function Ze(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:F};if(i.remainingNodes--,nt(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt(We);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("undefined"==typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=Ue||-Ue>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:D(t)};if("function"==typeof t)return{stringValue:L};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:A};if(r>=I)return{stringValue:F};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?D(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return Ze(o.call(t),e,i,r+1)}catch(t){}return G(t)?{arrayValue:{values:Qe(t,e,i,r+1)}}:{kvlistValue:{values:Je(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:D(String(t))}}function Qe(t,e,i,r){for(var n=[],s=Math.min(t.length,R),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(et(o))continue;n.push(Ze(o,e,i,r))}catch(t){n.push({stringValue:O})}return t.length>a&&n.push({stringValue:F}),n}function Je(t,e,i,r){var n=[];for(var s in t)if(Ve.call(t,s)){if(n.length>=R||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(tt(a)||K(a))continue;n.push({key:D(s),value:Ze(a,e,i,r)})}catch(t){n.push({key:D(s),value:{stringValue:O}})}}return n}var Ke={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}},Ye=Ke.info;function Xe(t){try{return D(String(t))}catch(t){return O}}function ti(t,e,i,r){var n,s=Ke[t.level||"info"]||Ye,a=s.text,o=s.number,l=(void 0===(n=it(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);var h=p({},u),d=t.attributes;if(d){var v=[];try{v=Object.keys(d)}catch(t){v=[]}for(var c of v){var f=void 0;try{f=d[c]}catch(t){f=O}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:Xe(t.body)},attributes:Ge(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),K(t.trace_flags)||(g.flags=t.trace_flags),g}function ei(t,e,i){return p({},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})}function ii(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ge(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let ri=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.gn=e,this.A=i,this.Pn=r,this.Fn=n,this.Dn=s,this.$n=a,this.Nn=null,this.qn=0,this.jn=0,this.Bn=0,this.Hn=0,this.zn=0,this.Un=!1,this.Wn=e.maxBufferSize,this.Vn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.Gn=e.flushIntervalMs,this.Zn=e.maxBatchRecordsPerPost,this.Qn=e.rateCapWindowMs,this.Jn=e.maxLogsPerInterval}clearQueue(){this.jn++,this._instance.setPersistedProperty(S.LogsQueue,[])}reset(){this.Kn(),this.Hn=0,this.zn=0,this.Un=!1,this.Bn=0,this.Zn=this.gn.maxBatchRecordsPerPost}onReconnect(){this.Bn=0,this.Yn()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Xn(t);if(null!==r)if(r.body){if(this.ts()){var n={record:ti(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Pn(),this.A,null==e?void 0:e.occurredAtMs)};this.Fn((()=>this.es(n)))}}else this.A.info("Log was rejected in beforeSend function")}}Xn(t){var e=this.gn.beforeSend;if(!e)return t;var i=G(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}ts(){if(void 0===this.Jn)return!0;var t=Date.now(),e=t-this.Hn;return this.Qn>e&&e>=0||(this.Hn=t,this.zn=0,this.Un=!1),this.Jn>this.zn?(this.zn++,!0):(this.Un||(this.A.warn("captureLog dropping logs: exceeded "+this.Jn+" logs per "+this.Qn+"ms"),this.Un=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.Nn||(t.Nn=t.rs().finally((()=>{t.Nn=null}))),t.Nn}))()}rs(){var t=this;return f((function*(){var e;t.Kn();var i=null!==(e=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a,o=t.jn;t.qn=0;var l=Math.min(i.length,t.Zn),u=i.slice(0,l),h=u.map((t=>t.record)),d=ii(h,t.ns(),null!==(s=t.$n)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.ss(d);if(t.jn!==o)return;if("too-large"===v.kind&&u.length>1)t.Zn=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.Zn);else{if("retry-later"===v.kind)throw v.error;if("too-large"===v.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"===v.kind&&t.gn.maxBatchRecordsPerPost>t.Zn&&(t.Zn=Math.min(t.gn.maxBatchRecordsPerPost,t.Zn+1)),yield t.os(u.length),i=null!==(a=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}os(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.qn),n=null!==(i=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(S.LogsQueue,n.slice(r)),yield e.Dn()}))()}ns(){return ei(this.gn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}es(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];this.Vn>i.length||(i.shift(),this.qn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(S.LogsQueue,i),this.Wn>i.length?this.ls():this.Yn()}}ls(t){void 0===t&&(t=this.Gn),this.us||(this.us=Pe((()=>{this.us=void 0,this.Yn()}),t))}hs(){var t=Math.min(Math.max(0,this.Bn-1),6);return this.Gn*Math.pow(2,t)}ds(){var t=this._instance.getPersistedProperty(S.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.Kn();var i=e.flush().catch((()=>{}));void 0!==t?yield Ae(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield Ae(i,t,(()=>{i.catch((()=>{}))}))}))()}Yn(){this.flush().then((()=>{this.Bn=0}),(t=>{this.Bn++,this.A.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.ds()&&this.ls(this.hs())}))}Kn(){this.us&&(clearTimeout(this.us),this.us=void 0)}};var ni=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function si(t){return String(t)+"000000"}function ai(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}let oi=class{constructor(t,e,i){this._instance=t,this.gn=e,this.A=i,this.vs=new Map,this.Nn=null,this.cs=!1,this.fs=new Map,this.ps=new Set,this.gs=0}count(t,e,i){void 0===e&&(e=1),this.ys({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.ys({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.ys({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.Nn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.bs()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.Nn===r&&(this.Nn=null)}));return this.Nn=r,r}drainWindow(){if(0===this.vs.size)return null;var t=this.vs;return this.vs=new Map,this.cs=!1,this.fs=new Map,this.ps=new Set,this._s(t)}reset(){this.gs++,this.Kn(),this.vs=new Map,this.Nn=null,this.cs=!1,this.fs=new Map,this.ps=new Set}ys(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Xn(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?p({},e.attributes):void 0,r=ai(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 n=this.vs.get(r);if(!n){if(!this.ws())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.vs.set(r,n)}var s=this.fs.get(e.name);void 0===s?this.fs.set(e.name,e.type):s===e.type||this.ps.has(e.name)||(this.ps.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.ks(n,e.value),this.ls()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}ws(){return this.gn.maxSeriesPerFlush>this.vs.size||(this.cs||(this.cs=!0,this.A.warn("Metric series cap reached ("+this.gn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}ks(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(ni.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,ni)]+=1}}Xn(t){var e=this.gn.beforeSend;if(!e)return t;var i=G(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}ls(){this.us||(this.us=Pe((()=>{this.us=void 0,this.flush().catch((t=>{this.A.error("Metrics flush failed:",t)}))}),this.gn.flushIntervalMs))}Kn(){this.us&&(clearTimeout(this.us),this.us=void 0)}bs(){var t=this;return f((function*(){if(0!==t.vs.size){var e=t.vs;t.vs=new Map,t.cs=!1,t.fs=new Map,t.ps=new Set;var i=t.gs,r=yield t._instance.Ss(t._s(e));if(i===t.gs)switch(r.kind){case"ok":return;case"retry-later":return t.xs(e),void t.ls();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)}}}))()}_s(t){return e=this.Cs(t),i=function(t,e,i){return p({},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})}(this.gn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ge(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Cs(t){var e=si(Date.now()),i=new Map;for(var r of t.values()){var n,s=ai(r.type,r.name,r.unit,void 0),a=i.get(s);a||(a=p({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(s,a));var o=Ge(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),l=si(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:o,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:ni})}return Array.from(i.values())}xs(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.vs.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.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(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.ws()&&this.vs.set(n,s)}}};function li(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ui,hi,di;function vi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return di&&i.length===hi||(hi=i.length,di=i.reduce(((i,r)=>{ui||(ui={});var n=ui[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,ui[r]=[l,u];break}}return i}),{})),di}}class ci{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 f((function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&G(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)),p({},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 f((function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i}))()}convertToExceptionList(t,e){var i,r,n,s={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!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:vi(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 p({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}}var fi="?";function pi(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?fi:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return K(r)||(s.lineno=r),K(n)||(s.colno=n),s}var gi=(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]:fi,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},mi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bi=/\((\S*)(?::(\d+))(?::(\d+))\)/,_i=(t,e)=>{var i=mi.exec(t);if(i)return pi(e,i[1],fi,+i[2],+i[3]);var r=yi.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=bi.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=gi(r[1]||fi,r[2]);return pi(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},wi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ki=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Si=(t,e)=>{var i=wi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=ki.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]||fi,a=gi(s,n);return pi(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},xi=/\(error: (.*)\)/,Ci=50;class Ti{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Y(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 ut(t,"DOMException")}isDOMError(t){return ut(t,"DOMError")}}class Mi{match(t){return ht(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}}class Ei{constructor(){}match(t){return!!ut(t,"ErrorEvent")&&(null!=t.error||this.Wi(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return p({},r,{stack:null!==(i=this.Vi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Wi(t){return Y(t.message)&&t.message.length>0}Vi(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(Y(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Ii=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ri{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(Ii);return r&&(e=r[1],i=r[2]),[e,i]}}var Pi=["fatal","error","warning","log","info","debug"];function Ai(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""}class Fi{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(dt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Y(e)&&!X(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: "+Ai(t)}isSeverityLevel(t){return Y(t)&&!X(t)&&Pi.indexOf(t)>=0}getStack(t){try{return Y(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Y(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(ht(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Oi{match(t){return dt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Ai(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Li{match(t){return lt(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}}}class Di{match(t){return ut(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!dt(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 lt(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}}var $i="$message",Ni="$timestamp",qi=new Set([$i,Ni]),ji={enabled:!0,max_bytes:32768};function Bi(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:ji.enabled,max_bytes:zi(t.max_bytes,ji.max_bytes)}:p({},ji)}class Hi{constructor(t){this.Ts=[],this.Ms=0,this.gn=Bi(t)}setConfig(t){this.gn=Bi(t),this.Es()}add(t){var e=function(t){var e;try{e=z(t)}catch(t){return}try{var i=JSON.parse(e);if(!Q(i))return;var r=i,n=r[$i],s=r[Ni];if(!Y(n)||0===n.trim().length)return;if(!Y(s)&&!it(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=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.gn.max_bytes||(this.Ts.push({step:e.step,bytes:i}),this.Ms+=i,this.Es())}}getAttachable(){return this.Ts.map((t=>t.step))}clear(){this.Ts=[],this.Ms=0}size(){return this.Ts.length}Es(){for(;this.Ms>this.gn.max_bytes&&this.Ts.length>0;){var t=this.Ts.shift();t&&(this.Ms-=t.bytes)}}}function zi(t,e){if(!it(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var Ui={DEBUG:!1,LIB_VERSION:"0.7.1",LIB_NAME:"browser-common"},Wi=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={q(i){if(t&&(Ui.DEBUG||t.POSTHOG_DEBUG||r)&&!K(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>Wi(e+" "+t,i)};return n},Vi=Wi("[PostHog.js]"),Gi=Vi.createLogger;function Zi(t,e){G(t)&&t.forEach(e)}function Qi(t,e){if(!et(t))if(G(t))t.forEach(e);else if(st(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)W.call(t,i)&&e(t[i],i)}var Ji=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 Ki(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 Yi=function(t){try{return t()}catch(t){return}},Xi=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){Vi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Vi.critical(t)}}},tr=function(t){var e={};return Qi(t,(function(t,i){(Y(t)&&t.length>0||it(t))&&(e[i]=t)})),e};var er=["herokuapp.com","vercel.app","netlify.app"];function ir(t){var e=null==t?void 0:t.hostname;if(!Y(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of er)if(i===r)return!1;return!0}function rr(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function nr(t){return"ph_toolbar_internal"===t.name}var sr=["localhost","127.0.0.1"],ar=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return z(t)}},or=t=>{var e=null==r?void 0:r.createElement("a");return K(e)?null:(e.href=t,e)},lr=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Qi(t,(function(t,e){K(t)||K(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)},ur=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(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Vi.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},hr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");G(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},dr=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},vr=(t,e)=>t>=e&&h(),cr=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function fr(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Z(r))return e;try{var n=r(e);return Y(n)&&n?n:e}catch(t){return Vi.error("Error in get_current_url, falling back to window.location.href",t),e}}function pr(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return K(r)?void 0:fr(e,r)}var gr="__POSTHOG_TOOLBAR__",mr=1,yr=3,br=11;function _r(t){return t instanceof Element&&(t.id===gr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function wr(t){return!!t&&t.nodeType===mr}function kr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Sr(t){return!!t&&t.nodeType===yr}function xr(t){return!!t&&t.nodeType===br&&wr(t.host)}var Cr=1e3;function Tr(t){return t?B(t).split(/\s+/):[]}function Mr(t,e){var i=pr(e);return!!(i&&t&&t.some((t=>i.match(t))))}function Er(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 Tr(e)}function Ir(t){return et(t)?null:B(t).split(/(\s+)/).filter((t=>tn(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Rr(t){var e="";return Wr(t)&&!Vr(t)&&t.childNodes&&t.childNodes.length&&Qi(t.childNodes,(function(t){var i;Sr(t)&&t.textContent&&(e+=null!==(i=Ir(t.textContent))&&void 0!==i?i:"")})),B(e)}function Pr(t){var e;return K(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Ar=["a","button","form","input","select","textarea","label"];function Fr(t,e){if(K(e))return!0;var i,r=function(t){if(e.some((e=>function(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}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Or(t){var e=t.parentNode;return!(!e||!wr(e))&&e}var Lr=[".ph-no-autocapture","[data-ph-no-autocapture]"],Dr=["next","previous","prev",">","<"],$r=[...Dr,"+","-","−","–"],Nr=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,qr=[".ph-no-deadclick",".ph-no-capture"],jr=[".ph-no-rageclick",".ph-no-capture"],Br=["","text","search","email","password","url","tel","number"];function Hr(e,i){if(!t||zr(e))return!1;var r,n,s,a,o;if(nt(i)?(r=!!i&&jr,n=void 0,s=!1):(r=null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:jr,n=null==i?void 0:i.content_ignorelist,s=null!==(o=null==i?void 0:i.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(s&&function(t){return!(!t||!wr(t))&&(!!kr(t,"textarea")||(kr(t,"input")?j(Br,(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)))}(e))return!1;var l=Ur(e,!1).targetElementList;return!function(t,e){if(!1===t||K(t))return!1;var i;if(!0===t)i=Dr;else{if(!G(t))return!1;if(t.length>10)return Vi.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=>Nr(e,t)||Nr(r,t)))}))}(n,l.map((t=>{var e;return{safeText:Rr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Fr(l,r)}var zr=t=>!t||kr(t,"html")||!wr(t),Ur=(e,i)=>{if(!t||zr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!kr(s,"body");)if(xr(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=Or(s);if(!a)break;if(i||Ar.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function Wr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!kr(r,"body");r=r.parentNode){if(i++>=Cr||e.has(r))return!1;e.add(r);var n=Er(r);if(j(n,"ph-sensitive")||j(n,"ph-no-capture"))return!1}if(j(Er(t),"ph-include"))return!0;var s=t.type||"";if(Y(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Y(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Vr(t){return!!(kr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||kr(t,"select")||kr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Gr=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}))$"),Zr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Qr=[16,15,14,13],Jr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Kr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Yr=/[0-9A-Za-z_]/;function Xr(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 tn(t,e){if(void 0===e&&(e=!0),et(t))return!1;if(Y(t)){t=B(t);var i=e?Gr.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Zr.lastIndex=0;e=Zr.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Qr){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(Gr.test(o)&&Xr(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Jr.test(t):function(t){var e;for(Kr.lastIndex=0;e=Kr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Yr.test(i)&&Yr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function en(t){var e=Rr(t);return tn(e=(e+" "+rn(t)).trim())?e:""}function rn(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Qi(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Rr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+rn(t)).trim())}catch(t){Vi.error("[AutoCapture]",t)}})),e}function nn(t){return t.replace(/"|\\"/g,'\\"')}function sn(t){var e=t.attr__class;if(e)return G(e)?e:Tr(e)}var an="[SessionRecording]",on="redacted",ln=1e6;function un(t){var e;return Math.min(ln,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ln)}var hn={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:ln,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},dn=["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"],vn=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],cn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],fn=t=>{et(t)||Qi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return dn.includes(e)||cn.some((t=>e.includes(t)))})(e)&&(t[e]=on)}))},pn=["/s/","/e/","/i/"];function gn(t,e,i,r){if(et(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Y(n)&&(n=parseInt(n)),n>i?an+" "+r+" body too large to record ("+n+" bytes)":t}function mn(t,e){if(et(t))return t;var i=t;return tn(i,!1)||(i=an+" "+e+" body "+on),Qi(vn,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=an+" "+e+" body "+on+" as might contain: "+t)})),i}var yn=new WeakSet,bn="$people_distinct_id",_n="distinct_id",wn="$device_id",kn="$device_model",Sn="__alias",xn="__timers",Cn="$autocapture_disabled_server_side",Tn="$heatmaps_enabled_server_side",Mn="$exception_capture_enabled_server_side",En="$error_tracking_suppression_rules",In="$error_tracking_capture_extension_exceptions",Rn="$web_vitals_enabled_server_side",Pn="$dead_clicks_enabled_server_side",An="$product_tours_enabled_server_side",Fn="$logs_capture_enabled_server_side",On="$web_vitals_allowed_metrics",Ln="$session_recording_remote_config",Dn="$replay_sample_rate",$n="$replay_override_sampling",Nn="$replay_override_linked_flag",qn="$replay_override_url_trigger",jn="$replay_override_event_trigger",Bn="$sesid",Hn="$session_is_sampled",zn="$session_past_minimum_duration",Un="$session_recording_url_trigger_activated_session",Wn="$session_recording_event_trigger_activated_session",Vn="$posthog_sr_group_event_trigger_",Gn="$posthog_sr_group_url_trigger_",Zn="$posthog_sr_group_sampling_",Qn="$debug_first_full_snapshot_timestamp",Jn="$sess_rec_flush_size",Kn="$enabled_feature_flags",Yn="$active_feature_flags",Xn="$early_access_features",ts="$feature_flag_details",es="$feature_flag_payloads",is="$feature_flag_request_id",rs="$minimal_flag_called_events",ns="$override_feature_flags",ss="$override_feature_flag_payloads",as="$stored_person_properties",os="$stored_group_properties",ls="$groups",us="$surveys",hs="$surveys_loaded_at",ds="$surveys_activated",vs="$surveys_activated_session",cs="$surveys_activated_timestamps",fs="ph_product_tours",ps="$flag_call_reported",gs="$flag_call_reported_session_id",ms="$feature_flag_errors",ys="$feature_flag_evaluated_at",bs="$user_state",_s="$client_session_props",ws="$capture_rate_limit",ks="$initial_campaign_params",Ss="$initial_referrer_info",xs="$initial_person_info",Cs="$epp",Ts="$posthog_cookieless",Ms="$cookieless_mode",Es="$sdk_debug_extensions_init_method",Is="$sdk_debug_extensions_init_time_ms",Rs="$sdk_debug_recording_script_not_loaded",Ps="$sdk_debug_replay_event_trigger_status",As="$sdk_debug_replay_linked_flag_trigger_status",Fs="$sdk_debug_replay_matched_recording_trigger_groups",Os="$sdk_debug_replay_pending_trigger_conditions",Ls="$sdk_debug_replay_remote_trigger_matching_config",Ds="$sdk_debug_replay_trigger_groups_count",$s="$sdk_debug_replay_url_trigger_status",Ns="$session_recording_start_reason",qs="PostHog loadExternalDependency extension not found.",js="on_reject",Bs="always",Hs="anonymous",zs="identified",Us="identified_only",Ws="visibilitychange",Vs="beforeunload",Gs="$pageview",Zs="$pageleave",Qs="$identify",Js="$groupidentify",Ks="disabled",Ys="sampled",Xs="active",ta="buffering",ea="paused",ia="lazy_loading",ra="awaiting_config",na="missing_config",sa="rrweb_error",aa="trigger",oa=aa+"_activated",la=aa+"_pending",ua=aa+"_"+Ks;function ha(t,e,i,r,n,s){return 0===e?ua:(null==t?void 0:t.get_property(i?r+i:n))===s?oa:la}function da(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 va(t){return t.includes(oa)?oa:t.includes(la)?la:ua}function ca(t){var e=new Set(t);switch(e.delete(ua),e.size){case 0:return ua;case 1:return Array.from(e)[0];default:return la}}class fa{constructor(t){this.j=t}triggerStatus(t){return va(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return va(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class pa{constructor(t){this.j=t}triggerStatus(t){return ca(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return ca(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class ga{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return oa}stop(){}}var ma=t=>"sessionRecording"in t;class ya{constructor(t,e){this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this._instance=t,this.V=e}onConfig(t){var e,i;this.B=(ma(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(ma(t)?Q(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){Vi.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){Vi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return ha(this._instance,this.B.length,this.V,Gn,Un,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[$s]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=pr(this._instance);if(!t)return!1;try{return da(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=pr(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=da(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=pr(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,a=da(n,this.H,this.U);a&&!s?t():!a&&s&&e();var o=this.G(r)===oa,l=da(n,this.B,this.$);!o&&l&&i("url",n)}}stop(){this.W=""}}class ba{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[As]:t}),t}triggerStatusNoSideEffects(){var t=la;return et(this.linkedFlag)&&(t=ua),this.linkedFlagSeen&&(t=oa),t}onConfig(t,e){var i;if(this.linkedFlag=(ma(t)?Q(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!et(this.linkedFlag)&&!this.linkedFlagSeen){var r=Y(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Y(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(Q(i)&&r in i){var a=i[r];s=nt(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}}class _a{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(ma(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return ha(this._instance,this.Y.length,this.V,Vn,Wn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Ps]:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Y.length){var r=this.K(i)===oa,n=this.Y.includes(t);!r&&n&&e("event",t)}}stop(){}}class wa{constructor(t,e,i){if(this._instance=t,this.group=e,this.X=new ya(t,e.id),this.ee=new _a(t,e.id),this.te=new ba(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.X.onConfig(n),this.ee.onConfig(n),this.te.onConfig(n,i);var s=[this.ee,this.X,this.te];this.re="any"===e.conditions.matchType?new fa(s):new pa(s)}else this.re=new ga}triggerStatus(t){return this.re.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.re.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==la?[]:[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.ee.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.te.triggerStatusNoSideEffects()}].filter((t=>t.status===la)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.ee.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.X.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?Gn+this.group.id:Vn+this.group.id]:e})}stop(){this.X.stop(),this.ee.stop(),this.te.stop()}}function ka(t){if(t.rrwebError)return sa;if(!t.receivedFlags)return ta;if(!t.isRecordingEnabled)return Ks;if(t.urlTriggerMatching.urlBlocked)return ea;var e=!0===t.isSampled,i=new fa([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ys:i===oa?Xs:i===la?ta:!1===t.isSampled?Ks:Xs}function Sa(t){if(t.rrwebError)return sa;if(!t.receivedFlags)return ta;if(!t.isRecordingEnabled)return Ks;if(t.urlTriggerMatching.urlBlocked)return ea;var e=new pa([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==ua,r=nt(t.isSampled);return i&&e===la?ta:i&&e===ua||r&&!t.isSampled?Ks:!0===t.isSampled?Ys:Xs}function xa(){var t=[];return function(e,i){if(Q(i)||G(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Ca(t){var e=JSON.stringify(t,xa());return e?new Blob([e]).size:0}function Ta(t){if(tt(t))return 4;if(K(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(G(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=K(r)||tt(r)?4:Ta(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];K(l)||(a||(s+=1),a=!1,s+=o.length+3+Ta(l))}return s;default:return 0}}function Ma(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[Ma({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Ma({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 Ea=Uint8Array,Ia=Uint16Array,Ra=Uint32Array,Pa=new Ea([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]),Aa=new Ea([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]),Fa=new Ea([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oa=function(t,e){for(var i=new Ia(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ra(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]},La=Oa(Pa,2),Da=La[1];La[0][28]=258,Da[258]=28;for(var $a=Oa(Aa,0)[1],Na=new Ia(32768),qa=0;32768>qa;++qa){var ja=(43690&qa)>>>1|(21845&qa)<<1;Na[qa]=((65280&(ja=(61680&(ja=(52428&ja)>>>2|(13107&ja)<<2))>>>4|(3855&ja)<<4))>>>8|(255&ja)<<8)>>>1}var Ba=function(t,e,i){for(var r=t.length,n=0,s=new Ia(e);r>n;++n)++s[t[n]-1];var a,o=new Ia(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new Ia(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=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Na[d]>>>l]=u}else for(a=new Ia(r),n=0;r>n;++n)a[n]=Na[o[t[n]-1]++]>>>15-t[n];return a},Ha=new Ea(288);for(qa=0;144>qa;++qa)Ha[qa]=8;for(qa=144;256>qa;++qa)Ha[qa]=9;for(qa=256;280>qa;++qa)Ha[qa]=7;for(qa=280;288>qa;++qa)Ha[qa]=8;var za=new Ea(32);for(qa=0;32>qa;++qa)za[qa]=5;var Ua=Ba(Ha,9,0),Wa=Ba(za,5,0),Va=function(t){return(t/8>>0)+(7&t&&1)},Ga=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Ia?Ia:t instanceof Ra?Ra:Ea)(i-e);return r.set(t.subarray(e,i)),r},Za=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Qa=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Ja=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 Ea(0),0];if(1==n){var a=new Ea(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=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:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new Ia(v+1),f=Ka(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 Ea(c),f]},Ka=function(t,e,i){return-1==t.s?Math.max(Ka(t.l,e,i+1),Ka(t.r,e,i+1)):e[t.s]=i},Ya=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Ia(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},Xa=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},to=function(t,e,i){var r=i.length,n=Va(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)},eo=function(t,e,i,r,n,s,a,o,l,u,h){Za(e,h++,i),++n[256];for(var d=Ja(n,15),v=d[0],c=d[1],f=Ja(s,15),p=f[0],g=f[1],m=Ya(v),y=m[0],b=m[1],_=Ya(p),w=_[0],k=_[1],S=new Ia(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=Ja(S,7),T=C[0],M=C[1],E=19;E>4&&!T[Fa[E-1]];--E);var I,R,P,A,F=u+5<<3,O=Xa(n,Ha)+Xa(s,za)+a,L=Xa(n,v)+Xa(s,p)+a+14+3*E+Xa(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return to(e,h,t.subarray(l,l+u));if(Za(e,h,1+(O>L)),h+=2,O>L){I=Ba(v,c,0),R=v,P=Ba(p,g,0),A=p;var D=Ba(T,M,0);for(Za(e,h,b-257),Za(e,h+5,k-1),Za(e,h+10,E-4),h+=14,x=0;E>x;++x)Za(e,h+3*x,T[Fa[x]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Za(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Za(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=Ua,R=Ha,P=Wa,A=za;for(x=0;o>x;++x)if(r[x]>255){var B;Qa(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Za(e,h,r[x]>>>23&31),h+=Pa[B]);var H=31&r[x];Qa(e,h,P[H]),h+=A[H],H>3&&(Qa(e,h,r[x]>>>5&8191),h+=Aa[H])}else Qa(e,h,I[r[x]]),h+=R[r[x]];return Qa(e,h,I[256]),h+R[256]},io=new Ra([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ro=function(){for(var t=new Ra(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),no=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=ro[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},so=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Ea(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=to(l,u,t.subarray(h,d)):(l[h]=true,u=to(l,u,t.subarray(h,a)))}else{for(var v=io[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Ia(32768),m=new Ia(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 Ra(25e3),k=new Ia(288),S=new Ia(32),x=0,C=0,T=(h=0,0),M=0,E=0;a>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=eo(t,l,0,w,k,S,C,T,E,h-E,u),T=x=C=0,E=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&I==_(h-N))for(var q=Math.min(c,A)-1,j=Math.min(32767,h),B=Math.min(258,A);j>=N&&--D&&R!=P;){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,L=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,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Da[O]<<18|$a[L];var G=31&Da[O],Z=31&$a[L];C+=Pa[G]+Aa[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=eo(t,l,true,w,k,S,C,T,E,h-E,u)}return Ga(o,0,r+Va(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r)},ao=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},oo=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&&ao(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)}},lo=function(t){return 10+(t.filename&&t.filename.length+1||0)};function uo(t,e){void 0===e&&(e={});var i=no(),r=t.length;i.p(t);var n=so(t,e,lo(e),8),s=n.length;return oo(n,e),ao(n,s-8,i.d()),ao(n,s-4,r),n}function ho(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Ea(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Ea(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);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(++a))>>>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 Ga(r,0,n)}function vo(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class co{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this.ie={},this.ne=Date.now(),this.ae=-1/0,this.oe=()=>{var t=Date.now(),e=t-this.ne;e>0?(this.se=Math.min(this.ue,this.se+e/1e3*this.le),this.ne=t):this.ne=t},this.he=t=>{if(!this.ie[t]){var e,i;this.ie[t]=!0;var r=this.ce(t);null==(e=(i=this.de).onBlockedNode)||e.call(i,t,r)}},this.ve=t=>{var e=this.ce(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.ce=t=>this._rrweb.mirror.getNode(t),this.fe=t=>{var e,i,r,n,s,a,o,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==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(l=t.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.fe(e);if(e.attributes){var r=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.ve(t.id);return!this.pe.consumeRateLimit(e[0])&&t}));var n,s,a=r-e.attributes.length;a>0&&(null==(n=(s=this.de).onDroppedAttributeMutations)||n.call(s,a))}var o=this.fe(e);if(0!==o||i===o){if(this.ge)return t;this.oe();var l,u,h=Ta(t);return h>this.se?(null==(l=(u=this.de).onDroppedOversizedMutation)||l.call(u,h),void this.me()):(this.se-=h,t)}},this.me=()=>{if(!this.ye){var t=Math.max(0,this.be-(Date.now()-this.ae));this.ye=setTimeout((()=>{var t,e;this.ye=void 0,this.ae=Date.now(),null==(t=(e=this.de).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.de=e,this.pe=new mt({bucketSize:null!==(i=this.de.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.de.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.he,A:Vi}),this.ue=null!==(n=this.de.bytesBucketSize)&&void 0!==n?n:0,this.le=null!==(s=this.de.bytesRefillRate)&&void 0!==s?s:25600,this.ge=!Number.isFinite(this.ue)||0>=this.ue,this.se=this.ue;var a=this.de.resyncIntervalMs;this.be=it(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.ie={},this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ae=Date.now()}stop(){this.pe.stop(),this.reset(),this.se=this.ue,this.ne=Date.now(),this.ae=-1/0}}Ui.DEBUG=!1,Ui.LIB_VERSION="1.423.2",Ui.LIB_NAME="web";class fo{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.we=t.get_property.bind(t),this.ke=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ke(Jn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.we(Jn);return Q(e=i)&&Y(e.sessionId)&&it(e.size)&&i.sessionId===t?i.size:0}}function po(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<gt(100*e,0,100,Vi)}function go(t){return"$survey_response_"+t}function mo(t,e){if(!e)return null;var i=t[go(e)];return G(i)?[...i]:i}function yo(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!K(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=mo(t,e.id);K(s)||(r[n]=s)}})),p({$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:mo(t,e.id)}}))},t,r)}function bo(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 _o(t){return"string"==typeof t&&t.trim()?t.trim():null}function wo(t){return t.toLowerCase()}function ko(t,e,i){if(!t||!e)return null;var r=wo(e),n=Object.keys(t).find((t=>wo(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>wo(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var So=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function xo(t,e,i){var r,n=ko(t.translations,e,i),s=p({},t),a=!1;if(n){var o,l=null==(o=t.translations)?void 0:o[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),K(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of So){var d=l[h];K(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return So.some((e=>!K(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=ko(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var s=null==(r=t.translations)?void 0:r[n];if(!s)return{question:t,matchedKey:null,hasChanges:!1};var a=p({},t),o=!1;return K(s.question)||(a.question=s.question,o=!0),K(s.description)||(a.description=s.description,o=!0),K(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!K(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!K(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!K(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return G(t.choices)}(s)&&(a.choices=s.choices,o=!0),{question:o?a:t,matchedKey:o?n:null,hasChanges:o}}(t,e,i))),c=v.map((t=>t.question)),f=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(r=v.find((t=>t.matchedKey)))?void 0:r.matchedKey)||null),f&&(s.questions=c,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:a?n||g:null}}function Co(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function To(t){var e;return Co(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Mo=(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}},Eo=t=>t.toLowerCase(),Io={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=>Mo(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Mo(e,t))))),icontains:(t,e)=>e.map(Eo).some((e=>t.map(Eo).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Eo).every((e=>t.map(Eo).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 Ro(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=Io[i.operator];return!!n&&n(i.values,[String(r)])}))}function Po(t,e,i){return ar({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Ao=new Set(["is_not","not_icontains","not_regex"]);function Fo(t,e,i){return!t||0===t.length||t.every((t=>{var r="person"===t.type?i:e,n=null==r?void 0:r[t.key],s=t.operator||"exact";if(K(n)||tt(n))return Ao.has(s);var a=Io[s];return!!a&&!K(t.value)&&!tt(t.value)&&a(G(t.value)?t.value.map(String):[String(t.value)],G(n)?n.map(String):[String(n)])}))}var Oo=Gi("[SessionRecording]");function Lo(t,e){return e?t:"!"+t}function Do(t,e){return t===e||t!=="!"+e&&null}class $o{constructor(t,e,i,r,n,s,a){this._e=null,this.Se=Sa,this._instance=t,this.X=e,this.ee=i,this.te=r,this.xe=n,this.Ce=s,this.Me=a}onRemoteConfig(t){this._e=it(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Te=new fa([this.ee,this.X]),this.Se=ka):(this.Te=new pa([this.ee,this.X]),this.Se=Sa),this._instance.register_for_session({[Ls]:t.triggerMatchType}),this.X.onConfig(t),this.ee.onConfig(t),this.te.onConfig(t,((t,e)=>{this.xe("linked_flag_matched",{flag:t,variant:e}),this.Me()}))}getStatus(t){return this.Se({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=this._instance.get_property("$session_recording_remote_config"),i=null==e?void 0:e.minimumDurationMilliseconds;return it(i)?i:null}checkUrlTriggers(t,e,i,r){this.X.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.ee.Y.length&&et(this.Ie))return this.Ie=t((t=>{try{this.ee.checkEventTriggerConditions(t.event,i,e)}catch(t){Oo.error("Could not activate event trigger",t)}})),this.Ie}makeSamplingDecisions(t){var e,i,r,n=this._e;if(!it(n))return null==(i=this._instance.persistence)||i.unregister(Hn),void(null==(r=this._instance.persistence)||r.unregister(Dn));var s=this._instance.get_property(Hn),a=this._instance.get_property(Dn),o=Do(s,t),l=it(a)&&a!==n,u=K(a)&&s===t,h=l||u||!nt(o),d=h?po(t,n):o;h&&(d?this.xe("sampled"):Oo.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Hn]:Lo(t,d),[Dn]:tt(a)&&s===t?null:n})}ensureSamplingDecision(t){if(it(this._e)){var e=this._instance.get_property(Hn);nt(Do(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Wn),null==(e=this._instance.persistence)||e.unregister(Un),null==(i=this._instance.persistence)||i.unregister(Hn),null==(r=this._instance.persistence)||r.unregister(Dn),null==(n=this._instance.persistence)||n.unregister(zn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Te)?void 0:e.triggerStatus(t))===la}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.ee.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.te.triggerStatusNoSideEffects()}].filter((t=>t.status===la)).map((t=>t.label))}stop(){var t;null==(t=this.Ie)||t.call(this),this.Ie=void 0,this.ee.stop(),this.X.stop(),this.te.stop()}}class No{constructor(t,e,i,r,n){this.Re=[],this.Ae=new Map,this.Ee=!1,this._instance=t,this.X=e,this.xe=i,this.Le=r,this.Me=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Oe(t.triggerGroups),this._instance.register_for_session({[Ls]:"v2_trigger_groups",[Ds]:t.triggerGroups.length}),this.X.onConfig(t)):Oo.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return sa;if(t.urlTriggerMatching.urlBlocked)return ea;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Ks;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===oa){var o=s.group.id,l=i.get(o);K(l)?Vi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===la&&(r=!0)}return n?Ys:r?ta:Ks}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Re,triggerGroupSamplingResults:this.Ae,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Re)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;it(r)&&(tt(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.X.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.De(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Me(e))}),t)};for(var a of this.Re)s(a)}setupEventTriggerListeners(t,e,i){var r=this;return this.Ie=t((t=>{var i;if(this.Ee)return Oo.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Ie)||i.call(this),void(this.Ie=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.De(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),a=r._instance.get_property(as),o=s.some((e=>!e.properties||0===e.properties.length||Fo(e.properties,t.properties,a)));o&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Me(n))}}),e)};for(var s of this.Re)n(s)}catch(t){Oo.error("Could not activate event trigger for trigger groups",t)}})),this.Ie}makeSamplingDecisions(t){for(var e of this.Re){var i,r=e.group,n=r.id,s=r.sampleRate,a=Zn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(Q(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=it(c)&&c!==s,l=v===t&&it(c)&&c===s&&nt(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!nt(l),g=p?po(t+n,s):l;p&&this.Le("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Ae.set(n,g),null==(i=this._instance.persistence)||i.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Ee=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Hn),null==(e=this._instance.persistence)||e.unregister(Dn),null==(i=this._instance.persistence)||i.unregister(zn),this.Re)){var n,s,a,o=r.group.id;null==(n=this._instance.persistence)||n.unregister(Vn+o),null==(s=this._instance.persistence)||s.unregister(Gn+o),null==(a=this._instance.persistence)||a.unregister(Zn+o)}}updateActiveTriggers(t){var e=[];for(var i of this.Re){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),a=!0===this.Ae.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:a})}this._instance.register_for_session({[Fs]:e})}hasPendingTriggers(t){for(var e of this.Re)if(e.triggerStatus(t)===la)return!0;return!1}getPendingTriggerConditions(t){return this.Re.flatMap((e=>e.triggerStatusNoSideEffects(t)!==la?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ie)||t.call(this),this.Ie=void 0,this.Re.forEach((t=>t.stop())),this.Re=[],this.Ae.clear(),this.X.stop()}De(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Fo(i,e,this._instance.get_property(as))}Oe(t){var e=this;this.Re.forEach((t=>t.stop())),this.Re=[],this.Ae.clear();var i=function(t){var i=new wa(e._instance,t,((i,r)=>{e.xe("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Me()}));e.Re.push(i)};for(var r of t)i(r)}}var qo=t=>{if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),n=0;i.length>n;n++){for(var s=i[n];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},jo="https?://(.*)",Bo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ho=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Bo],zo="<masked>",Uo=["li_fat_id"];function Wo(t,e,i){if(!r)return{};var n,s=e?[...Bo,...i||[]]:[],a=Vo(hr(r.URL,s,zo),t),o=(n={},Qi(Uo,(function(t){var e=qo(t);n[t]=e||null})),n);return Ji(o,a)}function Vo(t,e){var i=Ho.concat(e||[]),r={};return Qi(i,(function(e){var i=ur(t,e);r[e]=i||null})),r}function Go(t){var e=function(t){return t?0===t.search(jo+"google.([^/?]*)")?"google":0===t.search(jo+"bing.com")?"bing":0===t.search(jo+"yahoo.com")?"yahoo":0===t.search(jo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!tt(e)){n.$search_engine=e;var s=r?ur(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Zo(){return navigator.language||navigator.userLanguage}var Qo="$direct";function Jo(){return(null==r?void 0:r.referrer)||Qo}function Ko(t,e,i){void 0===i&&(i=!1);var r=t?[...Bo,...e||[]]:[],s=i?Re(null==n?void 0:n.href):null==n?void 0:n.href,a=null==s?void 0:s.substring(0,1e3);return{r:Jo().substring(0,1e3),u:a?hr(a,r,zo):void 0}}function Yo(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Re(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==Qo?Qo:null==(i=or(r))?void 0:i.host};if(s){a.$current_url=s;var o=or(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=Vo(s);Ji(a,l)}if(r){var u=Go(r);Ji(a,u)}return a}function Xo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function tl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var el=1e5,il="https://schema.org",rl=[],nl="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(" "),sl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),al="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(" "),ol="Accommodation AdministrativeArea Country Place State".split(" "),ll={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:sl,publisher:al},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:rl},Offer:{seller:al},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},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:al,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:al,areaServed:ol,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:rl}},ul={},hl=[[sl,ul],["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(" "),ll.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ll.Event],[al,ll.Organization],[ol,ll.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ll.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),ul]],dl="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function vl(t,e){return W.call(t,e)?t[e]:void 0}function cl(t){var e=typeof t;return tt(t)||"string"===e||"number"===e||"boolean"===e}function fl(t){return cl(t)||G(t)&&t.every(cl)?t:void 0}function pl(t){if(W.call(ll,t))return ll[t];for(var e of hl){var i=e[1];if(e[0].includes(t))return i}return dl.includes(t)?ul:void 0}function gl(t,e){if(!Q(t))return null;var i=vl(t,"@type"),r=function(t){return("string"==typeof t?[t]:G(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!pl(t)))}(i).filter((t=>!e||!e.length||e.includes(t)));if(!r.length)return null;var n={"@type":"string"==typeof i?r[0]:r},s=fl(vl(t,"@id"));for(var a of(K(s)||(n["@id"]=s),nl)){var o=fl(vl(t,a));K(o)||(n[a]=o)}for(var l of r){var u=pl(l),h=function(){var e=vl(t,d),i=u[d];if(!0===i){var r=fl(e);K(r)||(n[d]=r)}else if(G(e)){var s=e.map((t=>gl(t,i))).filter(Q);s.length&&(n[d]=s)}else{var a=gl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function ml(t){if(!Q(t))return null;var e=vl(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=gl(t);if(i)return p({"@context":il},i);var r=vl(t,"@graph");if(!G(r))return null;var n=r.map((t=>gl(t))).filter(Q);return n.length?{"@context":il,"@graph":n}:null}function yl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function bl(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 _l(t){return yl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(yl)}function wl(t){return K(t)?void 0:Math.round(t)}function kl(t){return Q(t)?t.network_timing:t}var Sl,xl,Cl=36e5,Tl=943718.4,Ml="[SessionRecording]",El=Gi(Ml),Il=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Rl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Pl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function Al(){var t;return null==(t=Pl())?void 0:t.record}function Fl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,xa())}}function Ol(t){return vo(uo(ho(Fl(t))))}function Ll(t){return Dl.apply(this,arguments)}function Dl(){return(Dl=f((function*(t){var e=Fl(t),i=yield He(e,Ui.DEBUG,{rethrow:!0});return vo(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var $l="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Nl=!1;function ql(t){return G(t)&&0===t.length?Sl=null!=Sl?Sl:Ol([]):Ol(t)}function jl(t){return Bl.apply(this,arguments)}function Bl(){return(Bl=f((function*(t){return G(t)&&0===t.length?Sl||(xl=null!=xl?xl:Ll([]).then((t=>(Sl=t,t))).catch((t=>{throw Sl=void 0,xl=void 0,t}))):Ll(t)}))).apply(this,arguments)}function Hl(t){return $l&&!Nl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function zl(t){return{event:t,size:Ta(t)}}function Ul(t,e){return p({},t,{data:e,cv:"2024-10"})}function Wl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Vl(t){try{if(t.type===m.FullSnapshot)return zl(Ul(t,Ol(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return zl(Wl(t,{texts:ql(t.data.texts),attributes:ql(t.data.attributes),removes:ql(t.data.removes),adds:ql(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return zl(Wl(t,{adds:t.data.adds?Ol(t.data.adds):void 0,removes:t.data.removes?Ol(t.data.removes):void 0}))}catch(t){El.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ca(t)}}function Gl(){return Gl=f((function*(t){try{if(t.type===m.FullSnapshot)return zl(Ul(t,yield Ll(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([jl(t.data.texts),jl(t.data.attributes),jl(t.data.removes),jl(t.data.adds)]);return zl(Wl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule){var i=yield Promise.all([t.data.adds?Ll(t.data.adds):void 0,t.data.removes?Ll(t.data.removes):void 0]);return zl(Wl(t,{adds:i[0],removes:i[1]}))}}catch(e){return qe(e)&&(Nl=!0),El.error("could not compress event asynchronously - trying synchronous compression",e),Vl(t)}return{event:t,size:Ca(t)}})),Gl.apply(this,arguments)}function Zl(t,e){return t.type===m.Custom&&t.data.tag===e}function Ql(t){return Zl(t,"sessionIdle")}function Jl(t){return Zl(t,"$session_ending")}function Kl(t){return Zl(t,"$session_starting")}class Yl{get sessionId(){return this.Pe}get Ne(){if(!this._instance.sessionManager)throw new Error(Ml+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Fe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get qe(){return Do(this._instance.get_property(Hn),this.sessionId)}get _e(){var t,e=null==(t=this.je)?void 0:t.sampleRate;return it(e)?e:null}get Be(){var t,e;return null!==(t=null==(e=this.He)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.$e="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Ue=void 0,this.ze=!1,this.We=Date.now(),this.Ve=!1,this.Ze=[],this.Ge="unknown",this.Qe=0,this.Je=0,this.Ye=0,this.Ke=0,this.Xe=!1,this.et=!1,this.tt=!1,this.rt=!1,this.it=!1,this.nt=!1,this.ot=!1,this.st=!1,this.ut=!1,this.ht=!1,this.ct=!1,this.dt=!1,this.vt=[],this.ft=void 0,this.yt=void 0,this.bt=[],this.wt=0,this.kt=0,this._t=!1,this.St=void 0,this.Ie=void 0,this.xt=void 0,this.Ct=void 0,this.Mt=void 0,this.Tt=(t,e,i)=>{var r,n,s;if(i&&(t!==this.Pe||e!==this.It)){var a,o=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Pe,u=this.It;if(o&&this.Le("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.We,flushed_size:null==(a=this.Rt)?void 0:a.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Qn),this.ot=!1,null==(n=Pl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Le("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.At(),!(!1===this.Ge&&this.isStarted||this.Pe===t&&this.It===e)){var h=this.Pe!==t&&!1!==this.Ge;this.Ge="unknown",this.Et(h)}o&&this.Le("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.We}),null==(s=this.He)||s.makeSamplingDecisions(t)}},this.Lt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[zn])===this.Pe},this.Ot=()=>{var t,e;if(0===this.Dt.data.length)return null;var i=null==(t=this.Dt.data[0])?void 0:t.timestamp,r=null==(e=this.Dt.data[this.Dt.data.length-1])?void 0:e.timestamp;return it(i)&&it(r)?r-i:null},this.Pt=()=>{var t,e,i=this.Be;if(!it(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Nt;return it(r)&&r>=0&&i>r}if(this.Lt())return!1;var n,s=this.Ot();return!!tt(s)||i>s||(null==(n=this._instance.persistence)||n.register({[zn]:this.Pe}),!1)},this.Ft=()=>{this.status!==ta?(this.Xe&&this.et&&this.qt&&!this.tt&&(this.Xe=!1),this.jt(),this.Bt()):this.Ht()},this.$t=()=>{this.Ft()},this.Ut=()=>{this.Le("browser offline",{})},this.zt=()=>{this.Le("browser online",{})},this.Wt=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.qt=!0),this.Le("window "+r.visibilityState,{}))},this._instance=t,this.qt=null==e||e;var i=this.Ne.checkAndGetSessionAndWindowId(),n=i.windowId;this.Pe=i.sessionId,this.It=n,this.te=new ba(this._instance),this.X=new ya(this._instance),this.ee=new _a(this._instance),this.Dt=this.Ht(),this.Ne.sessionTimeoutMs>this.Fe||El.warn("session_idle_threshold_ms ("+this.Fe+") is greater than the session timeout ("+this.Ne.sessionTimeoutMs+"). Session will never be detected as idle"),this.Rt=new fo(this._instance)}setDocumentWasEverVisible(t){t&&(this.qt=!0)}get Vt(){var t,e,i,r,n,s,a,o,l,u=null==(t=this.je)?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!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==u?void 0:u.maskTextSelector,c=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o: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 K(d)&&K(v)&&K(c)&&K(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Zt(){var t;if(!this.ut){var e=null==(t=this.je)?void 0:t.masking;if(!et(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!K(r)&&r!==n}));0!==r.length&&(this.ut=!0,El.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 Gt(){var t;return gt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Gi("canvas recording resolution scale"),1)}get Qt(){var t,e,i,r,n,s,a,o=this._instance.config.session_recording.captureCanvas,l=null==(t=this.je)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==o?void 0:o.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a: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:gt(h,0,12,Gi("canvas recording fps"),4),quality:gt(d,0,1,Gi("canvas recording quality"),.4)}}get Jt(){var t,e=!(null==(t=this.je)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Yt(){var t,e,i,r=null==(t=this.je)?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),a=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),o=kl(this._instance.config.capture_performance),l=kl(null==r?void 0:r.capturePerformance),u=!!(nt(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Kt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Jt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Yt&&Z(s))if(!sr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:hn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...hn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...hn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(r=un(n),t=>(null!=t&&t.requestBody&&(t.requestBody=gn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=gn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=or(t.name),s=0===e.indexOf("http")?null==(r=or(e))?void 0:r.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&pn.some((t=>0===a.indexOf(t)))))return t}})((fn((r=e).requestHeaders),fn(r.responseHeaders),r),t.api_host,i));var r},h=Z(t.session_recording.maskNetworkRequestFn);return h&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Vi.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:p({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Z(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=u(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 et(n)&&r?(yn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!K(t))return t.requestBody=mn(t.requestBody,"Request"),t.responseBody=mn(t.responseBody,"Response"),t}(u(t)),p({},hn,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Yt,a)))}else El.info("NetworkCapture not started because we are on localhost.");return i}Xt(t){return this._instance.config.disable_capture_url_hashes?Re(t):t}er(t,e){void 0===e&&(e=!1);var i=e?Re(t):this.Xt(t),r=this._instance.config.mask_personal_data_properties?[...Bo,...this._instance.config.custom_personal_data_properties||[]]:[];return this.tr(hr(i,r,zo))}tr(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var i,r=e.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==r?void 0:r.name)&&void 0!==i?i:null==r?void 0:r.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}rr(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Ze.length?this.Ze.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):El.warn("could not emit queued rrweb event.",e,t),!1}}Le(t,e){return this.rr(Rl((()=>Al().addCustomEvent(t,e))))}ir(){var t;return this.ze&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Ge}nr(t){if(!this.ir())return!1;try{var e=Al();return!!e&&(e.addCustomEvent("$json_ld",t),this.ir())}catch(t){return!1}}ar(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.sr)?void 0:e.scan(t)}))}ur(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.er(e.origin+e.pathname+e.search);this.lr!==i&&(this.lr=i,this.Le("$url_changed",{href:i}))}catch(t){}}hr(){if(this.Ze.length){var t=[...this.Ze];this.Ze=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.rr(t)}))}}Ce(){return this.rr(Rl((()=>Al().takeFullSnapshot())))}get cr(){var t,e,i;if(null!=(t=this.He)&&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 it(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}dr(){if(this.vr&&clearInterval(this.vr),!0!==this.Ge){var t=this.cr;t&&(this.vr=setInterval((()=>{this.Ce()}),t))}}Me(t){"event"===t&&this.pr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.dr()}gr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.sr)||t.scan(),clearInterval(this.vr),El.info("recording paused due to URL blocker"),this.Le("recording paused",{reason:"url blocker"}))}mr(){var t;this.X.urlBlocked&&(null==(t=this.sr)||t.scan(),this.X.urlBlocked=!1,this.Ce(),this.ar(),this.dr(),this.Le("recording resumed",{reason:"left blocked url"}),El.info("recording resumed"))}yr(t,e){var i;if("event"===t&&this.pr(),!this.Ve&&null!=(i=this.He)&&i.hasPendingTriggers(this.sessionId)){this.Ve=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?Un:Wn]:this.sessionId}),null==(n=this.He)||n.updateActiveTriggers(this.sessionId),this.Me(),this.Bt(),this.xe(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Ve=!1}}}get isStarted(){return!!this.Ue}get je(){var t=this._instance.get_property(Ln);if(t){var e;try{e=Q(t)?t:JSON.parse(t)}catch(t){return void El.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>Cl)return El.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(Ln))}return e}}br(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.je;if(s){this.isStarted||(this.Xe=!1!==this.Ge&&!this.rt,this.rt=!1,this.et=this.Xe,this.tt=!1),this._t&&(this.wr(),this.Ht());var a=this.Ne.checkAndGetSessionAndWindowId(),o=a.windowId;this.Pe=a.sessionId,this.It=o,null==(i=this._instance.persistence)||i.unregister(Qn),null!=s&&s.endpoint&&(this.$e=null==s?void 0:s.endpoint),this.He=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new No(this._instance,this.X,this.xe.bind(this),this.Le.bind(this),this.Me.bind(this)):new $o(this._instance,this.X,this.ee,this.te,this.xe.bind(this),this.Ce.bind(this),this.Me.bind(this)),this.He.onRemoteConfig(s),null==(n=this.Ie)||n.call(this),this.Ie=this.He.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.yr(t,e))),this.br($n,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister($n)})),this.br(Nn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Nn)})),this.br(jn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(jn)})),this.br(qn,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(qn)})),this.He.makeSamplingDecisions(this.sessionId),this.kr(),this.it||(rr(t,"beforeunload",this.Ft),rr(t,"pagehide",this.$t),rr(t,"offline",this.Ut),rr(t,"online",this.zt),rr(r,"visibilitychange",this.Wt),!this.xt&&Z(this.Ne.onSessionId)&&(this.xt=this.Ne.onSessionId(this.Tt)),!this.Ct&&Z(this.Ne.on)?this.Ct=this.Ne.on("forcedIdleReset",(()=>{this.At(),this.Ge="unknown",this.stop(),this.Mt=this.Ne.onSessionId(((t,e,i)=>{var r;null==(r=this.Mt)||r.call(this),this.Mt=void 0,this.Tt(t,e,i)}))})):Z(this.Ne.on)||El.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),et(this.St)&&(this.St=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.er(t.properties.$current_url):"";if(!e)return;this.Le("$pageview",{href:e})}}catch(t){El.error("Could not add $pageview to rrweb session",t)}}))),this.status===Xs&&this.xe(e||"recording_initialized"))}else El.info("remote config must be stored in persistence before recording can start")}_r(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.Ft),null==t||t.removeEventListener("pagehide",this.$t),null==t||t.removeEventListener("offline",this.Ut),null==t||t.removeEventListener("online",this.zt),null==r||r.removeEventListener("visibilitychange",this.Wt),clearInterval(this.vr),this.Sr(),null==(e=this.St)||e.call(this),this.St=void 0,null==(i=this.Ie)||i.call(this),this.Ie=void 0,null==(n=this.xt)||n.call(this),this.xt=void 0,null==(s=this.Ct)||s.call(this),this.Ct=void 0,null==(a=this.Mt)||a.call(this),this.Mt=void 0,null==(o=this.He)||o.stop(),this.Cr(),this.wr()}wr(){this.kt+=1,this.bt=[],this.wt=0,this.Mr=void 0,this._t=!1}Cr(){var t,e,i;null==(t=this.Tr)||t.stop(),this.Ze=[],null==(e=this.sr)||e.stop(),this.sr=void 0,this.ze=!1,null==(i=this.Ue)||i.call(this),this.Ue=void 0}Ir(){if(!this.Mr||0===this.wt)return!1;if(this._t)return!0;this._t=!0;var t=this.kt;return this.Sr(),this.Cr(),this.Mr.catch((()=>{})).then((()=>{t===this.kt&&(this._t=!1,this.Bt(),this.Ht(),this._r(),El.info("stopped"))})).catch((()=>{this._t=!1,this._r(),El.info("stopped")})),!0}stop(){this.Cr(),this.Ir()||(this.Bt(),this.Ht(),this._r(),El.info("stopped"))}Et(t){var e;this.stop(),this.Rr=void 0,this.Ar=void 0,this.Je=0,this.Ye=0,this.Ke=0,null==(e=Pl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Xe=t,this.et=!1}pr(){this.isStarted||(this.rt=!0),this.Xe&&(this.Xe=!1,this.et=!1,this.tt&&(this.tt=!1,this.Ce()),this.Er())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.Ht(),this.Cr()),this.Ht(),this._r(),El.info("discarded")}Lr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==Ks?(this.Or(t,r),this.Dr(s)):this.Ht()}Pr(){try{this.Nr()}catch(t){this.st||(this.st=!0,El.error("could not track full snapshot cost",t))}}Nr(){var t,e=null==(t=Pl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Ar&&(this.Ar=e,this.Rr&&this.Rr.durationMs>=e.durationMs||(this.Rr=e),500>e.durationMs||El.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}))}Or(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(K(this.ft)||this.ft===e||this.yt===e||(this.yt=e,El.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Ce())):this.ft=e}Fr(t){t.counted&&t.generation===this.kt&&(this.wt=Math.max(0,this.wt-1)),t.counted=!1,this.bt=this.bt.filter((e=>e!==t))}qr(t,e,i){t.processed||t.generation!==this.kt||(t.processed=!0,this.Lr(t.event,e,i,t.targetSessionId,t.targetWindowId))}jr(t){try{var e=t.compressionEnabled?Vl(t.event):{event:t.event,size:Ca(t.event)};this.qr(t,e.event,e.size)}finally{this.Fr(t)}}jt(){[...this.bt].forEach((t=>{this.jr(t)}))}Br(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.kt,processed:!1,counted:!0};this.bt.push(s),this.wt+=1;var a=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var a=e?Hl(t)?yield function(t){return Gl.apply(this,arguments)}(t):Vl(t):{event:t,size:Ca(t)};i=a.event,r=a.size}catch(e){El.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Ca(t)}n.qr(s,i,r)}finally{n.Fr(s)}}));return function(){return i.apply(this,arguments)}}();this.Mr=this.Mr?this.Mr.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.hr(),t&&Q(t))){if(t.type===m.Meta){var h=this.er(t.data.href);if(this.lr=h,!h)return;t.data.href=h}else this.ur();if(null==(e=this.He)||e.checkUrlTriggers(this.sessionId,(()=>this.gr()),(()=>this.mr()),((t,e)=>this.yr(t,e))),!this.X.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=Pl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.ot=!0),this.Pr(),Promise.resolve().then((()=>this.Pr())),this.dr(),null==(v=this.Tr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Qn]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.He)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.Hr();var p=this.Tr?this.Tr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Q(e)&&6===e.type&&Q(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),b=function(t){return Jl(t)?t.data.payload:null}(g),_=function(t){return Kl(t)?t.data.payload:null}(g),w=function(t){return Ql(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.$r(g),t.type===m.FullSnapshot&&(this.vt.push([this.Pe,t.timestamp]),this.vt.length>6&&(this.vt=this.vt.slice(-6)));var k=null!==(r=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==r?r:this.Pe,S=null!==(a=null!==(o=null!==(l=null==b?void 0:b.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.It;if(!0!==this.Ge||function(t){return Ql(t)||Jl(t)||Kl(t)}(g)){g.type===m.FullSnapshot&&(this.Qe=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var x=this.ze;this.ze=!0,f?this.ar(!0):x||this.ar();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.wt>0||C&&Hl(g))this.Br(g,C,k,S);else{var T=C?Vl(g):{event:g,size:Ca(g)};this.Lr(g,T.event,T.size,k,S)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(g)&&this.Qe++}else!0===this.Ge&&this.Qe++}}}get status(){return this.He?this.He.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.qe,rrwebError:this.it,urlTriggerMatching:this.X,eventTriggerMatching:this.ee,linkedFlagMatching:this.te,remoteConfig:this.je}):Ks}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.te.linkedFlagSeen=!0,this.Ce(),this.pr(),this.xe("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Hn]:this.sessionId,[Dn]:null}),this.Ce(),this.pr(),this.xe("sampling_overridden")}overrideTrigger(t){this.yr(t),this.pr()}Ur(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.er(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Sr(){this.zr&&(clearTimeout(this.zr),this.zr=void 0)}Er(){this.zr||(this.zr=setTimeout((()=>{this.Bt()}),2e3))}Wr(){return this.ft!==this.Dt.sessionId&&0!==this.Dt.data.length&&this.Dt.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Jl(t)&&!Kl(t)))}Vr(){var t,e;return null!==(t=null==(e=this.He)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Zr(t){if(t!==ta)return K(this.Gr)||this._instance.register_for_session({[Os]:[]}),void(this.Gr=void 0);var e=this.Vr();if(0===e.length)return K(this.Gr)||this._instance.register_for_session({[Os]:[]}),void(this.Gr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Gr&&(this.Gr=r,this._instance.register_for_session({[Os]:e}),El.info("buffering: "+i))}Bt(){var t;if(this.Sr(),this.Xe)return this.Dt;if(this.Wr())return this.Dt.size>Tl?this.Ht():this.Dt;var e=this.Dt;null==(t=this.He)||t.ensureSamplingDecision(this.sessionId);var i=this.Pt(),r=this.status;if(this.Zr(r),r===ta||r===ea||r===Ks||i)return this.Er(),this.Dt;if(this.Dt!==e)return this.Dt;if(e.data.length>0){var n,s=this.Ur();Ma(e).forEach((t=>{var e;null==(e=this.Rt)||e.trackSize(t.sessionId,t.size),this.Qr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Ui.LIB_NAME,$lib_version:Ui.LIB_VERSION,$snapshot_host:s})})),null==(n=this.He)||n.onFlushComplete()}return this.Ht()}Dr(t){var e,i=2+((null==(e=this.Dt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Dt.sessionId!==r;if(n||!0!==this.Ge&&!this.Xe&&this.Dt.size+t.$snapshot_bytes+i>Tl){var s=this.Pe;if(this.Dt=this.Bt(),this.Pe!==s)return;n&&this.Dt.data.length>0&&(this.Dt=this.Ht()),this.Dt.sessionId=r,this.Dt.windowId=t.$window_id}this.Xe&&(this.tt||this.Dt.size+t.$snapshot_bytes+i>Tl)?this.tt||(this.tt=!0,this.Dt=this.Ht()):(this.Dt.size+=t.$snapshot_bytes,this.Dt.data.push(t.$snapshot_data),this.Dt.sizes.push(t.$snapshot_bytes),!0===this.Ge||this.Xe||this.Er())}Qr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.$e),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Nt(){var t,e,i=null==(t=this.Dt)?void 0:t.data[(null==(e=this.Dt)?void 0:e.data.length)-1],r=this.Ne.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}Hr(){if(!this.Dt||0===this.Dt.data.length)return this.Ht();for(var t=-1,e=this.Dt.data.length-1;e>=0;e--)if(this.Dt.data[e].type===m.Meta){t=e;break}return 0>t?this.Ht():(this.Dt.data=this.Dt.data.slice(t),this.Dt.sizes=this.Dt.sizes.slice(t),this.Dt.size=this.Dt.sizes.reduce(((t,e)=>t+e),0),this.Dt)}Ht(){return this.Dt={size:0,data:[],sizes:[],sessionId:this.Pe,windowId:this.It},this.Dt}xe(t,e){this._instance.register_for_session({[Ns]:t}),El.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Le("$recording_started",p({reason:t},e))}Jr(t){var e;return 3===t.type&&-1!==Il.indexOf(null==(e=t.data)?void 0:e.source)}$r(t){var e=this.Jr(t);e||!0===this.Ge||t.timestamp-this.We>this.Fe&&(this.Ge=!0,clearInterval(this.vr),this.Le("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.We,threshold:this.Fe,bufferLength:this.Dt.data.length,bufferSize:this.Dt.size,sessionId:this.Pe,windowId:this.It}),this.Bt());var i=!1;if(e&&(this.We=t.timestamp,this.Ge)){var r="unknown"===this.Ge;this.Ge=!1,r||(this.Le("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Ne.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.Pe!==a,l=this.It!==s;if(this.It=s,this.Pe=a,o||l){var u=o&&!1!==this.Ge;u&&(this.Ge="unknown"),this.Et(u)}else if(e&&this.pr(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.He)?void 0:h.hasPendingTriggers(this.sessionId));this.Qe>0&&d&&this.Ce(),this.ar(),this.dr()}}At(){var t;null==(t=this.He)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,a,o,l,u=this.Ne.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Pl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Dt.data.length,$sdk_debug_replay_internal_buffer_size:this.Dt.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.Rt)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.vt,$snapshot_max_depth_exceeded:this.ot,$sdk_debug_replay_slowest_full_snapshot_ms:wl(null==(i=this.Rr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:wl(null==(r=this.Rr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Rr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Rr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Rr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:wl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:wl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:wl(null==(o=Pl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Pl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Je,$sdk_debug_replay_oversized_mutations_dropped:this.Ye,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.Ke,$sdk_debug_replay_rrweb_error:this.it,$sdk_debug_rrweb_attached:!!this.Ue,$sdk_debug_rrweb_start_attempted:this.nt}}kr(){var e;if(!this.Ue){this.nt=!0;var i,n,s,a,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 h=u[0],d=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=p({password:!0},d);else if("sampling"===h){var v=null!=d?d:{},c={};K(v.mousemove)||(c.mousemove=v.mousemove),K(v.mouseInteraction)||(c.mouseInteraction=v.mouseInteraction),o.sampling=c}else o[h]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=p({},o.slimDOMOptions,{script:!0})),this.Qt&&this.Qt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Qt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Qt.quality},o.canvasResolutionScale=this.Gt,o.canvasMasking={configured:()=>{var t;return Z(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(Z(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.ct||(this.ct=!0,El.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Vt&&(o.maskAllInputs=null===(i=this.Vt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Vt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Vt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Vt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ht||(this.ht=!0,El.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.Zt();var f=Al();if(f){this.Tr=null!==(e=this.Tr)&&void 0!==e?e:new co(f,{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";El.info(i,{node:e}),this.log(Ml+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Je+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.cr,onDroppedOversizedMutation:t=>{0===this.Ye&&this.log(Ml+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.Ye+=1,this.Ke+=t},requestFullSnapshot:()=>this.Ce()});var g=this.Kt();if(this.Ue=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.dt||(this.dt=!0,El.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Ue)return this.it=!0,void El.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.it=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.sr&&(this.sr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=el,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(bl(i,e.blockClass,e.blockSelector)||bl(i,e.maskTextClass,e.maskTextSelector))return!0;var r=i.parentNode;i=i.parentElement||(r&&r.nodeType===r.DOCUMENT_FRAGMENT_NODE?r.host:null)}return!1}(e,i))return;var o=function(t){if(!t||t.length>el)return null;try{var e=JSON.parse(t),i=G(e)?e.map(ml):ml(e);if(tt(i)||G(i)&&(!i.length||i.some(tt)))return null;var r=JSON.stringify(i);return r.length>2e4?null:[i,r]}catch(t){return null}}(e.text);if(!o)return void r.delete(e);var l=o[0],u=o[1];if(tt(a))return void r.set(e,u);if(r.get(e)!==u){if(u.length>s)return void(s=0);i.emit(l)&&(r.set(e,u),s-=u.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of _l(t))a(e)};for(var i of t)if("childList"===i.type)yl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&yl(r)&&a(r)}else"attributes"===i.type&&yl(i.target)&&a(i.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&_l(t.documentElement).forEach((t=>{e&&r.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.X.urlBlocked||this.X.isCurrentUrlBlocked()?null:this.ir()},emit:t=>this.nr(t)}),this.X.isCurrentUrlBlocked()&&this.sr.scan()),this.We=Date.now(),this.Ge=nt(this.Ge)?this.Ge:"unknown",this.tryAddCustomEvent("$remote_config_received",this.je),this.Le("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.Le("$posthog_config",{config:this._instance.config})}else El.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Le(t,e)}}var Xl,tu=["type"],eu=Object.defineProperty,iu=(t,e,i)=>((t,e,i)=>e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),ru=(t=>(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))(ru||{}),nu=(t=>(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))(nu||{}),su=(t=>(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))(su||{}),au=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(au||{}),ou=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ou||{}),lu=(t=>(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))(lu||{}),uu=(t=>(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))(uu||{});function hu(t,e){return-1!==t.indexOf(e)}var du={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},vu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},cu={};function fu(t){if(cu[t])return cu[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in du?du[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in vu?vu[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return cu[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return hu(t,"AppleWebKit")&&!hu(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),cu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var pu={};function gu(t,e,i){var r,n=t+"."+String(i);if(pu[n])return pu[n].call(e);var s=fu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(pu[n]=a,a.call(e)):e[i]}var mu={};function yu(t,e,i){var r=t+"."+String(i);if(mu[r])return mu[r].bind(e);var n=fu(t)[i];return"function"!=typeof n?e[i]:(mu[r]=n,n.bind(e))}function bu(){return fu("MutationObserver").constructor}function _u(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],a=i(r);a;){if(a.next===s)return void(a.next=n.next);a=i(r=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var wu={childNodes:t=>gu("Node",t,"childNodes"),parentNode:t=>gu("Node",t,"parentNode"),parentElement:t=>gu("Node",t,"parentElement"),textContent:t=>gu("Node",t,"textContent"),contains:(t,e)=>yu("Node",t,"contains")(e),getRootNode:t=>yu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?gu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?gu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>yu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>yu("Element",t,"querySelectorAll")(e),mutationObserver:bu,patch:_u},ku=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Su(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var xu=0,Cu=6e4;function Tu(){xu+=1}function Mu(){return xu}function Eu(t,e){return e!==xu||t>Cu}var Iu=0,Ru=0,Pu=0,Au=ku(),Fu=null,Ou=null,Lu=[],Du=0,$u=0,Nu={slowestBatchMs:0},qu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},ju=t=>t&&t>0?t:null;function Bu(t){(Iu+=1)>1||(Au=ku(),Lu=[],Du=0,Ou=ju(t),Ru=Su(),Pu=xu)}function Hu(){return 0===Iu?Fu||ku():(Iu-=1)>0?Au:(Au.durationMs=Su()-Ru,Au.deferredStylesheetCount=Du,qu.deferredCount+=Du,Ou=null,Eu(Au.durationMs,Pu)?Au:Fu=Au)}var zu=32;function Uu(t,e,i){var r=t.length;if(i>=zu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=Uu(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=Uu(l,e,i+1))}}}catch(t){}}return r}function Wu(t){if(0!==Iu){var e=Uu(t,null,0);Au.cssRuleCount+=e,$u>0&&(Au.nonDeferrableCssRuleCount+=e)}}function Vu(t){$u+=1;try{return t()}finally{$u-=1}}function Gu(t){Iu>0&&(Au.stylesheetMs+=t)}function Zu(t){if(0===Iu||null===Ou)return!1;var e=Au.cssRuleCount-Au.nonDeferrableCssRuleCount;return e>=Ou||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Uu(e,i,0)}catch(t){return 0}}(t)>Ou}function Qu(){qu.failedCount+=1}function Ju(t){t>0&&(qu.abandonedCount+=t)}function Ku(t){return t.nodeType===t.ELEMENT_NODE}function Yu(t){var e=t&&"host"in t&&"mode"in t&&wu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&wu.shadowRoot(e)===t)}function Xu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function th(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 eh(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 ih=0;function rh(t){var e=0===ih,i=e?Su():0;ih+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Wu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),th(Array.from(r,(t=>nh(t,n))).join(""))}catch(t){return null}finally{ih-=1,e&&Gu(Su()-i)}}function nh(t,e){var i;if(ah(t)){var r;try{r=rh(t.styleSheet)||eh(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return kh(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return oh(t)&&t.selectorText.includes(":")&&(n=sh(n)),e?kh(n,e):n}function sh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ah(t){return"styleSheet"in t}function oh(t){return"selectorText"in t}var lh=/^-?[A-Za-z_][\w-]*$/,uh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function hh(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 o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return i=!0,void(r=t);a(e[e.length-1],n.importRule,t)}function a(t,e,i){var r;try{var n;try{n=i||eh(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=kh(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var i=t.rules[t.index];if("sheet"===t.kind&&ah(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 a(t,i,null)}if(!function(t,i){try{var r=function(t){var e,i=t;if(!i.cssRules||0===i.cssRules.length)return null;if(i.media&&"string"==typeof i.media.mediaText)return"@media "+i.media.mediaText+" {";if(oh(t)){if("number"==typeof i.type&&1!==i.type)return null;var r=i.style?i.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in i)return"string"!=typeof i.containerQuery||i.containerName&&!lh.test(i.containerName)?null:"@container "+(i.containerName?i.containerName+" ":"")+i.containerQuery+" {";if("string"==typeof i.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+i.conditionText+" {":null}return"string"==typeof i.name?"keyText"in i.cssRules[0]?lh.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":uh.test(i.name)?"@layer "+i.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?kh(r,n):r,fixColons:"sheet"===i.kind&&oh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&oh(i)&&i.selectorText.includes(":")&&(s=sh(s)),t.parts.push(t.sheetHref?kh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Wu(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,!ah(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;Wu(s);var a=r.href;!a&&r.ownerNode&&(a=r.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:r,rules:o,sheetHref:a}),i.push({sheet:r,rules:o,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=Su(),a=t>0?t:1;try{for(;!i&&a>0;){var l=e[e.length-1];if(l.rules.length>l.index){a-=1;try{o(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?sh(h):h}else u=th(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Gu(Su()-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}}}class dh{constructor(){iu(this,"idNodeMap",new Map),iu(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-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))),Ku(t)){var i=wu.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 vh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&ch(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ch(t){return t.toLowerCase()}var fh=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function 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&&fh.has(ch(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var gh="__rrweb_original__";function mh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ch(e):null}catch(t){return null}}var yh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,bh=/^(?:[a-z+]+:)?\/\//i,_h=/^www\..*/i,wh=/^(data:)([^,]*),(.*)/i;function kh(t,e){return(t||"").replace(yh,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(bh.test(l)||_h.test(l))return"url("+u+l+u+")";if(wh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.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 Sh,xh,Ch="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Th=4096,Mh=1e5,Eh=10,Ih=new Map,Rh=1,Ph=new RegExp("[^a-z0-9-_:]"),Ah=-2;function Fh(){return Rh++}var Oh=/^[^ \t\n\r\u000c]+/,Lh=/^[, \t\n\r\u000c]+/,Dh=new WeakMap;function $h(t,e){return e&&""!==e.trim()?Nh(t,e):e}function Nh(t,e){var i=Dh.get(t);if(i||(i=t.createElement("a"),Dh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function qh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Ch:t}(t,e.maxBase64ImageLength):t}function jh(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=$h(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(Mh>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Th||t.naturalHeight>Th)return e;var n=Ih.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 a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(Ih.size>=Eh){var u=Ih.keys().next().value;void 0!==u&&Ih.delete(u)}return Ih.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),qh(u,s)}if("image"===e)return qh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=$h(t,r);return"image"===e&&h.startsWith("data:")?qh(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(Lh),e.length>i;){var s=r(Oh);if(","===s.slice(-1))s=$h(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=$h(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?kh(r,Nh(t)):"object"===e&&"data"===i?$h(t,r):r:$h(t,r)}function Bh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Hh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Hh(wu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Hh(wu.parentNode(t),e,i)}function zh(t,e,i,r){var n;if(Ku(t)){if(!wu.childNodes(n=t).length)return!1}else{if(null===wu.parentElement(t))return!1;n=wu.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(Hh(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 Uh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Wh=new Map;function Vh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Gh(t){return null==t?"":t.toLowerCase()}var Zh=50,Qh=!1,Jh=!1;function Kh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=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,E=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,L=e.keepIframeSrcFn,D=void 0===L?()=>!1:L,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,z=void 0===H?Zh:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return Jh=!0,Qh||(Qh=!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,a,o,void 0===U)),Iu>0&&(Au.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,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:uu.Document,childNodes:[],compatMode:t.compatMode}:{type:uu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:uu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s=e.doc,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,v=e.maskAttributeFn,c=e.dataURLOptions,f=void 0===c?{}:c,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,b=e.newlyAddedElement,_=void 0!==b&&b,w=e.rootId,k=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),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=ch(t.tagName);return Ph.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var E=t.attributes[M];Bh(S,E.name)||(C[E.name]=jh(s,S,ch(E.name),E.value,t,f))}if("link"===S&&a&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=Vh(s,R))&&R.includes(".css")&&(I=Vh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(Zu(I)?Iu>0&&(Lu.push(t),Du+=1):P=rh(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||wu.textContent(t)||"").trim().length){var A=Vu((()=>rh(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,O=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=vh({element:t,type:mh(t),tagName:S,value:F,maskInputOptions:l,maskInputFn:u}):O&&(C.checked=O)}if("option"===S&&(t.selected&&!l.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))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((gh in n?n[gh]: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)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var L=t.toDataURL(f.type,f.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,L!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=L)}var N,q,j=!1;if("img"===S&&p){Sh||(Sh=s.createElement("canvas"),xh=Sh.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",z=B.crossOrigin,U=(e,i)=>j?ph({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{Uh(B,"load",W);try{Sh.width=B.naturalWidth,Sh.height=B.naturalHeight,xh.drawImage(B,0,0);var t=Sh.toDataURL(f.type,f.quality);C.rr_dataURL=U("rr_dataURL",t)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(z?C.crossOrigin=U("crossOrigin",z):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=t.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(_||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),k){var G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null==(i=s.defaultView)?void 0:i.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),Y&&(C.rr_position=Y.position||"static",x.add("rr_position"),Y.transform&&"none"!==Y.transform&&(C.rr_transform=Y.transform,x.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(C.rr_display=Y.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||v)for(var X of Object.entries(C)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(C[tt]=ph({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:v,isGenerated:x.has(tt)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(t){}return{type:uu.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=t,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:k,rootId:w,isCustom:N}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:a,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,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=wu.parentNode(t),o=a&&a.tagName,l=wu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(Zu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=rh(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=kh(l,Nh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,wu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:uu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:uu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:uu.Comment,textContent:wu.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:D,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===uu.Comment)return!0;if(t.type===uu.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,e){var i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Gh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Gh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Gh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Gh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Gh(t.attributes.property).match(/^(og|twitter|fb):/)||Gh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Gh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Gh(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(Gh(t.attributes.name))||Gh(t.attributes.property).match(/^article:/)||Gh(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(Gh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===uu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Ah:Fh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===Ah)return null;M&&M(t);var J=!u;if(Q.type===uu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=wu.shadowRoot(t);K&&Xu(K)&&(Q.isShadowHost=!0)}if((Q.type===uu.Document||Q.type===uu.Element)&&J){b.headWhitespace&&Q.type===uu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,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:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z};if(Q.type===uu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(wu.childNodes(t))){var tt=Kh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(Ku(t)&&(et=wu.shadowRoot(t)))for(var it of Array.from(wu.childNodes(et))){var rt=Kh(it,Y);rt&&(Xu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=wu.parentNode(t);if(nt&&Yu(nt)&&Xu(nt)&&(Q.isShadow=!0),Q.type===uu.Element&&"iframe"===Q.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 a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),Uh(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?Uh(t,"load",a):(o=!0,Uh(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",a),()=>{clearTimeout(c),Uh(t,"load",a)}}return t.addEventListener("load",a),()=>{Uh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var i=Kh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,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:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z});i&&E(t,i)}}),R);null==P||P(t,st)}return Q.type===uu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Wh.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(A){var e=Kh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,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:E,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:z});e&&A(t,e)}})()}finally{Wh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),Wh.set(e,v)}}}(t,0,O),Q}function Yh(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}class Xh{constructor(){iu(this,"parentElement",null),iu(this,"parentNode",null),iu(this,"ownerDocument"),iu(this,"firstChild",null),iu(this,"lastChild",null),iu(this,"previousSibling",null),iu(this,"nextSibling",null),iu(this,"ELEMENT_NODE",1),iu(this,"TEXT_NODE",3),iu(this,"nodeType"),iu(this,"nodeName"),iu(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Xh))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.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 td(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>ed(i,t,e,r)}function ed(t,e,i,r){id((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function id(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var rd="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.",nd={map:{},getId(){return console.error(rd),-1},getNode(){return console.error(rd),null},removeNodeFromMap(){console.error(rd)},has(){return console.error(rd),!1},reset(){console.error(rd)}};function sd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];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,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function ad(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)}}}),()=>ad(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(nd=new Proxy(nd,{get(t,e,i){return"map"===e&&console.error(rd),Reflect.get(t,e,i)}}));var od=Date.now;function ld(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=wu.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?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=wu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function ud(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function hd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function dd(t){return t?t.nodeType===t.ELEMENT_NODE?t:wu.parentElement(t):null}function vd(t,e,i,r){if(!t)return!1;var n=dd(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(Hh(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)||e.getId(t)===Ah}function fd(t,e){if(Yu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=wu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||fd(r,e))}function pd(t){return Boolean(t.changedTouches)}function gd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function md(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function yd(t){return!!t&&(t instanceof Xh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(wu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(od=()=>(new Date).getTime());class bd{constructor(){iu(this,"id",1),iu(this,"styleIDMap",new WeakMap),iu(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 _d(t){var e,i=null;return"getRootNode"in t&&(null==(e=wu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&wu.host(wu.getRootNode(t))&&(i=wu.host(wu.getRootNode(t))),i}function wd(t){var e=t.ownerDocument;return!!e&&(wu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=_d(i);)i=e;return i}(t);return wu.contains(e,i)}(t))}function kd(t){return"__ln"in t}class Sd{constructor(){iu(this,"length",0),iu(this,"head",null),iu(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&&kd(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&&kd(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--)}}var xd,Cd=(t,e)=>t+"@"+e;class Td{constructor(){iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"texts",[]),iu(this,"attributes",[]),iu(this,"attributeMap",new WeakMap),iu(this,"generatedAttributes",new WeakMap),iu(this,"removes",[]),iu(this,"mapRemoves",[]),iu(this,"movedMap",{}),iu(this,"addedSet",new Set),iu(this,"movedSet",new Set),iu(this,"droppedSet",new Set),iu(this,"removesSubTreeCache",new Set),iu(this,"mutationCb"),iu(this,"blockClass"),iu(this,"blockSelector"),iu(this,"maskTextClass"),iu(this,"maskTextSelector"),iu(this,"inlineStylesheet"),iu(this,"maskInputOptions"),iu(this,"maskTextFn"),iu(this,"maskInputFn"),iu(this,"maskAllElementAttributes"),iu(this,"maskAttributeFn"),iu(this,"keepIframeSrcFn"),iu(this,"recordCanvas"),iu(this,"canvasMaskingConfigured"),iu(this,"inlineImages"),iu(this,"slimDOMOptions"),iu(this,"dataURLOptions"),iu(this,"doc"),iu(this,"mirror"),iu(this,"iframeManager"),iu(this,"stylesheetManager"),iu(this,"shadowDomManager"),iu(this,"canvasManager"),iu(this,"processedNodeManager"),iu(this,"unattachedDoc"),iu(this,"canvasManagerReleased",!1),iu(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),iu(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=Su(),r=Mu();try{this.processBufferedMutations()}finally{t=Su()-i,e=r,Iu>0||Eu(t,null!=e?e:xu)||t>Nu.slowestBatchMs&&(Nu.slowestBatchMs=t)}}})),iu(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new Sd,r=t=>{for(var e=t,i=Ah;i===Ah;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=wu.parentNode(n);if(s&&wd(n)&&"TEXTAREA"!==s.tagName){var a=Yu(s)?this.mirror.getId(_d(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=Kh(n,{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=>{gd(t,this.mirror)&&this.iframeManager.addIframe(t),md(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),yd(t)&&!vd(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(wu.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)}});l&&(t.push({parentId:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ed(this.removesSubTreeCache,s)&&!this.movedSet.has(wu.parentNode(s))||n(s);for(var a of this.addedSet)Id(this.droppedSet,a)||Ed(this.removesSubTreeCache,a)?Id(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(wu.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(wu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=wu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=wu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=wu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e,i=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof i.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);i.style.length>r.length&&(r+n).split("var(").length===i.style.split("var(").length&&(i.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(i)){var a=s[0],o=s[1];"string"!=typeof o&&null!==o||(i[a]=ph({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}return{id:this.mirror.getId(t.node),attributes:i}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};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={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)})),iu(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),iu(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(wu.childNodes(t),(t=>wu.textContent(t)||"")).join("");e.attributes.value=vh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:mh(t),value:i,maskInputFn:this.maskInputFn})})),iu(this,"processMutation",(t=>{var e;if(!cd(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=wu.textContent(t.target);vd(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:zh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,dd(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r: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}(n,s,a),l=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var u=n,h=mh(u);l=vh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(vd(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===o;if(v&&!this.keepIframeSrcFn(l)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Bh(n.tagName,o)){var c=jh(this.doc,ch(n.tagName),ch(o),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(o="rr_src"),d.attributes[o]=c,null==(e=this.generatedAttributes.get(t.target))||e.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=n.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)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(d.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.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(vd(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=Yu(t.target)?this.mirror.getId(wu.host(t.target)):this.mirror.getId(t.target);vd(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)?(Md(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||fd(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Cd(i,r)]?Md(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Yu(t.target)||!Xu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),wu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),iu(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[Cd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);vd(t,this.blockClass,this.blockSelector,!1)||(wu.childNodes(t).forEach((t=>this.genAdds(t))),yd(t)&&wu.childNodes(wu.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Md(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),wu.childNodes(r).forEach((t=>i.push(t)))}}function Ed(t,e,i){return 0!==t.size&&function(t,e,i){var r=wu.parentNode(e);return!!r&&t.has(r)}(t,e)}function Id(t,e){if(0===t.size)return!1;for(var i=wu.parentNode(e);i;){if(t.has(i))return!0;i=wu.parentNode(i)}return!1}var Rd=function(t,e){return void 0===e&&(e="rrweb"),xd?function(){try{return t(...arguments)}catch(t){if(xd&&!0===xd(t,e))return;throw t}}:t},Pd=[];function Ad(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 Fd(t,e){var i,r=new Td;r.init(t);try{i=new(bu())(Rd(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),Pd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Od(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=Ad(t);if(a&&!vd(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=ld(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[td("scroll",Rd(sd(Rd((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(td("scrollend",Rd(l),i)),()=>u.forEach((t=>t()))}function Ld(t,e){for(var i=Pd.length-1;i>=0;i--){var r=Pd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Pd.splice(i,1))}}}var Dd=["INPUT","TEXTAREA","SELECT"],$d=new WeakMap;function Nd(t){return function t(e,i){if(zd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||zd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||zd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||zd("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 qd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var jd=5e3;function Bd(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:wu.host(e));var o="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Rd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Hd(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=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),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...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 s,a,o,l,u,h,d,v,c=[],f=Rd((()=>{if(r){r.destroy(),r.reset();var e=Pd.indexOf(r);-1!==e&&Pd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Fd(t,t.doc);i=g.observer,r=g.buffer}if(c.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=sd(Rd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Rd(sd(Rd((t=>{var e=Ad(t),i=pd(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=od()),l.push({x:r,y:a,id:n.getId(e),timeOffset:od()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?nu.Drag:t instanceof MouseEvent?nu.MouseMove:nu.TouchMove)})),a,{trailing:!1})),d=[td("mousemove",h,r),td("touchmove",h,r),td("drag",h,r)];return Rd((()=>{d.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],u=null;return Object.keys(su).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=ch(t),o=(t=>i=>{var a=Ad(i);if(!vd(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=au.Mouse;break;case"touch":o=au.Touch;break;case"pen":o=au.Pen}o===au.Touch&&(su[t]===su.MouseDown?l="TouchStart":su[t]===su.MouseUp&&(l="TouchEnd"))}else pd(i)&&(o=au.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===au.Touch||l.startsWith("Mouse")&&o===au.Mouse)&&(o=null)):su[t]===su.Click&&(o=u,u=null);var h=pd(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Rd(e)(p({type:su[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(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}l.push(td(a,o,i))})),Rd((()=>{l.forEach((t=>t()))}))}(t)),c.push(Od(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return td("resize",Rd(sd(Rd((()=>{var t=ud(),e=hd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n})),c.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=Ad(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=wu.parentElement(e)),e&&c&&Dd.indexOf(c)>=0&&!vd(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=mh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=vh({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:u})),v(e,h?{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;v(t,h?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function v(t,i){var n=$d.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){$d.set(t,i);var s=r.getId(t);Rd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>td(t,Rd(d),i))),f=i.defaultView;if(!f)return()=>{c.forEach((t=>t()))};var g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&c.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map((t=>ad(t[0],t[1],{set(){Rd(d)({target:this,isTrusted:!1})}},!1,f)))),Rd((()=>{c.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Rd((t=>sd(Rd((s=>{var a=Ad(s);if(a&&!vd(a,i,r,!0)){var o=a.currentTime,l=a.volume,u=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[td("play",o(lu.Play),a),td("pause",o(lu.Pause),a),td("seeked",o(lu.Seeked),a),td("volumechange",o(lu.VolumeChange),a),td("ratechange",o(lu.RateChange),a)];return Rd((()=>{l.forEach((t=>t()))}))}(t)),t.recordDOM){var m=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.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(a,o,l){if(!r)return()=>{};var u=e.get(a);u||e.set(a,u=[]);var h={emit:o,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(a))};try{d=t.setTimeout(f,jd),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(a)))}},reset(){r=!1,i.forEach((e=>t.clearTimeout(e))),i.clear(),e.clear()}}}(n);c.push(m.reset),c.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Rd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=qd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:o,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:Rd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=qd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:o}]}))),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:Rd(((t,e,s)=>{var o=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=qd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=a.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:o})),(()=>{var t=rh(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:Rd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=qd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};Ud("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Ud("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Ud("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Ud("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:Rd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=qd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Nd(e),l];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:o,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Rd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=qd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Nd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Rd((()=>{s.CSSStyleSheet.prototype.insertRule=o,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:n,mutationQueue:m})),c.push(Bd(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,l=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Rd(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2],v=t.apply(e,a);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=qd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Nd(e.parentRule);o.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Rd(((t,e,a)=>{var l,u=a[0],h=t.apply(e,a);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=qd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Nd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Rd((()=>{a.CSSStyleDeclaration.prototype.setProperty=l,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&c.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(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 o=_u(i.fonts,"add",(function(t){return function(i){return setTimeout(Rd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),Rd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=Rd((()=>{var t=a.getSelection();if(!(!t||d&&(null==t?void 0:t.isCollapsed))){d=t.isCollapsed||!1;for(var e=[],i=t.rangeCount||0,r=0;i>r;r++){var n=t.getRangeAt(r),s=n.startContainer,v=n.startOffset,c=n.endContainer,f=n.endOffset;vd(s,l,u,!0)||vd(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),td("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?_u(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))c.push(y.observer(y.callback,n,y.options))}catch(t){try{f()}catch(t){}throw t}return f}function zd(t){return void 0!==window[t]}function Ud(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Wd{constructor(t){iu(this,"iframeRemoteIdToLocalIdMap",new WeakMap),iu(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),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}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}}class Vd{constructor(t){iu(this,"iframes",new WeakMap),iu(this,"crossOriginIframeMap",new WeakMap),iu(this,"crossOriginIframeMirror",new Wd(Fh)),iu(this,"crossOriginIframeStyleMirror"),iu(this,"crossOriginIframeRootIdMap",new WeakMap),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"wrappedEmit"),iu(this,"loadListener"),iu(this,"pageHideListener"),iu(this,"stylesheetManager"),iu(this,"recordCrossOriginIframes"),iu(this,"messageHandler"),iu(this,"nestedIframeListeners",new Map),iu(this,"attachedWindows",new WeakMap),iu(this,"attachedDocuments",new WeakMap),iu(this,"attachedIframes",new Map),iu(this,"loadListenerDisposers",new WeakMap),iu(this,"iframeElementsById",new Map),iu(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Wd(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.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=>id(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{ed(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 a=this.handleMessage.bind(this);id((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}id((()=>{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)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||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){var i;switch(e.type){case ru.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:ru.IncrementalSnapshot,data:{source:nu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ru.Meta:case ru.Load:case ru.DomContentLoaded:return!1;case ru.Plugin:return e;case ru.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ru.IncrementalSnapshot:switch(e.data.source){case nu.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 nu.Drag:case nu.TouchMove:case nu.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case nu.ViewportResize:return!1;case nu.MediaInteraction:case nu.MouseInteraction:case nu.Scroll:case nu.CanvasMutation:case nu.Input:return this.replaceIds(e.data,t,["id"]),e;case nu.StyleSheetRule:case nu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case nu.Font:return e;case nu.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case nu.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.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===uu.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&&(ed(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(ed(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=>{id((()=>this.mirror.removeNodeFromMap(t)))})),id((()=>Ld(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&&ed(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{ed(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}}class Gd{constructor(t){iu(this,"shadowDoms",new WeakSet),iu(this,"mutationCb"),iu(this,"scrollCb"),iu(this,"bypassOptions"),iu(this,"mirror"),iu(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(Xu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=wu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Fd(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=Pd.indexOf(o);-1!==t&&Pd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:Od(p({},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(wu.host(t))),this.restoreHandlers.push({doc:n,handler:Bd({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:_u(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=wu.shadowRoot(this);return s&&wd(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}}var Zd="skip-frame";function Qd(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 Jd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Yd=0;64>Yd;Yd++)Kd[Jd.charCodeAt(Yd)]=Yd;var Xd=new Map,tv=(t,e,i)=>{if(t&&(rv(t,e)||"object"==typeof t)){var r=function(t,e){var i=Xd.get(t);return i||Xd.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 ev(t,e,i,r){if(t instanceof Array)return t.map((t=>ev(t,e,i,r)));if(null===t)return t;if(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)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Jd[i[e]>>2],n+=Jd[(3&i[e])<<4|i[e+1]>>4],n+=Jd[(15&i[e+1])<<2|i[e+2]>>6],n+=Jd[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}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[ev(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:[ev(t.data,e,i,r),t.width,t.height]}:rv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:tv(t,e,i)}:t}var iv=(t,e,i,r)=>t.map((t=>ev(t,e,i,r))),rv=(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])))},nv=["webgl","webgl2"];function sv(t){return"nodeType"in t}function av(t,e,i,r){var n=[];try{if(r){var s=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return _u(r.prototype,"configure",(function(r){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||sv(s)&&vd(s,e,i,!0))return r.call(this,n);sv(s)&&!("__context"in s)&&(s.__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&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,i);s&&n.push(s)}var a=_u(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!vd(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&nv.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function ov(t,e,i,r,n,s,a){var o=[],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=_u(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(tv(d,s,this),this.canvas&&"tagName"in this.canvas&&!vd(this.canvas,r,n,!0)){var v=iv(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=ad(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!vd(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var lv,uv,hv,dv='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',vv="undefined"!=typeof self&&self.Blob&&new Blob([dv],{type:"text/javascript;charset=utf-8"});function cv(t){var e;try{if(!(e=vv&&(self.URL||self.webkitURL).createObjectURL(vv)))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(dv),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class fv{constructor(t){iu(this,"pendingCanvasMutations",new Map),iu(this,"rafStamps",{latestId:0,invokeId:null}),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"resetObservers"),iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"rafIdTimestamp",null),iu(this,"rafIdFlush",null),iu(this,"refCount",0),iu(this,"torndown",!1),iu(this,"resetFrameDedup",null),iu(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,a=t.recordCanvas,o=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,o),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:o,resolutionScale:l,canvasMasking:u})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||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}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,o="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=av(e,i,r,!0),u=new Map;try{a=new cv}catch(t){return}var h=!1;a.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(u.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:ou["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 d,v=1e3/t,c=0,p=t=>{var l,g;h||(c&&v>t-c||(c=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{vd(t,i,r,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=f((function*(t){var e,i,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var l=t.getContext(t.__context);if(null==(e=null==l?void 0:l.isContextLost)?void 0:e.call(l))return void u.set(r,!1);!1===(null==(i=null==l?void 0:l.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var h=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(h*o)),c=Math.max(1,Math.round(d*o)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Zd}if(void 0!==a){if(!Array.isArray(a)||!a.every(Qd))return Zd;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===Zd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>o?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:h,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=av(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=_u(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return vd(this.canvas,i,r,!0)||setTimeout((()=>{var i=iv(l,e,this,n);t(this.canvas,{type:ou["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ad(e.CanvasRenderingContext2D.prototype,a,{set(e){vd(this.canvas,i,r,!0)||t(this.canvas,{type:ou["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...ov(e.WebGLRenderingContext.prototype,ou.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ov(e.WebGL2RenderingContext.prototype,ou.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}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(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var r=i.map((t=>g(t,tu)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class pv{constructor(t){var e;iu(this,"trackedLinkElements",new WeakSet),iu(this,"pendingDeferredSheets",new Set),iu(this,"mutationCb"),iu(this,"adoptedStyleSheetCb"),iu(this,"maskAllElementAttributes"),iu(this,"maskAttributeFn"),iu(this,"styleMirror",new bd),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=hh(r))}catch(t){}if(!i||!r)return Qu(),null;var n=i,s=!1,a={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:i=>{if(o)return!0;var l,u,h=Su(),d=Mu(),v=!0;try{if(s)return o=!0,Qu(),!0;if(!n.advance(i))return v=!1,!1;o=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Qu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Qu(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Eu(l=Su()-h,null!=(u=d)?u:xu)||(qu.totalMs+=l,l>qu.slowestSliceMs&&(qu.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}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))||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 a=Su();try{Vu((()=>{try{var e=t.rules||t.cssRules;e&&Wu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:nh(e,t.href),index:i})))})}))}finally{Gu(Su()-a)}}r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Wh.forEach((t=>t.abort())),Wh.clear()}trackStylesheetInLinkElement(t){}}class gv{constructor(){iu(this,"nodeMap",new WeakMap),iu(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(){}}var mv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var yv=document.createElement("iframe");document.body.appendChild(yv),Array.from=(null==(Xl=yv.contentWindow)?void 0:Xl.Array.from)||Array.from,document.body.removeChild(yv)}}catch(t){console.debug("Unable to override Array.from",t)}var bv=new dh,_v=new Set([nu.Mutation,nu.MediaInteraction,nu.StyleSheetRule,nu.CanvasMutation,nu.Font,nu.Log,nu.StyleDeclaration,nu.AdoptedStyleSheet]);function wv(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.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function kv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,a=i.blockClass,o=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,h=i.ignoreClass,d=void 0===h?"rr-ignore":h,v=i.ignoreSelector,c=void 0===v?null:v,f=i.maskTextClass,g=void 0===f?"rr-mask":f,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,E=void 0!==M&&M,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,F=void 0===A?{}:A,O=i.dataURLOptions,L=void 0===O?{}:O,D=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,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,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;xd=i.errorHandler;var at=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),ot=!W||window.parent===window,lt=!1;if(!ot)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(ot&&!r)throw new Error("emit function is required");if(!ot&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),bv.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=Yh(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 P&&!lt&&(t=P(t)),t};lv=(t,e)=>{var i,a=t;if(a.timestamp=od(),!(null==(i=Pd[0])?void 0:i.isFrozen())||a.type===ru.FullSnapshot||a.type===ru.IncrementalSnapshot&&_v.has(a.data.source)||Pd.forEach((t=>t.unfreeze())),ot)null==r||r(gt(a),e);else if(lt){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===ru.FullSnapshot)ut=a,ft=0;else if(a.type===ru.IncrementalSnapshot){if(a.data.source===nu.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&uv(!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 n=bv.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}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()}lv({type:ru.IncrementalSnapshot,data:p({source:nu.Mutation},t)})},yt=t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.Scroll},t)}),bt=t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.CanvasMutation},t)}),_t=new pv({mutationCb:mt,adoptedStyleSheetCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.AdoptedStyleSheet},t)}),maskAllElementAttributes:E,maskAttributeFn:I}),wt=new Vd({mirror:bv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:lv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:bv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new gv,xt=null==N?void 0:N.configured;hv=new fv({recordCanvas:z,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:bv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Gd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:hv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:bv});uv=function(t){if(void 0===t&&(t=!1),B){Bu(w);try{lv({type:ru.Meta,data:{href:window.location.href,width:hd(),height:ud()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Pd.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new dh:r,s=i.blockClass,a=void 0===s?"rr-block":s,o=i.blockSelector,l=void 0===o?null:o,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,E=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,N=void 0===D?()=>!1:D,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=Yh(void 0!==M&&M);Bu(j);try{return Kh(t,{doc:t,mirror:n,blockClass:a,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:E,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Hu()}}(document,{mirror:bv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,slimDOM:dt,dataURLOptions:at,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){gd(t,bv)&&wt.addIframe(t),md(t,bv)&&_t.trackLinkElement(t),yd(t)&&Ct.addShadowRoot(wu.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=Lu,Lu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(lv({type:ru.FullSnapshot,data:{node:r,initialOffset:ld(window)}},t),Pd.forEach((t=>t.unlock())),hv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&id((()=>{a=e.beginDeferredLinkInlining(i,bv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;id((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!r){var e=0;do{try{a||l(),u()}catch(t){null==a||a.discard(),a=null,Ju(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=wv(h):i())}};return n=wv(h),{cancel(){r=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||l();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{u()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var v=h+(null!==a?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Ju(v),null==a||a.discard(),a=null}i()}}}}(i,_t,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,bv.getId(document))}finally{Hu()}var s}};try{var Tt=[];for(var Mt of(Tt.push(td("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(td(Mt,Tu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{id(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=bv.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 Et=t=>{var e;return Rd(Hd)({mutationCb:mt,mousemoveCb:(t,e)=>lv({type:ru.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.ViewportResize},t)}),inputCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.Input},t)}),mediaInteractionCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.MediaInteraction},t)}),styleSheetRuleCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.StyleSheetRule},t)}),styleDeclarationCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>lv({type:ru.IncrementalSnapshot,data:p({source:nu.Font},t)}),selectionCb(t){lv({type:ru.IncrementalSnapshot,data:p({source:nu.Selection},t)})},customElementCb(t){lv({type:ru.IncrementalSnapshot,data:p({source:nu.CustomElement},t)})},blockClass:o,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:bv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:hv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>lv({type:ru.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=bv.getId(t),i=Et(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=bv.getId(t);null==vt||vt(e),Ld(t)}));var It=-1,Rt=t=>lv({type:ru.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Pt=()=>{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,a=s?bv.getId(s):-1;a!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{uv();var t=Et(document);"function"==typeof t&&Tt.push(t),Tt.push(td("fullscreenchange",Pt)),Tt.push(td("webkitfullscreenchange",Pt)),Tt.push(td("mozfullscreenchange",Pt)),Tt.push(td("MSFullscreenChange",Pt)),mv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(td("DOMContentLoaded",(()=>{lv({type:ru.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(td("load",(()=>{lv({type:ru.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>id(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),bv.reset(),mv=!1,xd=void 0}}catch(t){console.warn(t)}}kv.addCustomEvent=(t,e)=>{if(!mv)throw new Error("please add custom event after start recording");lv({type:ru.Custom,data:{tag:t,payload:e}})},kv.freezePage=()=>{Pd.forEach((t=>t.freeze()))},kv.takeFullSnapshot=t=>{if(!mv)throw new Error("please take full snapshot after start recording");uv(t)},kv.mirror=bv;var Sv=Object.defineProperty,xv=(t,e,i)=>((t,e,i)=>e in t?Sv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Cv{constructor(t){xv(this,"fileName"),xv(this,"functionName"),xv(this,"lineNumber"),xv(this,"columnNumber"),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}}var Tv=/(^|@)\S+:\d+/,Mv=/^\s*at .*(\S+:\d+|\(native\))/m,Ev=/^(eval@)?(\[native code])?$/,Iv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Mv)?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(Mv)}),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()),s=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Cv({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Ev)}),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 Cv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Cv({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 a=e.exec(i[n]);a&&r.push(new Cv({fileName:a[2],lineNumber:parseFloat(a[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 a=e.exec(i[n]);a&&r.push(new Cv({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Tv)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Cv({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Rv(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 a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Pv(t){return Array.isArray(t)}function Av(t){return"object"==typeof t&&null!==t&&!Pv(t)}function Fv(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Av(t[r])&&Fv(t[r],e-1))return!0;return!1}function Ov(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(Av(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||Av(a)&&Fv(a,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 a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=Pv(u)?Rv(u.length?u[0]:null):u}return o}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 Lv={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 Dv(t,e,i){var r,n=i?Object.assign({},Lv,i):Lv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=Iv.parse(e.error).map((t=>t.toString())),s=[Ov(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[Ov("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Ov("Uncaught (in promise)",n.stringifyOptions),Ov(e.reason,n.stringifyOptions)]);var s=Iv.parse(i).map((t=>t.toString()));t({level:"error",trace:s,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,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(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]||o)){o=!0;try{var h=Iv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>Ov(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Ov("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)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===d)return void(r.next=h.next);r=t(i=r.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var $v=t=>({name:"rrweb/console@1",observer:Dv,options:t}),Nv=t=>"undefined"!=typeof Document&&t instanceof Document,qv=()=>{},jv=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Bv(t,e,i){try{if(!(e in t))return qv;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 Z(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=jv(i);s;){if(s.next===n)return void(s.next=r.next);s=jv(i=s.next)}else t[e]=r.next}}catch(t){return qv}}function Hv(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 zv=Gi("[Recorder]"),Uv=t=>"navigation"===t.entryType,Wv=t=>"resource"===t.entryType;function Vv(t,e){return!!e&&(nt(e)||e[t])}function Gv(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 Zv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Qv(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:!!Gv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Zv))return!1;if(nt(i))return!0;if(G(i))return n(i);var s=i[e];return nt(s)?s:n(s)}function Jv(t,e,i,r,n,s){return Kv.apply(this,arguments)}function Kv(){return Kv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return zv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(Wv(a=t[s])&&a.initiatorType===e&&(K(r)||a.startTime>=r)&&(K(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),Jv(t,e,i,r,n,s+1))})),Kv.apply(this,arguments)}function Yv(t){var e=t.body,i=t.options,r=t.url;if(et(e))return null;var n=Hv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Y(e))return e;if(Nv(e))return e.textContent;if(st(e))return lr(e);if(Q(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 Xv=t=>!tt(t)&&("navigation"===t.entryType||"resource"===t.entryType);function tc(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,u=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[p({},e?e.toJSON():{name:l},{startTime:K(a)?void 0:Math.round(a),endTime:K(o)?void 0:Math.round(o),timeOrigin:h,timestamp:d,method:i,initiatorType:u||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Xv(e))for(var c of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:c.name,duration:c.duration,entryType:"serverTiming"});return v}var ec=["video/","audio/"];function ic(t){return Q(t)&&Z(t.getReader)&&Z(t.tee)}var rc=500,nc="[SessionReplay] Timeout while trying to read body",sc="[SessionReplay] Failed to read body";function ac(t){return sc+": "+t}function oc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function lc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(nc)),rc);try{t.clone().text().then((t=>e(t)),(t=>e(ac(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(sc)}}))}(t);var i=un(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(oc(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(nc)),rc);try{o=t.clone()}catch(t){return void a(sc)}var u=o.body;if(ic(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(sc)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((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(o){if(d+o.byteLength>e)return void a(oc(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(ac(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(ac(t))))}catch(t){a(sc)}}))}(t,i)}function uc(){return uc=f((function*(t){var e=t.r,i=t.options,r=Hv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):lc(e,i)})),uc.apply(this,arguments)}function hc(){return hc=f((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(),a=ec.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Hv(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return tt(r)?lc(e,i):Promise.resolve(r)})),hc.apply(this,arguments)}var dc=null;function vc(t,e,i){if(!("performance"in e))return()=>{};if(dc)return zv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},hn,i):hn,n=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&yn.has(t))(s)),s&&i.push(s)}})),i.length>0&&t(p({},e,{requests:i}))},s=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>Uv(t)||Wv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>tc({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>Uv(t)||Wv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>tc({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,r),a=()=>{},o=()=>{};return(r.recordHeaders||r.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Vv("request",i.recordHeaders),n=Vv("response",i.recordHeaders),s=Bv(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),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=>(Qv({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=Yv({body:t,options:i,url:o})),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),Qv({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=Yv({body:d.response,options:i,url:o})),Jv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=tc({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){zv.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(n,e,r),o=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Vv("request",i.recordHeaders),n=Vv("response",i.recordHeaders),s=Bv(e,"fetch",(s=>function(){var a=f((function*(a,o){var l,u;try{l=new Request(a,o)}catch(t){return zv.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!ic(null==o?void 0:o.body)&&Qv({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return uc.apply(this,arguments)}({r:l,options:i,url:a}))}catch(t){zv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Gv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),Qv({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return hc.apply(this,arguments)}({r:u,options:i,url:a})),u}finally{Jv(e,"fetch",l.url,h,d).then((e=>{var i,r=tc({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),dc=()=>{s(),a(),o(),dc=null}}var cc=t=>({name:"rrweb/network@1",observer:vc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:$v,getRecordNetworkPlugin:cc},v.__PosthogExtensions__.rrweb={record:kv,version:"v2",wasMaxDepthReached:()=>Jh,resetMaxDepthState(){Jh=!1,Qh=!1},getLastSnapshotCost:()=>Fu,getMutationCost:()=>p({},Nu),resetSnapshotCostState(){Iu=0,Ru=0,Pu=0,xu=0,Au=ku(),Fu=null,Ou=null,Lu=[],Du=0,$u=0,Nu={slowestBatchMs:0},qu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:kv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:$v},v.getRecordNetworkPlugin=cc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Yl(t,e);var fc,pc,gc,mc,yc,bc,_c,wc,kc,Sc,xc,Cc,Tc,Mc,Ec,Ic={},Rc=[],Pc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ac=Array.isArray;function Fc(t,e){for(var i in e)t[i]=e[i];return t}function Oc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lc(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?fc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Dc(t,a,r,n,null)}function Dc(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?++gc:n,__i:-1,__u:0};return null==n&&null!=pc.vnode&&pc.vnode(s),s}function $c(t){return t.children}function Nc(t,e){this.props=t,this.context=e}function qc(t,e){if(null==e)return t.__?qc(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?qc(t):null}function jc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Fc({},e);s.__v=e.__v+1,pc.vnode&&pc.vnode(s),Jc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?qc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Yc(r,s,n),e.__e=e.__=null,s.__e!=i&&Bc(s)}}function Bc(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})),Bc(t)}function Hc(t){(!t.__d&&(t.__d=!0)&&mc.push(t)&&!zc.__r++||yc!=pc.debounceRendering)&&((yc=pc.debounceRendering)||bc)(zc)}function zc(){try{for(var t,e=1;mc.length;)mc.length>e&&mc.sort(_c),t=mc.shift(),e=mc.length,jc(t)}finally{mc.length=zc.__r=0}}function Uc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Rc,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Dc(null,a,null,null,null):Ac(a)?a=t.__k[s]=Dc($c,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Dc(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=Vc(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=qc(o)),ef(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Ic,c.__i=d,g=Jc(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&tf(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=Wc(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 Wc(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=Wc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=qc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Vc(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==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[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function Gc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Pc.test(e)?i:i+"px"}function Zc(t,e,i,r,n){var s,a;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||Gc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Gc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(xc,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Sc]=r[Sc]:(i[Sc]=Cc,t.addEventListener(e,s?Mc:Tc,s)):t.removeEventListener(e,s?Mc:Tc,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 Qc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[kc])e[kc]=Cc++;else if(i[Sc]>e[kc])return;return i(pc.event?pc.event(e):e)}}}function Jc(t,e,i,r,n,s,a,o,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=[o=e.__e=i.__e]),(h=pc.__b)&&h(e);t:if("function"==typeof C){d=a.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 Nc(y,_),v.constructor=C,v.render=rf),$&&$.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=Fc({},v.__s)),Fc(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)})),Rc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.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=pc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Rc.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=Fc(Fc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===$c&&null==h.key?Xc(h.props.children):h,o=Uc(t,Ac(S)?S:[S],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(x=s.length;x--;)Oc(s[x]);Kc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Kc(e);pc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||Ic,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),o&&(pc.__m&&pc.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&fc.call(t.childNodes),!o&&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||Zc(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:o&&"function"!=typeof c||g[u]===c||Zc(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Uc("template"==e.type?t.content:t,Ac(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&qc(i,0),o,l),null!=s)for(u=s.length;u--;)Oc(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Zc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Zc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=pc.diffed)&&h(e),128&e.__u?void 0:o}function Kc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Kc))}function Yc(t,e,i){for(var r=0;i.length>r;r++)tf(i[r],i[++r],i[++r]);pc.__c&&pc.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){pc.__e(t,e.__v)}}))}function Xc(t){return"object"!=typeof t||null==t||t.__b>0?t:Ac(t)?t.map(Xc):void 0!==t.constructor?null:Fc({},t)}function tf(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){pc.__e(t,i)}}function ef(t,e,i){var r,n;if(pc.unmount&&pc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||tf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){pc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&ef(r[n],e,i||"function"!=typeof t.type);i||Oc(t.__e),t.__c=t.__=t.__e=void 0}function rf(t,e,i){return this.constructor(t,i)}function nf(t,e,i){var r,n,s;e==document&&(e=document.documentElement),pc.__&&pc.__(t,e),r=e.__k,n=[],s=[],Jc(e,t=e.__k=Lc($c,null,[t]),r||Ic,Ic,e.namespaceURI,r?null:e.firstChild?fc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),Yc(n,t,s),t.props.children=null}fc=Rc.slice,pc={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},gc=0,Nc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Fc({},this.state),"function"==typeof t&&(t=t(Fc({},i),this.props)),t&&Fc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Hc(this))},Nc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Hc(this))},Nc.prototype.render=$c,mc=[],bc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_c=function(t,e){return t.__v.__b-e.__v.__b},zc.__r=0,wc=Math.random().toString(8),kc="__d"+wc,Sc="__a"+wc,xc=/(PointerCapture)$|Capture$/i,Cc=0,Tc=Qc(!1),Mc=Qc(!0),Ec=0;var sf,af,of,lf,uf=0,hf=[],df=pc,vf=df.__b,cf=df.__r,ff=df.diffed,pf=df.__c,gf=df.unmount,mf=df.__;function yf(t,e){df.__h&&df.__h(af,t,uf||e),uf=0;var i=af.__H||(af.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function bf(t){return uf=1,function(t,e,i){var r=yf(sf++,2);if(r.t=t,!r.__c&&(r.__=[Rf(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=af,!af.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};af.__f=!0;var s=af.shouldComponentUpdate,a=af.componentWillUpdate;af.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},af.shouldComponentUpdate=n}return r.__N||r.__}(Rf,t)}function _f(t,e){var i=yf(sf++,3);!df.__s&&If(i.__H,e)&&(i.__=t,i.u=e,af.__H.__h.push(i))}function wf(t){return uf=5,kf((function(){return{current:t}}),[])}function kf(t,e){var i=yf(sf++,7);return If(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Sf(t){var e=af.context[t.__c],i=yf(sf++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(af)),e.props.value):t.__}function xf(){for(var t;t=hf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Mf),e.__h.some(Ef),e.__h=[]}catch(i){e.__h=[],df.__e(i,t.__v)}}}df.__b=function(t){af=null,vf&&vf(t)},df.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),mf&&mf(t,e)},df.__r=function(t){cf&&cf(t),sf=0;var e=(af=t.__c).__H;e&&(of===af?(e.__h=[],af.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&xf(),sf=0)),of=af},df.diffed=function(t){ff&&ff(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==hf.push(e)&&lf===df.requestAnimationFrame||((lf=df.requestAnimationFrame)||Tf)(xf)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),of=af=null},df.__c=function(t,e){e.some((function(t){try{t.__h.some(Mf),t.__h=t.__h.filter((function(t){return!t.__||Ef(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],df.__e(i,t.__v)}})),pf&&pf(t,e)},df.unmount=function(t){gf&&gf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{Mf(t)}catch(t){e=t}})),i.__H=void 0,e&&df.__e(e,i.__v))};var Cf="function"==typeof requestAnimationFrame;function Tf(t){var e,i=function(){clearTimeout(r),Cf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Cf&&(e=requestAnimationFrame(i))}function Mf(t){var e=af,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),af=e}function Ef(t){var e=af;t.__c=t.__(),af=e}function If(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Rf(t,e){return"function"==typeof e?e(t):e}function Pf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Z(i.then)&&i.then(void 0,(()=>{}))}}}}var Af="gzip-js",Ff="base64",Of="events",Lf="cancelEvents",Df={Tab:"tab",Selector:"selector"},$f={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Nf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},qf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},jf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Bf={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Hf="always",zf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Uf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Wf="popover",Vf=Gi("[Surveys]");function Gf(t){return!(!t.start_date||t.end_date)}function Zf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Qf="seenSurvey_",Jf="inProgressSurvey_",Kf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Yf=t=>Kf(Qf,t),Xf=t=>{try{var e=Yf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Vf.error("Failed to persist survey seen state",t)}},tp=[qf.Popover,qf.Widget,qf.API],ep={ignoreConditions:!1,ignoreDelay:!1,displayType:Wf},ip="featureFlags",rp="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return it(t)&&isFinite(t)&&Math.floor(t)===t});class np{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new np(n)}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 np(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}}class sp{generate(){var t=this.generateOrAbort();if(!K(t))return t;this.Yr=0;var e=this.generateOrAbort();if(K(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Yr)this.Yr=t,this.Kr();else{if(this.Yr>=t+1e4)return;this.Xr++,this.Xr>4398046511103&&(this.Yr++,this.Kr())}return np.fromFieldsV7(this.Yr,Math.trunc(this.Xr/Math.pow(2,30)),this.Xr&Math.pow(2,30)-1,this.ei.nextUint32())}Kr(){this.Xr=1024*this.ei.nextUint32()+(1023&this.ei.nextUint32())}constructor(){this.Yr=0,this.Xr=0,this.ei=new lp}}var ap,op=t=>{if("undefined"!=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};t&&!K(t.crypto)&&crypto.getRandomValues&&(op=t=>crypto.getRandomValues(t));class lp{nextUint32(){return this.Dt.length>this.ti||(op(this.Dt),this.ti=0),this.Dt[this.ti++]}constructor(){this.Dt=new Uint32Array(8),this.ti=1/0}}var up=()=>hp().toString(),hp=()=>(ap||(ap=new sp)).generate(),dp="",vp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var cp=null,fp={ri(){if(!tt(cp))return cp;if(cp=!1,r)try{var t="__ph_cookie_support_"+up();fp.ii(t,"xyz"),cp='"xyz"'===qo(t),fp.ai(t)}catch(t){cp=!1}return cp},oi(t){Vi.error("cookieStore error: "+t)},ni:qo,si(t){var e;try{e=JSON.parse(fp.ni(t))||{}}catch(t){}return e},ii(t,e,i,n,s){if(!r)return!1;try{var a="",o="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),dp)return dp;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),n=Math.min(i.length,8),s="dmn_chk_"+up();!dp&&n--;){var a=i.slice(n).join("."),o=s+"=1;domain=."+a+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",dp=a)}return dp}(t);if(!i){var n=(t=>{var e=t.match(vp);return e?e[0]:""})(t);n!==i&&Vi.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,n);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),a="; expires="+u.toUTCString()}s&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&Vi.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},ai(t,e){if(null!=r&&r.cookie)try{fp.ii(t,"",-1,e)}catch(t){return}}},pp=null,gp={ri(){if(!tt(pp))return pp;var e=!0;if(K(t))e=!1;else try{var i="__mplssupport__";gp.ii(i,"xyz"),'"xyz"'!==gp.ni(i)&&(e=!1),gp.ai(i)}catch(t){e=!1}return e||Vi.error("localStorage unsupported; falling back to cookie store"),pp=e,e},oi(t){Vi.error("localStorage error: "+t)},ni(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){gp.oi(t)}return null},si(t){try{return JSON.parse(gp.ni(t))||{}}catch(t){}return null},ii(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){gp.oi(t)}return!1},ai(e){try{null==t||t.localStorage.removeItem(e)}catch(t){gp.oi(t)}}},mp=[as,Yn,Kn,ts,es,is,ys,ms,ps],yp=[wn,_n,Bn,Hn,Cs,xs,bs],bp=t=>t+"_cpm",_p=["__proto__","constructor","prototype"],wp=t=>{if(!Q(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===_p.indexOf(i)&&(e[i]=t[i])})),e},kp=function(t,e){void 0===e&&(e=[]);var i={};return[...yp,...e].forEach((e=>{var r=t[e];K(r)||tt(r)||""===r||(i[e]=r)})),i},Sp=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)},xp=(t,e)=>({p:e,f:Sp(JSON.stringify(t))}),Cp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=fp.si(bp(t)),r=(null==i?void 0:i.f)===Sp(e)&&G(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Tp=(t,e)=>e+"|"+(fp.ni(bp(t))||""),Mp={},Ep={ri:()=>!0,oi(t){Vi.error("memoryStorage error: "+t)},ni:t=>t in Mp?Mp[t]:null,si:t=>t in Mp?Mp[t]:null,ii:(t,e)=>(Mp[t]=e,!0),ai(t){delete Mp[t]}},Ip=null,Rp={ri(){if(!tt(Ip))return Ip;if(Ip=!0,K(t))Ip=!1;else try{var e="__support__";Rp.ii(e,"xyz"),'"xyz"'!==Rp.ni(e)&&(Ip=!1),Rp.ai(e)}catch(t){Ip=!1}return Ip},oi(t){Vi.error("sessionStorage error: ",t)},ni(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Rp.oi(t)}return null},si(t){try{return JSON.parse(Rp.ni(t))||null}catch(t){}return null},ii(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Rp.oi(t)}return!1},ai(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Rp.oi(t)}}},Pp=Gi("[Stylesheet Loader]"),Ap=t,Fp=r,Op="#020617",Lp={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:$f.Right,widgetType:Df.Tab,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:Op,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Dp=[$f.Center,$f.Left,$f.Right];function $p(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 Np(t){var e;void 0===t&&(t=Lp.backgroundColor),"#"===t[0]&&(e=$p(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=$p(i)),!e)return Op;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?Op:"white"}return Op}var qp=(t,e,i)=>{var r=ng(t),n=Fp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Fp.createElement("div");((t,e,i)=>{var r=p({},Lp,i),n=t.style,s=!Dp.includes(r.position)||e===qf.Widget&&(null==i?void 0:i.widgetType)===Df.Tab;n.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)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),s?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Np(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Np(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Np(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",Np(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),o=a||r.inputBackground;a||"white"!==r.backgroundColor||(o="#f8f8f8"),n.setProperty("--ph-survey-input-background",o);var l=(null==i?void 0:i.inputTextColor)||Np(o);n.setProperty("--ph-survey-input-text-color",l),n.setProperty("--ph-survey-rating-text-color",l),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(s,t.type,t.appearance),s.className=r;var a=s.attachShadow({mode:"open"}),o=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Pp.error("prepare_external_dependency_stylesheet returned null"),null)})(Fp,':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:2147483645;--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 rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.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),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{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);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.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{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}: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{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";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}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.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;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){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{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.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{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.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}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!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(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Fp.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},jp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,a=t.properties,o=t.surveyLanguage,l=t.questionSnapshots;n?(Xf(i),n.capture(zf.SENT,p({[Uf.SURVEY_NAME]:i.name,[Uf.SURVEY_ID]:i.id,[Uf.SURVEY_ITERATION]:i.current_iteration,[Uf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Uf.SURVEY_SUBMISSION_ID]:r,[Uf.SURVEY_COMPLETED]:s},o&&{[Uf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},yo(e,i,l),a,{$set:{[bo(i,"responded")]:!0}})),s&&(Ap.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),rg(i),n.reloadFeatureFlags())):Vf.error("[survey sent] event not captured, PostHog instance not found.")},Bp=(t,e,i)=>{return p({[Uf.SURVEY_NAME]:t.name,[Uf.SURVEY_ID]:t.id,[Uf.SURVEY_ITERATION]:t.current_iteration,[Uf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Uf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!et(t))))},(null==e?void 0:e.surveyLanguage)&&{[Uf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Uf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},yo(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Hp=(t,e,i,r)=>{if(e){if(!i){var n=eg(t),s=n?n.surveyLanguage:r;e.capture(zf.DISMISSED,p({},Bp(t,n,e),s&&{[Uf.SURVEY_LANGUAGE]:s},{$set:{[bo(t,"dismissed")]:!0}})),rg(t),Xf(t),Ap.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Vf.error("[survey dismissed] event not captured, PostHog instance not found.")},zp=(t,e)=>{if(e){var i=(t=>Kf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=eg(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(zf.ABANDONED,Bp(t,r,e),{transport:"sendBeacon"})}}else Vf.error("[survey abandoned] event not captured, PostHog instance not found.")},Up=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Wp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,Vp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Gp=(t,e)=>{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?Wp(t.questions,Up(t.questions)):t.questions;var i},Zp=t=>To(t)||ig(t),Qp=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,Hc(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"+Ec++,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=()=>Sf(Qp),Kp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Fc({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?fc.call(arguments,2):i),Dc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Yp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=pr(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return Io[a](s,[n])}var Xp=t=>Kf(Jf,t),tg=(t,e)=>{try{localStorage.setItem(Xp(t),JSON.stringify(e))}catch(t){Vf.error("Error setting in-progress survey state in localStorage",t)}},eg=t=>{try{var e=localStorage.getItem(Xp(t));if(e)return JSON.parse(e)}catch(t){Vf.error("Error getting in-progress survey state from localStorage",t)}return null},ig=t=>{var e=eg(t);return!et(null==e?void 0:e.surveySubmissionId)},rg=t=>{try{localStorage.removeItem(Xp(t))}catch(t){Vf.error("Error clearing in-progress survey state from localStorage",t)}};function ng(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function sg(t,e,i){if(void 0===e&&(e=$f.Right),t===qf.ExternalSurvey)return{};switch(e){case $f.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case $f.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case $f.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case $f.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case $f.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case $f.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case $f.Left:return{left:"30px"};case $f.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===qf.Widget&&i===Df.Tab?"60px":"30px"}}}var ag=0;function og(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ag,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return pc.vnode&&pc.vnode(u),u}var 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-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"})}),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-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"})}),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:"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"})}),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:"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"})}),vg=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"})}),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:"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"})}),fg=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"})}),pg=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return og("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,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:i})]})},gg=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 mg(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 ",gg]})}function yg(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,a=e.link,o=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=Sf(Qp).isPreviewMode,v=!!u&&!!h,c=!l&&og("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==t||t.open(a)),d?null==o||o():s()},children:i});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:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&og(mg,{urlParams:{utm_source:"survey-footer"}})]})}function bg(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===jf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Kp({component:Lc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function _g(t){return og("button",{className:"form-cancel",onClick:t.onClick,disabled:Sf(Qp).isPreviewMode,"aria-label":"Close survey",type:"button",children:pg({fill:"black"})})}og("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:og("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var wg=t;function kg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=Sf(Qp).isPopup;return _f((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return rr(wg,"keydown",t),()=>{wg.removeEventListener("keydown",t)}}),[a]),og("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&og(_g,{onClick:()=>a()}),og("h3",{className:"thank-you-message-header",children:e}),i&&Kp({component:Lc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&og(yg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function Sg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=Sf(Qp),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return og("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&og(_g,{onClick:()=>u()}),e&&og("h3",{className:"intro-screen-header",children:e}),i&&Kp({component:Lc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),og(yg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var xg=t=>G(t)&&t.every((t=>Y(t)));function Cg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Jp().isPreviewMode,d=wf(null),v=bf((()=>Y(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;_f((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=kf((()=>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 a of e)switch(a.type){case C:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case T:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=li(e.validation,C),b=li(e.validation,T),_=kf((()=>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($c,{children:[og("div",{className:"question-container",children:[og(bg,{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(yg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Tg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return og($c,{children:[og("div",{className:"question-container",children:og(bg,{question:e,forceDisableHtml:t.forceDisableHtml})}),og(yg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function Mg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=bf((()=>it(l)?l:G(l)&&l.length>0&&it(parseInt(l[0]))?parseInt(l[0]):Y(l)&&it(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Jp().isPreviewMode,y=t=>m?o(t):a(t);return og($c,{children:[og("div",{className:"question-container",children:[og(bg,{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=Fg[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:Og(i.scale).map(((t,e)=>og(Eg,{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(yg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:tt(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Eg(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 Ig(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,a=t.onPreviewSubmit,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=wf(null),d=kf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Wp(e,Up(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=bf((()=>((t,e)=>Y(t)||xg(t)?t:e===jf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=bf((()=>((t,e)=>{if(Y(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(xg(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(o,d))),m=g[0],y=g[1],b=Jp().isPreviewMode,_=e.type===jf.SingleChoice,w=e.type===jf.MultipleChoice,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(_)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),b&&a(t)));w&&G(c)&&(c.includes(t)?f(c.filter((e=>e!==t))):f([...c,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>p({},t,{inputValue:e}))),_&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),_&&f(null))},T=()=>!(e.optional||!tt(c)&&(!G(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?G(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return og($c,{children:[og("div",{className:"question-container",children:[og(bg,{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"}),d.map(((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,a=s+"Open",o=n?m.isSelected:_?c===t:G(c)&&c.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:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),og("span",{children:n?t+":":t})]}),n&&og("input",{type:"text",ref:h,id:a,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(yg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var Rg=[1,2,3,4,5],Pg=[1,2,3,4,5,6,7],Ag=[0,1,2,3,4,5,6,7,8,9,10],Fg={2:[cg,fg],3:[hg,ug,lg],5:[dg,hg,ug,lg,vg]};function Og(t){switch(t){case 5:default:return Rg;case 7:return Pg;case 10:return Ag}}var Lg=Gi("[Surveys]");function Dg(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?Bf.End:s;if(n.branching.type===Bf.End)return Bf.End;if(n.branching.type===Bf.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Bf.ResponseBased){if(n.type===jf.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Bf.End?Bf.End:s}}else if(n.type===jf.Rating){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===Bf.End?Bf.End:s}}return s}return Lg.warn("Falling back to next question index due to unexpected branching type"),s}var $g=Gi("[SurveyTranslations]");function Ng(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=_o(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?_o(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=_o(r);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(as):void 0,locale:Zo()},$g)}(e);if(!i)return $g.info("No user language detected"),{survey:t,language:null};var r=xo(t,i,$g);return{survey:r.survey,language:r.matchedKey}}var qg=-1,jg=t,Bg=r,Hg="ph:show_survey_widget",zg="PHWidgetSurveyClickListener";function Ug(t,e){try{var i=t.getBoundingClientRect(),r=jg.innerHeight,n=jg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:Lp.zIndex}}catch(t){return Vf.warn("Failed to calculate trigger position:",t),null}}class Wg{constructor(t){var e=this;this.ui=new Map,this.li=new Map,this.hi=new Map,this.ci=new Set,this.di=null,this.vi=!1,this.fi=null,this.pi=null,this.gi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(us);if(t)for(var e of t)ig(e)&&zp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,a,o,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.mi(t),v=d.survey,c=d.language;e.di=c,e.gi=null,e.yi=i;var f=e.bi(v,i);e.wi(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.ki(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.Si(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===$f.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Bg.querySelector(f.appearance.widgetSelector);k&&(_=Ug(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||Lp.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=qp(f,e._posthog).shadow;e.hi.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.xi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(e.gi=C,0>=S)return e.vi=!0,nf(og(Jg,p({},C)),x);var T=()=>{if(!e.Ci(f))return Vf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.xi(f);(()=>{e.vi=!0;var r=e.mi(t),n=r.survey,s=r.language;e.di=s;var a=e.bi(n,i),o=p({},C,{survey:a,surveyLanguage:s});e.gi=o,nf(og(Jg,p({},o,{survey:p({},a,{appearance:p({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,E=it(M)?Math.max(0,Date.now()-M):0,I=Math.max(0,1e3*S-E);if(0>=I)return T();var R=jg.setTimeout((()=>{e.ui.delete(f.id),T()}),I);e.ui.set(f.id,R)}},this.Mi=t=>{var e=this.mi(t),i=e.survey,r=e.language,n=qp(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.hi.set(s,s.host),a&&nf(og(Yg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Ti=t=>{var e=this.li.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(zg),this.li.delete(t),Vf.info("Removed click listener for survey "+t))},this.Ii=t=>{this.Ri(t)||(this.Ai(t),this.Ti(t.id))},this.Ri=t=>{try{var e,i=Bg.querySelector(ng(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ei=(t,e)=>{var i=Bg.querySelector(e),r=this.li.get(t.id);if(i){if(this.Mi(t),r){if(i===r.element)return;Vf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Ti(t.id)}if(!i.hasAttribute(zg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===$f.NextToTrigger?Ug(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Lp.maxWidth)):{};jg.dispatchEvent(new CustomEvent(Hg,{detail:{surveyId:t.id,position:n}}))};rr(i,"click",n),i.setAttribute(zg,"true"),this.li.set(t.id,{element:i,listener:n,survey:t}),Vf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Ii(t)},this.renderPopover=t=>{var e=this.mi(t),i=e.survey,r=e.language,n=qp(i,this._posthog).shadow;this.hi.set(n,n.host),nf(og(Jg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.xi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.mi(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.Li(s,a,i)),nf(og(Jg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.xi,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.Ci(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===qf.Popover||t.type===qf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.ui.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Oi(i),a=new Set;s.forEach((t=>{if(t.type===qf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Df.Tab)return void e.Mi(t);(null==(r=t.appearance)?void 0:r.widgetType)===Df.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Ei(t,null==(s=t.appearance)?void 0:s.widgetSelector))}tt(e.Di)&&t.type===qf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.li.forEach((t=>{var i=t.survey;a.has(i.id)||e.Ii(i)}))}),t)},this.Si=t=>{tt(this.Di)||Vf.error("Survey "+this.Di+" already in focus. Cannot add survey "+t.id+"."),this.Di=t.id},this.xi=t=>{this.Di!==t.id&&Vf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.wi(t.id),this.Di=null,this.di=null,this.vi=!1,this.gi=null,this.yi=void 0,this.Ai(t)},this._posthog=t,this.Di=null,this.fi=()=>this.Pi(),rr(jg,"languagechange",this.fi),this.pi=t.onFeatureFlags((()=>this.Pi()))}Pi(){if(!tt(this.Di)){var t=this._posthog.get_property(us),e=null==t?void 0:t.find((t=>t.id===this.Di));if(e){var i=this.mi(e),r=i.survey,n=i.language;if(n!==this.di&&(this.di=n,this.vi)){var s=this.bi(r,this.yi),a=qp(s,this._posthog).shadow;nf(og(Jg,p({},this.gi,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.xi,surveyLanguage:n})),a)}}}}get Ni(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,ip))&&void 0!==t?t:this._posthog.featureFlags}bi(t,e){return null!=e&&e.position||null!=e&&e.selector?p({},t,{appearance:p({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}wi(t){var e=this.ui.get(t);e&&(clearTimeout(e),this.ui.delete(t))}cancelSurvey(t){this.ui.has(t)&&(Vf.info("Cancelled pending survey "+t),this.wi(t),this.Di===t&&(this.Di=null,this.di=null,this.vi=!1,this.gi=null,this.yi=void 0))}setAutomaticDisplayDispose(t){this.Fi=t}dispose(){var t;null==(t=this.Fi)||t.call(this),this.Fi=void 0,this.fi&&(jg.removeEventListener("languagechange",this.fi),this.fi=null),this.pi&&(this.pi(),this.pi=null),this.ui.forEach(((t,e)=>this.wi(e))),this.li.forEach(((t,e)=>this.Ti(e))),this.hi.forEach(((t,e)=>{nf(null,e),null==t||t.remove()})),this.hi.clear(),this.Di=null}Oi(t){return t.sort(((t,e)=>{var i,r,n=ig(t),s=ig(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===Hf,o=e.schedule===Hf;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}mi(t){return Ng(t,this._posthog)}Li(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};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!K(l)){var u=decodeURIComponent(o),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(jg.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Vf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.qi(t,n,e);return!!s&&(this.ji(t,s,i,e),this.ci.add(t.id),s.isSurveyCompleted)}ji(t,e,i,r){var n=e.responses,s=e.submissionId,a=e.isSurveyCompleted,o=e.skippedResponses;(Object.keys(o).length>0&&t.enable_partial_responses||a)&&jp({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}ki(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=G(a)?a.map(String):[String(a)]}Vf.info("[Survey] Processing initial responses");var o=this.qi(t,n,r);return!!o&&(this.ji(t,o,i,r),o.isSurveyCompleted)}qi(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=go(t.id);try{switch(t.type){case jf.SingleChoice:if(!t.choices||0===t.choices.length)return void Vi.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Vi.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case jf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Vi.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Vi.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Vi.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case jf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Vi.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Vi.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Vi.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return Vf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=up(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=go(l.id);K(i[u])||(n[u]=i[u])}s.push(r);var h=Dg(t,r,l.id?i[go(l.id)]:null);if(h===Bf.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),o=a.startQuestionIndex,l=a.skippedResponses,u=a.skippedIndices,h=o>=t.questions.length;return tg(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Vp(t.questions),visitedIndices:u,surveyLanguage:i}),Vf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Vf.error("[Survey Prefill] Error handling prefill:",t),null}}Bi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Ni,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}Hi(e){return!e.conditions||Yp(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,a;if(!e||0===e.length)return!0;if(!u)return!1;var o=Te(u,{userAgentDataPlatform:null==i||null==(n=i.userAgentData)?void 0:n.platform,maxTouchPoints:null==i?void 0:i.maxTouchPoints,screenWidth:null==t||null==(s=t.screen)?void 0:s.width,screenHeight:null==t||null==(a=t.screen)?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return Io[null!=r?r:"icontains"](e,[o])}(null==(r=e.conditions)?void 0:r.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Fp||!Fp.querySelector(t.conditions.selector))}(e)}$i(t){var e;return Zp(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.Ni)&&e.hasLoadedFlags?{satisfied:this.Bi(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(!Gf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!tp.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.Bi(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.Bi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.$i(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,gp.ni("lastSeenSurveyDate"))?(t=>!!gp.ni(Yf(t))&&!Zp(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=a.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.Ui(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Ui(t){var e;if(!Co(t)&&!Zf(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}zi(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.Bi(e)}))}Ci(t){return this.checkSurveyEligibility(t).eligible&&this.Hi(t)&&this.Ui(t)&&this.zi(t)}Ai(t){try{var e=Bg.querySelector(ng(t,!0));null!=e&&e.shadowRoot&&(nf(null,e.shadowRoot),this.hi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Vf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Si,removeSurveyFromFocus:this.xi,surveyInFocus:this.Di,surveyTimeouts:this.ui,handleWidget:this.Mi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ei,sortSurveysByAppearanceDelay:this.Oi,checkFlags:this.zi.bind(this),isSurveyFeatureFlagEnabled:this.Bi.bind(this),onLanguageChange:this.Pi.bind(this),currentLanguage:this.di,surveyIsRendered:this.vi}}}function Vg(t,e){if(Bg&&jg){var i,r=new Wg(t);if(t.config.disable_surveys_automatic_display)return Vf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Vf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{K(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{K(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Bg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return rr(Bg,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Bg.removeEventListener("visibilitychange",a)})),r}}function Gg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;_f((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===qf.Widget,s=Yp(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Df.Tab&&i;if(!s)return Vf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Vf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};rr(jg,"popstate",i),rr(jg,"hashchange",i);var s=jg.history.pushState,l=jg.history.replaceState;return jg.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()},jg.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()},()=>{jg.removeEventListener("popstate",i),jg.removeEventListener("hashchange",i),jg.history.pushState=s,jg.history.replaceState=l}}}),[a,e,r,n,o])}var Zg=200;function Qg(t){switch(void 0===t&&(t=Nf.Right),t){case Nf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Nf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Nf.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,n,s,a,o,l,u,h,d,v,c=t.survey,f=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,E=t.onPopupSurveyDismissed,I=void 0===E?()=>{}:E,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=wf(null),N=Number.isInteger(b),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,a,o,l){var u=bf(r||0===i||t.type===qf.ExternalSurvey),h=u[0],d=u[1],v=bf(!1),c=v[0],f=v[1],g=wf(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Zg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Zg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return _f((()=>{if(e){if(!r){var n,s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();f(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Yp(t,e)){d(!0),jg.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(zf.SHOWN,p({[Uf.SURVEY_NAME]:t.name,[Uf.SURVEY_ID]:t.id,[Uf.SURVEY_ITERATION]:t.current_iteration,[Uf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Uf.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};rr(jg,"PHSurveyClosed",y),rr(jg,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return K(u)&&a(),()=>{K(u)||clearTimeout(u),K(n)||clearTimeout(n),jg.removeEventListener("PHSurveyClosed",y),jg.removeEventListener("PHSurveySent",s)}}}else Vf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Gg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,q,N,w,S,D,O,L),B=j.isPopupVisible,H=j.hidePopupWithAnimation,z=j.isSurveySent||b===c.questions.length||!0===F,U=bf(!1),W=U[0],V=U[1],G=kf((()=>!!eg(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?b===qg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=kf((()=>{var t=eg(c),e=(null==t?void 0:t.surveySubmissionId)||up();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Hp(c,g,N,L):Hp(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,I,C,M,A,L]);return B?og(Qp.Provider,{value:J,children:og("div",{className:"ph-survey",style:p({},sg(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:z?og(kg,{header:(null==(o=c.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(l=c.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!f,contentType:null==(u=c.appearance)?void 0:u.thankYouMessageDescriptionContentType,appearance:c.appearance||Lp,onClose(){H(),P()}}):Q?og(Sg,{header:(null==(h=c.appearance)?void 0:h.introScreenHeader)||"",description:(null==(d=c.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!f,contentType:null==(v=c.appearance)?void 0:v.introScreenDescriptionContentType,appearance:c.appearance||Lp,onStart:()=>V(!0)}):og(Kg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function Kg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=kf((()=>{var t=eg(r);if(!t)return null;var e=it(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(rg(r),null)}),[r]),o=bf((()=>(null!=a&&a.responses&&Vf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=Sf(Qp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,b=h.properties,_=h.surveyLanguage,w=bf((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=it(t)&&t>=0&&r.questions.length>t?t:0;return it(d)&&d>=0?d:e})),k=w[0],S=w[1],x=bf((()=>{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=bf((()=>{var t,e=eg(r);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),E=M[0],I=M[1],R=kf((()=>Vp(Gp(r,a))),[r.id,a]),P=kf((()=>{if(!R||new Set(R).size!==R.length)return Gp(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]);_f((()=>{!y||K(d)||0>d||S(d)}),[d,y]);var A=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),F=P.at(k);return F?og("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&og(_g,{onClick(){v()}}),og("div",{className:"survey-box","data-question-index":k,children:Xg({question:F,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||Lp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var a=go(n),o=p({},l,{[a]:e});u(o);var h=P[i],d=null!=h&&h.id?p({},E,{[h.id]:h.question}):E;I(d);var v=Dg(r,i,e),c=v===Bf.End,f=[...C,i];if(c||(T(f),S(v),tg(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:v,questionOrder:Vp(P),visitedIndices:f,surveyLanguage:_,questionSnapshots:d})),r.enable_partial_responses||c){var g=new Set(f.map((t=>{var e;return null==(e=P[t])?void 0:e.id})).filter((t=>!!t)).map((t=>go(t)))),y=Object.fromEntries(Object.entries(o).filter((t=>g.has(t[0]))));jp({responses:y,survey:r,surveySubmissionId:m,isSurveyCompleted:c,posthog:s,properties:b,surveyLanguage:_,questionSnapshots:d})}}else Vf.error("onNextButtonClick called without a questionId.");else Vf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:f,initialValue:F.id?l[go(F.id)]:void 0,canGoBack:A,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),tg(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:Vp(P),visitedIndices:e,surveyLanguage:_,questionSnapshots:E})}}})})]}):null}function Yg(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=bf(!0),f=c[0],p=c[1],g=bf(!1),m=g[0],y=g[1],b=bf({}),_=b[0],w=b[1],k=wf(void 0),S=()=>{y(!m)};if(_f((()=>{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&&(Vf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return rr(jg,Hg,e),()=>{K(k.current)||(clearTimeout(k.current),k.current=void 0),jg.removeEventListener(Hg,e)}}}else Vf.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]),Gg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Hf&&p(!1),K(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return og($c,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&og("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Nf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:Qg(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&og(Jg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Xg=t=>{var e=t.question,i=t.onSubmit,r=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){r(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case jf.Open:return Lc(Cg,p({},n,{question:e,key:e.id}));case jf.Link:return Lc(Tg,p({},n,{question:e,key:e.id}));case jf.Rating:return Lc(Mg,p({},n,{question:e,key:e.id}));case jf.SingleChoice:case jf.MultipleChoice:return Lc(Ig,p({},n,{question:e,key:e.id}));default:return Vf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=Vg,v.extendPostHogWithSurveys=Vg;var tm=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},em=1e4,im=(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),rm=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return im(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 a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return im(e,JSON.stringify(t.slice(0,n)),i)},nm=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,sm=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},am=(t,e,i)=>{if(!i.truncated)if(Q(t)){if(i.seen.has(t))return void sm(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(am(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else sm(e,t,i)},om=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!nm(t))return!n||im(e,"null",i);if(tt(t)||(t=>{try{return it(t)||nt(t)}catch(t){return!1}})(t))return im(e,JSON.stringify(t),i);if("string"==typeof t)return rm(t,e,i);if(!Q(t)&&!G(t))return im(e,JSON.stringify(t),i);if(r.has(t))return rm("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Z(a))return om(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return rm(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return im(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 om(l,e,i,r,n,s)}if(G(t)){if(!im(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!im(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!om(d,e,i,r,!0))return!1}return im(e,"]",i)}if(!im(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{am(f,c,s)}catch(t){}if(nm(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(!im(e,p,i))return!1;var b=e.length,_=om(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 im(e,"}",i)},lm=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Q(t[0])?{result:{},keysRemaining:50,sizeRemaining:em,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||im(i," ",r))&&om(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)||{}}},um={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},hm=t=>"canCapture"in t,dm=t=>hm(t)?t.canCapture?t.getExtension(rp):void 0:t.is_capturing()?t.logs:void 0;v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:v.location.host},n=!1,s=function(t){var s=v.console[t];i.push(Bv(v.console,t,(i=>{var a=(i=>function(){for(var s=!1,a=arguments.length,o=new Array(a),l=0;a>l;l++)o[l]=arguments[l];try{var u=e;if(o.length>0&&!n&&u){var h=dm(u);if(h){n=!0,s=!0;var d=lm(o,em),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(hm(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;Z(n)&&n.call(e,i)}})(u,h,{level:um[t],body:c,attributes:p({"log.source":"console."+t},g,f)})}}}catch(t){}finally{s&&(n=!1),i.apply(v.console,o)}})(i);return a.__rrweb_original__=tm(s),a})))};for(var a of Object.keys(um))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=dm(t);if(i)for(var r of e)try{var n=lm(r.args,em);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:um[r.level],body:n.body,attributes:p({"log.source":"console."+r.level,host:v.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var vm=Gi("[Error tracking]"),cm="webkit-masked-url:",fm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",cm],pm=["__firefox__","__gCrWeb"];function gm(){return new ci([new Ti,new Di,new Ei,new Mi,new Oi,new Fi,new Ri,new Li],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 n=[],s=e.split("\n"),a=r;s.length>a;a++){var o=s[a];if(1024>=o.length){var l=xi.test(o)?o.replace(xi,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,t);if(h){n.push(h);break}}if(n.length>=Ci)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Ci).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||fi});var i}))}(n)}}("web:javascript",_i,Si))}var mm=Gi("[ExceptionAutocapture]"),ym=gm(),bm=e=>{var i=t;i||mm.info("window not available, cannot wrap onerror");var r=i.onerror;return i.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var a=ym.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Y(e)&&Y(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}});return e(a),!!Z(r)&&null!==(t=r(...n))&&void 0!==t&&t},i.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onerror)||delete t.__POSTHOG_INSTRUMENTED__,i.onerror=r}},_m=function(e,i){void 0===i&&(i=!1);var r=t;r||mm.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=ym.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),Z(n)?null!==(r=n(t))&&void 0!==r&&r:i},r.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,r.onunhandledrejection=n}},wm={wrapOnError:bm,wrapUnhandledRejection:_m,wrapConsoleError(t){var e=console;e||mm.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var a=n.find((t=>t instanceof Error)),o=ym.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Z(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.errorWrappingFunctions=wm,v.posthogErrorWrappingFunctions=wm;var km=(t,e)=>{if(Z(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!tt(i)&&"object"==typeof i&&G(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){mm.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){mm.error("Failed to capture exception for a legacy client",t)}};bm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),_m(n,!0)}};v.extendPostHogWithExceptionAutoCapture=km,v.extendPostHogWithExceptionAutocapture=km;var Sm="X-POSTHOG-SESSION-ID",xm="X-POSTHOG-WINDOW-ID",Cm="X-POSTHOG-DISTINCT-ID",Tm=[Sm,xm,Cm],Mm=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Em=(t,e)=>({}.hasOwnProperty.call(t,e)),Im=t=>"object"==typeof t&&!tt(t)||Z(t),Rm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Pm=e=>{try{var i;return Rm(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(i=t.location)?void 0:i.href).toString()}catch(t){return}},Am=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(G(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(Sm,o.sessionId),n.set(xm,l),a=!0}var u=(t=>Z(t)?t():t)(e);return u&&u!==Ts&&(n.set(Cm,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Fm={_patchFetch:(e,i,r)=>Bv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=Pm(n);if(l)if(Rm(n)){var u=new Request(n,s);Am(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(Im(s)?s.headers:void 0);if(Am(e,i,r,l,h)){var d=((t,e)=>{if(K(t)||tt(t))return{headers:e};if(Im(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)=>Em(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Em(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Mm.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&&Mm.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?p({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(s,h);d&&(o=[n,d])}}}catch(t){o=a}return t.apply(this,o)})),_patchXHR:(e,i,r)=>Bv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=Pm(s);d&&Am(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return Tm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Fm,v.postHogTracingHeadersPatchFns=Fm,"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});let Om=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)}}};var Lm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Dm=t=>{if("loading"===document.readyState)return"loading";var e=Lm();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"},$m=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Nm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[$m(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},qm=new WeakMap;function jm(t,e){var i=qm.get(e);return i||(i=new WeakMap,qm.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Bm=-1,Hm=()=>Bm,zm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Bm=e.timeStamp,t(e))}),!0)},Um=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Wm=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Vm=()=>{var t,e;return null!==(t=null==(e=Lm())?void 0:e.activationStart)&&void 0!==t?t:0},Gm=-1,Zm=new Set,Qm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Jm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Zm)e();isFinite(Gm)||(Gm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Jm,!0))}},Km=function(t){if(void 0===t&&(t=!1),t&&(Gm=1/0),0>Gm){var e,i=Vm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Gm=null!=r?r:Qm(),addEventListener("visibilitychange",Jm,!0),addEventListener("prerenderingchange",Jm,!0),zm((()=>{setTimeout((()=>{Gm=Qm()}))}))}return{get firstHiddenTime(){return Gm},onHidden(t){Zm.add(t)}}},Ym=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Lm(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Hm()?o&&(document.prerendering||Vm()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},Xm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=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 s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},ty=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},ey=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},iy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class ry{constructor(){this.u=void 0}}var ny,sy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ay=[1800,3e3],oy=function(t,e){void 0===e&&(e={});var i=ty(e);sy((()=>{var r,n=jm(e,ry),s=Km(),a=Ym("FCP"),o=Xm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Vm(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Um(t,a,ay,e.reportAllChanges),zm((i=>{a=Ym("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Hm()),r=Um(t,a,ay,e.reportAllChanges),Wm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Xm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&ey(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Ym("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Um(t,a,ay,e.reportAllChanges))(!0)}))}),e)}))},ly=[.1,.25],uy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],hy=function(t,e){void 0===e&&(e={});var i=jm(e=Object.assign({},e),Om),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=uy(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:Nm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Km();oy(iy((()=>{var r,n=Ym("CLS",0),s=jm(e,Om),a=(i,a,o,l,u)=>{n=Ym("CLS",0,i,a,o,l,u),s.o=0,r=Um(t,n,ly,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];ty(e)&&h.push("soft-navigation");var d=Xm(h,u);d&&(r=Um(t,n,ly,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),zm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Hm()),Wm(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=uy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Dm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},dy=function(t,e){void 0===e&&(e={});var i=jm(e=Object.assign({},e),ry);ty(e)&&(i.u=new Map),oy((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Dm(Hm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Lm(),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:Dm(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},vy=0,cy=1/0,fy=0,py=t=>{for(var e of t)e.interactionId&&(cy=Math.min(cy,e.interactionId),fy=Math.max(fy,e.interactionId),vy=fy?(fy-cy)/7+1:0)},gy=()=>{var t;return ny?vy:null!==(t=performance.interactionCount)&&void 0!==t?t:0};let my=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return gy()-this.h}D(){this.h=gy(),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){var s=this.v.splice(10);for(var a of s)this.p.delete(a.id)}null==(n=this.M)||n.call(this,r)}}}};var yy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=iy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},by=[200,500],_y=function(t,e){void 0===e&&(e={});var i=jm(e=Object.assign({},e),my),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(yy(h),l=!0)},h=()=>{var t=new Set(i.v.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];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||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&a.set(t,i),u()},i.M=t=>{if(!o.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:Nm(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(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};Xm(["long-animation-frame"],(t=>{r=r.concat(t),u()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Km();sy((()=>{var r;"interactionCount"in performance||ny||(ny=Xm(["event"],py,{durationThreshold:0}));var n,s=Ym("INP"),a=jm(e,my),o=(i,r,o,l,u)=>{a.D(),s=Ym("INP",-1,i,r,o,l,u),n=Um(t,s,by,e.reportAllChanges)},l=()=>{var t=a.S(s.navigationType);t&&t.k!==s.value&&(s.value=t.k,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),yy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];ty(e)&&d.push("soft-navigation");var v=Xm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Um(t,s,by,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),zm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Hm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Dm(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),l=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,l),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),v=d(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:o.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:l,processedEventEntries:h,longAnimationFrameEntries:v,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:l-u,loadState:Dm(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,a=t.inputDelay,o=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+a>c.startTime?"input-delay":i+a+o>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+a+o&&(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)};let wy=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],ky=50,Sy=[];Xm(["resource"],(t=>{for(var e of t)Sy.push(e),Sy.length>ky&&Sy.shift()}));var xy=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(ky=e.resourceBufferSize);var i=jm(e,wy),r=new WeakMap;ty(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:Nm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=ty(e);sy((()=>{var n,s=Km(),a=Ym("LCP"),o=jm(e,wy),l=(r,o,l,u,h)=>{a=Ym("LCP",-1,r,o,l,u,h),n=Um(t,a,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Km(!0))},u=t=>{o.u&&t.navigationId&&ey(o.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-Vm(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Xm(d,h);if(v){n=Um(t,a,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;yy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});zm((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Hm()),n=Um(t,a,$,e.reportAllChanges),Wm((()=>{a.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 n,s,a,o,l,u,h=t.entries.at(-1),d=h.url&&(Sy.findLast((t=>t.name===h.url))||performance.getEntriesByType("resource").findLast((t=>t.name===h.url)));e.target=r.get(h),e.lcpEntry=h,h.url&&(e.url=h.url),d&&(e.lcpResourceEntry=d);var v=0,c=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(s=u=Lm())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(a=null==(o=u)?void 0:o.responseStart)&&void 0!==a?a:0):(v=t.navigationStartTime||0,u=null==(l=i.u)?void 0:l.get(t.navigationId)),u){var f=Math.max(0,c-v),g=Math.max(f,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=p({},e,{timeToFirstByte:f,resourceLoadDelay:g-f,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))}),e)},Cy=-1,Ty=()=>Cy,My=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Cy=e.timeStamp,t(e))}),!0)},Ey=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Iy=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Ry=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Py=()=>{var t,e;return null!==(t=null==(e=Ry())?void 0:e.activationStart)&&void 0!==t?t:0},Ay=-1,Fy=new Set,Oy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Ly=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Fy)e();isFinite(Ay)||(Ay="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Ly,!0))}},Dy=function(t){if(void 0===t&&(t=!1),t&&(Ay=1/0),0>Ay){var e,i=Py(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Ay=null!=r?r:Oy(),addEventListener("visibilitychange",Ly,!0),addEventListener("prerenderingchange",Ly,!0),My((()=>{setTimeout((()=>{Ay=Oy()}))}))}return{get firstHiddenTime(){return Ay},onHidden(t){Fy.add(t)}}},$y=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Ry(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Ty()?o&&(document.prerendering||Py()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},Ny=new WeakMap;function qy(t,e){var i=Ny.get(e);return i||(i=new WeakMap,Ny.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class jy{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)}}}var By=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=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 s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},Hy=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)}},Uy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Wy{constructor(){this.l=void 0}}var Vy,Gy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Zy=[1800,3e3],Qy=function(t,e){void 0===e&&(e={});var i=Hy(e);Gy((()=>{var r,n=qy(e,Wy),s=Dy(),a=$y("FCP"),o=By(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Py(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Ey(t,a,Zy,e.reportAllChanges),My((i=>{a=$y("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ty()),r=Ey(t,a,Zy,e.reportAllChanges),Iy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&By(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&zy(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=$y("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Ey(t,a,Zy,e.reportAllChanges))(!0)}))}),e)}))},Jy=[.1,.25],Ky=function(t,e){void 0===e&&(e={});var i=Dy();Qy(Uy((()=>{var r,n=$y("CLS",0),s=qy(e,jy),a=(i,a,o,l,u)=>{n=$y("CLS",0,i,a,o,l,u),s.i=0,r=Ey(t,n,Jy,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];Hy(e)&&h.push("soft-navigation");var d=By(h,u);d&&(r=Ey(t,n,Jy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),My((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Ty()),Iy(r)})),setTimeout(r))})))},Yy=0,Xy=1/0,tb=0,eb=t=>{for(var e of t)e.interactionId&&(Xy=Math.min(Xy,e.interactionId),tb=Math.max(tb,e.interactionId),Yy=tb?(tb-Xy)/7+1:0)},ib=()=>{var t;return Vy?Yy:null!==(t=performance.interactionCount)&&void 0!==t?t:0};class rb{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return ib()-this.u}M(){this.u=ib(),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){var s=this.v.splice(10);for(var a of s)this.m.delete(a.id)}null==(n=this.T)||n.call(this,r)}}}}var nb=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Uy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},sb=[200,500],ab=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Dy();Gy((()=>{var r;"interactionCount"in performance||Vy||(Vy=By(["event"],eb,{durationThreshold:0}));var n,s=$y("INP"),a=qy(e,rb),o=(i,r,o,l,u)=>{a.M(),s=$y("INP",-1,i,r,o,l,u),n=Ey(t,s,sb,e.reportAllChanges)},l=()=>{var t=a.L(s.navigationType);t&&t.P!==s.value&&(s.value=t.P,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),nb((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Hy(e)&&d.push("soft-navigation");var v=By(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Ey(t,s,sb,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),My((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Ty())})))}))}};class ob{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}}var lb=[2500,4e3],ub=function(t,e){void 0===e&&(e={});var i=!1,r=Hy(e);Gy((()=>{var n,s=Dy(),a=$y("LCP"),o=qy(e,ob),l=(r,o,l,u,h)=>{a=$y("LCP",-1,r,o,l,u,h),n=Ey(t,a,lb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Dy(!0))},u=t=>{o.l&&t.navigationId&&zy(o.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-Py(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=By(d,h);if(v){n=Ey(t,a,lb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;nb((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});My((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ty()),n=Ey(t,a,lb,e.reportAllChanges),Iy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},hb={onLCP:xy,onCLS:hy,onFCP:dy,onINP:_y,withoutAttribution:{onLCP:ub,onCLS:Ky,onFCP:Qy,onINP:ab}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=hb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=hb,v.postHogWebVitalsCallbacks=hb;var db={onLCP:ub,onCLS:Ky,onFCP:Qy,onINP:ab};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=db,v.__PosthogExtensions__.postHogWebVitalsCallbacks=db,v.postHogWebVitalsCallbacks=db,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>db;var vb={onLCP:xy,onCLS:hy,onFCP:dy,onINP:_y,withoutAttribution:{onLCP:ub,onCLS:Ky,onFCP:Qy,onINP:ab}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=vb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=vb,v.postHogWebVitalsCallbacks=vb;var cb={onLCP:ub,onCLS:Ky,onFCP:Qy,onINP:ab};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=cb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=cb,v.postHogWebVitalsCallbacks=cb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>cb;class fb{constructor(t){this.disabled=!1===t;var e=Q(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}}var pb="$copy_autocapture",gb=Gi("[AutoCapture]");function mb(t,e){return e.length>t?e.slice(0,t)+"...":e}function yb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!wr(e));return e}function bb(e,i){var r,n,s=i.e,a=i.maskAllElementAttributes,o=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!wr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!kr(c,"body")&&Cr>d.length;)if(xr(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!wr(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var g,m,y=[],b={},_=!1,w=!1;if(Qi(d,(t=>{var e=Wr(t);if(kr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&tn(i))&&(h?Re(i):i)}j(Er(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Ar.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?mb(1024,en(t)):mb(1024,Rr(t)));var o=Er(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),Qi(t.attributes,(function(i){var s;if((!Vr(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&tn(i.value)&&(!Y(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=Tr(o).join(" ")),a["attr__"+i.name]=mb(1024,"href"===i.name&&n?Re(o):o)}}));for(var l=1,u=1,h=t;h=yb(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!Wr(t))return{};var e={};return Qi(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&&tn(r)&&(e[i]=r)}})),e}(t);Qi(r,((t,e)=>{({}).hasOwnProperty.call(b,e)||(b[e]=t)}))})),w)return{props:{},explicitNoCapture:w};if(o||(y[0].$el_text=kr(e,"a")||kr(e,"button")?en(e):Rr(e)),_){var k,S;y[0].attr__href=_;var x=null==(k=or(_))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=_)}return{props:Ji({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,G(m)?function(t){var e=t.map((t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=p({},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 Ki(s).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[nn(t[0].toString())]=nn(e.toString())})),(r+=":")+Ki(a).map((t=>t[0]+'="'+t[1]+'"')).join("")}));return e.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:sn(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Ki(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(m)):"")},null!=(r=y[0])&&r.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},b)}}class _b{constructor(t){this.name="autocapture",this.Is=!1,this.Rs=null,this.Ps=!1,this.As=!1,this.gn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Fs=!1,this.Os=t,this.Os.refresh(this.gn),this.rageclicks=new fb(this.gn.rageclick),this.Ls=null}setup(t){this.Ds(),this.$s=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Fs?e.dispose():(this.Ns=e,this.startIfEnabled())}dispose(){var t;this.Fs||(this.Fs=!0,this.$s=void 0,null==(t=this.Ns)||t.dispose(),this.Ns=void 0,this.qs())}js(){return this.Os.refresh(this.gn),this.gn}Ds(){var t,e;return this.js(),this.gn.url_allowlist=null==(t=this.gn.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.gn.url_ignorelist=null==(e=this.gn.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.gn}Bs(){if(this.isBrowserSupported()){if(t&&r){var e=this.Hs=e=>{e=e||(null==t?void 0:t.event);try{this.zs(e)}catch(t){gb.error("Failed to capture event",t)}};if(rr(r,"submit",e,{capture:!0}),rr(r,"change",e,{capture:!0}),rr(r,"click",e,{capture:!0}),this.js().capture_copied_text){var i=this.Us=e=>{e=e||(null==t?void 0:t.event);try{this.zs(e,pb)}catch(t){gb.error("Failed to capture clipboard event",t)}};rr(r,"copy",i,{capture:!0}),rr(r,"cut",i,{capture:!0}),rr(r,"paste",i,{capture:!0})}}}else gb.info("Disabling Automatic Event Collection because this browser is not supported")}qs(){this.Hs&&(null==r||r.removeEventListener("submit",this.Hs,!0),null==r||r.removeEventListener("change",this.Hs,!0),null==r||r.removeEventListener("click",this.Hs,!0),this.Hs=void 0),this.Us&&(null==r||r.removeEventListener("copy",this.Us,!0),null==r||r.removeEventListener("cut",this.Us,!0),null==r||r.removeEventListener("paste",this.Us,!0),this.Us=void 0),this.Is=!1}startIfEnabled(){!this.Fs&&this.$s&&this.isEnabled&&!this.Is&&(this.Bs(),this.Is=!0)}onRemoteConfig(t){if(!this.Fs)if(this.Ps=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.As=e.elementsChainAsString);var i,r=e.autocapture_opt_out;nt(r)&&(null==(i=this.$s)||i.kv.set(Cn,r),this.Rs=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Ls=t}getElementSelectors(t){var e,i=[];return null==(e=this.Ls)||e.forEach((e=>{var n=null==r?void 0:r.querySelectorAll(e);null==n||n.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e;if(this.Fs)return!1;var i=null==(t=this.$s)?void 0:t.kv.get(Cn),r=this.Rs,n=this.js(),s=n.remoteRequestsDisabled&&!this.Ps;if(tt(r)&&!nt(i)&&!s)return!1;var a=null!==(e=this.Rs)&&void 0!==e?e:!!i;return!!n.enabled&&!a}zs(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Pr(e);Sr(r)&&(r=r.parentNode||null);var n,s=this.Ds();"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Hr(r,s.rageclick)&&this.zs(e,"$rageclick");var a=i===pb,o=a?p({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,i,r,n,s,a){var o;if(!t||zr(e))return!1;if(null!=r&&r.url_allowlist&&!Mr(r.url_allowlist,a))return!1;if(null!=r&&r.url_ignorelist&&Mr(r.url_ignorelist,a))return!1;if(null!=r&&r.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>i.type===t)))return!1}var u=Ur(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(K(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,r))return!1;if(!Fr(d,null==r?void 0:r.css_selector_allowlist))return!1;if(Fr(d,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Lr))return!1;try{var v=t.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===i.type)return!0}catch(t){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return h?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Ar.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,u=bb(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.As,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(h.$element_selectors=d),i===pb){var v=e.type||"clipboard";if("paste"!==v){var c,f,g=null==t||null==(c=t.getSelection())?void 0:c.toString(),m=Ir(g);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!==(f=null==g?void 0:g.length)&&void 0!==f?f:0}h.$copy_type=v}return null==(l=this.$s)||l.capture(i,h).catch((t=>gb.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return Z(null==r?void 0:r.querySelectorAll)}}var wb={};function kb(e,i){var r=wb[e];if(r)return r;var n=i[e];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return wb[e]=n.bind(i);var s=i.document;if(s&&Z(s.createElement)){var a,o=!1;try{(a=s.createElement("iframe")).hidden=!0,s.head.appendChild(a);var l,u,h=a.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return j(t,"AppleWebKit")&&!j(t,"Chrome")}(null!==(l=null==(u=i.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(a.classList.add("rr-block","ph-no-capture"),o=!0))}catch(t){Vi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!o&&null!=(d=a)&&d.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?wb[e]=n.bind(i):n}function Sb(t,e){var i=Pr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function xb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Cb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Tb="canvas,video,audio,embed,object",Mb=1e3;function Eb(t,e){return it(t)&&t>=e}function Ib(t){return t>=0&&Mb>t?t:void 0}function Rb(t,e){return e?Ib(t-e):void 0}class Pb{Zi(t){var e,i,r,n,s,a,o,l,u=this.Gi((null==t?void 0:t.__onCapture)||this.Qi.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!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o: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.Ji=[],this.Yi=0,this.Gi=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.Ki=t=>{var e=Sb(t,{type:"click"});tt(e)||this.Xi(e)||this.en(e),this.tn()},this.rn=()=>{var t=Date.now();this.nn=t,t%50==0&&this.Ji.forEach((e=>{K(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.an=()=>{this.sn=Date.now()},this.Wt=()=>{var t=Date.now();this.un=t,this.ln("visibilityChangedDelayMs",t)},this.hn=()=>{var t=Date.now();this.cn=t,this.ln("focusChangedDelayMs",t)},this.dn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.vn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.fn=()=>{this.vn=void 0},this.pn=t=>{var e,i=this.vn;if(this.vn=void 0,!K(i)&&this.gn.max_dead_swipes_per_page_load>this.Yi){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var a=s.clientX-i.x,o=s.clientY-i.y,l=a*a+o*o,u=this.gn.swipe_threshold_px;if(l>=u*u&&![this.nn,this.mn,this.sn].some((t=>it(t)&&t>=i.timestamp))){var h;if(this.yn()&&(null!==(h=null==r||null==r.elementsFromPoint?void 0:r.elementsFromPoint(i.x,i.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(Tb))))return;var d=Sb(n,{type:"swipe",swipeDirection:xb(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});tt(d)||this.Xi(d)||this.en(d),this.tn()}}}},this.instance=t,this.gn=this.Zi(e),this._onCapture=this.gn.__onCapture}start(t){this.bn(),this.wn(),this.kn(),this._n(),this.Sn(),this.xn(t),this.gn.capture_dead_swipes&&this.Cn()}xn(t){if(!this.Mn){var e=function(t){return kb("MutationObserver",t)}(v);this.Mn=new e((t=>{this.Tn(t)})),this.Mn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Mn)||t.disconnect(),this.Mn=void 0,v.removeEventListener("click",this.Ki),v.removeEventListener("scroll",this.rn,{capture:!0}),v.removeEventListener("selectionchange",this.an),v.removeEventListener("touchstart",this.dn,{capture:!0}),v.removeEventListener("touchend",this.pn,{capture:!0}),v.removeEventListener("touchcancel",this.fn,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.Wt),v.removeEventListener("blur",this.hn),v.removeEventListener("focus",this.hn),this.vn=void 0}Tn(t){this.mn=Date.now()}bn(){rr(v,"click",this.Ki)}en(t){t.visibilityChangedDelayMs=Rb(t.timestamp,this.un),t.focusChangedDelayMs=Rb(t.timestamp,this.cn),this.Ji.push(t)}tn(){this.Ji.length&&K(this.In)&&(this.In=v.setTimeout((()=>{this.Rn()}),1e3))}wn(){rr(v,"scroll",this.rn,{capture:!0})}kn(){rr(v,"selectionchange",this.an)}_n(){rr(r,"visibilitychange",this.Wt)}Sn(){rr(v,"blur",this.hn),rr(v,"focus",this.hn)}ln(t,e){this.Ji.forEach((i=>{var r=Ib(e-i.timestamp);it(r)&&(K(i[t])||i[t]>r)&&(i[t]=r)}))}Cn(){rr(v,"touchstart",this.dn,{capture:!0,passive:!0}),rr(v,"touchend",this.pn,{capture:!0,passive:!0}),rr(v,"touchcancel",this.fn,{capture:!0,passive:!0})}yn(){var t=K(this.An)||it(this.mn)&&this.mn>this.An;return(K(this.En)||t)&&(this.An=Date.now(),this.En=!(null==r||!r.querySelector(Tb))),!!this.En}Xi(t){return!t||("swipe"===t.type?this.Ln(t):this.On(t))}Ln(e){if(_r(e.node))return!0;var i=this.Ji.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!kr(e.node,"html")&&wr(e.node)&&function(e,i){var r;if(!t||zr(e))return!1;var n=nt(i)?qr:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:qr;return!Fr(Ur(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.gn.css_selector_ignorelist}))}On(e){return!(this.gn.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.Ln(e)||(r=e.node,!(!t||zr(r))&&Ur(r,!1).targetElementList.some((t=>kr(t,"a"))));var i,r}Rn(){if(this.Ji.length){clearTimeout(this.In),this.In=void 0;var t=this.Ji;for(var e of(this.Ji=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.mn&&this.mn>=e.timestamp?this.mn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.sn&&this.sn>=e.timestamp?this.sn-e.timestamp:void 0;var r=Eb(e.scrollDelayMs,this.gn.scroll_threshold_ms),n=Eb(e.selectionChangedDelayMs,this.gn.selection_change_threshold_ms),s=Eb(e.mutationDelayMs,this.gn.mutation_threshold_ms),a=Eb(e.absoluteDelayMs,1.1*this.gn.mutation_threshold_ms),o=it(e.scrollDelayMs)&&this.gn.scroll_threshold_ms>e.scrollDelayMs,l=it(e.mutationDelayMs)&&this.gn.mutation_threshold_ms>e.mutationDelayMs,u=it(e.selectionChangedDelayMs)&&this.gn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=it(e.visibilityChangedDelayMs),d=it(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=Cb(e);if("$dead_swipe"===v){if(this.Yi>=this.gn.max_dead_swipes_per_page_load)continue;this.Yi++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.mn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.gn.mutation_threshold_ms>e.absoluteDelayMs&&this.Ji.push(e)}this.tn()}}Qi(t,e){var i=Cb(t);this.instance.capture(i,p({},e,bb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.gn.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)})}}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Pb(t,e);var Ab=Gi("[ExternalScriptsLoader]"),Fb=t=>{var e=null==r?void 0:r.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]},Ob=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Ab.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=Fb(e);if(n){if(n.__posthog_loading_callback_fired)return i();var s=n.__posthog_loading_error;return s?i(s):(n.addEventListener("load",(t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)})),void n.addEventListener("error",(t=>{n.__posthog_loading_error=t,i(t)})))}var a=()=>{if(!r)return i("document not found");if(Fb(e))return Ob(t,e,i);var n=r.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)},n.onerror=t=>{n.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(n=t.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(n);else{var s,a=r.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(n,a[0]):r.body.appendChild(n)}};null!=r&&r.body?a():null==r||r.addEventListener("DOMContentLoaded",a)},Lb={},Db=(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)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__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(Fb(s))return void Ob(t,s,i);delete Lb[n]}Ob(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=Db(t,e);Lb[n]=o;var l=Fb(n);null==l||null==(a=l.parentNode)||a.removeChild(l),Ob(t,o,i)}else i(void 0,s)}:i)}else Ob(t,Db(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Ob(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);Ob(t,r,i)};class $b{constructor(t){this._instance=t}get gn(){return this._instance.config}get consent(){return this.Ws()?0:this.Vs}isOptedOut(){return this.gn.cookieless_mode===Bs||this.isRejected()||-1===this.consent&&this.gn.cookieless_mode===js}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.gn.opt_out_capturing_by_default}optInOut(t){this.Gs.ii(this.Zs,t?1:0,this.gn.cookie_expiration,this.gn.cross_subdomain_cookie,this.gn.secure_cookie)}reset(){this.Gs.ai(this.Zs,this.gn.cross_subdomain_cookie)}get Zs(){var 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 Vs(){var t=this.Gs.ni(this.Zs);return ft(t)?1:j(pt,t)?0:-1}get Gs(){var t=this.gn.opt_out_capturing_persistence_type,e="localStorage"===t?gp:fp,i=e.ri()?e:Ep;if(!this.Qs||this.Qs!==i){this.Qs=i;var r="localStorage"===t?fp:gp;r.ni(this.Zs)&&(this.Qs.ni(this.Zs)||this.optInOut(ft(r.ni(this.Zs))),r.ai(this.Zs,this.gn.cross_subdomain_cookie))}return this.Qs}Ws(){return!!this.gn.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack,null==i?void 0:i.globalPrivacyControl].some((t=>ft(t)))}}var Nb=Gi("[Dead Clicks]"),qb=()=>!0,jb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Pn)),r=t.instance.config.capture_dead_clicks;return nt(r)?r:!!Q(r)||i};class Bb{get lazyLoadedDeadClicksAutocapture(){return this.Js}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({[Pn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ks((()=>{this.Ys()})):this.stop()}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Nb.error("failed to load script",e):t()}))}Ys(){var t;if(r){if(!this.Js&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Q(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Js=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Js.start(r),Nb.info("starting...")}}else Nb.error("`document` not found. Cannot start.")}stop(){this.Js&&(this.Js.stop(),this.Js=void 0,Nb.info("stopping..."))}}var Hb=Gi("[SegmentIntegration]");var zb="posthog-js";function Ub(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,a,l,h,d;if("*"!==o&&!o.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,f=(null==(i=e.exception)?void 0:i.values)||[],g=f.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=f[0])?void 0:a.value)||e.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}class Wb{constructor(t,e,i,r,n,s){this.name=zb,this.setupOnce=function(a){a(Ub(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Vb{constructor(t){this.Xs=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Vi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ta=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.ea()}ea(){var t;this.ia=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Xs)}destroy(){var t;null==(t=this.ia)||t.call(this),this.ia=void 0}doPageView(e,i){var r,n=this.ra(e,i);return this.ta={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(t){var e;return this.ra(t,null==(e=this.ta)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ta)?void 0:t.pageViewId}}ra(t,e){var i=this.ta;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,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(K(s)||K(a)||K(o)||K(l)||K(u)||K(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?gt(a/s,0,1,Vi):1,v=s>1?gt(o/s,0,1,Vi):1,c=l>1?gt(u/l,0,1,Vi):1,f=l>1?gt(h/l,0,1,Vi):1;r=Ji(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$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}}var Gb=["flags","surveys"],Zb={[bn]:{exposure:"hidden"},[Sn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[xn]:{exposure:"hidden"},[Cn]:{exposure:"event"},[Tn]:{exposure:"hidden"},[Fn]:{exposure:"hidden"},[Mn]:{exposure:"event"},[En]:{exposure:"hidden"},[In]:{exposure:"event"},[Rn]:{exposure:"event"},[Pn]:{exposure:"event"},[An]:{exposure:"hidden"},[On]:{exposure:"event"},[Ln]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Bn]:{exposure:"hidden"},[Hn]:{exposure:"event"},[Dn]:{exposure:"event",shouldSkipFromEventProperties:t=>tt(t)},[zn]:{exposure:"event"},[Un]:{exposure:"event"},[Wn]:{exposure:"event"},[Qn]:{exposure:"event"},[Jn]:{exposure:"hidden"},[Kn]:{exposure:"hidden",storageGroup:"flags"},[Yn]:{exposure:"hidden",storageGroup:"flags"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden",storageGroup:"flags"},[es]:{exposure:"hidden",storageGroup:"flags"},[is]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[rs]:{exposure:"hidden",storageGroup:"flags"},[ns]:{exposure:"hidden"},[ss]:{exposure:"hidden"},[as]:{exposure:"hidden"},[os]:{exposure:"hidden"},[us]:{exposure:"hidden",storageGroup:"surveys"},[hs]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ds]:{exposure:"event"},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden"},[fs]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ls]:{exposure:"event"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[bs]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[ws]:{exposure:"hidden"},[ks]:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[xs]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[$n]:{exposure:"event"},[Nn]:{exposure:"event"},[qn]:{exposure:"event"},[jn]:{exposure:"event"},[Es]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"},[As]:{exposure:"event"},[Fs]:{exposure:"event"},[Os]:{exposure:"event"},[Ls]:{exposure:"event"},[Ds]:{exposure:"event"},[$s]:{exposure:"event"},[Ns]:{exposure:"event"}},Qb=[[Vn,{exposure:"hidden"}],[Gn,{exposure:"hidden"}],[Zn,{exposure:"hidden"}]],Jb=t=>{var e=Zb[t];if(e)return e;for(var i of Qb){var r=i[1];if(0===t.indexOf(i[0]))return r}},Kb={flags:ys,surveys:hs},Yb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Xb=t=>t+"_cookie_identity_change_pending",t_="main",e_=[Kn,Yn,ts,es,is,ys,rs,as],i_=t=>-1!==e_.indexOf(t),r_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},n_=t=>{if(!t)return{};var e=JSON.parse(t);return Q(e)?e:{}},s_=(t,e)=>{Qi(t,((i,r)=>{var n=Jb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class a_{constructor(e,i,r){if(void 0===r&&(r=!0),this.na={},this.sa=!1,this.aa=!1,this.oa=!1,this.la=!1,this.ua=new Map,this.ha=!1,this.da=!1,this.va=!1,this.ca=new Set,this.gn=e,this.fa=r,this.props={},this.pa=void 0,this.ga=(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"})(e),this.Gs=this.ma(e),this.aa=this.ya(e),this.load(),this.ba(),e.debug&&Vi.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();rr(t,"beforeunload",n,{capture:!1}),rr(t,"pagehide",n,{capture:!1}),this._a=e=>{if(this.sa&&(!e.storageArea||e.storageArea===(null==t?void 0:t.localStorage))&&e.key)if(e.key!==this.ga){if(this.aa){var i=Gb.find((t=>e.key===this.wa(t)));i&&this.ka(e.key,i)}}else this.ka(e.key,t_)},rr(t,"storage",this._a)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach((t=>{var e=t[0],i=t[1],r=this.ua.get(e);if(i_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach((t=>n.add(t))),n.size&&this.Sa(e,n)}else this.Sa(e,!0)}))}onCrossTabFeatureFlagChange(t){return this.ca.add(t),()=>this.ca.delete(t)}destroy(){this._a&&t&&(t.removeEventListener("storage",this._a),this._a=void 0),this.ca.clear()}ka(t,e,i){if(void 0===i&&(i=!0),this.xa)return!1;var r,n;try{if(n=gp.ni(t),tt(n)){var s=this.Ca(e);return s.storageValue=null,e!==t_&&(s.persisted=!1),!1}r=n_(n)}catch(t){return!1}var a=e===t_?r:gp.si(this.ga);if(a&&this.Ta(a))return!1;var o=this.Ma(r,e,i);return e===t_&&this.aa&&!r_(this.Ea().main,r)||this.Ia(r,e,!0,n),o}Ta(t){var e=this.props[_n],i=t[_n];return!K(e)&&!K(i)&&e!==i}Ia(t,e,i,r){var n=this.Ca(e);n.storageValue=r,e!==t_&&(n.persisted=i);try{n.fingerprint=this.Ra(t,e)}catch(t){n.fingerprint=void 0}}Ma(t,e,i){var r=!1;return e_.forEach((i=>{var n,s=null==(n=Jb(i))?void 0:n.storageGroup;if(!(e===t_&&this.aa&&s||e!==t_&&s!==e)){var a=i in t,o=this.Pa(i,a?t[i]:void 0),l=this.ua.has(i)?i in this.props:a;l===i in this.props&&r_(o,this.props[i])||(l?this.Aa(i,o,!1):this.Fa(i,!1),r=!0)}})),r&&i&&this.ca.forEach((t=>t())),r}Oa(){if(!this.sa)return!1;try{this.va=!1;var t,e=gp.ni(this.ga),i=this.Ca(t_),r=!1,n=!1;if(e!==i.storageValue)if(tt(e))i.storageValue=null;else{if(t=n_(e),this.va=!this.da&&this.Ta(t),this.va)return!1;n=this.Ma(t,t_,!1),!this.aa||r_(this.Ea().main,t)?this.Ia(t,t_,!0,e):i.storageValue=e,r=!0}return this.aa&&Gb.forEach((e=>{var i=gp.ni(this.wa(e)),s=this.Ca(e),a=t||{},o=r&&e_.some((t=>{var i;return(null==(i=Jb(t))?void 0:i.storageGroup)===e&&t in a}));if(i!==s.storageValue||o){if(tt(i))return s.storageValue=null,s.persisted=!1,void(o&&(n=this.Ma(a,e,!1)||n));var l=n_(i);n=this.Ma(l,e,!1)||n,this.Ia(l,e,!0,i)}})),n}catch(t){return!1}}Sa(t,e){this.ua.set(t,e);var i=Jb(t);null!=i&&i.volatile||(this.Ca((this.aa?null==i?void 0:i.storageGroup:void 0)||t_).fingerprint=void 0,this.La(t))}Da(){e_.forEach((t=>this.ua.set(t,!0)))}ba(){if(this.sa)try{var t=gp.ni(this.ga),e=n_(t);this.Ca(t_).storageValue=t,e_.forEach((t=>{var i,r=this.aa?null==(i=Jb(t))?void 0:i.storageGroup:void 0,n=r?gp.ni(this.wa(r)):null;if(r){var s=this.Ca(r);s.storageValue=n,s.persisted=!tt(n)}var a=r&&!tt(n)?n_(n):e;t in this.props?this.$a(t,a[t],this.props[t]):t in a&&this.Sa(t,!0)}))}catch(t){}}Pa(t,e){var i=this.ua.get(t);if(!i)return e;if(!0===i)return this.props[t];if(t===Yn){var r=new Set(G(e)?e:[]),n=new Set(G(this.props[t])?this.props[t]:[]);return i.forEach((t=>n.has(t)?r.add(t):r.delete(t))),Array.from(r)}var s=Q(e)?p({},e):{},a=Q(this.props[t])?this.props[t]:{};return i.forEach((t=>{t in a?s[t]=a[t]:delete s[t]})),s}$a(t,e,i){if(i_(t)){var r=this.ua.get(t);if(!0!==r){var n=e;if(this.sa)try{var s,a=this.aa?null==(s=Jb(t))?void 0:s.storageGroup:void 0,o=a?this.wa(a):this.ga;n=n_(gp.ni(o))[t]}catch(t){}var l=new Set(r||[]);if(t===Yn){if(!K(e)&&!G(e)||!K(n)&&!G(n)||!G(i))return void this.Sa(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(!Q(i))return void(r_(n,i)?this.ua.delete(t):this.Sa(t,!0));if(!K(e)&&!Q(e)||K(e)&&J(i)&&K(n))return void this.Sa(t,!0);var v=Q(e)?e:{},c=Q(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach((t=>{t in v==t in i&&r_(v[t],i[t])||l.add(t)})),l.forEach((t=>{t in c==t in i&&r_(c[t],i[t])&&l.delete(t)}))}l.size?this.Sa(t,l):this.ua.delete(t)}}}Na(){var t,e=null==(t=this.gn)?void 0:t.persistence_save_debounce_ms;return it(e)&&e>0?e:0}qa(t){if(this.gn.cookieWinsOnConflict&&"localstorage+cookie"===this.gn.persistence.toLowerCase())if(t)try{var e=kp(t,this.gn.cookie_persisted_properties||[]),i=xp(e,this.gn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=fp.ni(this.ga)||void 0;n&&Tp(this.ga,n)===r&&(this.ja=r,this.Ba=n)}catch(t){}else try{var s=fp.ni(this.ga)||void 0;this.ja=s?Tp(this.ga,s):void 0,this.Ba=s}catch(t){}}syncCookieProperties(){return this.Ha(this.gn)}Ha(t,e){if(void 0===e&&(e=!1),this.xa&&!e||this.la||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=fp.ni(this.ga)||void 0}catch(t){}if(!i||i===this.Ba)return!1;var r,n=Tp(this.ga,i);try{r=wp(JSON.parse(i))}catch(t){return!1}if((fp.ni(this.ga)||void 0)!==i)return!1;this.ja=n,this.Ba=i;var s=Cp(this.ga,i),a=[...yp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(K(e)||tt(e)||""===e||t===bs&&e!==Hs&&e!==zs)&&(o[t]=!0,delete r[t])})),J(r))return!1;var l=_n in r||r[bs]===Hs||r[bs]===zs,u=this.props,h=u[_n],d=u[bs],v=Ji({},u);[...yp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==_n&&t!==bs)){var e=v[t];!s.isValid&&-1!==yp.indexOf(t)&&(!1===e||0===e)||delete v[t]}})),this.props=Ji(v,r),e_.forEach((t=>{var e=t in this.props;t in u===e&&r_(u[t],this.props[t])||(e?this.$a(t,u[t],this.props[t]):this.Sa(t,!0))})),!l||bs in r||bs in this.props||this.Aa(bs,Hs);var c=this.props[_n],f=this.props[bs];return!l||c===h&&f===d||(this.da=!0,this.oa=!0,Rp.ii(Xb(this.ga),!0),this.Fa(as),this.Fa(Yn),this.Fa(Kn),this.Fa(ts),this.Fa(es),this.Fa(is),this.Fa(ys),this.Fa(ms),this.Fa(ps),f===Hs&&(d===zs||r[bs]===Hs||!K(h)&&c!==h)&&(s_(this.props,r),this.Fa(os)),f===zs?this.props.$user_id=c:delete this.props.$user_id,this.Fa(Sn)),!0}consumeCookieIdentityChange(){var t=Xb(this.ga),e=this.oa||!!Rp.ni(t);return this.oa=!1,e&&Rp.ai(t),e}za(t){return void 0===t&&(t=!1),!(this.la||this.xa&&!t||!this.gn.cookieWinsOnConflict||"localstorage+cookie"!==this.gn.persistence.toLowerCase()||(this.la=!0,0))}Ua(){this.la&&(K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0),delete this.na[t_],this.Va(!0))}Ga(t){if(void 0===t&&(t=!0),this.la)try{t?this.Ua():K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0)}finally{this.la=!1}}isDisabled(){return!!this.xa}ma(e){-1===Yb.indexOf(e.persistence.toLowerCase())&&(Vi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...yp,...e];return p({},gp,{si(t){try{var e,n={};try{e=fp.ni(t)||void 0,n=e?wp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(gp.ni(t)||"{}");if(i){var o=Cp(t,e),l=[...yp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];tt(e)||""===e||t===bs&&e!==Hs&&e!==zs||(u[t]=e)}));var h=_n in u||u[bs]===Hs||u[bs]===zs;if(Object.keys(u).length>0){var d,v=a[_n],c=null!==(d=a[bs])&&void 0!==d?d:Hs;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==_n&&t!==bs)){var e=a[t];!o.isValid&&-1!==yp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||bs in n||bs in a||(a[bs]=Hs),!h||(_n in u?u[_n]:a[_n])===v&&(bs in u?u[bs]:a[bs])===c||(mp.forEach((t=>delete a[t])),u[bs]===zs&&_n in u?a.$user_id=u[_n]:delete a.$user_id,u[bs]!==zs&&(delete a[ls],delete a[os]),delete a.__alias)}s=Ji(a,u)}else s=Ji(n,a);return gp.ii(t,s),s}catch(t){}return null},ii(t,r,n,s,a,o){var l=gp.ii(t,r,void 0,void 0,o);try{var u=kp(r,e);if(Object.keys(u).length){if(i){var h=bp(t),d=xp(u,e);if(fp.ii(h,d,n,s,a,o),fp.ni(h)!==JSON.stringify(d)){fp.ai(h,s);var v=kp(r);return fp.ii(t,v,n,s,a,o),l}}fp.ii(t,u,n,s,a,o)}}catch(t){gp.oi(t)}return l},ai(e,i){try{null==t||t.localStorage.removeItem(e),fp.ai(e,i),fp.ai(bp(e),i)}catch(t){gp.oi(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&gp.ri()?(i=gp,n=!0):"localstorage+cookie"===s&&r.ri()?(i=r,n=!0):"sessionstorage"===s&&Rp.ri()?i=Rp:"memory"===s?i=Ep:"cookie"===s&&fp.ri()?i=fp:r.ri()?(i=r,n=!0):i=fp.ri()?fp:Ep,this.sa=n,i}wa(t){return this.ga+"__"+t}ya(t){return this.sa&&!!t.split_storage}properties(){var t={};return Qi(this.props,((e,i)=>{var r=Jb(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.xa||t){var e=this.gn.cookieWinsOnConflict&&"localstorage+cookie"===this.gn.persistence.toLowerCase(),i=e?gp.si(this.ga):null,r={};if(e)try{Qi(r=wp(fp.si(this.ga)),((t,e)=>{(K(t)||tt(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.Gs.si(this.ga);if(n&&(this.props=Ji({},n)),this.aa&&this.Za(),e&&n){var s,a,o=null==i?void 0:i[_n],l=null!==(s=null==i?void 0:i[bs])&&void 0!==s?s:Hs,u=n[_n],h=null!==(a=n[bs])&&void 0!==a?a:Hs;if(u!==o||h!==l){this.oa=!0,Rp.ii(Xb(this.ga),!0);var d=Ji({},this.props);mp.forEach((t=>delete d[t])),h===Hs&&(l===zs||r[bs]===Hs||!K(o)&&u!==o)&&(s_(d,r),delete d[os]),this.props=d;var v=new Set;mp.forEach((t=>{var e,i=null==(e=Jb(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Qi(this.props,((i,r)=>{var n;(null==(n=Jb(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),J(e)?(gp.ai(this.wa(t)),this.na[t]={}):gp.ii(this.wa(t),e)&&(this.na[t]={persisted:!0,fingerprint:this.Ra(e,t)})}))}}Rp.ni(Xb(this.ga))&&(this.oa=!0)}}Za(){for(var t of Gb){var e=gp.si(this.wa(t));if(e&&!J(e)){var i=this.Ca(t);i.persisted=!0,this.Qa(t)||(i.fingerprint=this.Ra(e,t)),this.Ja(t,e)||Ji(this.props,e)}}}Qa(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Jb(e))?void 0:i.storageGroup)===t}))}Ja(t,e){var i=Kb[t];if(!i)return!1;var r=e[i],n=this.props[i];return it(r)&&it(n)&&n>r}refreshKey(t){var e;if(!this.xa){var i=this.aa?null==(e=Jb(t))?void 0:e.storageGroup:void 0,r=i?gp.si(this.wa(i)):this.Gs.si(this.ga);if(r&&t in r)this.Aa(t,r[t]);else{if(i){var n=this.Gs.si(this.ga);if(n&&t in n)return void this.Aa(t,n[t])}this.Fa(t)}}}save(){if(!this.xa){var t=this.Na();t>0?K(this.Wa)&&(this.Wa=setTimeout((()=>{this.Wa=void 0,this.Va()}),t)):this.Va()}}flush(){K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0,this.Va())}Va(t){if(void 0===t&&(t=!1),!(this.xa||this.la&&!t)){t||this.syncCookieProperties();var e=!t&&!this.ha;e||(this.va=!1);var i=!!e&&this.Oa();if(this.va)this.gn.debug&&Vi.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.aa)return this.Ka(),void(i&&this.ca.forEach((t=>t())));var r=this.Ya(this.Gs,this.ga,this.props,t_);"written"===r&&this.qa(this.props),"failed"!==r&&(this.ua.clear(),this.da=!1),i&&this.ca.forEach((t=>t()))}}}Ka(){var t=this,e=this.Ea(),i=e.main,r=e.groups,n=this.Ya(this.Gs,this.ga,i,t_);"written"===n&&this.qa(i),"failed"!==n&&(this.da=!1,e_.forEach((t=>{var e;null!=(e=Jb(t))&&e.storageGroup||this.ua.delete(t)})));var s=function(e){var i,n=r[e];if(J(n)&&(null==(i=t.na[e])||!i.persisted))return e_.forEach((i=>{var r;(null==(r=Jb(i))?void 0:r.storageGroup)===e&&t.ua.delete(i)})),1;var s=t.Ya(gp,t.wa(e),n,e);"failed"!==s&&e_.forEach((i=>{var r=Jb(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.ua.delete(i)}))};for(var a of Gb)s(a)}Ea(){var t={},e={flags:{},surveys:{}};return Qi(this.props,((i,r)=>{var n,s=null==(n=Jb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ra(t,e){if(e===t_)return JSON.stringify(t)+"|"+this.Xa+"|"+this.eo+"|"+this.io;var i={};return Qi(t,((t,e)=>{var r;i[e]=null!=(r=Jb(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}Ya(t,e,i,r){var n,s=this.Ca(r);if(r!==t_&&!s.dirty&&!K(s.fingerprint))return"skipped";try{if((n=this.Ra(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.ii(e,i,this.Xa,this.eo,this.io,this.gn.debug)?(s.dirty=!1,r!==t_&&(s.persisted=!0),K(n)||(s.fingerprint=n),this.sa&&(s.storageValue=gp.ni(e)),"written"):(this.gn.debug&&Vi.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.Da(),K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0),this.Gs.ai(this.ga,!1),this.Gs.ai(this.ga,!0),!i&&this.fa)for(var r of Gb)gp.ai(this.wa(r));i?delete this.na[t_]:this.na={},this.ja=void 0,this.Ba=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Q(t)){this.syncCookieProperties(),K(e)&&(e="None"),this.Xa=K(i)?this.ro:i;var r=!1;if(Qi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Aa(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Q(t)){this.syncCookieProperties(),this.Xa=K(e)?this.ro:e;var i=!1;if(Qi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Q(e)||G(e))&&(this.Aa(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.Fa(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.pa){var e=Wo(this.gn.custom_campaign_params,this.gn.mask_personal_data_properties,this.gn.custom_personal_data_properties);J(tr(e))||this.register(e),this.pa=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Go(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Jo(),$referring_domain:null!=r&&r.referrer&&(null==(t=or(r.referrer))?void 0:t.host)||Qo},void 0)}set_initial_person_info(){this.props[ks]||this.props[Ss]||this.register_once({[xs]:Ko(this.gn.mask_personal_data_properties,this.gn.custom_personal_data_properties,this.gn.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Qi([Ss,ks],(e=>{var i=this.props[e];i&&Qi(i,(function(e,i){t["$initial_"+H(i)]=e}))}));var e=this.props[xs];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Yo(t,e),r={};return Qi(i,(function(t,e){r["$initial_"+H(e)]=t})),r}(e,this.gn.disable_capture_url_hashes);Ji(t,i)}return t}safe_merge(t){return Qi(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){var r=t.persistence!==e.persistence,n=!((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||[]),s=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,o=t.disable_persistence||!!i,l=!!this.xa&&!o;o||this.Ha(e,l),this.gn=t,!o&&(r||n||a)&&(this.ja=void 0,this.Ba=void 0,this.Ha(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this.ma(t):this.Gs,h=this.ya(t),d=s||h!==this.aa,v=!o&&(d||t.cross_subdomain_cookie!==this.eo||t.secure_cookie!==this.io)&&this.za(l);this.ha=d;try{if(this.ro=this.Xa=t.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.Gs=u,this.aa=h,this.props=c,this.save()}else a&&(this.Gs=u,o||(delete this.na[t_],this.Va()))}finally{this.ha=!1,v&&this.Ga()}}set_disabled(t){this.xa=t,this.xa?this.remove():this.save()}set_cross_subdomain(t){t!==this.eo&&(this.eo=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.io&&(this.io=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[xn]||{};i[t]=e,this.Aa(xn,i),this.save()}remove_event_timer(t){var e=this.props[xn]||{},i=e[t];return K(i)||(delete e[t],this.Aa(xn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Aa(t,e),this.save()}Aa(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&(t!==_n&&t!==bs||n===e||(this.da=!0),this.$a(t,n,e),null!=(r=Jb(t))&&r.volatile||this.La(t))}Fa(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(i_(t)&&this.Sa(t,!0),this.La(t))}La(t){var e,i=null==(e=Jb(t))?void 0:e.storageGroup;i&&(this.Ca(i).dirty=!0)}Ca(t){return this.na[t]||(this.na[t]={})}}var o_=Gi("[RateLimiter]");class l_{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=>{o_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void o_.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,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(ws))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(it(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.no(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(ws,o),{isRateLimited:l,remainingTokens:o.tokens}}so(t){var e=this.instance.config.property_denylist;return!G(e)||!e.includes(t)}ao(){var t;if(this.so("$current_url")&&this.so("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}no(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ao(),a=this.so("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". 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}}var u_=Gi("[RemoteConfig]");class h_{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}oo(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}lo(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 u_.info("Using preloaded remote config",this.remoteConfig),void this.uo(this.remoteConfig);if(this._instance.ho())return void u_.warn("Remote config is disabled. Falling back to local config.");this.oo((t=>{if(!t)return u_.info("No config found after loading remote JS config. Falling back to JSON."),void this.lo((t=>{this.uo(t.json,t)}));this.uo(t)}))}catch(t){u_.error("Error loading remote config",t),this.uo()}}uo(t,e){!t&&e&&(0===e.statusCode?e.error||u_.warn("Failed to fetch remote config from PostHog."):u_.error("Failed to fetch remote config from PostHog."));try{this._instance.uo(t?{ok:!0,config:t}:{ok:!1})}catch(t){u_.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){u_.error("Error loading feature flags",t)}}}var d_=!!a||!!s,v_="text/plain",c_=!1,f_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},p_=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],a=n[1],o=p({},e),l=null!==(r=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=o[n])&&void 0!==e?e:r[1];return delete o[n],n+"="+s})))&&void 0!==r?r:[],u=lr(o);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},g_=t=>{if(t.do)return t.do;var e=t.data,i=t.compression;if(e){if(i===Af){var r=uo(ho(ar(e)),{mtime:0});return{contentType:v_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Ff){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(ar(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:ar(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=ar(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},m_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:p_(t.url,{compression:Ff}),encodedBody:g_(p({},t,{compression:Ff,do:void 0}))}:{url:f_(t.url,"compression"),encodedBody:g_(p({},t,{compression:void 0,do:void 0}))};try{e=g_(t)}catch(e){if($e(t.compression,ur(t.url,"compression")))return Vi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&$e(t.compression,ur(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?De(new Uint8Array(i)):ArrayBuffer.isView(i)&&De(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(c_=!0,r()):{url:t.url,encodedBody:e}},y_=t=>{try{return m_(t)}catch(e){return Vi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},b_=function(){var t=f((function*(t){var e=ar(t.data),i=yield He(e,Ui.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{do:{contentType:v_,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),__=/Failed to fetch|NetworkError|Load failed/i,w_=t=>"TypeError"===(null==t?void 0:t.name)&&__.test((null==t?void 0:t.message)||""),k_=t=>{var e=y_(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},a=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Qi(t.headers,(function(t,e){h.append(e,t)})),a&&h.append("Content-Type",a);var d=null,v=!1;if(o){var c=new o;d={signal:c.signal,timeout:setTimeout((()=>{var e;v=!0,c.abort(Ie("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||w_(e)?Vi.warn(e):Vi.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;s(i,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&!t.vo&&52428.8>(u||0),body:l,signal:null==(g=d)?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){Vi.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},S_=t=>{try{var e,r=m_(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(i.sendBeacon(n,u))return;var h=G(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(G(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>G(t.data)?e:p({},t.data,{batch:e});return S_(p({},t,{data:v(h.slice(0,d))})),void S_(p({},t,{data:v(h.slice(d))}))}Vi.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),k_(p({},t,{vo:!0}))}catch(t){Vi.warn("Beacon send failed",t)}},x_=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return p_(i===Af?f_(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Af?{}:{compression:i}))},C_=[];s&&C_.push({transport:"fetch",method:k_}),a&&C_.push({transport:"XHR",method(t){var e=y_(t);if(e){var i=new a,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Qi(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)}}}),null!=i&&i.sendBeacon&&C_.push({transport:"sendBeacon",method:S_});var T_=3e3;class M_{constructor(t,e){this.co=!0,this.fo=[],this.po=gt((null==e?void 0:e.flush_interval_ms)||T_,250,5e3,Vi.createLogger("flush interval"),T_),this.mo=t}enqueue(t){this.fo.push(t),this.yo||this.bo()}unload(){this._o();var t=this.fo.length>0?this.wo():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.ko(p({},t,{transport:"sendBeacon"}))}))}enable(){this.co=!1,this.bo()}bo(){var t=this;this.co||(this.yo=setTimeout((()=>{if(this._o(),this.fo.length>0){var e=this.wo(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&G(i.data)&&Qi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ko(i)};for(var r in e)i()}}),this.po))}ko(t){try{this.mo(t)}catch(t){Vi.error(t)}}_o(){clearTimeout(this.yo),this.yo=void 0}wo(){var t={};return Qi(this.fo,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;K(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.fo=[],t}}var E_=["retriesPerformedSoFar"];class I_{constructor(e){this.So=!1,this.xo=3e3,this.fo=[],this._instance=e,this.fo=[],this.Co=!0,!K(t)&&"onLine"in t.navigator&&(this.Co=t.navigator.onLine,this.To=()=>{this.Co=!0,this.Mo()},this.Eo=()=>{this.Co=!1},rr(t,"online",this.To),rr(t,"offline",this.Eo))}get length(){return this.fo.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,E_);rt(e)&&(i.url=p_(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.es(p({retriesPerformedSoFar:e},i));0===t.statusCode&&Vi.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!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}es(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;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.fo.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Vi.warn(n),this.So||(this.So=!0,this.Io())}Io(){if(this.Ro&&clearTimeout(this.Ro),0===this.fo.length)return this.So=!1,void(this.Ro=void 0);this.Ro=setTimeout((()=>{this.Co&&this.fo.length>0&&this.Mo(),this.Io()}),this.xo)}Mo(){var t=Date.now(),e=[],i=this.fo.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.fo=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Ro&&(clearTimeout(this.Ro),this.Ro=void 0),this.So=!1,K(t)||(this.To&&(t.removeEventListener("online",this.To),this.To=void 0),this.Eo&&(t.removeEventListener("offline",this.Eo),this.Eo=void 0)),this.fo)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Vi.error(t)}}this.fo=[]}}class R_{constructor(t){this.Po=()=>{var t,e,i,r;this.Ao||(this.Ao={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Ao.lastScrollY=Math.ceil(s),this.Ao.maxScrollY=Math.max(s,null!==(t=this.Ao.maxScrollY)&&void 0!==t?t:0),this.Ao.maxScrollHeight=Math.max(a,null!==(e=this.Ao.maxScrollHeight)&&void 0!==e?e:0),this.Ao.lastContentY=o,this.Ao.maxContentY=Math.max(o,null!==(i=this.Ao.maxContentY)&&void 0!==i?i:0),this.Ao.maxContentHeight=Math.max(l,null!==(r=this.Ao.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Fo(){return this._instance.config.scroll_root_selector}getContext(){return this.Ao}resetContext(){var t=this.Ao;return setTimeout(this.Po,0),t}startMeasuringScrollPosition(){rr(t,"scroll",this.Po,{capture:!0}),rr(t,"scrollend",this.Po,{capture:!0}),rr(t,"resize",this.Po)}scrollElement(){if(!this.Fo)return null==t?void 0:t.document.documentElement;var e=G(this.Fo)?this.Fo:[this.Fo];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Oo(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Fo){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Oo("y")}scrollX(){return this.Oo("x")}}var P_=t=>Ko(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 A_{constructor(t,e,i,r){this.Tt=t=>{var e=this.Lo();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Do(this._instance)};this.$o.register({[_s]:i})}},this._instance=t,this.No=e,this.$o=i,this.Do=r||P_,this.No.onSessionId(this.Tt)}Lo(){return this.$o.props[_s]}getSetOnceProps(){var t,e=null==(t=this.Lo())?void 0:t.props;return e?"r"in e?Yo(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 Qi(tr(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+H(i)]=e})),t}}class F_{on(t,e){return this.qo[t]||(this.qo[t]=[]),this.qo[t].push(e),()=>{this.qo[t]=this.qo[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.qo[t]||[])i(e);for(var r of this.qo["*"]||[])r(t,e)}constructor(){this.qo={}}}var O_=Gi("[SessionId]"),L_=864e5;class D_{on(t,e){return this.jo.on(t,e)}constructor(t,e,i){var r;if(this.Bo=null,this.Ho=null,this.zo=[],this.Uo=void 0,this.Wo=!1,this.jo=new F_,this.Vo=(t,e)=>!(!rt(t)||!rt(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Bs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.gn=t.config,this.$o=t.persistence,this.It=void 0,this.Pe=void 0,this._sessionStartTimestamp=null,this.Go=void 0,this._sessionActivityTimestamp=null,this.Zo=e||up,this.Qo=i||up;var n=this.gn.persistence_name||this.gn.token;if(this._sessionTimeoutMs=1e3*gt(this.gn.session_idle_timeout_seconds||1800,60,36e3,O_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Jo(),this.Ko="ph_"+n+"_window_id",this.Yo="ph_"+n+"_primary_window_exists",this.Xo()){var s=Rp.si(this.Ko),a=Rp.si(this.Yo);s&&!a?this.It=s:Rp.ai(this.Ko),Rp.ii(this.Yo,!0)}null!=(r=this.gn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.gn.bootstrap.sessionID),this.tl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return K(this.zo)&&(this.zo=[]),this.zo.push(t),this.Pe&&t(this.Pe,this.It),()=>{this.zo=this.zo.filter((e=>e!==t))}}Xo(){return"memory"!==this.gn.persistence&&!this.$o.xa&&Rp.ri()}el(t){t!==this.It&&(this.It=t,this.Xo()&&Rp.ii(this.Ko,t))}il(){return this.It?this.It:this.Xo()?Rp.si(this.Ko):null}rl(t){var e=this.Bo;return!tt(e)&&!tt(t)&&5e3>Math.abs(t-e)}nl(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Pe||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Pe=t,n&&!r||n&&this.rl(e)||(this.Bo=e,this.$o.register({[Bn]:[e,t,i]}))}sl(){var t,e=null==(t=this.gn)?void 0:t.persistence_save_debounce_ms;return rt(e)&&e>0}al(){this.sl()?this.$o.refreshKey(Bn):(this.$o.flush(),this.$o.load())}ol(){var t;if(!tt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Bo){this.al();var e=this.ll();e[1]===this.Pe&&e[2]===this._sessionStartTimestamp&&(this.Bo=this._sessionActivityTimestamp,this.$o.register({[Bn]:[this._sessionActivityTimestamp,null!==(t=this.Pe)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.$o.flush())}}ul(){var t=this.ll()[0],e=rt(t)?t:0,i=rt(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}hl(t){return this.al(),this.Vo(t,this.ul())}ll(){var t=this.$o.props[Bn];return G(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Bo=null,this.Go=void 0,clearTimeout(this.dl),this.dl=void 0,this.nl(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 O_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void O_.error("Invalid sessionID in bootstrap",t)}}(t);return!K(i)&&(e?this.Go={sessionId:t,sessionStartTimestamp:i}:this.nl(t,(new Date).getTime(),i),!0)}destroy(){this.Wo=!0,this.ol(),clearTimeout(this.dl),this.dl=void 0,this.Uo&&t&&(t.removeEventListener(Vs,this.Uo,{capture:!1}),this.Uo=void 0),this.zo=[]}tl(){this.Uo=()=>{this.ol(),this.Xo()&&Rp.ai(this.Yo)},rr(t,Vs,this.Uo,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.gn.cookieless_mode===Bs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Pe;if(i)this.Ho=r;else if(tt(this.Ho)||this.Ho>r||r-this.Ho>=1e3){var s,a;null==(s=(a=this.$o).syncCookieProperties)||s.call(a),this.Ho=r}var o=this.ll(),l=o[1],u=o[2],h=!K(n)&&l!==n,d=this.ul(),v=this.il(),c=this.Go,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>L_),p=c?f:rt(u)&&Math.abs(r-u)>L_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Vo(r,d);if(_){(_=this.hl(r))||O_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.ll();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Zo(),v=this.Qo(),O_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Go=void 0,g=!0}else v||(v=this.Qo(),g=!0),(m=m||l!==b)&&(O_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=rt(d)&&t&&!p?d:r,x=rt(u)?u:(new Date).getTime();this.el(v),this.nl(l,S,x),t||this.Jo();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.zo.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}Jo(){this.Wo||(clearTimeout(this.dl),this.dl=setTimeout((()=>{if(!this.Wo)if(this.hl((new Date).getTime())){var t=this.Pe;this.resetSessionId(),this.jo.emit("forcedIdleReset",{idleSessionId:t})}else this.Jo()}),1.1*this.sessionTimeoutMs))}}var $_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&q(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>q(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function N_(){return N_=f((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Y(r)&&r.length>0?r:void 0}catch(t){return void Vi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),N_.apply(this,arguments)}var q_="custom",j_="i.posthog.com",B_=/^\/static\//,H_=["/s/","/e/","/i/"];class z_{constructor(t){this.vl={},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("."+j_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.vl[this.apiHost]||(this.vl[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":q_),this.vl[this.apiHost]}cl(t){if(B_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}fl(t){var e=or(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}pl(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,a=(null==(s=or(i))?void 0:s.href)||i;r=n(new URL(a)).toString()}if(n&&"api"===t&&H_.some((t=>0===e.indexOf(t)))){var o=this.fl(r);if(o){var l,u=this.apiHost,h=this.gl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.gl=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this.gl,i=this.fl(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.pl(t,e,this.uiHost+e);if("flags"===t)return this.pl(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.cl(e);if(i)return this.pl(t,e,""+i+e)}if(this.region===q_)return this.pl(t,e,this.apiHost+e);var r=j_+e;switch(t){case"assets":return this.pl(t,e,"https://"+this.region+"-assets."+r);case"api":return this.pl(t,e,"https://"+this.region+"."+r)}}}var U_=Gi("[PostHog ExternalIntegrations]"),W_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class V_{constructor(t){this._instance=t}Ks(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return U_.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ks(W_[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=v.__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()}}}class G_{constructor(t,e){this.A=t,this.$s=e,this.ml=new Map,this.Fs=!1}add(t){var e=this;return f((function*(){if(e.Fs)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.ml.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.ml.set(t.name,t);try{var i=t.setup(e.$s);i&&(yield i)}catch(i){var r=e.ml.get(t.name)===t;r&&e.ml.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.yl(t)}}))()}getExtension(t){return this.ml.get(t)}dispose(){if(!this.Fs){this.Fs=!0;var t=Array.from(this.ml.values()).reverse();for(var e of(this.ml.clear(),t))this.yl(e)}}yl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Z(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)}}}class Z_{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);K(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)}}var Q_="extensionsRemoteConfig";class J_{constructor(t){this.Fs=!1,this.instance=t,this.A=Vi,this.bl=t._l,this.kv=new Z_(t),this.onEvent=t=>Pf(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.Fs)return Pf((()=>{}));var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.wl.on(Q_,e);return this.bl&&e(this.bl),Pf(i)},this.kl=new G_(Vi.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(wn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(wn);return"string"==typeof t?t:void 0}get library(){return{name:Ui.LIB_NAME,version:Ui.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.kl.add(t)}getExtension(t){return this.kl.getExtension(t)}capture(t,e,i){var r=this;return f((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 Pf(this.instance.Sl(t))}handleRemoteConfig(t){this.Fs||(this.bl=t,this.instance.wl.emit(Q_,t))}sendRequest(t,e){var i=this;return f((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?p_(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?x.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.Fs||(this.Fs=!0,this.kl.dispose())}}var K_={},Y_=0,X_=()=>{},tw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ew="Surveys module not available",iw="sanitize_properties is deprecated. Use before_send instead",rw="Invalid value for property_denylist config: ",nw=["token","distinct_id",Ms],sw="posthog",aw=!d_&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),ow=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},lw=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ir(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:X_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:n&&Y(null==n?void 0:n.search)&&-1!==n.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.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){Vi.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:Us,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:T_},error_tracking:{},_onCapture:X_},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:$r,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:ow(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)}))(e))},uw=[["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"]],hw=t=>{var e={};for(var i of uw){var r=i[0],n=i[1];K(t[r])||(e[n]=t[r])}var s=Ji({},e,t),a=t.__preview_external_dependency_versioned_paths;return K(a)||(K(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Y(a)&&K(t.asset_host)&&(s.asset_host=a)),G(t.property_blacklist)&&(K(t.property_denylist)?s.property_denylist=t.property_blacklist:G(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Vi.error(rw+t.property_denylist)),s};class dw{constructor(){this.__forceAllowLocalhost=!1}get xl(){return this.__forceAllowLocalhost}set xl(t){Vi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class vw{Cl(t){if(t){var e=this.ml.indexOf(t);-1!==e&&this.ml.splice(e,1)}}Tl(t,e){return this.Cl(t),this.ml.push(e),null==e.initialize||e.initialize(),e}Ml(){return this.config.cookieless_mode===Bs||this.config.cookieless_mode===js&&this.consent.isRejected()}El(){if(!this.Il&&!this.config.segment&&!this.Ml()){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Rl||(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', or keep this persistence and pass a stable ID through bootstrap.distinctID."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, or keep persistence disabled and pass a stable ID through bootstrap.distinctID."),this.Il=!0,console.warn("[PostHog.js]",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)))}}Pl(){if(!this.Ml()&&this.get_distinct_id()===Ts){var t=this.persistence;if(t){this.Al()||t.load(!0);var e=this.get_distinct_id();if(!e||e===Ts){var i=this.config.get_device_id(up());this.register({distinct_id:i,$device_id:i}),t.set_property(bs,Hs)}this.Fl()}}}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 t;this.webPerformance=new dw,this.Ol=!1,this.version=Ui.LIB_VERSION,this.Ll=new Set,this.Dl="",this.wl=new F_,this.ml=[],this.$l=[],this.Rl=!1,this.Il=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=lw(),this.SentryIntegration=Wb,this.sentryIntegration=t=>function(t,e){var i=Ub(t,e);return{name:zb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Nl=!1,this.ql=null,this.jl=null,this.Bl=null,this.scrollManager=new R_(this),this.pageViewManager=new Vb(this),this.rateLimiter=new l_(this),this.requestRouter=new z_(this),this.consent=new $b(this),this.externalIntegrations=new V_(this);var e=null!==(t=vw.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Vi.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==sw){var r,n=null!==(r=K_[i])&&void 0!==r?r:new vw;return n._init(t,e,i),K_[i]=n,K_[sw][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s,a;void 0===i&&(i={});var o,l=Y(e)?e.trim():"";if(!l)return Vi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return l!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=lw(i.defaults),i.debug=this.Hl(i.debug),this.zl=i,this.Ul=[],i.person_profiles?this.jl=i.person_profiles:i.process_person&&(this.jl=i.process_person);var u=lw(i.defaults),h=hw(i),d=Ji({},u,h,{name:r,token:l});Q(u.rageclick)&&Q(h.rageclick)&&(d.rageclick=Ji({},u.rageclick,h.rageclick)),Q(u.session_recording)&&Q(h.session_recording)&&(d.session_recording=Ji({},u.session_recording,h.session_recording)),this.set_config(d),this.config.on_xhr_error&&Vi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Af;var v=this.Al();if(this.persistence=new a_(this.config,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new a_(p({},this.config,{persistence:"sessionStorage"}),v,!1),this.Dl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!v&&Rp.ri()){var c=Rp.si(this.Dl);G(c)&&c.forEach((t=>{Y(t)&&this.Ll.add(t)}))}else Rp.ai(this.Dl);var f=p({},this.persistence.props),g=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Wl=new M_((t=>this.Vl(t)),this.config.request_queue_config),this.Gl=new I_(this),this.__request_queue=[];var m=this.Ml();m||(this.sessionManager=new D_(this),this.sessionPropsManager=new A_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Zl()}))),this.Ql(),this.config.__preview_deferred_init_extensions?(Vi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Jl(m)}),0)):(Vi.info("Initializing extensions synchronously"),this.Jl(m)),Ui.DEBUG=Ui.DEBUG||this.config.debug,Ui.DEBUG&&Vi.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(n=i.bootstrap)&&n.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(s=i.bootstrap)?void 0:s.distinctID;if(this.Rl=!!y&&!X(y),void 0!==(null==(a=i.bootstrap)?void 0:a.distinctID)){var b=i.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(bs);if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Hs)this.identify(b);else if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===zs)Vi.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(up()),S=i.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(bs,i.bootstrap.isIdentifiedID?zs:Hs),this.register({distinct_id:b,$device_id:S})}}if(m)this.register_once({distinct_id:Ts,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(up());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(bs,Hs)}return rr(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||up();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(bs,zs)),e()},n=i.user();"then"in n&&Z(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||Hb.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Hb.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Hb.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Gs),identify:t=>e(t,Qs),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Kl())):this.Kl(),Z(this.config._onCapture)&&this.config._onCapture!==X_&&(Vi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Vi.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 N_.apply(this,arguments)}().then((t=>{t&&this.register({[kn]:t})})).catch(X_),this}Yl(t){var e=t;return Y(e.name)&&Z(e.setup)}Xl(t,e){this.Yl(t)?e.push((()=>{this.tu().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Vi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.ml.push(t)}Ql(){var t,e,i,r,n,s,a=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=vw.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.eu)||r.call(this),this.eu=void 0,this.featureFlags=new a(this)),Z(this.featureFlags.onReloading)&&Z(this.featureFlags.setup)?this.eu||(this.eu=this.featureFlags.onReloading((()=>{this.wl.emit("featureFlagsReloading",!0)})),this.tu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}Jl(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},vw.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.ml.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.ml.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.ml.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.ml.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.ml.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.Xl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.Xl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.Xl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.ml.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.ml.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.ml.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.ml.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.ml.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.ml.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.ml.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,jb)),u.toolbar&&this.ml.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.ml.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.ml.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.iu){var t=this.iu;this.iu=void 0,this.ml.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.ru(h,l)}ru(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ru(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Vi.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Es]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Is]:r}),this.config.__preview_deferred_init_extensions&&Vi.info("PostHog extensions initialized ("+r+"ms)")}uo(t){var e;if(!r||!r.body)return Vi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.uo(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.iu=t),this._l=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=j(n.supportedCompression,Af)?Af:j(n.supportedCompression,Ff)?Ff:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.jl?this.jl:Us}),null==(e=this.nu)||e.handleRemoteConfig(t),this.ml.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Kl(){try{this.config.loaded(this)}catch(t){Vi.critical("`loaded` function failed",t)}if(this.su(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var t=n.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.Ml())&&this.au()}),1),this.ou=new h_(this),this.ou.load()}su(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Wl)||t.enable())}_dom_loaded(){this.is_capturing()&&Zi(this.__request_queue,(t=>this.Vl(t))),this.__request_queue=[],this.su()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.lu()&&this.capture(Zs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Wl)||r.unload(),null==(n=this.Gl)||n.unload()):this.lu()&&this.capture(Zs,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?aw?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=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(K(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,n=p({},t);n.timeout=n.timeout||6e4;var s,a,o,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&K(n.compression)&&n.data&&(n.compression=Ff),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(G(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(o=h.properties)?void 0:o.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),G(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=x_(n.url,n.method,n.compression,n.timestampMode);var v=C_.filter((t=>!n.disableTransport||!t.transport||!n.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){w_(t)?Vi.warn(t):Vi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Af&&l&&"undefined"!=typeof Promise&&!c_?b_(n).then((t=>{f(t)})).catch((e=>{if(Ne(e))return c_=!0,void f(p({},n,{compression:void 0,url:x_(t.url,t.method,void 0,t.timestampMode)}));qe(e)&&(c_=!0),f(n)})):c(n)})(p({},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}))}Vl(t){this.Gl?this.Gl.retriableRequest(t):this._send_request(t)}_execute_array(t){Y_++;try{var e,i=[],r=[],n=[];Zi(t,(t=>{if(t)if(G(e=t[0]))n.push(t);else if(Z(t))try{t.call(this)}catch(e){Vi.error("Error executing queued PostHog call",t,e)}else G(t)&&"alias"===e?i.push(t):G(t)&&-1!==e.indexOf("capture")&&Z(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Zi(t,(function(t){try{if(G(t[0])){var i=e;Qi(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Vi.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{Y_--}}push(t){if(Y_>0&&G(t)&&Y(t[0])){var e=vw.prototype[t[0]];Z(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Wl){if(this.is_capturing())if(!K(t)&&Y(t)){this.Pl();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=e&&e.$current_url&&!Y(null==e?void 0:e.$current_url)&&(Vi.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.uu||Vi.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=(null==i?void 0:i.timestamp)||h,v=Ee(null==i?void 0:i.uuid,up),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Gs&&this.config.__preview_capture_bot_pageviews&&l&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),u&&(c.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var f="$feature_flag_called"===t&&!1===c.properties.$feature_flag_has_experiment&&!0===this.get_property(rs);(null==i?void 0:i.$set)&&!f&&(c.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(c.$unset=g);var m=f?void 0:this.hu(null==i?void 0:i.$set_once,t!==Js,t===Qs);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,a=t=>Y(t)?t.slice(0,n):t,o=new Set,c=function t(e,i){if(e!==Object(e))return a?a(e):e;if(!o.has(e)){var r;if(o.add(e),G(e))r=[],Zi(e,(e=>{r.push(t(e))}));else{var n={};Qi(e,((e,i)=>{o.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,K(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),f&&(c.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return k.forEach(r),e.forEach(r),i}(c.properties,nw)),t===zf.DISMISSED||t===zf.SENT){var y=null==e?void 0:e[Uf.SURVEY_ID],b=null==e?void 0:e[Uf.SURVEY_ITERATION];Xf({id:y,current_iteration:b}),c.$set=p({},c.$set,{[bo({id:y,current_iteration:b},t===zf.SENT?"responded":"dismissed")]:!0})}else t===zf.SHOWN&&(c.$set=p({},c.$set,{[Uf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var _=null==e?void 0:e.$product_tour_type;_&&(c.$set=p({},c.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(J(w)||this.setPersonPropertiesForFlags(w),!et(this.config.before_send)){var S=this.Xn(c);if(!S)return;(c=S).uuid=Ee(c.uuid,up)}this.wl.emit("eventCaptured",c);var x=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:x,data:c,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(x)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Vl(C):this.Wl.enqueue(C),c}Vi.critical("This capture call is ignored due to client rate limiting.")}}else Vi.error("No event name provided to posthog.capture")}else Vi.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}getExtension(t){var e;return null==(e=this.nu)?void 0:e.getExtension(t)}tu(){var t;return null!==(t=this.nu)&&void 0!==t?t:this.nu=new J_(this)}Sl(t){this.$l.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.$l.indexOf(t);-1!==i&&this.$l.splice(i,1)}}}du(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Bl=null,this.persistence.get_property(bs)===Hs&&(null==(r=this.sessionPersistence)||r.clear(),this.Ll.clear(),this.vu()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.du();var l=o?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Ml()&&(h[Ms]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!Y(h.distinct_id)&&!it(h.distinct_id)||X(h.distinct_id))&&Vi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var a,o,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Bo,...i||[]]:[],c=function(t){for(var e=0;xe.length>e;e++){var i=xe[e],r=i[1],n=i[0].exec(t),s=n&&(Z(r)?r(n,t):r);if(s)return s}return["",""]}(u),f=c[0],p=c[1],g=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};K(r)||(m.detectGoogleSearchApp=r);var y={},b=null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,_=null==(o=navigator)?void 0:o.maxTouchPoints,w=null==t||null==(l=t.screen)?void 0:l.width,k=null==t||null==(h=t.screen)?void 0:h.height,S=null==t?void 0:t.devicePixelRatio;K(b)||(y.userAgentDataPlatform=b),K(_)||(y.maxTouchPoints=_),K(w)||(y.screenWidth=w),K(k)||(y.screenHeight=k),K(S)||(y.devicePixelRatio=S);var x,C=Ji(tr({$os:f,$os_version:p,$browser:we(u,navigator.vendor,g,m),$device:Ce(u),$device_type:Te(u,y),$timezone:Xo(),$timezone_offset:tl()}),{$current_url:hr(s?Re(null==n?void 0:n.href):null==n?void 0:n.href,v,zo),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:u.length>1e3?u.substring(0,997)+"...":u,$browser_version:Se(u,navigator.vendor,g,m),$browser_language:Zo(),$browser_language_prefix:(x=Zo(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:Ui.LIB_NAME,$lib_version:Ui.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ui.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Ui.SDK_DIST_CHANNEL),C}(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(o,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&Ji(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Ji(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Gl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===q_&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Gs||o?e!==Zs||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Ji(h,v),e===Gs&&r&&(h.title=r.title),!K(l)){var y=s.getTime()-l;h.$duration=parseFloat((y/1e3).toFixed(3))}u&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties();Qi(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var w={};if(this.$l.length>0)for(var k of this.$l.slice())try{Ji(w,k())}catch(t){Vi.error("Failed to produce browser extension event properties",t)}(h=Ji({},c,b,_,p({},w,h))).$is_identified=this._isIdentified(),G(this.config.property_denylist)?Qi(this.config.property_denylist,(function(t){delete h[t]})):Vi.error(rw+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(Vi.error(iw),h=S(h,e));var x=this.cu();return h.$process_person_profile=x,x&&!o&&this.fu("_calculate_event_properties"),h}hu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.cu())return t;if(this.Ol&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=Ji({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Vi.error(iw),a=o(a,"$set_once")),e&&(this.Ol=!0),J(a)?void 0:a}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.du(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.Ll.add(t))),this.vu()}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.Ll.delete(t),this.vu()}pu(t,e){this.register({[t]:e})}Zl(){this.Ll.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.Ll.clear(),this.vu()}vu(){var t;if(this.Dl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.xa||!Rp.ri())Rp.ai(this.Dl);else{var e=[];this.Ll.forEach((t=>e.push(t))),e.length>0?Rp.ii(this.Dl,e):Rp.ai(this.Dl)}}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.wl.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:ew}),()=>{})}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:ew})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ew})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ep),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:ew}}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:ew})}gu(t){return!t||X(t)?(Vi.critical("Unique user id has not been set in posthog.identify"),!1):t===Ts?(Vi.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())||(Vi.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 Vi.uninitializedWarning("posthog.identify");if(it(t)&&(t=t.toString(),Vi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.gu(t)&&this.fu("posthog.identify")){this.Pl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.du(!1),a=this.persistence.za(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(wn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(Sn)&&(this.unregister(Sn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(bs)||Hs)===Hs,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(bs,zs),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ua(),this.capture(Qs,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Bl=Po(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(bs,zs);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Ua(),this.capture("$set",{$set:c,$set_once:f}),this.Bl=Po(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ps)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Ga(o)}}}setPersonProperties(t,e){if((t||e)&&this.fu("posthog.setPersonProperties")){var i=Po(this.get_distinct_id(),t,e);this.Bl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Bl=i):Vi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(G(t)?t:[t]).filter((t=>Y(t)&&t.length>0));0!==i.length&&this.fu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Bl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.du();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(Js,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Vi.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.fu("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=nt(t)?t:null==t?void 0:t.resetDeviceID,i=nt(t)||null==t?void 0:t.bootstrap;this.mu(e,!1,i)}mu(t,e,i){var r,n,s;if(void 0===e&&(e=!1),Vi.info("reset"),!this.__loaded)return Vi.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.zl)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.ho());var o=this.get_property(wn),l=this.get_property(kn),u=this.get_property(Ln),h=this.is_capturing();this.consent.reset(),e||!h||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 d=null==(s=this.persistence)||null==s.za?void 0:s.za(),v=!1;try{var c,f,g,m,y,b,_,w,k,S,x,C,T;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.Ll.clear(),this.vu(),K(u)||null==(S=this.persistence)||S.register({[Ln]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(y=this.conversations)||y.reset(),null==(b=this.logs)||b.reset(),null==(_=this.metrics)||_.reset(),null==(w=this.persistence)||w.set_property(bs,Hs),null==(k=this.sessionManager)||k.resetSessionId(),this.Bl=null,this.config.cookieless_mode===Bs)this.register_once({distinct_id:Ts,$device_id:null},"");else{var M=this.config.get_device_id(up());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||K(l)||this.register({[kn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Ml()||(null==(T=this.persistence)||T.set_property(bs,i.isIdentifiedID?zs:Hs),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(K(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var E=p({},i);delete E.sessionID,this.config.bootstrap=E}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var I;d&&(null==(I=this.persistence)||null==I.Ga||I.Ga(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s,a,o;if(e.__loaded){e.tu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.Wl)||n.unload(),null==(s=e.Gl)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){Vi.error("Error while destroying feature flags",t)}null==(a=e.persistence)||a.destroy(),null==(o=e.sessionPersistence)||o.destroy()}else Vi.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.yu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.bu()}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(bn)?(Vi.critical("Attempting to create alias for existing People user - aborting."),-2):this.fu("posthog.alias")?(K(e)&&(e=this.get_distinct_id()),t!==e?(this.pu(Sn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Vi.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(Q(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Ji(this.config,hw(t));var f=this.Al();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new a_(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Hl(this.config.debug);nt(m)&&(this.config.debug=m),nt(this.config.debug)&&(this.config.debug?(Ui.DEBUG=!0,gp.ri()&&gp.ii("ph_debug",!0),Vi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Ui.DEBUG=!1,gp.ri()&&gp.ai("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ho()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.Fl(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Ui.LIB_NAME=t,Ui.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.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){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}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 t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:vw._u}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:sw;return e!==sw&&(e=sw+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(bs))===zs||(null==(e=this.sessionPersistence)?void 0:e.get_property(bs))===zs}cu(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Us&&!this._isIdentified()&&J(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Sn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Cs]))}lu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.cu()||this.fu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.fu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}fu(t){return"never"===this.config.person_profiles?(Vi.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.El(),this.pu(Cs,!0),!0)}Al(){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&&this.config.cookieless_mode!==js)}Fl(){var t,e,i,r,n,s=this.Al();return this.is_capturing()||null==(i=this.logs)||i.wu(),(null==(t=this.persistence)?void 0:t.xa)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.xa)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.Ll.clear(),this.vu()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Bs){if(this.Ml()){var i,r,n,s,a,o;null==(i=this.sessionRecording)||i.dispose({discardBufferedEvents:!0}),this.mu(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new D_(this),this.pageViewManager=new Vb(this),this.persistence&&(this.sessionPropsManager=new A_(this,this.sessionManager,this.persistence));var l,u=null!==(s=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==s?s:null==(o=vw.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Tl(this.sessionRecording,new u(this)),this._l&&(null==(l=this.sessionRecording)||null==l.onRemoteConfig||l.onRemoteConfig(this._l)))}var h,d;this.consent.optInOut(!0),this.Fl(),this.su(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==js&&(null==(h=this.surveys)||h.loadIfEnabled()),(K(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(d=null==t?void 0:t.captureEventName)&&void 0!==d?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.au()}else Vi.warn(tw)}opt_out_capturing(){if(this.config.cookieless_mode!==Bs){var t,e,i=this.config.cookieless_mode===js?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===js&&this.consent.isOptedIn()&&this.mu(!0,!0),this.consent.optInOut(!1),this.Fl(),this.config.cookieless_mode===js&&(this.register({distinct_id:Ts,$device_id:null}),this.Cl(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.au(),this.su())}else Vi.warn(tw)}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 this.config.cookieless_mode===Bs||(this.config.cookieless_mode===js?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Fl()}_is_bot(){return i?$_(i,this.config.custom_blocked_useragents):void 0}au(){r&&("visible"===r.visibilityState?this.Nl||(this.Nl=!0,this.capture(Gs,{title:r.title},{send_instantly:!0}),this.ql&&(r.removeEventListener(Ws,this.ql),this.ql=null)):this.ql||(this.ql=this.au.bind(this),rr(r,Ws,this.ql)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ho(){var t=this.zl||{};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?(Vi.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&&!et(t[e]),a=i in t&&!et(t[i]);return s?t[e]:!!a&&(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,Vi)}Xn(t){var e;if(et(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(ot),r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),et(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return at(t.event)?Vi.warn(a+". This can cause unexpected behavior."):Vi.info(a),null}n.properties&&!J(n.properties)||Vi.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Vi.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var o of i)if(n.properties&&et(n.properties[o]))return Vi.warn("Event '"+t.event+"' had its '"+o+"' 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.ta)?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)})}Hl(t){var e=nt(t)&&!t,i=gp.ri()&&"true"===gp.ni("ph_debug");return!e&&(!!i||t)}}vw.__defaultExtensionClasses={},vw._u=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Xi(t.prototype[e[i]])}(vw,["identify"]);class cw{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Q(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.ho(),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}}var fw=Gi("[ExceptionAutocapture]"),pw=Gi("[TracingHeaders]"),gw=Gi("[Web Vitals]"),mw=9e5,yw=["CLS","FCP","INP","LCP"],bw=["INP","LCP"],_w=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],ww="[SessionRecording]",kw=Gi(ww),Sw=Gi("[Heatmaps]");function xw(t){return Q(t)&&"clientX"in t&&"clientY"in t&&it(t.clientX)&&it(t.clientY)}var Cw=Gi("[Product Tours]"),Tw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(An))},Mw=["$set_once","$set"],Ew=Gi("[SiteApps]"),Iw="Error while initializing PostHog app with config id ",Rw=(t,e)=>null!=t&&t.then?t.then(e):e(t),Pw="SDK is not enabled or survey functionality is not yet loaded",Aw="Disabled. Not loading surveys.";class Fw{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ku=!1,this.Su=[],this.xu=null,this.Cu=null,this.Fs=!1,this.Tu=new Set,this.onRemoteConfig=t=>{if(!this.Fs&&!this.gn.disableSurveys){if(!t.ok)return Vf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(et(e))return Vf.warn("Flags not loaded yet. Not loading surveys.");this.Mu=nt(e)?e:e.length>0,Vf.info("flags response received, isSurveysEnabled: "+this.Mu),this.loadIfEnabled()}},this.Os=t,this.Eu=e}setup(t){if(!this.Fs)return this.Iu=t,Rw(t.kv.initialize(),(()=>{if(this.Iu===t&&!this.Fs){this.Iu=void 0,this.$s=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Fs?e.dispose():(this.Ns=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Fs||(this.Fs=!0,this.Iu=void 0,this.$s=void 0,null==(t=this.Ns)||t.dispose(),this.Ns=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Su=[],this.xu=null,this.Tu.forEach((t=>clearTimeout(t))),this.Tu.clear())}get gn(){return this.Os.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(Qf)||null!=r&&r.startsWith(Jf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Fs&&this.$s){var t=this.gn;if(!this._surveyManager)if(this.ku)Vf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Vf.info(Aw);else if(t.cookielessMode&&this.Os.isOptedOut())Vf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Os.getExtensions();if(e){if(!K(this.Mu)||t.advancedEnableSurveys){var i=this.Mu||t.advancedEnableSurveys;this.ku=!0;try{var r=e.generateSurveys;if(r)return this.Ru(r,i),void(this.ku=!1);var n=e.loadExternalDependency;if(!n)return this.Pu(qs),void(this.ku=!1);n((t=>{try{if(this.Fs)return;var e=this.Os.getExtensions();t||null==e||!e.generateSurveys?this.Pu("Could not load surveys script",t):this.Ru(e.generateSurveys,i)}finally{this.ku=!1}}))}catch(t){throw this.ku=!1,this.Pu("Error initializing surveys",t),t}}}else Vf.error("PostHog Extensions not found.")}}}Ru(t,e){this.Fs||(this._surveyManager=t(e),this._surveyEventReceiver=this.Os.createEventReceiver(),Vf.info("Surveys loaded successfully"),this.Au({isLoaded:!0}))}Pu(t,e){Vf.error(t,e),this.Au({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Su.push(t),this._surveyManager&&this.Au({isLoaded:!0}),()=>{this.Su=this.Su.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.$s)&&void 0!==i?i:this.Eu;if(r&&!this.Fs){if(this.gn.disableSurveys)return Vf.info(Aw),t([]);var n=r.kv.get(us);if(n&&!e)return t(n,{isLoaded:!0}),void(this.Fu()&&this.getSurveys((()=>{}),!0));if(this.xu)this.xu.then((e=>{this.Fs||t(e.surveys,e.context)})).catch((t=>Vf.error("Error in survey callback",t)));else{var s=this.Ou("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.gn.requestTimeoutMs}).then((t=>{try{return this.Lu(r,t)}catch(t){return Vf.error("Error processing surveys response",t),this.Lu(r,{statusCode:0,error:t})}}),(t=>this.Lu(r,{statusCode:0,error:t})));this.xu=s;var a=()=>{this.xu===s&&(this.xu=null)};s.then((e=>{a(),this.Fs||t(e.surveys,e.context)}),a).catch((t=>Vf.error("Error in survey callback",t)))}}}Ou(t,e){var i=this.$s;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(Pw)})))}Lu(t,e){if(this.Fs)return{surveys:[],context:{isLoaded:!1,error:Pw}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Vf.error(r):e.error||Vf.warn(r),this.Cu=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Cu=null;var n,s=e.json.surveys||[],a=s.filter((t=>Gf(t)&&(Co(t)||Zf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[us]:s,[hs]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}Fu(){return this.Du()&&!this.xu&&!this.$u()}Du(){var t,e,i=null==(t=null!==(e=this.$s)&&void 0!==e?e:this.Eu)?void 0:t.kv.get(hs);return it(i)&&Date.now()-i>3e5}$u(){return it(this.Cu)&&3e5>Date.now()-this.Cu}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Xf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Au(t){for(var e of this.Su)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Vf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Vf.warn("init was not called")}Nu(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}qu(t){if(et(this._surveyManager))return{eligible:!1,reason:Pw};var e="string"==typeof t?this.Nu(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}ju(t){if(et(this._surveyManager))return{eligible:!1,reason:Pw};var e="string"==typeof t?this.Nu(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(et(this._surveyManager))return Vf.warn("init was not called"),{visible:!1,disabledReason:Pw};var e=this.ju(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return et(this._surveyManager)?(Vf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Pw})):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.ju(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(et(this._surveyManager))Vf.warn("init was not called");else{var s="string"==typeof t?this.Nu(t):t;if(null!=s&&s.id)if(tp.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Vf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.Tu.delete(o),this.Fs||(Vf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,a,i),Vf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Tu.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Vf.warn("Survey element not found")}else Vf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Vf.warn("Survey not found")}}displaySurvey(t,e){var i;if(et(this._surveyManager))Vf.warn("init was not called");else{var r=this.Nu(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=p({},r,{appearance:p({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Wf&&e.initialResponses&&Vf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.qu(r);if(!s.eligible)return void Vf.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Vf.warn("Survey not found")}}cancelPendingSurvey(t){et(this._surveyManager)?Vf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function Ow(t,e,i){if(et(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}}class Lw{constructor(t){this.Bu=new Set,this.Hu=new Set,this.zu=new F_,this.Uu=(t,e)=>this.Wu(t,e)&&this.Vu(t,e)&&this.Gu(t,e)&&this.Zu(t,e),this.Wu=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t}init(){var t,e;K(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Qu=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.Qu)||t.call(this),this.Qu=void 0,this.zu=new F_}register(t){var e,i;if(!K(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Bu.add(t),null==(e=t.steps)||e.forEach((t=>{this.Hu.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Bu.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.Bu.clear(),this.Hu.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Hu.has(t)||this.Hu.has(e.event))&&this.Bu.forEach((t=>{this.Ju(e,t)&&this.zu.emit("actionCaptured",t.name)}))}Ku(t){this.onAction("actionCaptured",(e=>t(e)))}Ju(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Uu(t,i))return!0;return!1}onAction(t,e){return this.zu.on(t,e)}Vu(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(!Ow(r,e.url,e.url_matching||"contains"))return!1}return!0}Gu(t,e){return!!this.Yu(t,e)&&!!this.Xu(t,e)&&!!this.th(t,e)}Yu(t,e){var i;if(null==e||!e.href)return!0;var r=this.eh(t);if(r.length>0)return r.some((t=>Ow(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Ow((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Xu(t,e){var i;if(null==e||!e.text)return!0;var r=this.eh(t);if(r.length>0)return r.some((t=>Ow(t.text,e.text,e.text_matching||"exact")||Ow(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!et(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>Ow(t,s,a))))}th(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}eh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Zu(t,e){return null==e||!e.properties||0===e.properties.length||Ro(e.properties.reduce(((t,e)=>{var i=G(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)}}class Dw{constructor(t){var e;this.ih=[],this._instance=t,this.rh=new Map,this.nh=new Map,this.sh=new Map,this.ah=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.oh(t)))}lh(t){return!1}uh(){return null}hh(t){}dh(){}fh(t,e){return!!t&&Ro(t.propertyFilters,null==e?void 0:e.properties)}ph(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}gh(t,e,i){var r=(i===Of?this.rh:this.nh).get(t),n=[];return this.mh((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.fh(s,e)}))}register(t){this.yh(t,!1)}replace(t){this.yh(t,!0)}yh(t,e){var i;K(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.bh(t,e),this._h(t,e))}_h(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.sh.clear(),0!==i.length){this.wh||(this.wh=new Lw(this._instance),this.wh.init(),this.wh.Ku((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.sh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.sh.set(e.name,n)}}))})),e?this.wh.replace(r):this.wh.register(r)}else{var n;e&&(null==(n=this.wh)||n.replace([]))}}kh(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)}))}bh(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})),a=this.ph(t,Of),o=this.ph(t,Lf);e?(this.rh=a,this.nh=o):(this.kh(this.rh,a),this.kh(this.nh,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.Qu)&&void 0!==i||(this.Qu=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Sh(),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 a=this.xh(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Ch([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Th(s),void this.Mh([s])}if(this.nh.has(t)){var o=this.gh(t,e,Lf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Ch(o.map((t=>t.id))),o.forEach((t=>this.Eh(t.id))))}if(this.rh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.rh.get(t)});var l=this.gh(t,e,Of);this.Ih(l.map((t=>t.id)))}}onAction(t){this.sh.has(t)&&this.Ih(this.sh.get(t)||[])}Ih(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.Th(n)&&this.Rh(n):r.push(n);r.length>0&&(this.ih=[...new Set([...this.ih,...r])]),this.Sh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Th(t){this.ih=this.ih.filter((e=>e!==t));var e=this.Ph();return!e.includes(t)&&(this.Ah([...e,t]),this.Fh(),!0)}Ch(t){var e=new Set(t);this.ih=this.ih.filter((t=>!e.has(t)));var i=this.Oh(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Ah(r),0===r.length&&this.Lh()),this.Mh(t)}Dh(){var t,e=this.uh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Rh(t){if(this.uh()){var e=this.Dh();this.hh(p({},e,{[t]:Date.now()}))}}Mh(t){if(this.uh()){var e=this.Dh(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(J(i)?this.dh():this.hh(i))}}$h(){this.uh()&&this.dh()}getActivationTimestamp(t){if(this.Ph().includes(t)){var e=this.Dh()[t];return it(e)?e:void 0}}Oh(){var t,e=this.Nh();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Ph(){var t,e,i=this.Oh();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.qh()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Fh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.jh(e)}Lh(){this.Bh()}oh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.qh()];if(i&&i!==t){var r=this.Oh(),n=this.Dh();r.length>0&&(this.Ah([]),r.filter((t=>it(n[t]))).forEach((t=>this.Eh(t)))),this.Lh(),this.$h()}}getActivatedIds(){return[...new Set([...this.Ph(),...this.ih])].filter((t=>!this.Hh(t)))}dispose(){var t,e,i;null==(t=this.ah)||t.call(this),this.ah=void 0,null==(e=this.Qu)||e.call(this),this.Qu=void 0,null==(i=this.wh)||i.dispose(),this.wh=void 0}reset(){this.ih=[],this.Oh().length>0&&this.Ah([]),this.Lh(),this.$h()}getEventToItemsMap(){return this.rh}zh(){return this.wh}}class $w extends Dw{constructor(t){super(t)}Nh(){return ds}qh(){return vs}uh(){return cs}hh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[cs]:t})}dh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(cs)}lh(t){var e,i;this.mh((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return it(r)&&r>0}Uh(){return zf.SHOWN}mh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Eh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Sh(){return Vf}Ah(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ds]:t})}jh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[vs]:t})}Bh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(vs)}Hh(){return!1}xh(t,e){var i;return this.mh((t=>{i=t.find((t=>t.id===e))})),!i||To(i)?t===zf.SHOWN?"consume":"ignore":t===zf.SHOWN?"persist":t===zf.DISMISSED||t===zf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Nw{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);K(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)}}class qw{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==v?void 0:v.__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 $w(this._instance)}}var jw=null!=t&&t.location?dr(t.location.hash,"__posthog")||dr(location.hash,"state"):null,Bw="_postHogToolbarParams",Hw=Gi("[Toolbar]"),zw=Gi("[FeatureFlags]");class Uw{constructor(t,e){void 0===e&&(e=!1),this.Wh=!1,this.update(t,e)}update(t,e){this.Vh=((t,e)=>{var i,r,n,s,a;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!==(a=t.evaluation_contexts)&&void 0!==a?a:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:G(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Wh||(zw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wh=!0),K(t.flag_keys)||G(t.flag_keys)||zw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Vh}}var Ww=Gi("[FeatureFlags]"),Vw=Gi("[FeatureFlags]",{debugEnabled:!0}),Gw="\" failed. Feature flags didn't load in time.",Zw="connection_error",Qw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Jw=t=>{var e={};for(var i of Ki(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Kw="Refusing to render web experiment since the viewer is a likely bot",Yw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Mo(e,t),not_regex:(t,e)=>!Mo(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Xw{get gn(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Xw.Gh("retrieved web experiments from the server"),e.Zh=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.Zh&&(Xw.Gh("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.Zh)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Y(r)&&t.variants[r]&&e.Qh(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Xw.Jh(s,e._instance)&&e.Qh(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Xw.Gh(Kw);else if(!this.gn.disable_web_experiments){if(et(this.Zh))return this.Zh=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Xw.Gh("applying feature flags",t),t.forEach((t=>{var e;if(this.Zh&&null!=(e=this.Zh)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Zh)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Qh(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Xw.getWindowLocation();if(null!=t&&t.search){var e=ur(null==t?void 0:t.search,"__experiment_id"),i=ur(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Xw.Gh("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.Kh(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.gn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.gn.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.gn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Kh(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Xw.Gh("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.Qh(r[0].name,e,r[0].variants[e].transforms))}static Jh(t,e){return!et(t.conditions)&&Xw.Yh(t,e)&&Xw.Xh(t)}static Yh(t,e){var i;if(et(t.conditions)||et(null==(i=t.conditions)?void 0:i.url))return!0;var r=Xw.getWindowLocation();if(r){var n,s,a,o=fr(e,r.href);return null==(n=t.conditions)||!n.url||Yw[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static Xh(t){var e;if(et(t.conditions)||et(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Wo();if(i.utm_source){var r,n,s,a,o,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==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.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 Gh(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Vi.info("[WebExperiments] "+t,i)}Qh(t,e,i){this._is_bot()?Xw.Gh(Kw):"control"!==e?i.forEach((i=>{if(i.selector){var r;Xw.Gh("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Xw.Gh("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?$_(i,this.gn.custom_blocked_useragents):void 0}}var tk=Gi("[Conversations]"),ek="Conversations not available yet.";function ik(t,e){var i,r,n,s,a,o,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=K(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var rk=["debug","log","warn","error","info"],nk="console",sk="__posthogHandledLogsRequestError",ak=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[sk]=!0,i},ok=t=>!!t&&"object"==typeof t&&!0===t[sk],lk={featureFlags:class{constructor(t){this.name=ip,this.td=!1,this.featureFlagEventHandlers=[],this.A=Ww,this.ed={},this.rd={},this.nd=[],this.sd=!1,this.ad=!1,this.od=0,this.ld=!1,this.ud=!1,this.hd=!1,this.dd=!1,this.vd=0,this.zt=()=>{var t=this.fd();this.vd=0,t&&this.reloadFeatureFlags()},this.pd=()=>{var t,e=this.gd;K(e)||this.gn.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.md)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.yd())},this.Wt=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.pd()},"get"in t?this.Os=t:(this._instance=t,this.bd=new Uw(t.config,t.ho()),this.Os=this.bd)}updateConfig(t,e){var i;null==(i=this.bd)||i.update(t,e),this.$s&&this._d()}setup(t){return this.Iu=t,this.A=t.logger.createLogger("[FeatureFlags]"),Rw(t.kv.initialize(),(()=>{this.Iu===t&&(this.Iu=void 0,this.$s=t,this.wd(t))}))}wd(e){var i;if(this.$s===e)return t&&rr(t,"online",this.zt),this._d(),this.kd=e.registerDynamicEventProperties((()=>this.Sd()?this.ed:this.rd)),this.xd=null==(i=this._instance)||null==(i=i.persistence)?void 0:i.onCrossTabFeatureFlagChange((()=>{this.Cd(),this.Td()})),this.Cd(),this.initialize()}_d(){var t=this.gn.refreshIntervalMs,e=!this.gn.remoteRequestsDisabled&&r&&!K(t)&&t>0?t:void 0;e!==this.gd&&(this.Md(),K(e)||(this.gd=e,this.yd(),null!=r&&r.addEventListener&&rr(r,Ws,this.Wt)))}yd(){K(this.gd)||(K(this.Ed)||clearInterval(this.Ed),this.md=Date.now(),this.Ed=setInterval(this.pd,this.gd))}Md(){K(this.Ed)||(clearInterval(this.Ed),this.Ed=void 0,null==r||null==r.removeEventListener||r.removeEventListener(Ws,this.Wt)),this.gd=void 0,this.md=void 0}destroy(){this.Id()}dispose(){this.Id()}Id(){var e,i;this.Md(),this.od++,this.ud=!1,this.Iu=void 0,this.$s&&(this.Rd(),null==(e=this.kd)||e.dispose(),this.kd=void 0,null==(i=this.xd)||i.call(this),this.xd=void 0,this.nd=[],null==t||t.removeEventListener("online",this.zt),this.$s=void 0)}get gn(){return this.Os.get()}Pd(t){var e;return null==(e=this.$s)?void 0:e.kv.get(t)}ii(t){this.Ad((()=>{var e;return null==(e=this.$s)?void 0:e.kv.set(t)}))}Fd(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t[Kn]){var n=this.Pd(Kn)||{},s=t[Kn]||{},a=e.flags||e.featureFlags,o=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?o:i&&!G(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Pd(es)||{},d=t[es]||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p={[Yn]:f,[Kn]:f,[es]:!!c||v};for(var g of(t[ts]&&(p[ts]=f),[is,ys,rs]))K(t[g])||(p[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(p)}}ai(t){this.Ad((()=>{var e;return null==(e=this.$s)?void 0:e.kv.remove(t)}))}Ad(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Cd(){var t={};for(var e of[Yn,es,is,ns]){var i=this.Pd(e);K(i)||(t[e]=i)}this.ed=t;var r=p({},t),n=this.Pd(Kn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.rd=r}Sd(){var t=this.gn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Pd(ys);return"number"!=typeof e||Date.now()-e>t}Od(){return!!this.Sd()&&(this.dd||this.ad||(this.dd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ld(){var t=this.gn.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})):[]}Dd(){var t=this.gn.flagKeys;if(!K(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.gn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.$d({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Pd(Kn))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Pd(es))&&void 0!==n?n:{},o=p({},s,t),l=p({},a,e),u={};for(var h of Object.entries(o)){var d=h[0],v=h[1];u[d]={key:d,enabled:_(v),variant:w(v),reason:void 0,metadata:K(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.$d({flags:u})}get hasLoadedFlags(){return this.sd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Pd(ts),e=this.Pd(ns),i=this.Pd(ss);if(!i&&!e)return t||{};var r=Ji({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var a,o,l=r[s],u=null==e?void 0:e[s],h=K(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=K(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=p({},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=p({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(o=l.metadata)?void 0:o.payload})),r[s]=c}return this.td||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.td=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:_(r),variant:w(r),payload:b(e[i])}}))}getFlagVariants(){var t=this.Pd(Kn),e=this.Pd(ns);if(!e)return t||{};for(var i=Ji({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.td||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.td=!0),i}getFlagPayloads(){var t=this.Pd(es),e=this.Pd(ss);if(!e)return t||{};for(var i=Ji({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.td||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.td=!0),i}reloadFeatureFlags(){this.ld||this.gn.featureFlagsDisabled||this.fd()||this.Nd||(this.nd.slice().forEach((t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}})),this.Nd=setTimeout((()=>{this.qd()}),5))}Rd(){clearTimeout(this.Nd),this.Nd=void 0}onReloading(t){return this.nd.push(t),()=>{this.nd=this.nd.filter((e=>e!==t))}}ensureFlagsLoaded(){this.sd||this.ad||this.Nd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ld=t}resetFlagCallReported(){this.ai(ps)}qd(t){this.Rd();var e=this.$s;if(e&&!this.gn.remoteRequestsDisabled&&!this.fd())if(this.ad)this.ud=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},e.initialPersonProperties,this.Pd(as)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Pd(os),timezone:Xo()};K(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.gn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Ld();r.length&&(i.evaluation_contexts=r);var n=this.Dd();K(n)||(i.flag_keys=n);var s=this.gn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.od;this.ad=!0;var l=()=>{this.ud&&(this.ud=!1,this.qd())},u=t=>{this.ad=!1,o===this.od?(this.ii({[ms]:[Zw]}),this.A.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.gn.compression,sentAt:"body",timeoutMs:this.gn.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.ad=!1,o===this.od){if(this.jd(t.statusCode),a||this.ud||(this.$anon_distinct_id=void 0),!i.disable_flags||this.ud){this.hd=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Zw:"unknown_error"):200!==t.statusCode&&u.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.ii({[ms]:u}),h?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.$d(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}fd(){return vr(this.vd,3)}jd(t){this.vd=cr(t,this.vd,3,(()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.hd)if(this.sd||this.getFlags()&&this.getFlags().length>0){if(!this.Od()){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+Gw)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.hd)if(this.sd||this.getFlags()&&this.getFlags().length>0){if(!this.Od()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Pd(is)||void 0,u=this.Pd(ys)||void 0,h=this.Pd(ps)||{};if(this.gn.deduplicateCallsPerSession){var d,v=null==(d=this.$s)?void 0:d.session.sessionId,c=this.Pd(gs);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.ii({[ps]:h,[gs]:i});else{var f,g,m,y,_,w,k,S,x,C,T,M;G(h[t])?h[t].push(o):h[t]=[o],this.ii(p({[ps]:h},i?{[gs]:i}:{}));var E=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Pd(ms))&&void 0!==f?f:[]];K(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.gn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.gn.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.hd};K(null==E||null==(w=E.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=E.metadata.has_experiment),K(null==E||null==(k=E.metadata)?void 0:k.version)||(R.$feature_flag_version=E.metadata.version);var P,A=null!==(S=null==E||null==(x=E.reason)?void 0:x.description)&&void 0!==S?S:null==E||null==(C=E.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=E&&null!=(T=E.metadata)&&T.id&&(R.$feature_flag_id=E.metadata.id),K(null==E?void 0:E.original_variant)&&K(null==E?void 0:E.original_enabled)||(R.$feature_flag_original_response=K(E.original_variant)?E.original_enabled:E.original_variant),null!=E&&null!=(M=E.metadata)&&M.original_payload&&(R.$feature_flag_original_payload=null==E||null==(P=E.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.Bd(R)}else i&&this.ii({[ps]:h,[gs]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:b(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+Gw)}Bd(t){try{var e;null==(e=this.$s)||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.Hd(t,e)}Hd(t,e){var i=this;return f((function*(){var r=i.$s;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Ld();s.length&&(n.evaluation_contexts=s);var a,o=i.Dd();K(o)||(n.flag_keys=o);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.gn.compression,sentAt:"body",timeoutMs:i.gn.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(a)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.hd)return e.defaultValue;if(!(this.sd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Gw),e.defaultValue;var i=this.getFeatureFlag(t,e);return K(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.$d(t,e,i)}$d(t,e,i){if(this.$s){this.sd=!0;var r=function(t,e,i,r,n,s){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=Ww);var a=((t,e)=>{var i=t.flags;return i?p({},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!K(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,s),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(G(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var c=0;l.length>c;c++)v[l[c]]=!0;return{[Yn]:l,[Kn]:v,[rs]:!1}}var f=l,g=u,m=o;if(null!=n&&n.partialResponse){var y=Object.keys(f),b=g||{};f=p({},e,f),g=p({},i,b),y.forEach((t=>{var e;t in b||null==(e=g)||delete e[t]})),m=p({},r,m)}else if(t.errorsWhileComputingFlags)if(o){var _=new Set(Object.keys(o).filter((t=>{var e;return!(null!=(e=o[t])&&e.failed)})));f=p({},e,Object.fromEntries(Object.entries(f).filter((t=>_.has(t[0])))));var w=Object.fromEntries(Object.entries(g||{}).filter((t=>_.has(t[0]))));g=p({},i,w),_.forEach((t=>{var e;t in w||null==(e=g)||delete e[t]})),m=p({},r,Object.fromEntries(Object.entries(m||{}).filter((t=>_.has(t[0])))))}else f=p({},e,f),g=p({},i,g),m=p({},r,m);return p({[Yn]:Object.keys(Jw(f)),[Kn]:f||{},[es]:g||{},[ts]:m||{},[rs]:!0===t.minimalFlagCalledEvents},h?{[is]:h}:{},d?{[ys]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);r&&(this.Fd(r,t,!(null==i||!i.partialResponse)),this.ii(r)),e||(this.dd=!1),this.Td(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.zd(t)}zd(t){if(this.$s){if(!1===t)return this.ai([ns,ss]),this.Td(),void Vw.info("All overrides cleared");if(G(t))return this.ii({[ns]:Qw(t)}),this.Td(),void Vw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.td=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[ns]=G(n)?Qw(n):n),s&&(r[ss]=s),Object.keys(r).length&&this.ii(r),!1===n&&!1===s?this.ai([ns,ss]):!1===n?this.ai(ns):!1===s&&this.ai(ss),this.Td(),!1===n?Vw.info("Flag overrides cleared"):n&&Vw.info("Flag overrides set",{flags:n}),void(!1===s?Vw.info("Payload overrides cleared"):s&&Vw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ii({[ns]:t}),this.Td(),void Vw.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.sd){var e=this.Ud(),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,n=(this.Pd(Xn)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);var o=p({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[Yn]:[t],[Kn]:[t],[as]:Object.keys(s)}),this.ii({[Yn]:Object.keys(Jw(o)),[Kn]:o,[as]:p({},this.Pd(as)||{},s)}),this.Td();try{var l;null==(l=this.$s)||l.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.Pd(Xn);!r||e?this.Wd(t,i):t(r)}Wd(t,e){var i=this;return f((function*(){var r=i.$s;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.ii({[Xn]:n=a.json.earlyAccessFeatures})}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)}}}))()}Ud(){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)),{})}}Td(t){this.Cd();var e=this.Ud(),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.Vd(t,e)}Vd(t,e){void 0===e&&(e=!0);var i=this.Pd(as)||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,s={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(s[a]=n[a]));this.ii({[as]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Pd(as)||{});t.forEach((t=>{delete i[t]})),this.ii({[as]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.ai(as),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Pd(os)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.ii({[os]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Pd(os)||{};this.ii({[os]:p({},e,{[t]:{}})})}else this.ai(os)}reset(){this.od++,this.ud=!1,this.ed={},this.rd={},this.sd=!1,this.ld=!1,this.hd=!1,this.$anon_distinct_id=void 0,this.Rd(),this.td=!1,this.vd=0}}},uk={sessionRecording:class{get gn(){return this._instance.config}get $o(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Gd)||!t.isStarted)}get status(){var t,e;return this.Zd===ra||this.Zd===na?this.Zd:null!==(t=null==(e=this.Gd)?void 0:e.status)&&void 0!==t?t:this.Zd}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Zd=Ks,this.Qd=void 0,this.Jd=!1,this.qt=(()=>{var e;if(null==r||!r.visibilityState||"visible"===r.visibilityState)return!0;var i=null==t||null==(e=t.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=i&&i.length)||i.some((t=>"visible"===t.name))})(),this.Wt=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.qt=!0,null==(t=this.Gd)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw kw.error("started without valid sessionManager"),new Error(ww+" started without valid sessionManager. This is a bug.");if(this.gn.cookieless_mode===Bs)throw new Error(ww+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&rr(r,"visibilitychange",this.Wt)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.Jd=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.Wt),i?this.Kd(!0):this.stopRecording()}get Yd(){var e,i=!(null==(e=this._instance.get_property(Ln))||!e.enabled),r=!this.gn.disable_session_recording,n=this.gn.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.Jd||this.Yd&&null!=(e=this.Gd)&&e.isStarted)){var i=!K(Object.assign)&&!K(Array.from);this.Yd&&i?(this.Xd(t),kw.info("starting")):(this.Zd=Ks,this.stopRecording())}}Xd(t){var e,i;if(this.Yd)if(this.Zd!==ra&&this.Zd!==na&&(this.Zd=ia),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording)this.tv(t);else{var r,n=this._instance.sessionManager;null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.ev,(e=>{if(!this.Jd&&this.Yd&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Rs]:!0}),kw.error("could not load recorder",e)):void this.tv(t);this.Zd=Ks}))}}stopRecording(){var t,e;null==(t=this.Qd)||t.call(this),this.Qd=void 0,null==(e=this.Gd)||e.stop()}Kd(t){var e,i;void 0===t&&(t=!1),null==(e=this.Qd)||e.call(this),this.Qd=void 0,null==(i=this.Gd)||i.discard({discardProducerEvents:t})}iv(){var t,e;null==(t=this.$o)||t.unregister(Hn),null==(e=this.$o)||e.unregister(Dn)}rv(t,e){if(et(t))return null;var i,r=it(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(kw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}nv(t){if(this.$o){var e,i,r=this.$o,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.rv(null==(e=this.gn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.rv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;et(a)&&this.iv();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Ln]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({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:K(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};n(),null==(e=this.Qd)||e.call(this),this.Qd=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.nv(e),void this.Kd()):(this.nv(e),void this.startIfEnabledOrStop()):(this.Zd===ra&&(this.Zd=na,kw.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.Gd)&&i.log?this.Gd.log(t,e):kw.warn("log called before recorder was ready")}get ev(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Ln);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}sv(){var t,e=this._instance.get_property(Ln);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return kw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!et(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=Cl}tv(t){var e,i,r;if(!this.Jd&&this.Yd&&this._instance.sessionManager){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return kw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Rs]:!0});var n;if(this.Gd||(this.Gd=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.qt),this.Gd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.sv()){if(this.Zd===na||this.Zd===ra)return;return this.Zd=ra,kw.info("persisted remote config is stale, requesting fresh config before starting"),void new h_(this._instance).load()}this.Zd=ia,null==(i=(r=this.Gd).setDocumentWasEverVisible)||i.call(r,this.qt),this.Gd.start(t)}else this.Zd=Ks}onRRwebEmit(t){var e;null==(e=this.Gd)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Gd||null==(e=this.$o)||e.register({[Nn]:!0}),null==(t=this.Gd)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Gd||null==(e=this.$o)||e.register({[$n]:!0}),null==(t=this.Gd)||t.overrideSampling()}overrideTrigger(t){var e,i;this.Gd||null==(i=this.$o)||i.register({["url"===t?qn:jn]:!0}),null==(e=this.Gd)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Gd)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Gd)||!i.tryAddCustomEvent(t,e))}}},hk={autocapture:class extends _b{constructor(t){super(new cw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.av=this.ov()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.lv();return!!(t.path||t.search||this.uv(t))}startIfEnabled(){this.isEnabled&&(Vi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.av=this.ov(),this.startIfEnabled()}stop(){this.hv&&this.hv(),this.hv=void 0,this.dv&&this.dv(),this.dv=void 0,Vi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.vv("pushState"),this.vv("replaceState"),this.fv(),this.uv()&&this.pv())}vv(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Bv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.gv(e)}))}}ov(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}lv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Q(t)?t:{}}uv(t){return void 0===t&&(t=this.lv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}mv(t){var e=this.lv(),i=this.av;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.uv(e)&&t.hash!==i.hash))}gv(t){try{var e=this.ov();if(!e)return;this.mv(e)&&this._instance.capture(Gs,{navigation_type:t}),this.av=e}catch(e){Vi.error("Error capturing "+t+" pageview",e)}}fv(){if(!this.hv){var e=()=>{this.gv("popstate")};rr(t,"popstate",e),this.hv=()=>{t&&t.removeEventListener("popstate",e)}}}pv(){if(!this.dv){var e=()=>{this.gv("hashchange")};rr(t,"hashchange",e),this.dv=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get gn(){return this.instance.config}constructor(t){var e;this.yv=!1,this.Is=!1,this.bv=null,this.instance=t,this.yv=!(null==(e=this.instance.persistence)||!e.props[Tn]),this.rageclicks=new fb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Q(this.gn.capture_heatmaps)&&this.gn.capture_heatmaps.flush_interval_milliseconds&&(t=this.gn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.gn.capture_heatmaps)?et(this.gn.enable_heatmaps)?this.yv:this.gn.enable_heatmaps:!1!==this.gn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Is)return;Sw.info("starting..."),this._v(),this.Wt()}else{var t;clearInterval(null!==(t=this.bv)&&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({[Tn]:i}),this.yv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Dt;return this.Dt=void 0,t}Sv(t){xw(t.originalEvent)&&this.Ki(t.originalEvent,"deadclick")}Wt(){this.bv&&clearInterval(this.bv),this.bv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.Mo.bind(this),this.flushIntervalMilliseconds):null}_v(){t&&r&&(this.xv=this.Mo.bind(this),rr(t,Vs,this.xv),this.Cv=e=>this.Ki(e||(null==t?void 0:t.event)),rr(r,"click",this.Cv,{capture:!0}),this.Tv=e=>this.Mv(e||(null==t?void 0:t.event)),rr(r,"mousemove",this.Tv,{capture:!0}),this.Ev=new Bb(this.instance,qb,this.Sv.bind(this)),this.Ev.startIfEnabledOrStop(),this.Iv=this.Wt.bind(this),rr(r,Ws,this.Iv),this.Is=!0)}wv(){var e;t&&r&&(this.xv&&t.removeEventListener(Vs,this.xv),this.Cv&&r.removeEventListener("click",this.Cv,{capture:!0}),this.Tv&&r.removeEventListener("mousemove",this.Tv,{capture:!0}),this.Iv&&r.removeEventListener(Ws,this.Iv),clearTimeout(this.Rv),null==(e=this.Ev)||e.stop(),this.Is=!1)}Pv(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(e,i,r){for(var n=e;n&&wr(n)&&!kr(n,"body");){if(n===r)return!1;var s=void 0;try{var a,o,l;s=null==(a=null!==(o=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:t)?void 0:a.getComputedStyle(n).position}catch(t){return!1}if(j(i,s))return!0;n=Or(n)}return!1}(Pr(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:n),y:e.clientY+(a?0:r),target_fixed:a,type:i}}Ki(t,e){var i;if(void 0===e&&(e="click"),!_r(t.target)&&xw(t)){var r=this.Pv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Hr(Pr(t),this.instance.config.rageclick)&&this.ys(p({},r,{type:"rageclick"})),this.ys(r)}}Mv(t){!_r(t.target)&&xw(t)&&(clearTimeout(this.Rv),this.Rv=setTimeout((()=>{this.ys(this.Pv(t,"mousemove"))}),500))}ys(e){if(t){var i=this.gn.disable_capture_url_hashes?Re(t.location.href):t.location.href,r=this.gn.custom_personal_data_properties,n=this.gn.mask_personal_data_properties?[...Bo,...r||[]]:[],s=hr(i,n,zo);this.Dt=this.Dt||{},this.Dt[s]||(this.Dt[s]=[]),this.Dt[s].push(e)}}Mo(){this.Dt&&!J(this.Dt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Bb,webVitalsAutocapture:class{constructor(t){var e;this.yv=!1,this.Is=!1,this.Dt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Av=()=>{clearTimeout(this.Fv),this.Fv=void 0,0!==this.Dt.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.Dt.url},this.Dt.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.Dt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ov=t=>{var e;if(this.Dt=this.Dt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(null==t?void 0:t.name)||et(null==t?void 0:t.value))gw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Lv(i);if(!K(r)){var n=it(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Dv||this.Dv>t.value){this.Dt.navigationKey!==n&&(this.Av(),this.Fv=setTimeout(this.Av,this.flushToCaptureTimeoutMs)),K(this.Dt.navigationKey)&&(this.Dt.navigationKey=n,this.Dt.url=r),this.Dt.firstMetricTimestamp=K(this.Dt.firstMetricTimestamp)?Date.now():this.Dt.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Q(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of _w){var u="url"===l&&"string"==typeof t.attribution[l]?this.Lv(t.attribution[l]):t.attribution[l];K(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;K(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.Dt.metrics.push(a),this.Dt.metrics.length===this.allowedMetrics.length&&this.Av()}else gw.error("Ignoring metric with value >= "+this.Dv,t)}}},this.$v=()=>{if(!this.Is){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Nv])||("web-vitals"===this.Nv&&K(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!K(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!K(l),t=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,e=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,r=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(t&&e&&i&&r){var h={reportSoftNavs:this.useSoftNavs},d=n&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Ov.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Ov.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Ov.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Ov.bind(this),d),this.Is=!0}else gw.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.yv=!(null==(e=this._instance.persistence)||!e.props[Rn]),this.startIfEnabled()}get qv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Q(this.qv)?null==(t=this.qv)?void 0:t.web_vitals_allowed_metrics:void 0;return et(i)?(null==(e=this._instance.persistence)?void 0:e.props[On])||yw:i}get flushToCaptureTimeoutMs(){return(Q(this.qv)?this.qv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Q(this.qv)?this.qv.web_vitals_attribution:void 0;return nt(t)?t?yw:[]:G(t)?t:bw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=Q(this.qv)?this.qv.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get Dv(){var t=Q(this.qv)&&it(this.qv.__web_vitals_max_value)?this.qv.__web_vitals_max_value:mw;return t>0&&6e4>=t?mw:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return gw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Q(this.qv)?this.qv.web_vitals:nt(this.qv)?this.qv:void 0;return nt(e)?e:this.yv}startIfEnabled(){this.isEnabled&&!this.Is&&(gw.info("enabled, starting..."),this.Ks(this.$v))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Rn]:i}),this._instance.persistence.register({[On]:r})),this.yv=i,this.startIfEnabled()}}}get Nv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ks(t){var e=v.__PosthogExtensions__,i=this.Nv,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&K(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?gw.error("failed to load script",e):t()}))}Lv(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Re(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Bo,...n||[]]:[];return hr(r,s,zo)}gw.error("Could not determine current URL")}}},dk={exceptionObserver:class{constructor(e){var i;this.$v=()=>{var e;if(t&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jv&&this.gn.capture_unhandled_errors&&(this.jv=i(this.captureException.bind(this))),!this.Bv&&this.gn.capture_unhandled_rejections&&(this.Bv=r(this.captureException.bind(this))),!this.Hv&&this.gn.capture_console_errors&&(this.Hv=n(this.captureException.bind(this)))}catch(t){fw.error("failed to start",t),this.zv()}}},this._instance=e,this.Uv=!(null==(i=this._instance.persistence)||!i.props[Mn]),this.pe=new mt(p({},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:fw})),this.gn=this.Wv(),this.startIfEnabledOrStop()}Wv(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Q(t)?e=p({},e,t):(K(t)?this.Uv:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.gn.capture_console_errors||this.gn.capture_unhandled_errors||this.gn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(fw.info("enabled"),this.zv(),this.Ks(this.$v)):this.zv()}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return fw.error("failed to load script",e);t()}))}zv(){var t,e,i;null==(t=this.jv)||t.call(this),this.jv=void 0,null==(e=this.Bv)||e.call(this),this.Bv=void 0,null==(i=this.Hv)||i.call(this),this.Hv=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Uv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Mn]:this.Uv}),this.gn=this.Wv(),this.startIfEnabledOrStop())}}onConfigChange(){this.gn=this.Wv()}captureException(t){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";this.pe.consumeRateLimit(n)?fw.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Vv=[],this.Gv=gm(),this._instance=t,this.Vv=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(En))&&void 0!==e?e:[],this.Zv=Bi(this.Qv()),this.Jv=new Hi(this.Zv)}onConfigChange(){this.Zv=Bi(this.Qv()),this.Jv.setConfig(this.Zv)}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:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Vv=s,this._instance.persistence&&this._instance.persistence.register({[En]:this.Vv,[In]:a})}}}get Kv(){var t,e=!!this._instance.get_property(In),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.Gv.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Zv.enabled)try{if(!Y(t)||0===t.trim().length)return void vm.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)=>qi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.Yv(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&vm.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.Jv.add(p({[$i]:t,[Ni]:(new Date).toISOString()},r))}catch(t){vm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Xv(e)){if(this.tc(e))return this.ec("Exception dropped: matched a suppression rule"),void vm.info("Skipping exception capture because a suppression rule matched");if(!this.Kv&&this.ic(e))return this.ec("Exception dropped: thrown by a browser extension"),void vm.info("Skipping exception capture because it was thrown by an extension");if(!this.Kv&&this.rc(e))return this.ec("Exception dropped: thrown by an injected browser script"),void vm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.nc(e))return this.ec("Exception dropped: thrown by the PostHog SDK"),void vm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Zv.enabled&&et(t.$exception_steps)?this.sc(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",uu:!0});return n&&this.Jv.clear(),n}catch(t){return vm.error("Failed to capture exception event. Dropping this exception.",t),void this.Jv.clear()}}catch(t){return void vm.error("Failed to process exception event. Ignoring this exception.",t)}var s}sc(t){try{var e=this.Jv.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return vm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ec(t){this.Zv.enabled&&this.Jv.add({[$i]:t,[Ni]:(new Date).toISOString()})}Yv(t){return Q(t)?p({},t):{}}Qv(){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 Y(i)&&i.length>0&&t.$exception_types.push(i),Y(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Vv.some((t=>{var i=t.values.map((t=>{var i=Io[t.operator],r=e[t.key];if(!i||!r)return!1;var n=G(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 vm.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&&fm.some((t=>e.startsWith(t)))}));return 0!==i.length&&(!i.every((t=>{var e=t.filename;return!!e&&e.startsWith(cm)}))||t.some((t=>{var e=t.value;return Y(e)&&e.includes("isolatedAPI.contexts.topHostname")}))&&!e.some((t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(cm))})))}rc(t){return t.some((t=>{var e=t.value;return Y(e)&&pm.some((t=>e.includes(t)))}))}nc(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:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Xv(t){return!et(t)&&G(t)}}},vk=p({productTours:class{get $o(){return this._instance.persistence}constructor(t){this.ac=null,this.oc=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.$o&&this.$o.register({[An]:!!e.productTours}),!Tw(this._instance))return!this.ac&&et(null==(i=this.$o)?void 0:i.props[fs])||Cw.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&&Tw(this._instance)&&this.Ks((()=>this.lc()))}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?Cw.error("Could not load product tours script",e):t()}))}lc(){var t;!this.ac&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.ac=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!G(this.oc)||e){var i=this.$o;if(i){var r=i.props[fs];if(G(r)&&!e)return this.oc=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(Tw(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||Cw.warn(n):Cw.error(n),void t([],{isLoaded:!1,error:n})}var s=G(e.json.product_tours)?e.json.product_tours:[];this.oc=s,i&&i.register({[fs]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.oc,{isLoaded:!0})}getActiveProductTours(t){et(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.Ks((()=>{var e;this.lc(),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.oc=null,null==(t=this.$o)||t.unregister(fs)}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)}}},lk),ck={siteApps:class{constructor(t){this.uc=0,this._instance=t,this.hc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}dc(t,e){if(e){var i=this.globalsForEvent(e);this.hc.push(i),this.hc.length>1e3&&(this.hc=this.hc.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._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.vc=()=>{t(),this.hc=[],this.vc=void 0}}}globalsForEvent(t){var e,i,r,n,s,a,o;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(h)){var v=d[0];l[v]={id:u[v],type:v,properties:d[1]}}var c=t.$set_once,f=t.$set;return{event:p({},g(t,Mw),{properties:p({},t.properties,f?{$set:p({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},f)}:{},c?{$set_once:p({},null!==(r=null==(n=t.properties)?void 0:n.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(s=null==(a=t.properties)?void 0:a.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=t.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}cc(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)||(Ew.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)||(Ew.error("prepare_external_dependency_script returned null"),null):t}fc(){var t,e,i,n,s,a,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==r?void 0:r.defaultView,h=null==u||null==(t=u.Node)?void 0:t.prototype;if(!u||!h)return()=>{};if(this.uc++,this.gc)return this.mc();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.cc(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!tt(t)));return f(h,"appendChild",(t=>function(e){var i=p(e);return i?t.call(this,i):e})),f(h,"insertBefore",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e})),f(h,"replaceChild",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i})),[null==(e=u.Element)?void 0:e.prototype,null==(i=u.Document)?void 0:i.prototype,null==(n=u.DocumentFragment)?void 0:n.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==(s=u.Element)?void 0:s.prototype,null==(a=u.CharacterData)?void 0:a.prototype,null==(o=u.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==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",(t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null})),this.gc=()=>{d.forEach((t=>t())),this.gc=void 0},this.mc()}mc(){var t=!1;return()=>{var e;t||(t=!0,this.uc--,0===this.uc&&(null==(e=this.gc)||e.call(this)))}}yc(t,e){void 0===e&&(e=!0);var i=this.fc();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.hc.length&&(Ew.info("Processing "+this.hc.length+" events for site app with id "+t.id),this.hc.forEach((t=>this.yc((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.vc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Ew.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.yc((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Ew.error(Iw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Ew.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}bc(){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)}_c(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.yc((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Ew.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.bc(),void this._instance.on("eventCaptured",(t=>this._c(t)))):void Ew.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.vc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Ew.error(Iw+e,t)}))};for(var o of s.siteApps)a()}else Ew.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},fk={tracingHeaders:class{constructor(t){this.wc=void 0,this.kc=void 0,this.Sc=void 0,this.$v=()=>{var t,e,i=this.xc();i?(K(this.wc)&&(this.wc=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),K(this.kc)&&(this.kc=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.zv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return pw.error("failed to load script",e);t()}))}Cc(){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}xc(){var t=this.Cc();return G(t)?(G(this.Sc)?this.Sc.splice(0,this.Sc.length,...t):this.Sc=[...t],t.length>0?this.Sc:void 0):(G(this.Sc)&&this.Sc.splice(0),this.Sc=t||void 0,this.Sc)}zv(){var t,e;null==(t=this.wc)||t.call(this),null==(e=this.kc)||e.call(this),this.wc=void 0,this.kc=void 0}startIfEnabledOrStop(){this.xc()?this.Ks(this.$v):this.zv()}}},pk=p({surveys:class extends Fw{constructor(t){var e;super(new qw(t),{get projectToken(){return e.config.token},kv:new Nw(e=t)}),this._instance=t}Ou(t,e){var i=e.query?p_(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})}))}}},lk),gk={toolbar:class{constructor(t){this.instance=t}Tc(t){v.ph_toolbar_state=t}Mc(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,n){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===n&&(n=void 0),nr(this.instance.config))return!1;if(!t||!r)return!1;e=null!=e?e:t.location,n=null!=n?n:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}i=null==t?void 0:t.localStorage}var s,a=jw||dr(e.hash,"__posthog")||dr(e.hash,"state"),o=a?Yi((()=>JSON.parse(atob(decodeURIComponent(a)))))||Yi((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(Bw)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Ec(t){var e=v.ph_load_toolbar||v.ph_load_editor;!et(e)&&Z(e)?e(t,this.instance):Hw.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(gr));if(!t||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(t.localStorage.setItem(Bw,JSON.stringify(p({},s,{source:void 0}))),2===this.Mc())this.Ec(s);else if(0===this.Mc()){var a;this.Tc(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Hw.error("[Toolbar] Failed to load",t),void this.Tc(0);this.Tc(2),this.Ec(s)})),rr(t,"turbolinks:load",(()=>{this.Tc(0),this.loadToolbar(s)}))}return!0}Ic(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)}}},mk=p({experiments:Xw},lk),yk={conversations:class{constructor(t){this.Rc=void 0,this._conversationsManager=null,this.Pc=!1,this.je=null,this.Ac=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Fc=t.ok,t.ok)){var e=t.config.conversations;et(e)||(nt(e)?this.Rc=e:(this.Rc=e.enabled,this.je=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Rc=void 0,this.je=null,this.Fc=void 0,this.Ac=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Pc||this._instance.config.disable_conversations||nr(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!K(this.Rc)&&this.Rc)if(this.je&&this.je.token){this.Pc=!0;try{var e=t.initConversations;if(e)return this.Oc(e),void(this.Pc=!1);var i=t.loadExternalDependency;if(!i)return void this.Lc(qs);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Lc("Could not load conversations script",e):this.Oc(t.initConversations),this.Pc=!1}))}catch(t){this.Lc("Error initializing conversations",t),this.Pc=!1}}else tk.error("Conversations enabled but missing token in remote config.")}}Oc(t){if(this.je)try{this._conversationsManager=t(this.je,this._instance),this.Ac=!1,tk.info("Conversations loaded successfully")}catch(t){this.Lc("Error completing conversations initialization",t)}else tk.error("Cannot complete initialization: remote config is null")}Lc(t,e){tk.error(t,e),this._conversationsManager=null,this.Pc=!1,this.Ac=!0}show(){this._conversationsManager?this._conversationsManager.show():tk.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Rc&&!tt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":nr(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Fc?"remote_config_failed":K(this.Rc)?this.Fc?"disabled_in_project":"remote_config_pending":this.Rc?et(this.je)||!this.je.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.Pc?"initializing":this.Ac?"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 f((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(tk.warn(ek),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(tk.warn(ek),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(tk.warn(ek),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(tk.warn(ek),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(tk.warn(ek),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(tk.warn(ek),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(tk.warn(ek),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}yu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}bu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},bk={logs:class{constructor(e){var i,r=this;this.name=rp,this.Dc=!1,this.$c=!1,this.Nc=!1,this.A=Gi("[logs]"),this.qc=p({},this.A,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(ok)||r.A.error(...e)}}),this.fo=[],this.jc=[],this.vd=0,this.Fs=!1,this.Bc=[],this.Hc=[],this.zc=!1,this.Uc=!1,this.Wc=()=>{var t,e;this.Fs||(this.vd=0,null==(t=this.Vc)||t.onReconnect(),null==(e=this.Gc)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.Dc=!0),t&&rr(t,"online",this.Wc)}Zc(t,e,i,r){var n,s=ik(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new ri(this.Qc(t,e),s,this.qc,(()=>this.Jc()),(t=>t()),void 0,r),s]}Kc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Vc||this.Yc!==e){var i;null==(i=this.Vc)||i.reset(),this.Yc=e;var r=this.Zc((()=>this.fo),(t=>{this.fo=t}));this.Vc=r[0],this.Xc=r[1]}return this.Vc}tf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Gc||this.ef!==e){var i;null==(i=this.Gc)||i.reset(),this.ef=e;var r=this.Zc((()=>this.jc),(t=>{this.jc=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},nk);this.Gc=r[0],this.if=r[1]}return this.Gc}setup(t){var e;if(!this.Fs){this.$s=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.Dc=!0),(this.Dc||this.rf()&&this.nf())&&this.sf();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.Fs?r.dispose():(this.Ns=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.Fs||(this.Fs=!0,this.af(),null==(e=this.Ns)||e.dispose(),this.Ns=void 0,this.$s=void 0,this.Nc=!1,null==t||t.removeEventListener("online",this.Wc),null==(i=this.lf)||i.call(this),this.lf=void 0,null==(r=this.Vc)||r.reset(),null==(n=this.Gc)||n.reset())}onRemoteConfig(t){var e,i;if(!this.Fs){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;et(r)?this.uf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[Fn]:!!r}),r?(this.Dc=!0,this.$c||this.sf(),this.loadIfEnabled()):this.uf())}}reset(){var t,e,i,r;this.af(),null==(t=this.Vc)||t.clearQueue(),this.fo=[],null==(e=this.Vc)||e.reset(),null==(i=this.Gc)||i.clearQueue(),this.jc=[],null==(r=this.Gc)||r.reset(),this.vd=0}captureLog(t){this.Fs||this.Kc().captureLog(t)}captureConsoleLog(t){this.Fs||this.tf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Fs||this.tf().captureLog(t,{context:e,occurredAtMs:i})}nf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[Fn])}rf(){var t,e;return null==(t=this._instance)||null==t.ho||!t.ho()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}wu(){var t;this.af(),null==(t=this.Gc)||t.clearQueue(),this.jc=[]}uf(){this.Dc||this.af()}sf(){var t,e=this;if(!this.zc&&null!=v&&v.console){var i=ik(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=tm(v.console[t])}catch(t){return 0}if(!r)return 0;e.Hc.push(Bv(v.console,t,(n=>{var s=function(){for(var r=arguments.length,s=new Array(r),a=0;r>a;a++)s[a]=arguments[a];try{e.hf(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of rk)r(n);this.zc=!0,this.df=setTimeout((()=>{this.af()}),3e4)}}hf(t,e,i){var r;if(this.zc&&!this.Uc&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Bc.length){this.Uc=!0;try{this.Bc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Jc()})}finally{this.Uc=!1}}}else this.af()}af(){if(this.Bc=[],this.zc){for(var t of(this.zc=!1,this.df&&(clearTimeout(this.df),this.df=void 0),this.Hc))t();this.Hc=[]}}vf(){var t=this.Bc;return this.af(),t}get logger(){return this.cf||(this.cf={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.cf}flushLogs(t){t?this.ff(t):(this.Vc&&this.Vc.flush().catch((t=>this.pf(t))),this.Gc&&this.Gc.flush().catch((t=>this.pf(t))))}pf(t){ok(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Fs&&this.Dc&&!this.$c&&!this.Nc){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.af();var e=t.loadExternalDependency;if(!e)return this.A.error(qs),void this.af();this.Nc=!0;try{e(this._instance,"logs",(e=>{if(this.Nc=!1,!this.Fs&&this.Dc){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.af();else{var r,n,s=this.vf();this.lf=i.initializeLogs(null!==(r=this.$s)&&void 0!==r?r:this._instance),this.$c=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.$s)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.Nc=!1,t}}}Qc(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===S.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===S.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},ss:t=>this.ss(t),getLibraryId:()=>Ui.LIB_NAME,getLibraryVersion:()=>Ui.LIB_VERSION}}ss(t){return new Promise((e=>{if(vr(this.vd,3))e({kind:"fatal",error:ak(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:ak(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.mf(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:ak(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)})}}})}}))}mf(t){(0!==t||this._instance.__loaded)&&(this.vd=cr(t,this.vd,3,(()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}ff(t){this.fo.length>0&&this.yf(t,this.fo,this.Xc,Ui.LIB_NAME,(t=>{this.fo=t})),this.jc.length>0&&this.yf(t,this.jc,this.if,nk,(t=>{this.jc=t}))}yf(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=ii(s,ei(i,Ui.LIB_NAME,Ui.LIB_VERSION),r,Ui.LIB_VERSION);this._instance._send_request({method:"POST",url:this.gf(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}gf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Jc(){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,et(n)||(e.sessionStartTimestamp=n),et(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Re(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},_k={metrics:class{constructor(t){this.A=Gi("[metrics]"),this._instance=t}initialize(){}Kc(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Vc&&this.Yc===i||(null==(e=this.Vc)||e.reset(),this.Yc=i,this.Vc=new oi(this.Qc(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,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.Vc}count(t,e,i){void 0===e&&(e=1),this.Kc().count(t,e,i)}gauge(t,e,i){this.Kc().gauge(t,e,i)}histogram(t,e,i){this.Kc().histogram(t,e,i)}flush(t){if(!this.Vc)return Promise.resolve();if(t){var e=this.Vc.drainWindow();return e&&this.Ss(e,t),Promise.resolve()}return this.Vc.flush().catch((t=>this.A.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Vc)||t.reset()}Qc(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ss:t=>e.Ss(t),getLibraryId:()=>Ui.LIB_NAME,getLibraryVersion:()=>Ui.LIB_VERSION}}Ss(t,e){return new Promise((i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(s),i(t))},s=setTimeout((()=>n({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(p({method:"POST",url:this.bf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)n({kind:"ok"});else if(413===e)n({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)n({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;n({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}bf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},wk=p({},lk,uk,hk,dk,vk,ck,pk,fk,gk,mk,yk,bk,_k);vw.__defaultExtensionClasses=p({},wk),function(){Ui.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||G(e._i)){var i=K_[sw]=new vw;if(e){var n=[];Qi(e._i,(function(t){if(t&&G(t)){var r=i.init(t[0],t[1],t[2]),s=e[t[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}}))}i.__SV=1,v.posthog=i,function(){function e(){e.done||(e.done=!0,aw=!1,Qi(K_,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():rr(r,"DOMContentLoaded",e,{capture:!1}):t&&Vi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
|
|
1
|
+
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,n=null==e?void 0:e.location,s=null==e?void 0:e.fetch,a=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,o=null==e?void 0:e.AbortController,l=null==e?void 0:e.CompressionStream,u=null==i?void 0:i.userAgent;function h(){return!(!t||!1===t.navigator.onLine)}var d="undefined"!=typeof globalThis?globalThis:t;d&&"undefined"==typeof self&&(d.self=d),d&&"undefined"==typeof File&&(d.File=function(){});var v=null!=t?t:{};function c(t,e,i,r,n,s,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function f(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var s=t.apply(e,i);function a(t){c(s,r,n,a,o,"next",t)}function o(t){c(s,r,n,a,o,"throw",t)}a(void 0)}))}}function p(){return p=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},p.apply(null,arguments)}function g(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}var m={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},y={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},b=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function _(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k=["$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"],S=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}({}),x=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),C="min_length",T="max_length",M=["$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"],I=20,R=1e3,P=1e4,A="[Circular]",F="[Truncated]",O="[Unserializable]",L="[Function]";function D(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}var N=["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"],q=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return N.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function j(t,e){return-1!==t.indexOf(e)}var B=function(t){return t.trim()},H=function(t){return t.replace(/^\$/,"")};function z(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 U=Object.prototype,W=U.hasOwnProperty,V=U.toString,G=Array.isArray||function(t){return"[object Array]"===V.call(t)},Z=t=>"function"==typeof t,Q=t=>t===Object(t)&&!G(t),J=t=>{if(Q(t)){for(var e in t)if(W.call(t,e))return!1;return!0}return!1},K=t=>void 0===t,Y=t=>"[object String]"==V.call(t),X=t=>Y(t)&&0===t.trim().length,tt=t=>null===t,et=t=>K(t)||tt(t),it=t=>"[object Number]"==V.call(t)&&t==t,rt=t=>it(t)&&t>0,nt=t=>"[object Boolean]"===V.call(t),st=t=>t instanceof FormData,at=t=>j(M,t),ot=t=>j(E,t);function lt(t){return null===t||"object"!=typeof t}function ut(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ht(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 vt(t,Error)}}function dt(t){return"undefined"!=typeof Event&&vt(t,Event)}function vt(t,e){try{return t instanceof e}catch(t){return!1}}var ct=[!0,"true",1,"1","yes"],ft=t=>j(ct,t),pt=[!1,"false",0,"0","no"];function gt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),it(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),gt(n||i,e,i,r))}class mt{constructor(t){this.C={},this.I=t.I,this.R=gt(t.bucketSize,0,100,t.A),this.O=gt(t.refillRate,0,this.R,t.A),this.N=gt(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={}}}var yt="Mobile",bt="iOS",_t="Android",wt="Tablet",kt=_t+" "+wt,St="iPad",xt="Apple",Ct=xt+" Watch",Tt="Safari",Mt="BlackBerry",Et="Samsung",It=Et+"Browser",Rt=Et+" Internet",Pt="Chrome",At=Pt+" OS",Ft=Pt+" "+bt,Ot="Internet Explorer",Lt=Ot+" "+yt,Dt="Opera",$t=Dt+" Mini",Nt="Edge",qt="Microsoft "+Nt,jt="Firefox",Bt=jt+" "+bt,Ht="Nintendo",zt="PlayStation",Ut="Xbox",Wt=_t+" "+yt,Vt=yt+" "+Tt,Gt="Windows",Zt=Gt+" Phone",Qt="Nokia",Jt="Ouya",Kt="Generic",Yt=Kt+" "+yt.toLowerCase(),Xt=Kt+" "+wt.toLowerCase(),te="Konqueror",ee="Oculus Browser",ie="Vivaldi",re="Yandex",ne="Whale",se="DuckDuckGo",ae="Pale Moon",oe="Waterfox",le="Brave",ue="Claude",he="Codex",de="ChatGPT",ve="Google Search App",ce="(\\d+(\\.\\d+)?)",fe=new RegExp("Version/"+ce),pe=new RegExp("("+ue+"|"+he+"|"+de+")\\/"+ce),ge=new RegExp(Ut,"i"),me=new RegExp(zt+" \\w+","i"),ye=new RegExp(Ht+" \\w+","i"),be=new RegExp(Mt+"|PlayBook|BB10","i"),_e={"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"},we=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?le:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&j(t,"GSA/")?ve:j(t," OPR/")&&j(t,"Mini")?$t:j(t," OPR/")?Dt:be.test(t)?Mt:j(t,"IE"+yt)||j(t,"WPDesktop")?Lt:j(t,"OculusBrowser")?ee:j(t,It)?Rt:j(t,Nt)||j(t,"Edg/")?qt:j(t,ie+"/")?ie:j(t,"YaBrowser/")?re:j(t,ne+"/")?ne:j(t,se+"/")||j(t,"Ddg/")?se:j(t,ue+"/")?ue:j(t,he+"/")?he:j(t,de+"/")?de:j(t,"FBIOS")?"Facebook "+yt:j(t,"UCWEB")||j(t,"UCBrowser")?"UC Browser":j(t,"CriOS")?Ft:j(t,"CrMo")||j(t,Pt)?Pt:j(t,_t)&&j(t,Tt)?Wt:j(t,"FxiOS")?Bt:j(t.toLowerCase(),te.toLowerCase())?te:j(t,le+"/")?le:((t,e)=>e&&j(e,xt)||function(t){return j(t,Tt)&&!j(t,Pt)&&!j(t,_t)}(t))(t,e)?j(t,yt)?Vt:Tt:j(t,"PaleMoon/")?ae:j(t,oe+"/")?oe:j(t,jt)?jt:j(t,"MSIE")||j(t,"Trident/")?Ot:j(t,"Gecko")?jt:"")},ke={[Lt]:[new RegExp("rv:"+ce)],[qt]:[new RegExp(Nt+"?\\/"+ce)],[Pt]:[new RegExp("("+Pt+"|CrMo)\\/"+ce)],[Ft]:[new RegExp("CriOS\\/"+ce)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ce)],[Tt]:[fe],[Vt]:[fe],[Dt]:[new RegExp("(Opera|OPR)\\/"+ce)],[jt]:[new RegExp(jt+"\\/"+ce)],[Bt]:[new RegExp("FxiOS\\/"+ce)],[te]:[new RegExp("Konqueror[:/]?"+ce,"i")],[Mt]:[new RegExp(Mt+" "+ce),fe],[Wt]:[new RegExp("android\\s"+ce,"i")],[Rt]:[new RegExp(It+"\\/"+ce)],[ee]:[new RegExp("OculusBrowser\\/"+ce)],[ie]:[new RegExp(ie+"\\/"+ce)],[re]:[new RegExp("YaBrowser\\/"+ce)],[ne]:[new RegExp(ne+"\\/"+ce)],[le]:[new RegExp(le+"\\/"+ce)],[ue]:[pe],[he]:[pe],[de]:[pe],[se]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ce)],[ae]:[new RegExp("PaleMoon\\/"+ce)],[oe]:[new RegExp(oe+"\\/"+ce)],[ve]:[new RegExp("GSA\\/"+ce)],[Ot]:[new RegExp("(rv:|MSIE )"+ce)],Mozilla:[new RegExp("rv:"+ce)]},Se=function(t,e,i,r){var n=we(t,e,i,r),s=ke[n];if(K(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},xe=[[new RegExp(Ut+"; "+Ut+" (.*?)[);]","i"),t=>[Ut,t&&t[1]||""]],[new RegExp(Ht,"i"),[Ht,""]],[new RegExp(zt,"i"),[zt,""]],[be,[Mt,""]],[new RegExp(Gt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zt,""];if(new RegExp(yt).test(e)&&!/IEMobile\b/.test(e))return[Gt+" "+yt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=_e[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Gt,r]}return[Gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[bt,[t[3],t[4],t[5]||"0"].join(".")]:[bt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=K(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_t+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_t+")","i"),t=>t&&t[2]?[_t,[t[2],t[3],t[4]||"0"].join(".")]:[_t,""]],[/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/,[At,""]],[/Linux|debian/i,["Linux",""]]],Ce=function(t){for(var e=0;xe.length>e;e++){var i=xe[e],r=i[1],n=i[0].exec(t),s=n&&(Z(r)?r(n,t):r);if(s)return s}return["",""]},Te=function(t){return ye.test(t)?Ht:me.test(t)?zt:ge.test(t)?Ut:new RegExp(Jt,"i").test(t)?Jt:new RegExp("("+Zt+"|WPDesktop)","i").test(t)?Zt:/iPad/.test(t)?St:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ct:be.test(t)?Mt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Qt,"i").test(t)?Qt:/(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(yt).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)?_t:kt:new RegExp("(pda|"+yt+")","i").test(t)?Yt:new RegExp(wt,"i").test(t)&&!new RegExp(wt+" pc","i").test(t)?Xt:""},Me=function(t,e){var i,r,n,s,a=Te(t);return a===St||a===kt||"Kobo"===a||"Kindle Fire"===a||a===Xt?wt:a===Ht||a===Ut||a===zt||a===Jt?"Console":a===Ct?"Wearable":a?yt:"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)?yt:wt:"Desktop"},Ee=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ie(t,e){return"string"==typeof(i=t)&&Ee.test(i)?t:e();var i}function Re(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 Pe(t){return t?t.split("#")[0]:t}function Ae(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Fe(t,e,i){return Oe.apply(this,arguments)}function Oe(){return(Oe=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Ae((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Le,De="NativeGzipValidationError",$e=t=>t.length>=2&&31===t[0]&&139===t[1],Ne=(t,e)=>t===x.GZipJS||e===x.GZipJS||"gzip"===e,qe=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),je=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return qe(t)||e===De},Be=t=>{throw Re(De,"Native gzip produced invalid output: "+t)},He=function(){var t=f((function*(t,e){18>t.size&&Be("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());$e(i)&&8===i[2]||Be("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Le)return Le;Le=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Le[t]=e>>>0}return Le})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Be("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Be("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function ze(t,e,i){return Ue.apply(this,arguments)}function Ue(){return Ue=f((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=f((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),o=new Response(n.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield He(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),Ue.apply(this,arguments)}var We=0x8000000000000000,Ve="9223372036854775808",Ge={}.propertyIsEnumerable;function Ze(t,e){try{return Ke(t,e,{ancestors:new WeakSet,remainingNodes:P},0)}catch(t){return[]}}function Qe(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:F};if(i.remainingNodes--,nt(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt(Ve);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("undefined"==typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=We||-We>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:D(t)};if("function"==typeof t)return{stringValue:L};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:A};if(r>=I)return{stringValue:F};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?D(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return Qe(o.call(t),e,i,r+1)}catch(t){}return G(t)?{arrayValue:{values:Je(t,e,i,r+1)}}:{kvlistValue:{values:Ke(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:D(String(t))}}function Je(t,e,i,r){for(var n=[],s=Math.min(t.length,R),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(et(o))continue;n.push(Qe(o,e,i,r))}catch(t){n.push({stringValue:O})}return t.length>a&&n.push({stringValue:F}),n}function Ke(t,e,i,r){var n=[];for(var s in t)if(Ge.call(t,s)){if(n.length>=R||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(tt(a)||K(a))continue;n.push({key:D(s),value:Qe(a,e,i,r)})}catch(t){n.push({key:D(s),value:{stringValue:O}})}}return n}function Ye(t,e,i){return p({},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 Xe={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var ti={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}},ei=ti.info;function ii(t){try{return D(String(t))}catch(t){return O}}function ri(t,e,i,r){var n,s=ti[t.level||"info"]||ei,a=s.text,o=s.number,l=(void 0===(n=it(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);var h=p({},u),d=t.attributes;if(d){var v=[];try{v=Object.keys(d)}catch(t){v=[]}for(var c of v){var f=void 0;try{f=d[c]}catch(t){f=O}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:ii(t.body)},attributes:Ze(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),K(t.trace_flags)||(g.flags=t.trace_flags),g}function ni(t,e,i){return Ye(t,e,i)}function si(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ze(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let ai=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.gn=e,this.A=i,this.Pn=r,this.Fn=n,this.Dn=s,this.$n=a,this.Nn=null,this.qn=0,this.jn=0,this.Bn=0,this.Hn=0,this.zn=0,this.Un=!1,this.Wn=e.maxBufferSize,this.Vn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.Gn=e.flushIntervalMs,this.Zn=e.maxBatchRecordsPerPost,this.Qn=e.rateCapWindowMs,this.Jn=e.maxLogsPerInterval}clearQueue(){this.jn++,this._instance.setPersistedProperty(S.LogsQueue,[])}reset(){this.Kn(),this.Hn=0,this.zn=0,this.Un=!1,this.Bn=0,this.Zn=this.gn.maxBatchRecordsPerPost}onReconnect(){this.Bn=0,this.Yn()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Xn(t);if(null!==r)if(r.body){if(this.ts()){var n={record:ri(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Pn(),this.A,null==e?void 0:e.occurredAtMs)};this.Fn((()=>this.es(n)))}}else this.A.info("Log was rejected in beforeSend function")}}Xn(t){var e=this.gn.beforeSend;if(!e)return t;var i=G(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}ts(){if(void 0===this.Jn)return!0;var t=Date.now(),e=t-this.Hn;return this.Qn>e&&e>=0||(this.Hn=t,this.zn=0,this.Un=!1),this.Jn>this.zn?(this.zn++,!0):(this.Un||(this.A.warn("captureLog dropping logs: exceeded "+this.Jn+" logs per "+this.Qn+"ms"),this.Un=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.Nn||(t.Nn=t.rs().finally((()=>{t.Nn=null}))),t.Nn}))()}rs(){var t=this;return f((function*(){var e;t.Kn();var i=null!==(e=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a,o=t.jn;t.qn=0;var l=Math.min(i.length,t.Zn),u=i.slice(0,l),h=u.map((t=>t.record)),d=si(h,t.ns(),null!==(s=t.$n)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.ss(d);if(t.jn!==o)return;if("too-large"===v.kind&&u.length>1)t.Zn=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.Zn);else{if("retry-later"===v.kind)throw v.error;if("too-large"===v.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"===v.kind&&t.gn.maxBatchRecordsPerPost>t.Zn&&(t.Zn=Math.min(t.gn.maxBatchRecordsPerPost,t.Zn+1)),yield t.os(u.length),i=null!==(a=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}os(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.qn),n=null!==(i=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(S.LogsQueue,n.slice(r)),yield e.Dn()}))()}ns(){return ni(this.gn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}es(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];this.Vn>i.length||(i.shift(),this.qn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(S.LogsQueue,i),this.Wn>i.length?this.ls():this.Yn()}}ls(t){void 0===t&&(t=this.Gn),this.us||(this.us=Ae((()=>{this.us=void 0,this.Yn()}),t))}hs(){var t=Math.min(Math.max(0,this.Bn-1),6);return this.Gn*Math.pow(2,t)}ds(){var t=this._instance.getPersistedProperty(S.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.Kn();var i=e.flush().catch((()=>{}));void 0!==t?yield Fe(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield Fe(i,t,(()=>{i.catch((()=>{}))}))}))()}Yn(){this.flush().then((()=>{this.Bn=0}),(t=>{this.Bn++,this.A.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.ds()&&this.ls(this.hs())}))}Kn(){this.us&&(clearTimeout(this.us),this.us=void 0)}};var oi=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function li(t){return String(t)+"000000"}function ui(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}let hi=class{constructor(t,e,i){this._instance=t,this.gn=e,this.A=i,this.vs=new Map,this.Nn=null,this.cs=!1,this.fs=new Map,this.ps=new Set,this.gs=0}count(t,e,i){void 0===e&&(e=1),this.ys({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.ys({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.ys({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.Nn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.bs()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.Nn===r&&(this.Nn=null)}));return this.Nn=r,r}drainWindow(){if(0===this.vs.size)return null;var t=this.vs;return this.vs=new Map,this.cs=!1,this.fs=new Map,this.ps=new Set,this._s(t)}reset(){this.gs++,this.Kn(),this.vs=new Map,this.Nn=null,this.cs=!1,this.fs=new Map,this.ps=new Set}ys(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Xn(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?p({},e.attributes):void 0,r=ui(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 n=this.vs.get(r);if(!n){if(!this.ws())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.vs.set(r,n)}var s=this.fs.get(e.name);void 0===s?this.fs.set(e.name,e.type):s===e.type||this.ps.has(e.name)||(this.ps.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.ks(n,e.value),this.ls()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}ws(){return this.gn.maxSeriesPerFlush>this.vs.size||(this.cs||(this.cs=!0,this.A.warn("Metric series cap reached ("+this.gn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}ks(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(oi.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,oi)]+=1}}Xn(t){var e=this.gn.beforeSend;if(!e)return t;var i=G(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}ls(){this.us||(this.us=Ae((()=>{this.us=void 0,this.flush().catch((t=>{this.A.error("Metrics flush failed:",t)}))}),this.gn.flushIntervalMs))}Kn(){this.us&&(clearTimeout(this.us),this.us=void 0)}bs(){var t=this;return f((function*(){if(0!==t.vs.size){var e=t.vs;t.vs=new Map,t.cs=!1,t.fs=new Map,t.ps=new Set;var i=t.gs,r=yield t._instance.Ss(t._s(e));if(i===t.gs)switch(r.kind){case"ok":return;case"retry-later":return t.xs(e),void t.ls();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)}}}))()}_s(t){return e=this.Cs(t),i=function(t,e,i){return Ye(t,e,i)}(this.gn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ze(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Cs(t){var e=li(Date.now()),i=new Map;for(var r of t.values()){var n,s=ui(r.type,r.name,r.unit,void 0),a=i.get(s);a||(a=p({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(s,a));var o=Ze(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),l=li(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:o,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:oi})}return Array.from(i.values())}xs(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.vs.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.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(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.ws()&&this.vs.set(n,s)}}};function di(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var vi,ci,fi;function pi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return fi&&i.length===ci||(ci=i.length,fi=i.reduce(((i,r)=>{vi||(vi={});var n=vi[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,vi[r]=[l,u];break}}return i}),{})),fi}}class gi{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 f((function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&G(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)),p({},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 f((function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i}))()}convertToExceptionList(t,e){var i,r,n,s={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!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:pi(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 p({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}}var mi="?";function yi(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?mi:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return K(r)||(s.lineno=r),K(n)||(s.colno=n),s}var bi=(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]:mi,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},_i=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ki=/\((\S*)(?::(\d+))(?::(\d+))\)/,Si=(t,e)=>{var i=_i.exec(t);if(i)return yi(e,i[1],mi,+i[2],+i[3]);var r=wi.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=ki.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=bi(r[1]||mi,r[2]);return yi(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},xi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ci=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ti=(t,e)=>{var i=xi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=Ci.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]||mi,a=bi(s,n);return yi(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Mi=/\(error: (.*)\)/,Ei=50;class Ii{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Y(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 ut(t,"DOMException")}isDOMError(t){return ut(t,"DOMError")}}class Ri{match(t){return ht(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}}class Pi{constructor(){}match(t){return!!ut(t,"ErrorEvent")&&(null!=t.error||this.Wi(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return p({},r,{stack:null!==(i=this.Vi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Wi(t){return Y(t.message)&&t.message.length>0}Vi(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(Y(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Ai=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Fi{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(Ai);return r&&(e=r[1],i=r[2]),[e,i]}}var Oi=["fatal","error","warning","log","info","debug"];function Li(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""}class Di{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(dt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Y(e)&&!X(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: "+Li(t)}isSeverityLevel(t){return Y(t)&&!X(t)&&Oi.indexOf(t)>=0}getStack(t){try{return Y(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Y(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(ht(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class $i{match(t){return dt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Li(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ni{match(t){return lt(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}}}class qi{match(t){return ut(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!dt(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 lt(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}}var ji="$message",Bi="$timestamp",Hi=new Set([ji,Bi]),zi={enabled:!0,max_bytes:32768};function Ui(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:zi.enabled,max_bytes:Vi(t.max_bytes,zi.max_bytes)}:p({},zi)}class Wi{constructor(t){this.Ts=[],this.Ms=0,this.gn=Ui(t)}setConfig(t){this.gn=Ui(t),this.Es()}add(t){var e=function(t){var e;try{e=z(t)}catch(t){return}try{var i=JSON.parse(e);if(!Q(i))return;var r=i,n=r[ji],s=r[Bi];if(!Y(n)||0===n.trim().length)return;if(!Y(s)&&!it(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=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.gn.max_bytes||(this.Ts.push({step:e.step,bytes:i}),this.Ms+=i,this.Es())}}getAttachable(){return this.Ts.map((t=>t.step))}clear(){this.Ts=[],this.Ms=0}size(){return this.Ts.length}Es(){for(;this.Ms>this.gn.max_bytes&&this.Ts.length>0;){var t=this.Ts.shift();t&&(this.Ms-=t.bytes)}}}function Vi(t,e){if(!it(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var Gi={DEBUG:!1,LIB_VERSION:"0.7.1",LIB_NAME:"browser-common"},Zi=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={q(i){if(t&&(Gi.DEBUG||t.POSTHOG_DEBUG||r)&&!K(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.q("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>Zi(e+" "+t,i)};return n},Qi=Zi("[PostHog.js]"),Ji=Qi.createLogger;function Ki(t,e){G(t)&&t.forEach(e)}function Yi(t,e){if(!et(t))if(G(t))t.forEach(e);else if(st(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)W.call(t,i)&&e(t[i],i)}var Xi=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 tr(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 er=function(t){try{return t()}catch(t){return}},ir=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){Qi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Qi.critical(t)}}},rr=function(t){var e={};return Yi(t,(function(t,i){(Y(t)&&t.length>0||it(t))&&(e[i]=t)})),e};var nr=["herokuapp.com","vercel.app","netlify.app"];function sr(t){var e=null==t?void 0:t.hostname;if(!Y(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of nr)if(i===r)return!1;return!0}function ar(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function or(t){return"ph_toolbar_internal"===t.name}var lr=["localhost","127.0.0.1"],ur=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return z(t)}},hr=t=>{var e=null==r?void 0:r.createElement("a");return K(e)?null:(e.href=t,e)},dr=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Yi(t,(function(t,e){K(t)||K(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)},vr=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(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Qi.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},cr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");G(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},fr=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},pr=(t,e)=>t>=e&&h(),gr=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function mr(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Z(r))return e;try{var n=r(e);return Y(n)&&n?n:e}catch(t){return Qi.error("Error in get_current_url, falling back to window.location.href",t),e}}function yr(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return K(r)?void 0:mr(e,r)}var br="__POSTHOG_TOOLBAR__",_r=1,wr=3,kr=11;function Sr(t){return t instanceof Element&&(t.id===br||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function xr(t){return!!t&&t.nodeType===_r}function Cr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Tr(t){return!!t&&t.nodeType===wr}function Mr(t){return!!t&&t.nodeType===kr&&xr(t.host)}var Er=1e3;function Ir(t){return t?B(t).split(/\s+/):[]}function Rr(t,e){var i=yr(e);return!!(i&&t&&t.some((t=>i.match(t))))}function Pr(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 Ir(e)}function Ar(t){return et(t)?null:B(t).split(/(\s+)/).filter((t=>nn(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Fr(t){var e="";return Zr(t)&&!Qr(t)&&t.childNodes&&t.childNodes.length&&Yi(t.childNodes,(function(t){var i;Tr(t)&&t.textContent&&(e+=null!==(i=Ar(t.textContent))&&void 0!==i?i:"")})),B(e)}function Or(t){var e;return K(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Lr=["a","button","form","input","select","textarea","label"];function Dr(t,e){if(K(e))return!0;var i,r=function(t){if(e.some((e=>function(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}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function $r(t){var e=t.parentNode;return!(!e||!xr(e))&&e}var Nr=[".ph-no-autocapture","[data-ph-no-autocapture]"],qr=["next","previous","prev",">","<"],jr=[...qr,"+","-","−","–"],Br=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Hr=[".ph-no-deadclick",".ph-no-capture"],zr=[".ph-no-rageclick",".ph-no-capture"],Ur=["","text","search","email","password","url","tel","number"];function Wr(e,i){if(!t||Vr(e))return!1;var r,n,s,a,o;if(nt(i)?(r=!!i&&zr,n=void 0,s=!1):(r=null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:zr,n=null==i?void 0:i.content_ignorelist,s=null!==(o=null==i?void 0:i.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(s&&function(t){return!(!t||!xr(t))&&(!!Cr(t,"textarea")||(Cr(t,"input")?j(Ur,(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)))}(e))return!1;var l=Gr(e,!1).targetElementList;return!function(t,e){if(!1===t||K(t))return!1;var i;if(!0===t)i=qr;else{if(!G(t))return!1;if(t.length>10)return Qi.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=>Br(e,t)||Br(r,t)))}))}(n,l.map((t=>{var e;return{safeText:Fr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Dr(l,r)}var Vr=t=>!t||Cr(t,"html")||!xr(t),Gr=(e,i)=>{if(!t||Vr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!Cr(s,"body");)if(Mr(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=$r(s);if(!a)break;if(i||Lr.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function Zr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Cr(r,"body");r=r.parentNode){if(i++>=Er||e.has(r))return!1;e.add(r);var n=Pr(r);if(j(n,"ph-sensitive")||j(n,"ph-no-capture"))return!1}if(j(Pr(t),"ph-include"))return!0;var s=t.type||"";if(Y(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Y(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Qr(t){return!!(Cr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Cr(t,"select")||Cr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Jr=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}))$"),Kr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Yr=[16,15,14,13],Xr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),tn=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),en=/[0-9A-Za-z_]/;function rn(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 nn(t,e){if(void 0===e&&(e=!0),et(t))return!1;if(Y(t)){t=B(t);var i=e?Jr.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Kr.lastIndex=0;e=Kr.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Yr){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(Jr.test(o)&&rn(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Xr.test(t):function(t){var e;for(tn.lastIndex=0;e=tn.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&en.test(i)&&en.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function sn(t){var e=Fr(t);return nn(e=(e+" "+an(t)).trim())?e:""}function an(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Yi(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Fr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+an(t)).trim())}catch(t){Qi.error("[AutoCapture]",t)}})),e}function on(t){return t.replace(/"|\\"/g,'\\"')}function ln(t){var e=t.attr__class;if(e)return G(e)?e:Ir(e)}var un="[SessionRecording]",hn="redacted",dn=1e6;function vn(t){var e;return Math.min(dn,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:dn)}var cn={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:dn,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},fn=["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"],pn=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],gn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],mn=t=>{et(t)||Yi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return fn.includes(e)||gn.some((t=>e.includes(t)))})(e)&&(t[e]=hn)}))},yn=["/s/","/e/","/i/"];function bn(t,e,i,r){if(et(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Y(n)&&(n=parseInt(n)),n>i?un+" "+r+" body too large to record ("+n+" bytes)":t}function _n(t,e){if(et(t))return t;var i=t;return nn(i,!1)||(i=un+" "+e+" body "+hn),Yi(pn,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=un+" "+e+" body "+hn+" as might contain: "+t)})),i}var wn=new WeakSet,kn="$people_distinct_id",Sn="distinct_id",xn="$device_id",Cn="$device_model",Tn="__alias",Mn="__timers",En="$autocapture_disabled_server_side",In="$heatmaps_enabled_server_side",Rn="$exception_capture_enabled_server_side",Pn="$error_tracking_suppression_rules",An="$error_tracking_capture_extension_exceptions",Fn="$web_vitals_enabled_server_side",On="$dead_clicks_enabled_server_side",Ln="$product_tours_enabled_server_side",Dn="$logs_capture_enabled_server_side",$n="$web_vitals_allowed_metrics",Nn="$session_recording_remote_config",qn="$replay_sample_rate",jn="$replay_override_sampling",Bn="$replay_override_linked_flag",Hn="$replay_override_url_trigger",zn="$replay_override_event_trigger",Un="$sesid",Wn="$session_is_sampled",Vn="$session_past_minimum_duration",Gn="$session_recording_url_trigger_activated_session",Zn="$session_recording_event_trigger_activated_session",Qn="$posthog_sr_group_event_trigger_",Jn="$posthog_sr_group_url_trigger_",Kn="$posthog_sr_group_sampling_",Yn="$debug_first_full_snapshot_timestamp",Xn="$sess_rec_flush_size",ts="$enabled_feature_flags",es="$active_feature_flags",is="$early_access_features",rs="$feature_flag_details",ns="$feature_flag_payloads",ss="$feature_flag_request_id",as="$minimal_flag_called_events",os="$override_feature_flags",ls="$override_feature_flag_payloads",us="$stored_person_properties",hs="$stored_group_properties",ds="$groups",vs="$surveys",cs="$surveys_loaded_at",fs="$surveys_activated",ps="$surveys_activated_session",gs="$surveys_activated_timestamps",ms="ph_product_tours",ys="$flag_call_reported",bs="$flag_call_reported_session_id",_s="$feature_flag_errors",ws="$feature_flag_evaluated_at",ks="$user_state",Ss="$client_session_props",xs="$capture_rate_limit",Cs="$initial_campaign_params",Ts="$initial_referrer_info",Ms="$initial_person_info",Es="$epp",Is="$posthog_cookieless",Rs="$cookieless_mode",Ps="$sdk_debug_extensions_init_method",As="$sdk_debug_extensions_init_time_ms",Fs="$sdk_debug_recording_script_not_loaded",Os="$sdk_debug_replay_event_trigger_status",Ls="$sdk_debug_replay_linked_flag_trigger_status",Ds="$sdk_debug_replay_matched_recording_trigger_groups",$s="$sdk_debug_replay_pending_trigger_conditions",Ns="$sdk_debug_replay_remote_trigger_matching_config",qs="$sdk_debug_replay_trigger_groups_count",js="$sdk_debug_replay_url_trigger_status",Bs="$session_recording_start_reason",Hs="PostHog loadExternalDependency extension not found.",zs="on_reject",Us="always",Ws="anonymous",Vs="identified",Gs="identified_only",Zs="visibilitychange",Qs="beforeunload",Js="$pageview",Ks="$pageleave",Ys="$identify",Xs="$groupidentify",ta="disabled",ea="sampled",ia="active",ra="buffering",na="paused",sa="lazy_loading",aa="awaiting_config",oa="missing_config",la="rrweb_error",ua="trigger",ha=ua+"_activated",da=ua+"_pending",va=ua+"_"+ta;function ca(t,e,i,r,n,s){return 0===e?va:(null==t?void 0:t.get_property(i?r+i:n))===s?ha:da}function fa(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 pa(t){return t.includes(ha)?ha:t.includes(da)?da:va}function ga(t){var e=new Set(t);switch(e.delete(va),e.size){case 0:return va;case 1:return Array.from(e)[0];default:return da}}class ma{constructor(t){this.j=t}triggerStatus(t){return pa(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return pa(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class ya{constructor(t){this.j=t}triggerStatus(t){return ga(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return ga(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class ba{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return ha}stop(){}}var _a=t=>"sessionRecording"in t;class wa{constructor(t,e){this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this._instance=t,this.V=e}onConfig(t){var e,i;this.B=(_a(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(_a(t)?Q(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){Qi.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){Qi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return ca(this._instance,this.B.length,this.V,Jn,Gn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[js]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=yr(this._instance);if(!t)return!1;try{return fa(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=yr(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=fa(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=yr(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,a=fa(n,this.H,this.U);a&&!s?t():!a&&s&&e();var o=this.G(r)===ha,l=fa(n,this.B,this.$);!o&&l&&i("url",n)}}stop(){this.W=""}}class ka{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ls]:t}),t}triggerStatusNoSideEffects(){var t=da;return et(this.linkedFlag)&&(t=va),this.linkedFlagSeen&&(t=ha),t}onConfig(t,e){var i;if(this.linkedFlag=(_a(t)?Q(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!et(this.linkedFlag)&&!this.linkedFlagSeen){var r=Y(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Y(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(Q(i)&&r in i){var a=i[r];s=nt(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}}class Sa{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(_a(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return ca(this._instance,this.Y.length,this.V,Qn,Zn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Os]:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Y.length){var r=this.K(i)===ha,n=this.Y.includes(t);!r&&n&&e("event",t)}}stop(){}}class xa{constructor(t,e,i){if(this._instance=t,this.group=e,this.X=new wa(t,e.id),this.ee=new Sa(t,e.id),this.te=new ka(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.X.onConfig(n),this.ee.onConfig(n),this.te.onConfig(n,i);var s=[this.ee,this.X,this.te];this.re="any"===e.conditions.matchType?new ma(s):new ya(s)}else this.re=new ba}triggerStatus(t){return this.re.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.re.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==da?[]:[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.ee.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.te.triggerStatusNoSideEffects()}].filter((t=>t.status===da)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.ee.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.X.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?Jn+this.group.id:Qn+this.group.id]:e})}stop(){this.X.stop(),this.ee.stop(),this.te.stop()}}function Ca(t){if(t.rrwebError)return la;if(!t.receivedFlags)return ra;if(!t.isRecordingEnabled)return ta;if(t.urlTriggerMatching.urlBlocked)return na;var e=!0===t.isSampled,i=new ma([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ea:i===ha?ia:i===da?ra:!1===t.isSampled?ta:ia}function Ta(t){if(t.rrwebError)return la;if(!t.receivedFlags)return ra;if(!t.isRecordingEnabled)return ta;if(t.urlTriggerMatching.urlBlocked)return na;var e=new ya([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==va,r=nt(t.isSampled);return i&&e===da?ra:i&&e===va||r&&!t.isSampled?ta:!0===t.isSampled?ea:ia}function Ma(){var t=[];return function(e,i){if(Q(i)||G(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Ea(t){var e=JSON.stringify(t,Ma());return e?new Blob([e]).size:0}function Ia(t){if(tt(t))return 4;if(K(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(G(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=K(r)||tt(r)?4:Ia(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];K(l)||(a||(s+=1),a=!1,s+=o.length+3+Ia(l))}return s;default:return 0}}function Ra(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[Ra({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Ra({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 Pa=Uint8Array,Aa=Uint16Array,Fa=Uint32Array,Oa=new Pa([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]),La=new Pa([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]),Da=new Pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$a=function(t,e){for(var i=new Aa(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Fa(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]},Na=$a(Oa,2),qa=Na[1];Na[0][28]=258,qa[258]=28;for(var ja=$a(La,0)[1],Ba=new Aa(32768),Ha=0;32768>Ha;++Ha){var za=(43690&Ha)>>>1|(21845&Ha)<<1;Ba[Ha]=((65280&(za=(61680&(za=(52428&za)>>>2|(13107&za)<<2))>>>4|(3855&za)<<4))>>>8|(255&za)<<8)>>>1}var Ua=function(t,e,i){for(var r=t.length,n=0,s=new Aa(e);r>n;++n)++s[t[n]-1];var a,o=new Aa(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new Aa(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=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Ba[d]>>>l]=u}else for(a=new Aa(r),n=0;r>n;++n)a[n]=Ba[o[t[n]-1]++]>>>15-t[n];return a},Wa=new Pa(288);for(Ha=0;144>Ha;++Ha)Wa[Ha]=8;for(Ha=144;256>Ha;++Ha)Wa[Ha]=9;for(Ha=256;280>Ha;++Ha)Wa[Ha]=7;for(Ha=280;288>Ha;++Ha)Wa[Ha]=8;var Va=new Pa(32);for(Ha=0;32>Ha;++Ha)Va[Ha]=5;var Ga=Ua(Wa,9,0),Za=Ua(Va,5,0),Qa=function(t){return(t/8>>0)+(7&t&&1)},Ja=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Aa?Aa:t instanceof Fa?Fa:Pa)(i-e);return r.set(t.subarray(e,i)),r},Ka=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ya=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Xa=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 Pa(0),0];if(1==n){var a=new Pa(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=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:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new Aa(v+1),f=to(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 Pa(c),f]},to=function(t,e,i){return-1==t.s?Math.max(to(t.l,e,i+1),to(t.r,e,i+1)):e[t.s]=i},eo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Aa(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},io=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},ro=function(t,e,i){var r=i.length,n=Qa(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)},no=function(t,e,i,r,n,s,a,o,l,u,h){Ka(e,h++,i),++n[256];for(var d=Xa(n,15),v=d[0],c=d[1],f=Xa(s,15),p=f[0],g=f[1],m=eo(v),y=m[0],b=m[1],_=eo(p),w=_[0],k=_[1],S=new Aa(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=Xa(S,7),T=C[0],M=C[1],E=19;E>4&&!T[Da[E-1]];--E);var I,R,P,A,F=u+5<<3,O=io(n,Wa)+io(s,Va)+a,L=io(n,v)+io(s,p)+a+14+3*E+io(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return ro(e,h,t.subarray(l,l+u));if(Ka(e,h,1+(O>L)),h+=2,O>L){I=Ua(v,c,0),R=v,P=Ua(p,g,0),A=p;var D=Ua(T,M,0);for(Ka(e,h,b-257),Ka(e,h+5,k-1),Ka(e,h+10,E-4),h+=14,x=0;E>x;++x)Ka(e,h+3*x,T[Da[x]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Ka(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Ka(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=Ga,R=Wa,P=Za,A=Va;for(x=0;o>x;++x)if(r[x]>255){var B;Ya(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Ka(e,h,r[x]>>>23&31),h+=Oa[B]);var H=31&r[x];Ya(e,h,P[H]),h+=A[H],H>3&&(Ya(e,h,r[x]>>>5&8191),h+=La[H])}else Ya(e,h,I[r[x]]),h+=R[r[x]];return Ya(e,h,I[256]),h+R[256]},so=new Fa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ao=function(){for(var t=new Fa(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),oo=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=ao[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},lo=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Pa(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=ro(l,u,t.subarray(h,d)):(l[h]=true,u=ro(l,u,t.subarray(h,a)))}else{for(var v=so[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Aa(32768),m=new Aa(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 Fa(25e3),k=new Aa(288),S=new Aa(32),x=0,C=0,T=(h=0,0),M=0,E=0;a>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=no(t,l,0,w,k,S,C,T,E,h-E,u),T=x=C=0,E=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&I==_(h-N))for(var q=Math.min(c,A)-1,j=Math.min(32767,h),B=Math.min(258,A);j>=N&&--D&&R!=P;){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,L=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,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|qa[O]<<18|ja[L];var G=31&qa[O],Z=31&ja[L];C+=Oa[G]+La[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=no(t,l,true,w,k,S,C,T,E,h-E,u)}return Ja(o,0,r+Qa(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r)},uo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},ho=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&&uo(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)}},vo=function(t){return 10+(t.filename&&t.filename.length+1||0)};function co(t,e){void 0===e&&(e={});var i=oo(),r=t.length;i.p(t);var n=lo(t,e,vo(e),8),s=n.length;return ho(n,e),uo(n,s-8,i.d()),uo(n,s-4,r),n}function fo(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Pa(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Pa(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);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(++a))>>>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 Ja(r,0,n)}function po(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class go{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this.ie={},this.ne=Date.now(),this.ae=-1/0,this.oe=()=>{var t=Date.now(),e=t-this.ne;e>0?(this.se=Math.min(this.ue,this.se+e/1e3*this.le),this.ne=t):this.ne=t},this.he=t=>{if(!this.ie[t]){var e,i;this.ie[t]=!0;var r=this.ce(t);null==(e=(i=this.de).onBlockedNode)||e.call(i,t,r)}},this.ve=t=>{var e=this.ce(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.ce=t=>this._rrweb.mirror.getNode(t),this.fe=t=>{var e,i,r,n,s,a,o,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==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(l=t.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.fe(e);if(e.attributes){var r=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.ve(t.id);return!this.pe.consumeRateLimit(e[0])&&t}));var n,s,a=r-e.attributes.length;a>0&&(null==(n=(s=this.de).onDroppedAttributeMutations)||n.call(s,a))}var o=this.fe(e);if(0!==o||i===o){if(this.ge)return t;this.oe();var l,u,h=Ia(t);return h>this.se?(null==(l=(u=this.de).onDroppedOversizedMutation)||l.call(u,h),void this.me()):(this.se-=h,t)}},this.me=()=>{if(!this.ye){var t=Math.max(0,this.be-(Date.now()-this.ae));this.ye=setTimeout((()=>{var t,e;this.ye=void 0,this.ae=Date.now(),null==(t=(e=this.de).requestFullSnapshot)||t.call(e)}),t)}},this._rrweb=t,this.de=e,this.pe=new mt({bucketSize:null!==(i=this.de.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.de.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.he,A:Qi}),this.ue=null!==(n=this.de.bytesBucketSize)&&void 0!==n?n:0,this.le=null!==(s=this.de.bytesRefillRate)&&void 0!==s?s:25600,this.ge=!Number.isFinite(this.ue)||0>=this.ue,this.se=this.ue;var a=this.de.resyncIntervalMs;this.be=it(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.ie={},this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ae=Date.now()}stop(){this.pe.stop(),this.reset(),this.se=this.ue,this.ne=Date.now(),this.ae=-1/0}}Gi.DEBUG=!1,Gi.LIB_VERSION="1.424.0",Gi.LIB_NAME="web";class mo{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.we=t.get_property.bind(t),this.ke=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ke(Xn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.we(Xn);return Q(e=i)&&Y(e.sessionId)&&it(e.size)&&i.sessionId===t?i.size:0}}function yo(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<gt(100*e,0,100,Qi)}function bo(t){return"$survey_response_"+t}function _o(t,e){if(!e)return null;var i=t[bo(e)];return G(i)?[...i]:i}function wo(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!K(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=_o(t,e.id);K(s)||(r[n]=s)}})),p({$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:_o(t,e.id)}}))},t,r)}function ko(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 So(t){return"string"==typeof t&&t.trim()?t.trim():null}function xo(t){return t.toLowerCase()}function Co(t,e,i){if(!t||!e)return null;var r=xo(e),n=Object.keys(t).find((t=>xo(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>xo(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var To=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Mo(t,e,i){var r,n=Co(t.translations,e,i),s=p({},t),a=!1;if(n){var o,l=null==(o=t.translations)?void 0:o[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),K(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of To){var d=l[h];K(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return To.some((e=>!K(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=Co(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var s=null==(r=t.translations)?void 0:r[n];if(!s)return{question:t,matchedKey:null,hasChanges:!1};var a=p({},t),o=!1;return K(s.question)||(a.question=s.question,o=!0),K(s.description)||(a.description=s.description,o=!0),K(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!K(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!K(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!K(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return G(t.choices)}(s)&&(a.choices=s.choices,o=!0),{question:o?a:t,matchedKey:o?n:null,hasChanges:o}}(t,e,i))),c=v.map((t=>t.question)),f=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(r=v.find((t=>t.matchedKey)))?void 0:r.matchedKey)||null),f&&(s.questions=c,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:a?n||g:null}}function Eo(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Io(t){var e;return Eo(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ro=(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}},Po=t=>t.toLowerCase(),Ao={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=>Ro(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ro(e,t))))),icontains:(t,e)=>e.map(Po).some((e=>t.map(Po).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Po).every((e=>t.map(Po).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 Fo(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=Ao[i.operator];return!!n&&n(i.values,[String(r)])}))}function Oo(t,e,i){return ur({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Lo=new Set(["is_not","not_icontains","not_regex"]);function Do(t,e,i){return!t||0===t.length||t.every((t=>{var r="person"===t.type?i:e,n=null==r?void 0:r[t.key],s=t.operator||"exact";if(K(n)||tt(n))return Lo.has(s);var a=Ao[s];return!!a&&!K(t.value)&&!tt(t.value)&&a(G(t.value)?t.value.map(String):[String(t.value)],G(n)?n.map(String):[String(n)])}))}var $o=Ji("[SessionRecording]");function No(t,e){return e?t:"!"+t}function qo(t,e){return t===e||t!=="!"+e&&null}class jo{constructor(t,e,i,r,n,s,a){this._e=null,this.Se=Ta,this._instance=t,this.X=e,this.ee=i,this.te=r,this.xe=n,this.Ce=s,this.Me=a}onRemoteConfig(t){this._e=it(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Te=new ma([this.ee,this.X]),this.Se=Ca):(this.Te=new ya([this.ee,this.X]),this.Se=Ta),this._instance.register_for_session({[Ns]:t.triggerMatchType}),this.X.onConfig(t),this.ee.onConfig(t),this.te.onConfig(t,((t,e)=>{this.xe("linked_flag_matched",{flag:t,variant:e}),this.Me()}))}getStatus(t){return this.Se({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=this._instance.get_property("$session_recording_remote_config"),i=null==e?void 0:e.minimumDurationMilliseconds;return it(i)?i:null}checkUrlTriggers(t,e,i,r){this.X.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.ee.Y.length&&et(this.Ie))return this.Ie=t((t=>{try{this.ee.checkEventTriggerConditions(t.event,i,e)}catch(t){$o.error("Could not activate event trigger",t)}})),this.Ie}makeSamplingDecisions(t){var e,i,r,n=this._e;if(!it(n))return null==(i=this._instance.persistence)||i.unregister(Wn),void(null==(r=this._instance.persistence)||r.unregister(qn));var s=this._instance.get_property(Wn),a=this._instance.get_property(qn),o=qo(s,t),l=it(a)&&a!==n,u=K(a)&&s===t,h=l||u||!nt(o),d=h?yo(t,n):o;h&&(d?this.xe("sampled"):$o.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Wn]:No(t,d),[qn]:tt(a)&&s===t?null:n})}ensureSamplingDecision(t){if(it(this._e)){var e=this._instance.get_property(Wn);nt(qo(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Zn),null==(e=this._instance.persistence)||e.unregister(Gn),null==(i=this._instance.persistence)||i.unregister(Wn),null==(r=this._instance.persistence)||r.unregister(qn),null==(n=this._instance.persistence)||n.unregister(Vn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Te)?void 0:e.triggerStatus(t))===da}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.X.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.ee.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.te.triggerStatusNoSideEffects()}].filter((t=>t.status===da)).map((t=>t.label))}stop(){var t;null==(t=this.Ie)||t.call(this),this.Ie=void 0,this.ee.stop(),this.X.stop(),this.te.stop()}}class Bo{constructor(t,e,i,r,n){this.Re=[],this.Ae=new Map,this.Ee=!1,this._instance=t,this.X=e,this.xe=i,this.Le=r,this.Me=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Oe(t.triggerGroups),this._instance.register_for_session({[Ns]:"v2_trigger_groups",[qs]:t.triggerGroups.length}),this.X.onConfig(t)):$o.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return la;if(t.urlTriggerMatching.urlBlocked)return na;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return ta;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===ha){var o=s.group.id,l=i.get(o);K(l)?Qi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===da&&(r=!0)}return n?ea:r?ra:ta}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Re,triggerGroupSamplingResults:this.Ae,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Re)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;it(r)&&(tt(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.X.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.De(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Me(e))}),t)};for(var a of this.Re)s(a)}setupEventTriggerListeners(t,e,i){var r=this;return this.Ie=t((t=>{var i;if(this.Ee)return $o.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Ie)||i.call(this),void(this.Ie=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.De(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),a=r._instance.get_property(us),o=s.some((e=>!e.properties||0===e.properties.length||Do(e.properties,t.properties,a)));o&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Me(n))}}),e)};for(var s of this.Re)n(s)}catch(t){$o.error("Could not activate event trigger for trigger groups",t)}})),this.Ie}makeSamplingDecisions(t){for(var e of this.Re){var i,r=e.group,n=r.id,s=r.sampleRate,a=Kn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(Q(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=it(c)&&c!==s,l=v===t&&it(c)&&c===s&&nt(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!nt(l),g=p?yo(t+n,s):l;p&&this.Le("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Ae.set(n,g),null==(i=this._instance.persistence)||i.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Ee=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Wn),null==(e=this._instance.persistence)||e.unregister(qn),null==(i=this._instance.persistence)||i.unregister(Vn),this.Re)){var n,s,a,o=r.group.id;null==(n=this._instance.persistence)||n.unregister(Qn+o),null==(s=this._instance.persistence)||s.unregister(Jn+o),null==(a=this._instance.persistence)||a.unregister(Kn+o)}}updateActiveTriggers(t){var e=[];for(var i of this.Re){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),a=!0===this.Ae.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:a})}this._instance.register_for_session({[Ds]:e})}hasPendingTriggers(t){for(var e of this.Re)if(e.triggerStatus(t)===da)return!0;return!1}getPendingTriggerConditions(t){return this.Re.flatMap((e=>e.triggerStatusNoSideEffects(t)!==da?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.Ie)||t.call(this),this.Ie=void 0,this.Re.forEach((t=>t.stop())),this.Re=[],this.Ae.clear(),this.X.stop()}De(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Do(i,e,this._instance.get_property(us))}Oe(t){var e=this;this.Re.forEach((t=>t.stop())),this.Re=[],this.Ae.clear();var i=function(t){var i=new xa(e._instance,t,((i,r)=>{e.xe("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Me()}));e.Re.push(i)};for(var r of t)i(r)}}var Ho=t=>{if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),n=0;i.length>n;n++){for(var s=i[n];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},zo="https?://(.*)",Uo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Wo=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Uo],Vo="<masked>",Go=["li_fat_id"];function Zo(t,e,i){if(!r)return{};var n,s=e?[...Uo,...i||[]]:[],a=Qo(cr(r.URL,s,Vo),t),o=(n={},Yi(Go,(function(t){var e=Ho(t);n[t]=e||null})),n);return Xi(o,a)}function Qo(t,e){var i=Wo.concat(e||[]),r={};return Yi(i,(function(e){var i=vr(t,e);r[e]=i||null})),r}function Jo(t){var e=function(t){return t?0===t.search(zo+"google.([^/?]*)")?"google":0===t.search(zo+"bing.com")?"bing":0===t.search(zo+"yahoo.com")?"yahoo":0===t.search(zo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!tt(e)){n.$search_engine=e;var s=r?vr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Ko(){return navigator.language||navigator.userLanguage}var Yo="$direct";function Xo(){return(null==r?void 0:r.referrer)||Yo}function tl(t,e,i){void 0===i&&(i=!1);var r=t?[...Uo,...e||[]]:[],s=i?Pe(null==n?void 0:n.href):null==n?void 0:n.href,a=null==s?void 0:s.substring(0,1e3);return{r:Xo().substring(0,1e3),u:a?cr(a,r,Vo):void 0}}function el(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Pe(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==Yo?Yo:null==(i=hr(r))?void 0:i.host};if(s){a.$current_url=s;var o=hr(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=Qo(s);Xi(a,l)}if(r){var u=Jo(r);Xi(a,u)}return a}function il(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function rl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var nl=1e5,sl="https://schema.org",al=[],ol="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(" "),ll="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ul="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(" "),hl="Accommodation AdministrativeArea Country Place State".split(" "),dl={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:ll,publisher:ul},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:al},Offer:{seller:ul},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},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:ul,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ul,areaServed:hl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:al}},vl={},cl=[[ll,vl],["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(" "),dl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),dl.Event],[ul,dl.Organization],[hl,dl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),dl.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),vl]],fl="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function pl(t,e){return W.call(t,e)?t[e]:void 0}function gl(t){var e=typeof t;return tt(t)||"string"===e||"number"===e||"boolean"===e}function ml(t){return gl(t)||G(t)&&t.every(gl)?t:void 0}function yl(t){if(W.call(dl,t))return dl[t];for(var e of cl){var i=e[1];if(e[0].includes(t))return i}return fl.includes(t)?vl:void 0}function bl(t,e){if(!Q(t))return null;var i=pl(t,"@type"),r=function(t){return("string"==typeof t?[t]:G(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!yl(t)))}(i).filter((t=>!e||!e.length||e.includes(t)));if(!r.length)return null;var n={"@type":"string"==typeof i?r[0]:r},s=ml(pl(t,"@id"));for(var a of(K(s)||(n["@id"]=s),ol)){var o=ml(pl(t,a));K(o)||(n[a]=o)}for(var l of r){var u=yl(l),h=function(){var e=pl(t,d),i=u[d];if(!0===i){var r=ml(e);K(r)||(n[d]=r)}else if(G(e)){var s=e.map((t=>bl(t,i))).filter(Q);s.length&&(n[d]=s)}else{var a=bl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function _l(t){if(!Q(t))return null;var e=pl(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=bl(t);if(i)return p({"@context":sl},i);var r=pl(t,"@graph");if(!G(r))return null;var n=r.map((t=>bl(t))).filter(Q);return n.length?{"@context":sl,"@graph":n}:null}function wl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function kl(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 Sl(t){return wl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(wl)}function xl(t){return K(t)?void 0:Math.round(t)}function Cl(t){return Q(t)?t.network_timing:t}var Tl,Ml,El=36e5,Il=943718.4,Rl="[SessionRecording]",Pl=Ji(Rl),Al=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Fl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ol(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function Ll(){var t;return null==(t=Ol())?void 0:t.record}function Dl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Ma())}}function $l(t){return po(co(fo(Dl(t))))}function Nl(t){return ql.apply(this,arguments)}function ql(){return(ql=f((function*(t){var e=Dl(t),i=yield ze(e,Gi.DEBUG,{rethrow:!0});return po(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var jl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Bl=!1;function Hl(t){return G(t)&&0===t.length?Tl=null!=Tl?Tl:$l([]):$l(t)}function zl(t){return Ul.apply(this,arguments)}function Ul(){return(Ul=f((function*(t){return G(t)&&0===t.length?Tl||(Ml=null!=Ml?Ml:Nl([]).then((t=>(Tl=t,t))).catch((t=>{throw Tl=void 0,Ml=void 0,t}))):Nl(t)}))).apply(this,arguments)}function Wl(t){return jl&&!Bl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function Vl(t){return{event:t,size:Ia(t)}}function Gl(t,e){return p({},t,{data:e,cv:"2024-10"})}function Zl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Ql(t){try{if(t.type===m.FullSnapshot)return Vl(Gl(t,$l(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Vl(Zl(t,{texts:Hl(t.data.texts),attributes:Hl(t.data.attributes),removes:Hl(t.data.removes),adds:Hl(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Vl(Zl(t,{adds:t.data.adds?$l(t.data.adds):void 0,removes:t.data.removes?$l(t.data.removes):void 0}))}catch(t){Pl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ea(t)}}function Jl(){return Jl=f((function*(t){try{if(t.type===m.FullSnapshot)return Vl(Gl(t,yield Nl(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([zl(t.data.texts),zl(t.data.attributes),zl(t.data.removes),zl(t.data.adds)]);return Vl(Zl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule){var i=yield Promise.all([t.data.adds?Nl(t.data.adds):void 0,t.data.removes?Nl(t.data.removes):void 0]);return Vl(Zl(t,{adds:i[0],removes:i[1]}))}}catch(e){return je(e)&&(Bl=!0),Pl.error("could not compress event asynchronously - trying synchronous compression",e),Ql(t)}return{event:t,size:Ea(t)}})),Jl.apply(this,arguments)}function Kl(t,e){return t.type===m.Custom&&t.data.tag===e}function Yl(t){return Kl(t,"sessionIdle")}function Xl(t){return Kl(t,"$session_ending")}function tu(t){return Kl(t,"$session_starting")}class eu{get sessionId(){return this.Pe}get Ne(){if(!this._instance.sessionManager)throw new Error(Rl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Fe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get qe(){return qo(this._instance.get_property(Wn),this.sessionId)}get _e(){var t,e=null==(t=this.je)?void 0:t.sampleRate;return it(e)?e:null}get Be(){var t,e;return null!==(t=null==(e=this.He)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.$e="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Ue=void 0,this.ze=!1,this.We=Date.now(),this.Ve=!1,this.Ze=[],this.Ge="unknown",this.Qe=0,this.Je=0,this.Ye=0,this.Ke=0,this.Xe=!1,this.et=!1,this.tt=!1,this.rt=!1,this.it=!1,this.nt=!1,this.ot=!1,this.st=!1,this.ut=!1,this.ht=!1,this.ct=!1,this.dt=!1,this.vt=[],this.ft=void 0,this.yt=void 0,this.bt=[],this.wt=0,this.kt=0,this._t=!1,this.St=void 0,this.Ie=void 0,this.xt=void 0,this.Ct=void 0,this.Mt=void 0,this.Tt=(t,e,i)=>{var r,n,s;if(i&&(t!==this.Pe||e!==this.It)){var a,o=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Pe,u=this.It;if(o&&this.Le("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.We,flushed_size:null==(a=this.Rt)?void 0:a.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Yn),this.ot=!1,null==(n=Ol())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Le("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.At(),!(!1===this.Ge&&this.isStarted||this.Pe===t&&this.It===e)){var h=this.Pe!==t&&!1!==this.Ge;this.Ge="unknown",this.Et(h)}o&&this.Le("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.We}),null==(s=this.He)||s.makeSamplingDecisions(t)}},this.Lt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Vn])===this.Pe},this.Ot=()=>{var t,e;if(0===this.Dt.data.length)return null;var i=null==(t=this.Dt.data[0])?void 0:t.timestamp,r=null==(e=this.Dt.data[this.Dt.data.length-1])?void 0:e.timestamp;return it(i)&&it(r)?r-i:null},this.Pt=()=>{var t,e,i=this.Be;if(!it(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Nt;return it(r)&&r>=0&&i>r}if(this.Lt())return!1;var n,s=this.Ot();return!!tt(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Vn]:this.Pe}),!1)},this.Ft=()=>{this.status!==ra?(this.Xe&&this.et&&this.qt&&!this.tt&&(this.Xe=!1),this.jt(),this.Bt()):this.Ht()},this.$t=()=>{this.Ft()},this.Ut=()=>{this.Le("browser offline",{})},this.zt=()=>{this.Le("browser online",{})},this.Wt=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.qt=!0),this.Le("window "+r.visibilityState,{}))},this._instance=t,this.qt=null==e||e;var i=this.Ne.checkAndGetSessionAndWindowId(),n=i.windowId;this.Pe=i.sessionId,this.It=n,this.te=new ka(this._instance),this.X=new wa(this._instance),this.ee=new Sa(this._instance),this.Dt=this.Ht(),this.Ne.sessionTimeoutMs>this.Fe||Pl.warn("session_idle_threshold_ms ("+this.Fe+") is greater than the session timeout ("+this.Ne.sessionTimeoutMs+"). Session will never be detected as idle"),this.Rt=new mo(this._instance)}setDocumentWasEverVisible(t){t&&(this.qt=!0)}get Vt(){var t,e,i,r,n,s,a,o,l,u=null==(t=this.je)?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!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==u?void 0:u.maskTextSelector,c=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o: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 K(d)&&K(v)&&K(c)&&K(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Zt(){var t;if(!this.ut){var e=null==(t=this.je)?void 0:t.masking;if(!et(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!K(r)&&r!==n}));0!==r.length&&(this.ut=!0,Pl.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 Gt(){var t;return gt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Ji("canvas recording resolution scale"),1)}get Qt(){var t,e,i,r,n,s,a,o=this._instance.config.session_recording.captureCanvas,l=null==(t=this.je)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==o?void 0:o.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a: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:gt(h,0,12,Ji("canvas recording fps"),4),quality:gt(d,0,1,Ji("canvas recording quality"),.4)}}get Jt(){var t,e=!(null==(t=this.je)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Yt(){var t,e,i,r=null==(t=this.je)?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),a=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),o=Cl(this._instance.config.capture_performance),l=Cl(null==r?void 0:r.capturePerformance),u=!!(nt(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Kt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Jt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Yt&&Z(s))if(!lr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:cn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...cn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...cn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(r=vn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=bn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=bn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=hr(t.name),s=0===e.indexOf("http")?null==(r=hr(e))?void 0:r.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&yn.some((t=>0===a.indexOf(t)))))return t}})((mn((r=e).requestHeaders),mn(r.responseHeaders),r),t.api_host,i));var r},h=Z(t.session_recording.maskNetworkRequestFn);return h&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Qi.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:p({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Z(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=u(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 et(n)&&r?(wn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!K(t))return t.requestBody=_n(t.requestBody,"Request"),t.responseBody=_n(t.responseBody,"Response"),t}(u(t)),p({},cn,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Yt,a)))}else Pl.info("NetworkCapture not started because we are on localhost.");return i}Xt(t){return this._instance.config.disable_capture_url_hashes?Pe(t):t}er(t,e){void 0===e&&(e=!1);var i=e?Pe(t):this.Xt(t),r=this._instance.config.mask_personal_data_properties?[...Uo,...this._instance.config.custom_personal_data_properties||[]]:[];return this.tr(cr(i,r,Vo))}tr(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var i,r=e.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==r?void 0:r.name)&&void 0!==i?i:null==r?void 0:r.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}rr(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Ze.length?this.Ze.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Pl.warn("could not emit queued rrweb event.",e,t),!1}}Le(t,e){return this.rr(Fl((()=>Ll().addCustomEvent(t,e))))}ir(){var t;return this.ze&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Ge}nr(t){if(!this.ir())return!1;try{var e=Ll();return!!e&&(e.addCustomEvent("$json_ld",t),this.ir())}catch(t){return!1}}ar(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.sr)?void 0:e.scan(t)}))}ur(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.er(e.origin+e.pathname+e.search);this.lr!==i&&(this.lr=i,this.Le("$url_changed",{href:i}))}catch(t){}}hr(){if(this.Ze.length){var t=[...this.Ze];this.Ze=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.rr(t)}))}}Ce(){return this.rr(Fl((()=>Ll().takeFullSnapshot())))}get cr(){var t,e,i;if(null!=(t=this.He)&&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 it(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}dr(){if(this.vr&&clearInterval(this.vr),!0!==this.Ge){var t=this.cr;t&&(this.vr=setInterval((()=>{this.Ce()}),t))}}Me(t){"event"===t&&this.pr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.dr()}gr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.sr)||t.scan(),clearInterval(this.vr),Pl.info("recording paused due to URL blocker"),this.Le("recording paused",{reason:"url blocker"}))}mr(){var t;this.X.urlBlocked&&(null==(t=this.sr)||t.scan(),this.X.urlBlocked=!1,this.Ce(),this.ar(),this.dr(),this.Le("recording resumed",{reason:"left blocked url"}),Pl.info("recording resumed"))}yr(t,e){var i;if("event"===t&&this.pr(),!this.Ve&&null!=(i=this.He)&&i.hasPendingTriggers(this.sessionId)){this.Ve=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?Gn:Zn]:this.sessionId}),null==(n=this.He)||n.updateActiveTriggers(this.sessionId),this.Me(),this.Bt(),this.xe(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Ve=!1}}}get isStarted(){return!!this.Ue}get je(){var t=this._instance.get_property(Nn);if(t){var e;try{e=Q(t)?t:JSON.parse(t)}catch(t){return void Pl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>El)return Pl.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(Nn))}return e}}br(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.je;if(s){this.isStarted||(this.Xe=!1!==this.Ge&&!this.rt,this.rt=!1,this.et=this.Xe,this.tt=!1),this._t&&(this.wr(),this.Ht());var a=this.Ne.checkAndGetSessionAndWindowId(),o=a.windowId;this.Pe=a.sessionId,this.It=o,null==(i=this._instance.persistence)||i.unregister(Yn),null!=s&&s.endpoint&&(this.$e=null==s?void 0:s.endpoint),this.He=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Bo(this._instance,this.X,this.xe.bind(this),this.Le.bind(this),this.Me.bind(this)):new jo(this._instance,this.X,this.ee,this.te,this.xe.bind(this),this.Ce.bind(this),this.Me.bind(this)),this.He.onRemoteConfig(s),null==(n=this.Ie)||n.call(this),this.Ie=this.He.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.yr(t,e))),this.br(jn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(jn)})),this.br(Bn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Bn)})),this.br(zn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(zn)})),this.br(Hn,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Hn)})),this.He.makeSamplingDecisions(this.sessionId),this.kr(),this.it||(ar(t,"beforeunload",this.Ft),ar(t,"pagehide",this.$t),ar(t,"offline",this.Ut),ar(t,"online",this.zt),ar(r,"visibilitychange",this.Wt),!this.xt&&Z(this.Ne.onSessionId)&&(this.xt=this.Ne.onSessionId(this.Tt)),!this.Ct&&Z(this.Ne.on)?this.Ct=this.Ne.on("forcedIdleReset",(()=>{this.At(),this.Ge="unknown",this.stop(),this.Mt=this.Ne.onSessionId(((t,e,i)=>{var r;null==(r=this.Mt)||r.call(this),this.Mt=void 0,this.Tt(t,e,i)}))})):Z(this.Ne.on)||Pl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),et(this.St)&&(this.St=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.er(t.properties.$current_url):"";if(!e)return;this.Le("$pageview",{href:e})}}catch(t){Pl.error("Could not add $pageview to rrweb session",t)}}))),this.status===ia&&this.xe(e||"recording_initialized"))}else Pl.info("remote config must be stored in persistence before recording can start")}_r(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.Ft),null==t||t.removeEventListener("pagehide",this.$t),null==t||t.removeEventListener("offline",this.Ut),null==t||t.removeEventListener("online",this.zt),null==r||r.removeEventListener("visibilitychange",this.Wt),clearInterval(this.vr),this.Sr(),null==(e=this.St)||e.call(this),this.St=void 0,null==(i=this.Ie)||i.call(this),this.Ie=void 0,null==(n=this.xt)||n.call(this),this.xt=void 0,null==(s=this.Ct)||s.call(this),this.Ct=void 0,null==(a=this.Mt)||a.call(this),this.Mt=void 0,null==(o=this.He)||o.stop(),this.Cr(),this.wr()}wr(){this.kt+=1,this.bt=[],this.wt=0,this.Mr=void 0,this._t=!1}Cr(){var t,e,i;null==(t=this.Tr)||t.stop(),this.Ze=[],null==(e=this.sr)||e.stop(),this.sr=void 0,this.ze=!1,null==(i=this.Ue)||i.call(this),this.Ue=void 0}Ir(){if(!this.Mr||0===this.wt)return!1;if(this._t)return!0;this._t=!0;var t=this.kt;return this.Sr(),this.Cr(),this.Mr.catch((()=>{})).then((()=>{t===this.kt&&(this._t=!1,this.Bt(),this.Ht(),this._r(),Pl.info("stopped"))})).catch((()=>{this._t=!1,this._r(),Pl.info("stopped")})),!0}stop(){this.Cr(),this.Ir()||(this.Bt(),this.Ht(),this._r(),Pl.info("stopped"))}Et(t){var e;this.stop(),this.Rr=void 0,this.Ar=void 0,this.Je=0,this.Ye=0,this.Ke=0,null==(e=Ol())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Xe=t,this.et=!1}pr(){this.isStarted||(this.rt=!0),this.Xe&&(this.Xe=!1,this.et=!1,this.tt&&(this.tt=!1,this.Ce()),this.Er())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.Ht(),this.Cr()),this.Ht(),this._r(),Pl.info("discarded")}Lr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==ta?(this.Or(t,r),this.Dr(s)):this.Ht()}Pr(){try{this.Nr()}catch(t){this.st||(this.st=!0,Pl.error("could not track full snapshot cost",t))}}Nr(){var t,e=null==(t=Ol())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Ar&&(this.Ar=e,this.Rr&&this.Rr.durationMs>=e.durationMs||(this.Rr=e),500>e.durationMs||Pl.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}))}Or(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(K(this.ft)||this.ft===e||this.yt===e||(this.yt=e,Pl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Ce())):this.ft=e}Fr(t){t.counted&&t.generation===this.kt&&(this.wt=Math.max(0,this.wt-1)),t.counted=!1,this.bt=this.bt.filter((e=>e!==t))}qr(t,e,i){t.processed||t.generation!==this.kt||(t.processed=!0,this.Lr(t.event,e,i,t.targetSessionId,t.targetWindowId))}jr(t){try{var e=t.compressionEnabled?Ql(t.event):{event:t.event,size:Ea(t.event)};this.qr(t,e.event,e.size)}finally{this.Fr(t)}}jt(){[...this.bt].forEach((t=>{this.jr(t)}))}Br(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.kt,processed:!1,counted:!0};this.bt.push(s),this.wt+=1;var a=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var a=e?Wl(t)?yield function(t){return Jl.apply(this,arguments)}(t):Ql(t):{event:t,size:Ea(t)};i=a.event,r=a.size}catch(e){Pl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Ea(t)}n.qr(s,i,r)}finally{n.Fr(s)}}));return function(){return i.apply(this,arguments)}}();this.Mr=this.Mr?this.Mr.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.hr(),t&&Q(t))){if(t.type===m.Meta){var h=this.er(t.data.href);if(this.lr=h,!h)return;t.data.href=h}else this.ur();if(null==(e=this.He)||e.checkUrlTriggers(this.sessionId,(()=>this.gr()),(()=>this.mr()),((t,e)=>this.yr(t,e))),!this.X.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=Ol())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.ot=!0),this.Pr(),Promise.resolve().then((()=>this.Pr())),this.dr(),null==(v=this.Tr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Yn]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.He)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.Hr();var p=this.Tr?this.Tr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Q(e)&&6===e.type&&Q(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),b=function(t){return Xl(t)?t.data.payload:null}(g),_=function(t){return tu(t)?t.data.payload:null}(g),w=function(t){return Yl(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.$r(g),t.type===m.FullSnapshot&&(this.vt.push([this.Pe,t.timestamp]),this.vt.length>6&&(this.vt=this.vt.slice(-6)));var k=null!==(r=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==r?r:this.Pe,S=null!==(a=null!==(o=null!==(l=null==b?void 0:b.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.It;if(!0!==this.Ge||function(t){return Yl(t)||Xl(t)||tu(t)}(g)){g.type===m.FullSnapshot&&(this.Qe=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var x=this.ze;this.ze=!0,f?this.ar(!0):x||this.ar();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.wt>0||C&&Wl(g))this.Br(g,C,k,S);else{var T=C?Ql(g):{event:g,size:Ea(g)};this.Lr(g,T.event,T.size,k,S)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(g)&&this.Qe++}else!0===this.Ge&&this.Qe++}}}get status(){return this.He?this.He.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.qe,rrwebError:this.it,urlTriggerMatching:this.X,eventTriggerMatching:this.ee,linkedFlagMatching:this.te,remoteConfig:this.je}):ta}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.te.linkedFlagSeen=!0,this.Ce(),this.pr(),this.xe("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Wn]:this.sessionId,[qn]:null}),this.Ce(),this.pr(),this.xe("sampling_overridden")}overrideTrigger(t){this.yr(t),this.pr()}Ur(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.er(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Sr(){this.zr&&(clearTimeout(this.zr),this.zr=void 0)}Er(){this.zr||(this.zr=setTimeout((()=>{this.Bt()}),2e3))}Wr(){return this.ft!==this.Dt.sessionId&&0!==this.Dt.data.length&&this.Dt.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Xl(t)&&!tu(t)))}Vr(){var t,e;return null!==(t=null==(e=this.He)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Zr(t){if(t!==ra)return K(this.Gr)||this._instance.register_for_session({[$s]:[]}),void(this.Gr=void 0);var e=this.Vr();if(0===e.length)return K(this.Gr)||this._instance.register_for_session({[$s]:[]}),void(this.Gr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Gr&&(this.Gr=r,this._instance.register_for_session({[$s]:e}),Pl.info("buffering: "+i))}Bt(){var t;if(this.Sr(),this.Xe)return this.Dt;if(this.Wr())return this.Dt.size>Il?this.Ht():this.Dt;var e=this.Dt;null==(t=this.He)||t.ensureSamplingDecision(this.sessionId);var i=this.Pt(),r=this.status;if(this.Zr(r),r===ra||r===na||r===ta||i)return this.Er(),this.Dt;if(this.Dt!==e)return this.Dt;if(e.data.length>0){var n,s=this.Ur();Ra(e).forEach((t=>{var e;null==(e=this.Rt)||e.trackSize(t.sessionId,t.size),this.Qr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Gi.LIB_NAME,$lib_version:Gi.LIB_VERSION,$snapshot_host:s})})),null==(n=this.He)||n.onFlushComplete()}return this.Ht()}Dr(t){var e,i=2+((null==(e=this.Dt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Dt.sessionId!==r;if(n||!0!==this.Ge&&!this.Xe&&this.Dt.size+t.$snapshot_bytes+i>Il){var s=this.Pe;if(this.Dt=this.Bt(),this.Pe!==s)return;n&&this.Dt.data.length>0&&(this.Dt=this.Ht()),this.Dt.sessionId=r,this.Dt.windowId=t.$window_id}this.Xe&&(this.tt||this.Dt.size+t.$snapshot_bytes+i>Il)?this.tt||(this.tt=!0,this.Dt=this.Ht()):(this.Dt.size+=t.$snapshot_bytes,this.Dt.data.push(t.$snapshot_data),this.Dt.sizes.push(t.$snapshot_bytes),!0===this.Ge||this.Xe||this.Er())}Qr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.$e),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Nt(){var t,e,i=null==(t=this.Dt)?void 0:t.data[(null==(e=this.Dt)?void 0:e.data.length)-1],r=this.Ne.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}Hr(){if(!this.Dt||0===this.Dt.data.length)return this.Ht();for(var t=-1,e=this.Dt.data.length-1;e>=0;e--)if(this.Dt.data[e].type===m.Meta){t=e;break}return 0>t?this.Ht():(this.Dt.data=this.Dt.data.slice(t),this.Dt.sizes=this.Dt.sizes.slice(t),this.Dt.size=this.Dt.sizes.reduce(((t,e)=>t+e),0),this.Dt)}Ht(){return this.Dt={size:0,data:[],sizes:[],sessionId:this.Pe,windowId:this.It},this.Dt}xe(t,e){this._instance.register_for_session({[Bs]:t}),Pl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Le("$recording_started",p({reason:t},e))}Jr(t){var e;return 3===t.type&&-1!==Al.indexOf(null==(e=t.data)?void 0:e.source)}$r(t){var e=this.Jr(t);e||!0===this.Ge||t.timestamp-this.We>this.Fe&&(this.Ge=!0,clearInterval(this.vr),this.Le("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.We,threshold:this.Fe,bufferLength:this.Dt.data.length,bufferSize:this.Dt.size,sessionId:this.Pe,windowId:this.It}),this.Bt());var i=!1;if(e&&(this.We=t.timestamp,this.Ge)){var r="unknown"===this.Ge;this.Ge=!1,r||(this.Le("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Ne.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.Pe!==a,l=this.It!==s;if(this.It=s,this.Pe=a,o||l){var u=o&&!1!==this.Ge;u&&(this.Ge="unknown"),this.Et(u)}else if(e&&this.pr(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.He)?void 0:h.hasPendingTriggers(this.sessionId));this.Qe>0&&d&&this.Ce(),this.ar(),this.dr()}}At(){var t;null==(t=this.He)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,a,o,l,u=this.Ne.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Ol())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Dt.data.length,$sdk_debug_replay_internal_buffer_size:this.Dt.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.Rt)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.vt,$snapshot_max_depth_exceeded:this.ot,$sdk_debug_replay_slowest_full_snapshot_ms:xl(null==(i=this.Rr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:xl(null==(r=this.Rr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Rr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Rr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Rr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:xl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:xl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:xl(null==(o=Ol())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Ol())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Je,$sdk_debug_replay_oversized_mutations_dropped:this.Ye,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.Ke,$sdk_debug_replay_rrweb_error:this.it,$sdk_debug_rrweb_attached:!!this.Ue,$sdk_debug_rrweb_start_attempted:this.nt}}kr(){var e;if(!this.Ue){this.nt=!0;var i,n,s,a,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 h=u[0],d=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=p({password:!0},d);else if("sampling"===h){var v=null!=d?d:{},c={};K(v.mousemove)||(c.mousemove=v.mousemove),K(v.mouseInteraction)||(c.mouseInteraction=v.mouseInteraction),o.sampling=c}else o[h]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=p({},o.slimDOMOptions,{script:!0})),this.Qt&&this.Qt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Qt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Qt.quality},o.canvasResolutionScale=this.Gt,o.canvasMasking={configured:()=>{var t;return Z(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(Z(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.ct||(this.ct=!0,Pl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Vt&&(o.maskAllInputs=null===(i=this.Vt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Vt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Vt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Vt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ht||(this.ht=!0,Pl.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.Zt();var f=Ll();if(f){this.Tr=null!==(e=this.Tr)&&void 0!==e?e:new go(f,{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";Pl.info(i,{node:e}),this.log(Rl+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Je+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.cr,onDroppedOversizedMutation:t=>{0===this.Ye&&this.log(Rl+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.Ye+=1,this.Ke+=t},requestFullSnapshot:()=>this.Ce()});var g=this.Kt();if(this.Ue=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.dt||(this.dt=!0,Pl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Ue)return this.it=!0,void Pl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.it=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.sr&&(this.sr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=nl,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(kl(i,e.blockClass,e.blockSelector)||kl(i,e.maskTextClass,e.maskTextSelector))return!0;var r=i.parentNode;i=i.parentElement||(r&&r.nodeType===r.DOCUMENT_FRAGMENT_NODE?r.host:null)}return!1}(e,i))return;var o=function(t){if(!t||t.length>nl)return null;try{var e=JSON.parse(t),i=G(e)?e.map(_l):_l(e);if(tt(i)||G(i)&&(!i.length||i.some(tt)))return null;var r=JSON.stringify(i);return r.length>2e4?null:[i,r]}catch(t){return null}}(e.text);if(!o)return void r.delete(e);var l=o[0],u=o[1];if(tt(a))return void r.set(e,u);if(r.get(e)!==u){if(u.length>s)return void(s=0);i.emit(l)&&(r.set(e,u),s-=u.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Sl(t))a(e)};for(var i of t)if("childList"===i.type)wl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&wl(r)&&a(r)}else"attributes"===i.type&&wl(i.target)&&a(i.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Sl(t.documentElement).forEach((t=>{e&&r.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.X.urlBlocked||this.X.isCurrentUrlBlocked()?null:this.ir()},emit:t=>this.nr(t)}),this.X.isCurrentUrlBlocked()&&this.sr.scan()),this.We=Date.now(),this.Ge=nt(this.Ge)?this.Ge:"unknown",this.tryAddCustomEvent("$remote_config_received",this.je),this.Le("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.Le("$posthog_config",{config:this._instance.config})}else Pl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Le(t,e)}}var iu,ru=["type"],nu=Object.defineProperty,su=(t,e,i)=>((t,e,i)=>e in t?nu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),au=(t=>(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))(au||{}),ou=(t=>(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))(ou||{}),lu=(t=>(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))(lu||{}),uu=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(uu||{}),hu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(hu||{}),du=(t=>(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))(du||{}),vu=(t=>(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))(vu||{});function cu(t,e){return-1!==t.indexOf(e)}var fu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},pu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},gu={};function mu(t){if(gu[t])return gu[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in fu?fu[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in pu?pu[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return gu[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return cu(t,"AppleWebKit")&&!cu(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),gu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var yu={};function bu(t,e,i){var r,n=t+"."+String(i);if(yu[n])return yu[n].call(e);var s=mu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(yu[n]=a,a.call(e)):e[i]}var _u={};function wu(t,e,i){var r=t+"."+String(i);if(_u[r])return _u[r].bind(e);var n=mu(t)[i];return"function"!=typeof n?e[i]:(_u[r]=n,n.bind(e))}function ku(){return mu("MutationObserver").constructor}function Su(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],a=i(r);a;){if(a.next===s)return void(a.next=n.next);a=i(r=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var xu={childNodes:t=>bu("Node",t,"childNodes"),parentNode:t=>bu("Node",t,"parentNode"),parentElement:t=>bu("Node",t,"parentElement"),textContent:t=>bu("Node",t,"textContent"),contains:(t,e)=>wu("Node",t,"contains")(e),getRootNode:t=>wu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?bu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?bu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>wu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>wu("Element",t,"querySelectorAll")(e),mutationObserver:ku,patch:Su},Cu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Tu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Mu=0,Eu=6e4;function Iu(){Mu+=1}function Ru(){return Mu}function Pu(t,e){return e!==Mu||t>Eu}var Au=0,Fu=0,Ou=0,Lu=Cu(),Du=null,$u=null,Nu=[],qu=0,ju=0,Bu={slowestBatchMs:0},Hu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},zu=t=>t&&t>0?t:null;function Uu(t){(Au+=1)>1||(Lu=Cu(),Nu=[],qu=0,$u=zu(t),Fu=Tu(),Ou=Mu)}function Wu(){return 0===Au?Du||Cu():(Au-=1)>0?Lu:(Lu.durationMs=Tu()-Fu,Lu.deferredStylesheetCount=qu,Hu.deferredCount+=qu,$u=null,Pu(Lu.durationMs,Ou)?Lu:Du=Lu)}var Vu=32;function Gu(t,e,i){var r=t.length;if(i>=Vu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=Gu(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=Gu(l,e,i+1))}}}catch(t){}}return r}function Zu(t){if(0!==Au){var e=Gu(t,null,0);Lu.cssRuleCount+=e,ju>0&&(Lu.nonDeferrableCssRuleCount+=e)}}function Qu(t){ju+=1;try{return t()}finally{ju-=1}}function Ju(t){Au>0&&(Lu.stylesheetMs+=t)}function Ku(t){if(0===Au||null===$u)return!1;var e=Lu.cssRuleCount-Lu.nonDeferrableCssRuleCount;return e>=$u||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Gu(e,i,0)}catch(t){return 0}}(t)>$u}function Yu(){Hu.failedCount+=1}function Xu(t){t>0&&(Hu.abandonedCount+=t)}function th(t){return t.nodeType===t.ELEMENT_NODE}function eh(t){var e=t&&"host"in t&&"mode"in t&&xu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&xu.shadowRoot(e)===t)}function ih(t){return"[object ShadowRoot]"==={}.toString.call(t)}function rh(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 nh(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 sh=0;function ah(t){var e=0===sh,i=e?Tu():0;sh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Zu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),rh(Array.from(r,(t=>oh(t,n))).join(""))}catch(t){return null}finally{sh-=1,e&&Ju(Tu()-i)}}function oh(t,e){var i;if(uh(t)){var r;try{r=ah(t.styleSheet)||nh(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return Ch(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return hh(t)&&t.selectorText.includes(":")&&(n=lh(n)),e?Ch(n,e):n}function lh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function uh(t){return"styleSheet"in t}function hh(t){return"selectorText"in t}var dh=/^-?[A-Za-z_][\w-]*$/,vh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ch(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 o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return i=!0,void(r=t);a(e[e.length-1],n.importRule,t)}function a(t,e,i){var r;try{var n;try{n=i||nh(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=Ch(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var i=t.rules[t.index];if("sheet"===t.kind&&uh(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 a(t,i,null)}if(!function(t,i){try{var r=function(t){var e,i=t;if(!i.cssRules||0===i.cssRules.length)return null;if(i.media&&"string"==typeof i.media.mediaText)return"@media "+i.media.mediaText+" {";if(hh(t)){if("number"==typeof i.type&&1!==i.type)return null;var r=i.style?i.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in i)return"string"!=typeof i.containerQuery||i.containerName&&!dh.test(i.containerName)?null:"@container "+(i.containerName?i.containerName+" ":"")+i.containerQuery+" {";if("string"==typeof i.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+i.conditionText+" {":null}return"string"==typeof i.name?"keyText"in i.cssRules[0]?dh.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":vh.test(i.name)?"@layer "+i.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?Ch(r,n):r,fixColons:"sheet"===i.kind&&hh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&hh(i)&&i.selectorText.includes(":")&&(s=lh(s)),t.parts.push(t.sheetHref?Ch(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Zu(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,!uh(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;Zu(s);var a=r.href;!a&&r.ownerNode&&(a=r.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:r,rules:o,sheetHref:a}),i.push({sheet:r,rules:o,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=Tu(),a=t>0?t:1;try{for(;!i&&a>0;){var l=e[e.length-1];if(l.rules.length>l.index){a-=1;try{o(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?lh(h):h}else u=rh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Ju(Tu()-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}}}class fh{constructor(){su(this,"idNodeMap",new Map),su(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-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))),th(t)){var i=xu.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 ph(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&gh(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function gh(t){return t.toLowerCase()}var mh=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 yh(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&&mh.has(gh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var bh="__rrweb_original__";function _h(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?gh(e):null}catch(t){return null}}var wh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,kh=/^(?:[a-z+]+:)?\/\//i,Sh=/^www\..*/i,xh=/^(data:)([^,]*),(.*)/i;function Ch(t,e){return(t||"").replace(wh,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(kh.test(l)||Sh.test(l))return"url("+u+l+u+")";if(xh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.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 Th,Mh,Eh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Ih=4096,Rh=1e5,Ph=10,Ah=new Map,Fh=1,Oh=new RegExp("[^a-z0-9-_:]"),Lh=-2;function Dh(){return Fh++}var $h=/^[^ \t\n\r\u000c]+/,Nh=/^[, \t\n\r\u000c]+/,qh=new WeakMap;function jh(t,e){return e&&""!==e.trim()?Bh(t,e):e}function Bh(t,e){var i=qh.get(t);if(i||(i=t.createElement("a"),qh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Hh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Eh:t}(t,e.maxBase64ImageLength):t}function zh(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}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(Rh>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Ih||t.naturalHeight>Ih)return e;var n=Ah.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 a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(Ah.size>=Ph){var u=Ah.keys().next().value;void 0!==u&&Ah.delete(u)}return Ah.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Hh(u,s)}if("image"===e)return Hh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=jh(t,r);return"image"===e&&h.startsWith("data:")?Hh(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(Nh),e.length>i;){var s=r($h);if(","===s.slice(-1))s=jh(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=jh(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?Ch(r,Bh(t)):"object"===e&&"data"===i?jh(t,r):r:jh(t,r)}function Uh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Wh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Wh(xu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Wh(xu.parentNode(t),e,i)}function Vh(t,e,i,r){var n;if(th(t)){if(!xu.childNodes(n=t).length)return!1}else{if(null===xu.parentElement(t))return!1;n=xu.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(Wh(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 Gh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Zh=new Map;function Qh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Jh(t){return null==t?"":t.toLowerCase()}var Kh=50,Yh=!1,Xh=!1;function td(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=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,E=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,L=e.keepIframeSrcFn,D=void 0===L?()=>!1:L,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,z=void 0===H?Kh:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return Xh=!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=Vh(t,a,o,void 0===U)),Au>0&&(Lu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,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:vu.Document,childNodes:[],compatMode:t.compatMode}:{type:vu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:vu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s=e.doc,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,v=e.maskAttributeFn,c=e.dataURLOptions,f=void 0===c?{}:c,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,b=e.newlyAddedElement,_=void 0!==b&&b,w=e.rootId,k=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),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=gh(t.tagName);return Oh.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var E=t.attributes[M];Uh(S,E.name)||(C[E.name]=zh(s,S,gh(E.name),E.value,t,f))}if("link"===S&&a&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=Qh(s,R))&&R.includes(".css")&&(I=Qh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(Ku(I)?Au>0&&(Nu.push(t),qu+=1):P=ah(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||xu.textContent(t)||"").trim().length){var A=Qu((()=>ah(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,O=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=ph({element:t,type:_h(t),tagName:S,value:F,maskInputOptions:l,maskInputFn:u}):O&&(C.checked=O)}if("option"===S&&(t.selected&&!l.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))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((bh in n?n[bh]: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)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var L=t.toDataURL(f.type,f.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,L!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=L)}var N,q,j=!1;if("img"===S&&p){Th||(Th=s.createElement("canvas"),Mh=Th.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",z=B.crossOrigin,U=(e,i)=>j?yh({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{Gh(B,"load",W);try{Th.width=B.naturalWidth,Th.height=B.naturalHeight,Mh.drawImage(B,0,0);var t=Th.toDataURL(f.type,f.quality);C.rr_dataURL=U("rr_dataURL",t)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(z?C.crossOrigin=U("crossOrigin",z):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=t.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(_||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),k){var G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null==(i=s.defaultView)?void 0:i.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),Y&&(C.rr_position=Y.position||"static",x.add("rr_position"),Y.transform&&"none"!==Y.transform&&(C.rr_transform=Y.transform,x.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(C.rr_display=Y.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||v)for(var X of Object.entries(C)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(C[tt]=yh({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:v,isGenerated:x.has(tt)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(t){}return{type:vu.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=t,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:k,rootId:w,isCustom:N}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:a,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,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=xu.parentNode(t),o=a&&a.tagName,l=xu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(Ku(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=ah(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=Ch(l,Bh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,xu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:vu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:vu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:vu.Comment,textContent:xu.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:D,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===vu.Comment)return!0;if(t.type===vu.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,e){var i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Jh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Jh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Jh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Jh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Jh(t.attributes.property).match(/^(og|twitter|fb):/)||Jh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Jh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Jh(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(Jh(t.attributes.name))||Jh(t.attributes.property).match(/^article:/)||Jh(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(Jh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===vu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Lh:Dh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===Lh)return null;M&&M(t);var J=!u;if(Q.type===vu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=xu.shadowRoot(t);K&&ih(K)&&(Q.isShadowHost=!0)}if((Q.type===vu.Document||Q.type===vu.Element)&&J){b.headWhitespace&&Q.type===vu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,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:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z};if(Q.type===vu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(xu.childNodes(t))){var tt=td(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(th(t)&&(et=xu.shadowRoot(t)))for(var it of Array.from(xu.childNodes(et))){var rt=td(it,Y);rt&&(ih(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=xu.parentNode(t);if(nt&&eh(nt)&&ih(nt)&&(Q.isShadow=!0),Q.type===vu.Element&&"iframe"===Q.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 a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),Gh(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?Gh(t,"load",a):(o=!0,Gh(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",a),()=>{clearTimeout(c),Gh(t,"load",a)}}return t.addEventListener("load",a),()=>{Gh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var i=td(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,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:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z});i&&E(t,i)}}),R);null==P||P(t,st)}return Q.type===vu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Zh.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(A){var e=td(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:U,maskTextClass:a,maskTextSelector:o,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:E,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:z});e&&A(t,e)}})()}finally{Zh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),Zh.set(e,v)}}}(t,0,O),Q}function ed(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}class id{constructor(){su(this,"parentElement",null),su(this,"parentNode",null),su(this,"ownerDocument"),su(this,"firstChild",null),su(this,"lastChild",null),su(this,"previousSibling",null),su(this,"nextSibling",null),su(this,"ELEMENT_NODE",1),su(this,"TEXT_NODE",3),su(this,"nodeType"),su(this,"nodeName"),su(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof id))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.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 rd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>nd(i,t,e,r)}function nd(t,e,i,r){sd((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function sd(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var ad="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.",od={map:{},getId(){return console.error(ad),-1},getNode(){return console.error(ad),null},removeNodeFromMap(){console.error(ad)},has(){return console.error(ad),!1},reset(){console.error(ad)}};function ld(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];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,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function ud(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)}}}),()=>ud(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(od=new Proxy(od,{get(t,e,i){return"map"===e&&console.error(ad),Reflect.get(t,e,i)}}));var hd=Date.now;function dd(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=xu.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?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=xu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function vd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function cd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function fd(t){return t?t.nodeType===t.ELEMENT_NODE?t:xu.parentElement(t):null}function pd(t,e,i,r){if(!t)return!1;var n=fd(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(Wh(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 gd(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===Lh}function md(t,e){if(eh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=xu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||md(r,e))}function yd(t){return Boolean(t.changedTouches)}function bd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function _d(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function wd(t){return!!t&&(t instanceof id&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(xu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(hd=()=>(new Date).getTime());class kd{constructor(){su(this,"id",1),su(this,"styleIDMap",new WeakMap),su(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 Sd(t){var e,i=null;return"getRootNode"in t&&(null==(e=xu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&xu.host(xu.getRootNode(t))&&(i=xu.host(xu.getRootNode(t))),i}function xd(t){var e=t.ownerDocument;return!!e&&(xu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Sd(i);)i=e;return i}(t);return xu.contains(e,i)}(t))}function Cd(t){return"__ln"in t}class Td{constructor(){su(this,"length",0),su(this,"head",null),su(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&&Cd(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&&Cd(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--)}}var Md,Ed=(t,e)=>t+"@"+e;class Id{constructor(){su(this,"frozen",!1),su(this,"locked",!1),su(this,"texts",[]),su(this,"attributes",[]),su(this,"attributeMap",new WeakMap),su(this,"generatedAttributes",new WeakMap),su(this,"removes",[]),su(this,"mapRemoves",[]),su(this,"movedMap",{}),su(this,"addedSet",new Set),su(this,"movedSet",new Set),su(this,"droppedSet",new Set),su(this,"removesSubTreeCache",new Set),su(this,"mutationCb"),su(this,"blockClass"),su(this,"blockSelector"),su(this,"maskTextClass"),su(this,"maskTextSelector"),su(this,"inlineStylesheet"),su(this,"maskInputOptions"),su(this,"maskTextFn"),su(this,"maskInputFn"),su(this,"maskAllElementAttributes"),su(this,"maskAttributeFn"),su(this,"keepIframeSrcFn"),su(this,"recordCanvas"),su(this,"canvasMaskingConfigured"),su(this,"inlineImages"),su(this,"slimDOMOptions"),su(this,"dataURLOptions"),su(this,"doc"),su(this,"mirror"),su(this,"iframeManager"),su(this,"stylesheetManager"),su(this,"shadowDomManager"),su(this,"canvasManager"),su(this,"processedNodeManager"),su(this,"unattachedDoc"),su(this,"canvasManagerReleased",!1),su(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),su(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=Tu(),r=Ru();try{this.processBufferedMutations()}finally{t=Tu()-i,e=r,Au>0||Pu(t,null!=e?e:Mu)||t>Bu.slowestBatchMs&&(Bu.slowestBatchMs=t)}}})),su(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new Td,r=t=>{for(var e=t,i=Lh;i===Lh;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=xu.parentNode(n);if(s&&xd(n)&&"TEXTAREA"!==s.tagName){var a=eh(s)?this.mirror.getId(Sd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=td(n,{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=>{bd(t,this.mirror)&&this.iframeManager.addIframe(t),_d(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),wd(t)&&!pd(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(xu.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)}});l&&(t.push({parentId:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Pd(this.removesSubTreeCache,s)&&!this.movedSet.has(xu.parentNode(s))||n(s);for(var a of this.addedSet)Ad(this.droppedSet,a)||Pd(this.removesSubTreeCache,a)?Ad(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(xu.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(xu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=xu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=xu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=xu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e,i=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof i.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);i.style.length>r.length&&(r+n).split("var(").length===i.style.split("var(").length&&(i.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(i)){var a=s[0],o=s[1];"string"!=typeof o&&null!==o||(i[a]=yh({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}return{id:this.mirror.getId(t.node),attributes:i}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};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={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)})),su(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),su(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(xu.childNodes(t),(t=>xu.textContent(t)||"")).join("");e.attributes.value=ph({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:_h(t),value:i,maskInputFn:this.maskInputFn})})),su(this,"processMutation",(t=>{var e;if(!gd(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=xu.textContent(t.target);pd(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:Vh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,fd(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r: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}(n,s,a),l=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var u=n,h=_h(u);l=ph({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(pd(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===o;if(v&&!this.keepIframeSrcFn(l)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Uh(n.tagName,o)){var c=zh(this.doc,gh(n.tagName),gh(o),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(o="rr_src"),d.attributes[o]=c,null==(e=this.generatedAttributes.get(t.target))||e.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=n.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)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(d.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.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(pd(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=eh(t.target)?this.mirror.getId(xu.host(t.target)):this.mirror.getId(t.target);pd(t.target,this.blockClass,this.blockSelector,!1)||gd(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Rd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||md(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ed(i,r)]?Rd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!eh(t.target)||!ih(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),xu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),su(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(gd(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[Ed(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);pd(t,this.blockClass,this.blockSelector,!1)||(xu.childNodes(t).forEach((t=>this.genAdds(t))),wd(t)&&xu.childNodes(xu.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Rd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),xu.childNodes(r).forEach((t=>i.push(t)))}}function Pd(t,e,i){return 0!==t.size&&function(t,e,i){var r=xu.parentNode(e);return!!r&&t.has(r)}(t,e)}function Ad(t,e){if(0===t.size)return!1;for(var i=xu.parentNode(e);i;){if(t.has(i))return!0;i=xu.parentNode(i)}return!1}var Fd=function(t,e){return void 0===e&&(e="rrweb"),Md?function(){try{return t(...arguments)}catch(t){if(Md&&!0===Md(t,e))return;throw t}}:t},Od=[];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 Dd(t,e){var i,r=new Id;r.init(t);try{i=new(ku())(Fd(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),Od.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function $d(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=Ld(t);if(a&&!pd(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=dd(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[rd("scroll",Fd(ld(Fd((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(rd("scrollend",Fd(l),i)),()=>u.forEach((t=>t()))}function Nd(t,e){for(var i=Od.length-1;i>=0;i--){var r=Od[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Od.splice(i,1))}}}var qd=["INPUT","TEXTAREA","SELECT"],jd=new WeakMap;function Bd(t){return function t(e,i){if(Vd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Vd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Vd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Vd("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 Hd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var zd=5e3;function Ud(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:xu.host(e));var o="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Fd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Wd(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=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),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...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 s,a,o,l,u,h,d,v,c=[],f=Fd((()=>{if(r){r.destroy(),r.reset();var e=Od.indexOf(r);-1!==e&&Od.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Dd(t,t.doc);i=g.observer,r=g.buffer}if(c.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=ld(Fd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Fd(ld(Fd((t=>{var e=Ld(t),i=yd(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=hd()),l.push({x:r,y:a,id:n.getId(e),timeOffset:hd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?ou.Drag:t instanceof MouseEvent?ou.MouseMove:ou.TouchMove)})),a,{trailing:!1})),d=[rd("mousemove",h,r),rd("touchmove",h,r),rd("drag",h,r)];return Fd((()=>{d.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],u=null;return Object.keys(lu).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=gh(t),o=(t=>i=>{var a=Ld(i);if(!pd(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=uu.Mouse;break;case"touch":o=uu.Touch;break;case"pen":o=uu.Pen}o===uu.Touch&&(lu[t]===lu.MouseDown?l="TouchStart":lu[t]===lu.MouseUp&&(l="TouchEnd"))}else yd(i)&&(o=uu.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===uu.Touch||l.startsWith("Mouse")&&o===uu.Mouse)&&(o=null)):lu[t]===lu.Click&&(o=u,u=null);var h=yd(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Fd(e)(p({type:lu[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(lu[t]){case lu.MouseDown:case lu.MouseUp:a=a.replace("mouse","pointer");break;case lu.TouchStart:case lu.TouchEnd:return}l.push(rd(a,o,i))})),Fd((()=>{l.forEach((t=>t()))}))}(t)),c.push($d(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return rd("resize",Fd(ld(Fd((()=>{var t=vd(),e=cd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n})),c.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=Ld(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=xu.parentElement(e)),e&&c&&qd.indexOf(c)>=0&&!pd(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=_h(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=ph({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:u})),v(e,h?{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;v(t,h?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function v(t,i){var n=jd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){jd.set(t,i);var s=r.getId(t);Fd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>rd(t,Fd(d),i))),f=i.defaultView;if(!f)return()=>{c.forEach((t=>t()))};var g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&c.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map((t=>ud(t[0],t[1],{set(){Fd(d)({target:this,isTrusted:!1})}},!1,f)))),Fd((()=>{c.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Fd((t=>ld(Fd((s=>{var a=Ld(s);if(a&&!pd(a,i,r,!0)){var o=a.currentTime,l=a.volume,u=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[rd("play",o(du.Play),a),rd("pause",o(du.Pause),a),rd("seeked",o(du.Seeked),a),rd("volumechange",o(du.VolumeChange),a),rd("ratechange",o(du.RateChange),a)];return Fd((()=>{l.forEach((t=>t()))}))}(t)),t.recordDOM){var m=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.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(a,o,l){if(!r)return()=>{};var u=e.get(a);u||e.set(a,u=[]);var h={emit:o,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(a))};try{d=t.setTimeout(f,zd),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(a)))}},reset(){r=!1,i.forEach((e=>t.clearTimeout(e))),i.clear(),e.clear()}}}(n);c.push(m.reset),c.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Fd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Hd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:o,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:Fd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Hd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:o}]}))),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:Fd(((t,e,s)=>{var o=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=Hd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=a.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:o})),(()=>{var t=ah(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:Fd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Hd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};Gd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Gd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Gd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Gd("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:Fd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Hd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Bd(e),l];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:o,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Fd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Hd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Bd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Fd((()=>{s.CSSStyleSheet.prototype.insertRule=o,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:n,mutationQueue:m})),c.push(Ud(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,l=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Fd(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2],v=t.apply(e,a);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Hd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Bd(e.parentRule);o.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Fd(((t,e,a)=>{var l,u=a[0],h=t.apply(e,a);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Hd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Bd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Fd((()=>{a.CSSStyleDeclaration.prototype.setProperty=l,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&c.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(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 o=Su(i.fonts,"add",(function(t){return function(i){return setTimeout(Fd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),Fd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=Fd((()=>{var t=a.getSelection();if(!(!t||d&&(null==t?void 0:t.isCollapsed))){d=t.isCollapsed||!1;for(var e=[],i=t.rangeCount||0,r=0;i>r;r++){var n=t.getRangeAt(r),s=n.startContainer,v=n.startOffset,c=n.endContainer,f=n.endOffset;pd(s,l,u,!0)||pd(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),rd("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Su(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))c.push(y.observer(y.callback,n,y.options))}catch(t){try{f()}catch(t){}throw t}return f}function Vd(t){return void 0!==window[t]}function Gd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Zd{constructor(t){su(this,"iframeRemoteIdToLocalIdMap",new WeakMap),su(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),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}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}}class Qd{constructor(t){su(this,"iframes",new WeakMap),su(this,"crossOriginIframeMap",new WeakMap),su(this,"crossOriginIframeMirror",new Zd(Dh)),su(this,"crossOriginIframeStyleMirror"),su(this,"crossOriginIframeRootIdMap",new WeakMap),su(this,"mirror"),su(this,"mutationCb"),su(this,"wrappedEmit"),su(this,"loadListener"),su(this,"pageHideListener"),su(this,"stylesheetManager"),su(this,"recordCrossOriginIframes"),su(this,"messageHandler"),su(this,"nestedIframeListeners",new Map),su(this,"attachedWindows",new WeakMap),su(this,"attachedDocuments",new WeakMap),su(this,"attachedIframes",new Map),su(this,"loadListenerDisposers",new WeakMap),su(this,"iframeElementsById",new Map),su(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Zd(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.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=>sd(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{nd(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 a=this.handleMessage.bind(this);sd((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}sd((()=>{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)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||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){var i;switch(e.type){case au.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:au.IncrementalSnapshot,data:{source:ou.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case au.Meta:case au.Load:case au.DomContentLoaded:return!1;case au.Plugin:return e;case au.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case au.IncrementalSnapshot:switch(e.data.source){case ou.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 ou.Drag:case ou.TouchMove:case ou.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case ou.ViewportResize:return!1;case ou.MediaInteraction:case ou.MouseInteraction:case ou.Scroll:case ou.CanvasMutation:case ou.Input:return this.replaceIds(e.data,t,["id"]),e;case ou.StyleSheetRule:case ou.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ou.Font:return e;case ou.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case ou.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.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===vu.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&&(nd(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(nd(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=>{sd((()=>this.mirror.removeNodeFromMap(t)))})),sd((()=>Nd(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&&nd(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{nd(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}}class Jd{constructor(t){su(this,"shadowDoms",new WeakSet),su(this,"mutationCb"),su(this,"scrollCb"),su(this,"bypassOptions"),su(this,"mirror"),su(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(ih(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=xu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Dd(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=Od.indexOf(o);-1!==t&&Od.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:$d(p({},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(xu.host(t))),this.restoreHandlers.push({doc:n,handler:Ud({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:Su(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=xu.shadowRoot(this);return s&&xd(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}}var Kd="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 Xd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ev=0;64>ev;ev++)tv[Xd.charCodeAt(ev)]=ev;var iv=new Map,rv=(t,e,i)=>{if(t&&(av(t,e)||"object"==typeof t)){var r=function(t,e){var i=iv.get(t);return i||iv.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 nv(t,e,i,r){if(t instanceof Array)return t.map((t=>nv(t,e,i,r)));if(null===t)return t;if(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)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Xd[i[e]>>2],n+=Xd[(3&i[e])<<4|i[e+1]>>4],n+=Xd[(15&i[e+1])<<2|i[e+2]>>6],n+=Xd[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}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[nv(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:[nv(t.data,e,i,r),t.width,t.height]}:av(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:rv(t,e,i)}:t}var sv=(t,e,i,r)=>t.map((t=>nv(t,e,i,r))),av=(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])))},ov=["webgl","webgl2"];function lv(t){return"nodeType"in t}function uv(t,e,i,r){var n=[];try{if(r){var s=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return Su(r.prototype,"configure",(function(r){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||lv(s)&&pd(s,e,i,!0))return r.call(this,n);lv(s)&&!("__context"in s)&&(s.__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&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,i);s&&n.push(s)}var a=Su(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!pd(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&ov.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function hv(t,e,i,r,n,s,a){var o=[],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=Su(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(rv(d,s,this),this.canvas&&"tagName"in this.canvas&&!pd(this.canvas,r,n,!0)){var v=sv(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=ud(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!pd(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var dv,vv,cv,fv='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',pv="undefined"!=typeof self&&self.Blob&&new Blob([fv],{type:"text/javascript;charset=utf-8"});function gv(t){var e;try{if(!(e=pv&&(self.URL||self.webkitURL).createObjectURL(pv)))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(fv),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class mv{constructor(t){su(this,"pendingCanvasMutations",new Map),su(this,"rafStamps",{latestId:0,invokeId:null}),su(this,"mirror"),su(this,"mutationCb"),su(this,"resetObservers"),su(this,"frozen",!1),su(this,"locked",!1),su(this,"rafIdTimestamp",null),su(this,"rafIdFlush",null),su(this,"refCount",0),su(this,"torndown",!1),su(this,"resetFrameDedup",null),su(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,a=t.recordCanvas,o=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,o),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:o,resolutionScale:l,canvasMasking:u})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||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}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,o="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=uv(e,i,r,!0),u=new Map;try{a=new gv}catch(t){return}var h=!1;a.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(u.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:hu["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 d,v=1e3/t,c=0,p=t=>{var l,g;h||(c&&v>t-c||(c=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{pd(t,i,r,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=f((function*(t){var e,i,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var l=t.getContext(t.__context);if(null==(e=null==l?void 0:l.isContextLost)?void 0:e.call(l))return void u.set(r,!1);!1===(null==(i=null==l?void 0:l.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var h=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(h*o)),c=Math.max(1,Math.round(d*o)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Kd}if(void 0!==a){if(!Array.isArray(a)||!a.every(Yd))return Kd;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===Kd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>o?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:h,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=uv(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=Su(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return pd(this.canvas,i,r,!0)||setTimeout((()=>{var i=sv(l,e,this,n);t(this.canvas,{type:hu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ud(e.CanvasRenderingContext2D.prototype,a,{set(e){pd(this.canvas,i,r,!0)||t(this.canvas,{type:hu["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...hv(e.WebGLRenderingContext.prototype,hu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...hv(e.WebGL2RenderingContext.prototype,hu.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}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(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var r=i.map((t=>g(t,ru)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class yv{constructor(t){var e;su(this,"trackedLinkElements",new WeakSet),su(this,"pendingDeferredSheets",new Set),su(this,"mutationCb"),su(this,"adoptedStyleSheetCb"),su(this,"maskAllElementAttributes"),su(this,"maskAttributeFn"),su(this,"styleMirror",new kd),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=ch(r))}catch(t){}if(!i||!r)return Yu(),null;var n=i,s=!1,a={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:i=>{if(o)return!0;var l,u,h=Tu(),d=Ru(),v=!0;try{if(s)return o=!0,Yu(),!0;if(!n.advance(i))return v=!1,!1;o=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Yu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Yu(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Pu(l=Tu()-h,null!=(u=d)?u:Mu)||(Hu.totalMs+=l,l>Hu.slowestSliceMs&&(Hu.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}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))||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:yh({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 a=Tu();try{Qu((()=>{try{var e=t.rules||t.cssRules;e&&Zu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:oh(e,t.href),index:i})))})}))}finally{Ju(Tu()-a)}}r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Zh.forEach((t=>t.abort())),Zh.clear()}trackStylesheetInLinkElement(t){}}class bv{constructor(){su(this,"nodeMap",new WeakMap),su(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(){}}var _v=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var wv=document.createElement("iframe");document.body.appendChild(wv),Array.from=(null==(iu=wv.contentWindow)?void 0:iu.Array.from)||Array.from,document.body.removeChild(wv)}}catch(t){console.debug("Unable to override Array.from",t)}var kv=new fh,Sv=new Set([ou.Mutation,ou.MediaInteraction,ou.StyleSheetRule,ou.CanvasMutation,ou.Font,ou.Log,ou.StyleDeclaration,ou.AdoptedStyleSheet]);function xv(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.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Cv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,a=i.blockClass,o=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,h=i.ignoreClass,d=void 0===h?"rr-ignore":h,v=i.ignoreSelector,c=void 0===v?null:v,f=i.maskTextClass,g=void 0===f?"rr-mask":f,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,E=void 0!==M&&M,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,F=void 0===A?{}:A,O=i.dataURLOptions,L=void 0===O?{}:O,D=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,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,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;Md=i.errorHandler;var at=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),ot=!W||window.parent===window,lt=!1;if(!ot)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(ot&&!r)throw new Error("emit function is required");if(!ot&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),kv.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=ed(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 P&&!lt&&(t=P(t)),t};dv=(t,e)=>{var i,a=t;if(a.timestamp=hd(),!(null==(i=Od[0])?void 0:i.isFrozen())||a.type===au.FullSnapshot||a.type===au.IncrementalSnapshot&&Sv.has(a.data.source)||Od.forEach((t=>t.unfreeze())),ot)null==r||r(gt(a),e);else if(lt){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===au.FullSnapshot)ut=a,ft=0;else if(a.type===au.IncrementalSnapshot){if(a.data.source===ou.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&vv(!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 n=kv.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}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()}dv({type:au.IncrementalSnapshot,data:p({source:ou.Mutation},t)})},yt=t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.Scroll},t)}),bt=t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.CanvasMutation},t)}),_t=new yv({mutationCb:mt,adoptedStyleSheetCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.AdoptedStyleSheet},t)}),maskAllElementAttributes:E,maskAttributeFn:I}),wt=new Qd({mirror:kv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:dv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:kv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new bv,xt=null==N?void 0:N.configured;cv=new mv({recordCanvas:z,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:kv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Jd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:cv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:kv});vv=function(t){if(void 0===t&&(t=!1),B){Uu(w);try{dv({type:au.Meta,data:{href:window.location.href,width:cd(),height:vd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Od.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new fh:r,s=i.blockClass,a=void 0===s?"rr-block":s,o=i.blockSelector,l=void 0===o?null:o,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,E=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,N=void 0===D?()=>!1:D,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=ed(void 0!==M&&M);Uu(j);try{return td(t,{doc:t,mirror:n,blockClass:a,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:E,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Wu()}}(document,{mirror:kv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,slimDOM:dt,dataURLOptions:at,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){bd(t,kv)&&wt.addIframe(t),_d(t,kv)&&_t.trackLinkElement(t),wd(t)&&Ct.addShadowRoot(xu.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=Nu,Nu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(dv({type:au.FullSnapshot,data:{node:r,initialOffset:dd(window)}},t),Od.forEach((t=>t.unlock())),cv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&sd((()=>{a=e.beginDeferredLinkInlining(i,kv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;sd((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!r){var e=0;do{try{a||l(),u()}catch(t){null==a||a.discard(),a=null,Xu(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=xv(h):i())}};return n=xv(h),{cancel(){r=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||l();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{u()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var v=h+(null!==a?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Xu(v),null==a||a.discard(),a=null}i()}}}}(i,_t,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,kv.getId(document))}finally{Wu()}var s}};try{var Tt=[];for(var Mt of(Tt.push(rd("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(rd(Mt,Iu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{sd(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=kv.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 Et=t=>{var e;return Fd(Wd)({mutationCb:mt,mousemoveCb:(t,e)=>dv({type:au.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.ViewportResize},t)}),inputCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.Input},t)}),mediaInteractionCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.MediaInteraction},t)}),styleSheetRuleCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.StyleSheetRule},t)}),styleDeclarationCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>dv({type:au.IncrementalSnapshot,data:p({source:ou.Font},t)}),selectionCb(t){dv({type:au.IncrementalSnapshot,data:p({source:ou.Selection},t)})},customElementCb(t){dv({type:au.IncrementalSnapshot,data:p({source:ou.CustomElement},t)})},blockClass:o,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:kv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:cv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>dv({type:au.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=kv.getId(t),i=Et(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=kv.getId(t);null==vt||vt(e),Nd(t)}));var It=-1,Rt=t=>dv({type:au.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Pt=()=>{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,a=s?kv.getId(s):-1;a!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{vv();var t=Et(document);"function"==typeof t&&Tt.push(t),Tt.push(rd("fullscreenchange",Pt)),Tt.push(rd("webkitfullscreenchange",Pt)),Tt.push(rd("mozfullscreenchange",Pt)),Tt.push(rd("MSFullscreenChange",Pt)),_v=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(rd("DOMContentLoaded",(()=>{dv({type:au.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(rd("load",(()=>{dv({type:au.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>sd(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),kv.reset(),_v=!1,Md=void 0}}catch(t){console.warn(t)}}Cv.addCustomEvent=(t,e)=>{if(!_v)throw new Error("please add custom event after start recording");dv({type:au.Custom,data:{tag:t,payload:e}})},Cv.freezePage=()=>{Od.forEach((t=>t.freeze()))},Cv.takeFullSnapshot=t=>{if(!_v)throw new Error("please take full snapshot after start recording");vv(t)},Cv.mirror=kv;var Tv=Object.defineProperty,Mv=(t,e,i)=>((t,e,i)=>e in t?Tv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Ev{constructor(t){Mv(this,"fileName"),Mv(this,"functionName"),Mv(this,"lineNumber"),Mv(this,"columnNumber"),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}}var Iv=/(^|@)\S+:\d+/,Rv=/^\s*at .*(\S+:\d+|\(native\))/m,Pv=/^(eval@)?(\[native code])?$/,Av={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Rv)?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(Rv)}),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()),s=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ev({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Pv)}),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 Ev({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ev({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 a=e.exec(i[n]);a&&r.push(new Ev({fileName:a[2],lineNumber:parseFloat(a[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 a=e.exec(i[n]);a&&r.push(new Ev({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Iv)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ev({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Fv(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 a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Ov(t){return Array.isArray(t)}function Lv(t){return"object"==typeof t&&null!==t&&!Ov(t)}function Dv(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Lv(t[r])&&Dv(t[r],e-1))return!0;return!1}function $v(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(Lv(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||Lv(a)&&Dv(a,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 a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=Ov(u)?Fv(u.length?u[0]:null):u}return o}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 Nv={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({},Nv,i):Nv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=Av.parse(e.error).map((t=>t.toString())),s=[$v(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[$v("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[$v("Uncaught (in promise)",n.stringifyOptions),$v(e.reason,n.stringifyOptions)]);var s=Av.parse(i).map((t=>t.toString()));t({level:"error",trace:s,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,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(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]||o)){o=!0;try{var h=Av.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>$v(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[$v("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)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===d)return void(r.next=h.next);r=t(i=r.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var jv=t=>({name:"rrweb/console@1",observer:qv,options:t}),Bv=t=>"undefined"!=typeof Document&&t instanceof Document,Hv=()=>{},zv=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Uv(t,e,i){try{if(!(e in t))return Hv;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 Z(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=zv(i);s;){if(s.next===n)return void(s.next=r.next);s=zv(i=s.next)}else t[e]=r.next}}catch(t){return Hv}}function Wv(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 Vv=Ji("[Recorder]"),Gv=t=>"navigation"===t.entryType,Zv=t=>"resource"===t.entryType;function Qv(t,e){return!!e&&(nt(e)||e[t])}function Jv(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 Kv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Yv(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:!!Jv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Kv))return!1;if(nt(i))return!0;if(G(i))return n(i);var s=i[e];return nt(s)?s:n(s)}function Xv(t,e,i,r,n,s){return tc.apply(this,arguments)}function tc(){return tc=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Vv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(Zv(a=t[s])&&a.initiatorType===e&&(K(r)||a.startTime>=r)&&(K(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),Xv(t,e,i,r,n,s+1))})),tc.apply(this,arguments)}function ec(t){var e=t.body,i=t.options,r=t.url;if(et(e))return null;var n=Wv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Y(e))return e;if(Bv(e))return e.textContent;if(st(e))return dr(e);if(Q(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 ic=t=>!tt(t)&&("navigation"===t.entryType||"resource"===t.entryType);function rc(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,u=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[p({},e?e.toJSON():{name:l},{startTime:K(a)?void 0:Math.round(a),endTime:K(o)?void 0:Math.round(o),timeOrigin:h,timestamp:d,method:i,initiatorType:u||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(ic(e))for(var c of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:c.name,duration:c.duration,entryType:"serverTiming"});return v}var nc=["video/","audio/"];function sc(t){return Q(t)&&Z(t.getReader)&&Z(t.tee)}var ac=500,oc="[SessionReplay] Timeout while trying to read body",lc="[SessionReplay] Failed to read body";function uc(t){return lc+": "+t}function hc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function dc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(oc)),ac);try{t.clone().text().then((t=>e(t)),(t=>e(uc(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(lc)}}))}(t);var i=vn(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(hc(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(oc)),ac);try{o=t.clone()}catch(t){return void a(lc)}var u=o.body;if(sc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(lc)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((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(o){if(d+o.byteLength>e)return void a(hc(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(uc(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(uc(t))))}catch(t){a(lc)}}))}(t,i)}function vc(){return vc=f((function*(t){var e=t.r,i=t.options,r=Wv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):dc(e,i)})),vc.apply(this,arguments)}function cc(){return cc=f((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(),a=nc.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Wv(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return tt(r)?dc(e,i):Promise.resolve(r)})),cc.apply(this,arguments)}var fc=null;function pc(t,e,i){if(!("performance"in e))return()=>{};if(fc)return Vv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},cn,i):cn,n=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&wn.has(t))(s)),s&&i.push(s)}})),i.length>0&&t(p({},e,{requests:i}))},s=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>Gv(t)||Zv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>rc({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>Gv(t)||Zv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>rc({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,r),a=()=>{},o=()=>{};return(r.recordHeaders||r.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Qv("request",i.recordHeaders),n=Qv("response",i.recordHeaders),s=Uv(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),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=>(Yv({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=ec({body:t,options:i,url:o})),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),Yv({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=ec({body:d.response,options:i,url:o})),Xv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=rc({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Vv.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(n,e,r),o=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Qv("request",i.recordHeaders),n=Qv("response",i.recordHeaders),s=Uv(e,"fetch",(s=>function(){var a=f((function*(a,o){var l,u;try{l=new Request(a,o)}catch(t){return Vv.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!sc(null==o?void 0:o.body)&&Yv({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return vc.apply(this,arguments)}({r:l,options:i,url:a}))}catch(t){Vv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Jv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),Yv({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return cc.apply(this,arguments)}({r:u,options:i,url:a})),u}finally{Xv(e,"fetch",l.url,h,d).then((e=>{var i,r=rc({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),fc=()=>{s(),a(),o(),fc=null}}var gc=t=>({name:"rrweb/network@1",observer:pc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:jv,getRecordNetworkPlugin:gc},v.__PosthogExtensions__.rrweb={record:Cv,version:"v2",wasMaxDepthReached:()=>Xh,resetMaxDepthState(){Xh=!1,Yh=!1},getLastSnapshotCost:()=>Du,getMutationCost:()=>p({},Bu),resetSnapshotCostState(){Au=0,Fu=0,Ou=0,Mu=0,Lu=Cu(),Du=null,$u=null,Nu=[],qu=0,ju=0,Bu={slowestBatchMs:0},Hu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:Cv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:jv},v.getRecordNetworkPlugin=gc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new eu(t,e);var mc,yc,bc,_c,wc,kc,Sc,xc,Cc,Tc,Mc,Ec,Ic,Rc,Pc,Ac={},Fc=[],Oc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Lc=Array.isArray;function Dc(t,e){for(var i in e)t[i]=e[i];return t}function $c(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Nc(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?mc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return qc(t,a,r,n,null)}function qc(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?++bc:n,__i:-1,__u:0};return null==n&&null!=yc.vnode&&yc.vnode(s),s}function jc(t){return t.children}function Bc(t,e){this.props=t,this.context=e}function Hc(t,e){if(null==e)return t.__?Hc(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?Hc(t):null}function zc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Dc({},e);s.__v=e.__v+1,yc.vnode&&yc.vnode(s),Xc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Hc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,ef(r,s,n),e.__e=e.__=null,s.__e!=i&&Uc(s)}}function Uc(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})),Uc(t)}function Wc(t){(!t.__d&&(t.__d=!0)&&_c.push(t)&&!Vc.__r++||wc!=yc.debounceRendering)&&((wc=yc.debounceRendering)||kc)(Vc)}function Vc(){try{for(var t,e=1;_c.length;)_c.length>e&&_c.sort(Sc),t=_c.shift(),e=_c.length,zc(t)}finally{_c.length=Vc.__r=0}}function Gc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Fc,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=qc(null,a,null,null,null):Lc(a)?a=t.__k[s]=qc(jc,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=qc(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=Qc(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Hc(o)),sf(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Ac,c.__i=d,g=Xc(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&nf(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=Zc(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 Zc(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=Zc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Hc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Qc(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==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[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function Jc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Oc.test(e)?i:i+"px"}function Kc(t,e,i,r,n){var s,a;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||Jc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Jc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Mc,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Tc]=r[Tc]:(i[Tc]=Ec,t.addEventListener(e,s?Rc:Ic,s)):t.removeEventListener(e,s?Rc:Ic,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 Yc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Cc])e[Cc]=Ec++;else if(i[Tc]>e[Cc])return;return i(yc.event?yc.event(e):e)}}}function Xc(t,e,i,r,n,s,a,o,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=[o=e.__e=i.__e]),(h=yc.__b)&&h(e);t:if("function"==typeof C){d=a.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 Bc(y,_),v.constructor=C,v.render=af),$&&$.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=Dc({},v.__s)),Dc(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)})),Fc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.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=yc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Fc.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=Dc(Dc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===jc&&null==h.key?rf(h.props.children):h,o=Gc(t,Lc(S)?S:[S],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(x=s.length;x--;)$c(s[x]);tf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||tf(e);yc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||Ac,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),o&&(yc.__m&&yc.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&mc.call(t.childNodes),!o&&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||Kc(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:o&&"function"!=typeof c||g[u]===c||Kc(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Gc("template"==e.type?t.content:t,Lc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Hc(i,0),o,l),null!=s)for(u=s.length;u--;)$c(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Kc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Kc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=yc.diffed)&&h(e),128&e.__u?void 0:o}function tf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(tf))}function ef(t,e,i){for(var r=0;i.length>r;r++)nf(i[r],i[++r],i[++r]);yc.__c&&yc.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){yc.__e(t,e.__v)}}))}function rf(t){return"object"!=typeof t||null==t||t.__b>0?t:Lc(t)?t.map(rf):void 0!==t.constructor?null:Dc({},t)}function nf(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){yc.__e(t,i)}}function sf(t,e,i){var r,n;if(yc.unmount&&yc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||nf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){yc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&sf(r[n],e,i||"function"!=typeof t.type);i||$c(t.__e),t.__c=t.__=t.__e=void 0}function af(t,e,i){return this.constructor(t,i)}function of(t,e,i){var r,n,s;e==document&&(e=document.documentElement),yc.__&&yc.__(t,e),r=e.__k,n=[],s=[],Xc(e,t=e.__k=Nc(jc,null,[t]),r||Ac,Ac,e.namespaceURI,r?null:e.firstChild?mc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),ef(n,t,s),t.props.children=null}mc=Fc.slice,yc={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},bc=0,Bc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Dc({},this.state),"function"==typeof t&&(t=t(Dc({},i),this.props)),t&&Dc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Wc(this))},Bc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Wc(this))},Bc.prototype.render=jc,_c=[],kc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sc=function(t,e){return t.__v.__b-e.__v.__b},Vc.__r=0,xc=Math.random().toString(8),Cc="__d"+xc,Tc="__a"+xc,Mc=/(PointerCapture)$|Capture$/i,Ec=0,Ic=Yc(!1),Rc=Yc(!0),Pc=0;var lf,uf,hf,df,vf=0,cf=[],ff=yc,pf=ff.__b,gf=ff.__r,mf=ff.diffed,yf=ff.__c,bf=ff.unmount,_f=ff.__;function wf(t,e){ff.__h&&ff.__h(uf,t,vf||e),vf=0;var i=uf.__H||(uf.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function kf(t){return vf=1,function(t,e,i){var r=wf(lf++,2);if(r.t=t,!r.__c&&(r.__=[Ff(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=uf,!uf.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};uf.__f=!0;var s=uf.shouldComponentUpdate,a=uf.componentWillUpdate;uf.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},uf.shouldComponentUpdate=n}return r.__N||r.__}(Ff,t)}function Sf(t,e){var i=wf(lf++,3);!ff.__s&&Af(i.__H,e)&&(i.__=t,i.u=e,uf.__H.__h.push(i))}function xf(t){return vf=5,Cf((function(){return{current:t}}),[])}function Cf(t,e){var i=wf(lf++,7);return Af(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Tf(t){var e=uf.context[t.__c],i=wf(lf++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(uf)),e.props.value):t.__}function Mf(){for(var t;t=cf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Rf),e.__h.some(Pf),e.__h=[]}catch(i){e.__h=[],ff.__e(i,t.__v)}}}ff.__b=function(t){uf=null,pf&&pf(t)},ff.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),_f&&_f(t,e)},ff.__r=function(t){gf&&gf(t),lf=0;var e=(uf=t.__c).__H;e&&(hf===uf?(e.__h=[],uf.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Mf(),lf=0)),hf=uf},ff.diffed=function(t){mf&&mf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==cf.push(e)&&df===ff.requestAnimationFrame||((df=ff.requestAnimationFrame)||If)(Mf)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),hf=uf=null},ff.__c=function(t,e){e.some((function(t){try{t.__h.some(Rf),t.__h=t.__h.filter((function(t){return!t.__||Pf(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],ff.__e(i,t.__v)}})),yf&&yf(t,e)},ff.unmount=function(t){bf&&bf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{Rf(t)}catch(t){e=t}})),i.__H=void 0,e&&ff.__e(e,i.__v))};var Ef="function"==typeof requestAnimationFrame;function If(t){var e,i=function(){clearTimeout(r),Ef&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Ef&&(e=requestAnimationFrame(i))}function Rf(t){var e=uf,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),uf=e}function Pf(t){var e=uf;t.__c=t.__(),uf=e}function Af(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Ff(t,e){return"function"==typeof e?e(t):e}function Of(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Z(i.then)&&i.then(void 0,(()=>{}))}}}}var Lf="gzip-js",Df="base64",$f="events",Nf="cancelEvents",qf={Tab:"tab",Selector:"selector"},jf={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Bf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Hf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},zf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Uf={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Wf="always",Vf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Gf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Zf="popover",Qf=Ji("[Surveys]");function Jf(t){return!(!t.start_date||t.end_date)}function Kf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Yf="seenSurvey_",Xf="inProgressSurvey_",tp=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),ep=t=>tp(Yf,t),ip=t=>{try{var e=ep(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Qf.error("Failed to persist survey seen state",t)}},rp=[Hf.Popover,Hf.Widget,Hf.API],np={ignoreConditions:!1,ignoreDelay:!1,displayType:Zf},sp="featureFlags",ap="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return it(t)&&isFinite(t)&&Math.floor(t)===t});class op{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new op(n)}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 op(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}}class lp{generate(){var t=this.generateOrAbort();if(!K(t))return t;this.Yr=0;var e=this.generateOrAbort();if(K(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Yr)this.Yr=t,this.Kr();else{if(this.Yr>=t+1e4)return;this.Xr++,this.Xr>4398046511103&&(this.Yr++,this.Kr())}return op.fromFieldsV7(this.Yr,Math.trunc(this.Xr/Math.pow(2,30)),this.Xr&Math.pow(2,30)-1,this.ei.nextUint32())}Kr(){this.Xr=1024*this.ei.nextUint32()+(1023&this.ei.nextUint32())}constructor(){this.Yr=0,this.Xr=0,this.ei=new dp}}var up,hp=t=>{if("undefined"!=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};t&&!K(t.crypto)&&crypto.getRandomValues&&(hp=t=>crypto.getRandomValues(t));class dp{nextUint32(){return this.Dt.length>this.ti||(hp(this.Dt),this.ti=0),this.Dt[this.ti++]}constructor(){this.Dt=new Uint32Array(8),this.ti=1/0}}var vp=()=>cp().toString(),cp=()=>(up||(up=new lp)).generate(),fp="",pp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var gp=null,mp={ri(){if(!tt(gp))return gp;if(gp=!1,r)try{var t="__ph_cookie_support_"+vp();mp.ii(t,"xyz"),gp='"xyz"'===Ho(t),mp.ai(t)}catch(t){gp=!1}return gp},oi(t){Qi.error("cookieStore error: "+t)},ni:Ho,si(t){var e;try{e=JSON.parse(mp.ni(t))||{}}catch(t){}return e},ii(t,e,i,n,s){if(!r)return!1;try{var a="",o="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),fp)return fp;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),n=Math.min(i.length,8),s="dmn_chk_"+vp();!fp&&n--;){var a=i.slice(n).join("."),o=s+"=1;domain=."+a+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",fp=a)}return fp}(t);if(!i){var n=(t=>{var e=t.match(pp);return e?e[0]:""})(t);n!==i&&Qi.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,n);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),a="; expires="+u.toUTCString()}s&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&Qi.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},ai(t,e){if(null!=r&&r.cookie)try{mp.ii(t,"",-1,e)}catch(t){return}}},yp=null,bp={ri(){if(!tt(yp))return yp;var e=!0;if(K(t))e=!1;else try{var i="__mplssupport__";bp.ii(i,"xyz"),'"xyz"'!==bp.ni(i)&&(e=!1),bp.ai(i)}catch(t){e=!1}return e||Qi.error("localStorage unsupported; falling back to cookie store"),yp=e,e},oi(t){Qi.error("localStorage error: "+t)},ni(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){bp.oi(t)}return null},si(t){try{return JSON.parse(bp.ni(t))||{}}catch(t){}return null},ii(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){bp.oi(t)}return!1},ai(e){try{null==t||t.localStorage.removeItem(e)}catch(t){bp.oi(t)}}},_p=[us,es,ts,rs,ns,ss,ws,_s,ys],wp=[xn,Sn,Un,Wn,Es,Ms,ks],kp=t=>t+"_cpm",Sp=["__proto__","constructor","prototype"],xp=t=>{if(!Q(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===Sp.indexOf(i)&&(e[i]=t[i])})),e},Cp=function(t,e){void 0===e&&(e=[]);var i={};return[...wp,...e].forEach((e=>{var r=t[e];K(r)||tt(r)||""===r||(i[e]=r)})),i},Tp=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)},Mp=(t,e)=>({p:e,f:Tp(JSON.stringify(t))}),Ep=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=mp.si(kp(t)),r=(null==i?void 0:i.f)===Tp(e)&&G(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Ip=(t,e)=>e+"|"+(mp.ni(kp(t))||""),Rp={},Pp={ri:()=>!0,oi(t){Qi.error("memoryStorage error: "+t)},ni:t=>t in Rp?Rp[t]:null,si:t=>t in Rp?Rp[t]:null,ii:(t,e)=>(Rp[t]=e,!0),ai(t){delete Rp[t]}},Ap=null,Fp={ri(){if(!tt(Ap))return Ap;if(Ap=!0,K(t))Ap=!1;else try{var e="__support__";Fp.ii(e,"xyz"),'"xyz"'!==Fp.ni(e)&&(Ap=!1),Fp.ai(e)}catch(t){Ap=!1}return Ap},oi(t){Qi.error("sessionStorage error: ",t)},ni(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Fp.oi(t)}return null},si(t){try{return JSON.parse(Fp.ni(t))||null}catch(t){}return null},ii(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Fp.oi(t)}return!1},ai(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Fp.oi(t)}}},Op=Ji("[Stylesheet Loader]"),Lp=t,Dp=r,$p="#020617",Np={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:jf.Right,widgetType:qf.Tab,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:$p,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},qp=[jf.Center,jf.Left,jf.Right];function jp(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Bp(t){var e;void 0===t&&(t=Np.backgroundColor),"#"===t[0]&&(e=jp(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=jp(i)),!e)return $p;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?$p:"white"}return $p}var Hp=(t,e,i)=>{var r=og(t),n=Dp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Dp.createElement("div");((t,e,i)=>{var r=p({},Np,i),n=t.style,s=!qp.includes(r.position)||e===Hf.Widget&&(null==i?void 0:i.widgetType)===qf.Tab;n.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)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),s?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Bp(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Bp(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Bp(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",Bp(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),o=a||r.inputBackground;a||"white"!==r.backgroundColor||(o="#f8f8f8"),n.setProperty("--ph-survey-input-background",o);var l=(null==i?void 0:i.inputTextColor)||Bp(o);n.setProperty("--ph-survey-input-text-color",l),n.setProperty("--ph-survey-rating-text-color",l),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(s,t.type,t.appearance),s.className=r;var a=s.attachShadow({mode:"open"}),o=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Op.error("prepare_external_dependency_stylesheet returned null"),null)})(Dp,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--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 rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.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),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{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);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.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{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}: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{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";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}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.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;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){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{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.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{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.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}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!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(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Dp.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},zp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,a=t.properties,o=t.surveyLanguage,l=t.questionSnapshots;n?(ip(i),n.capture(Vf.SENT,p({[Gf.SURVEY_NAME]:i.name,[Gf.SURVEY_ID]:i.id,[Gf.SURVEY_ITERATION]:i.current_iteration,[Gf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Gf.SURVEY_SUBMISSION_ID]:r,[Gf.SURVEY_COMPLETED]:s},o&&{[Gf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},wo(e,i,l),a,{$set:{[ko(i,"responded")]:!0}})),s&&(Lp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),ag(i),n.reloadFeatureFlags())):Qf.error("[survey sent] event not captured, PostHog instance not found.")},Up=(t,e,i)=>{return p({[Gf.SURVEY_NAME]:t.name,[Gf.SURVEY_ID]:t.id,[Gf.SURVEY_ITERATION]:t.current_iteration,[Gf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Gf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!et(t))))},(null==e?void 0:e.surveyLanguage)&&{[Gf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Gf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},wo(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Wp=(t,e,i,r)=>{if(e){if(!i){var n=ng(t),s=n?n.surveyLanguage:r;e.capture(Vf.DISMISSED,p({},Up(t,n,e),s&&{[Gf.SURVEY_LANGUAGE]:s},{$set:{[ko(t,"dismissed")]:!0}})),ag(t),ip(t),Lp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Qf.error("[survey dismissed] event not captured, PostHog instance not found.")},Vp=(t,e)=>{if(e){var i=(t=>tp("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ng(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Vf.ABANDONED,Up(t,r,e),{transport:"sendBeacon"})}}else Qf.error("[survey abandoned] event not captured, PostHog instance not found.")},Gp=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Zp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,Qp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Jp=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map((t=>[t.id,t]))),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Zp(t.questions,Gp(t.questions)):t.questions;var i},Kp=t=>Io(t)||sg(t),Yp=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,Wc(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}),Xp=()=>Tf(Yp),tg=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Dc({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?mc.call(arguments,2):i),qc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function eg(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=yr(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return Ao[a](s,[n])}var ig=t=>tp(Xf,t),rg=(t,e)=>{try{localStorage.setItem(ig(t),JSON.stringify(e))}catch(t){Qf.error("Error setting in-progress survey state in localStorage",t)}},ng=t=>{try{var e=localStorage.getItem(ig(t));if(e)return JSON.parse(e)}catch(t){Qf.error("Error getting in-progress survey state from localStorage",t)}return null},sg=t=>{var e=ng(t);return!et(null==e?void 0:e.surveySubmissionId)},ag=t=>{try{localStorage.removeItem(ig(t))}catch(t){Qf.error("Error clearing in-progress survey state from localStorage",t)}};function og(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function lg(t,e,i){if(void 0===e&&(e=jf.Right),t===Hf.ExternalSurvey)return{};switch(e){case jf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case jf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case jf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case jf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case jf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case jf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case jf.Left:return{left:"30px"};case jf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Hf.Widget&&i===qf.Tab?"60px":"30px"}}}var ug=0;function hg(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ug,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return yc.vnode&&yc.vnode(u),u}var dg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),vg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),cg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),fg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),pg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:hg("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),gg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:hg("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),mg=hg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:hg("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),yg=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return hg("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[hg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),hg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:i})]})},bg=hg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[hg("g",{"clip-path":"url(#clip0_2415_6911)",children:[hg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:hg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),hg("g",{mask:"url(#mask0_2415_6911)",children:[hg("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),hg("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),hg("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),hg("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),hg("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),hg("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),hg("defs",{children:hg("clipPath",{id:"clip0_2415_6911",children:hg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function _g(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return hg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",bg]})}function wg(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,a=e.link,o=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=Tf(Yp).isPreviewMode,v=!!u&&!!h,c=!l&&hg("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==t||t.open(a)),d?null==o||o():s()},children:i});return hg("div",{className:"bottom-section",children:[v?hg("div",{className:"form-buttons form-buttons-with-back",children:[hg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&hg(_g,{urlParams:{utm_source:"survey-footer"}})]})}function kg(t){var e=t.question,i=t.forceDisableHtml;return hg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[hg(e.type===zf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&tg({component:Nc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Sg(t){return hg("button",{className:"form-cancel",onClick:t.onClick,disabled:Tf(Yp).isPreviewMode,"aria-label":"Close survey",type:"button",children:yg({fill:"black"})})}hg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:hg("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var xg=t;function Cg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=Tf(Yp).isPopup;return Sf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return ar(xg,"keydown",t),()=>{xg.removeEventListener("keydown",t)}}),[a]),hg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&hg(Sg,{onClick:()=>a()}),hg("h3",{className:"thank-you-message-header",children:e}),i&&tg({component:Nc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&hg(wg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function Tg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=Tf(Yp),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return hg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&hg(Sg,{onClick:()=>u()}),e&&hg("h3",{className:"intro-screen-header",children:e}),i&&tg({component:Nc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),hg(wg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var Mg=t=>G(t)&&t.every((t=>Y(t)));function Eg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Xp().isPreviewMode,d=xf(null),v=kf((()=>Y(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Sf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=Cf((()=>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 a of e)switch(a.type){case C:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case T:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=di(e.validation,C),b=di(e.validation,T),_=Cf((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return hg(jc,{children:[hg("div",{className:"question-container",children:[hg(kg,{question:e,forceDisableHtml:i,htmlFor:g}),hg("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),_&&hg("div",{className:"validation-hint",children:_})]}),hg(wg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Ig(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return hg(jc,{children:[hg("div",{className:"question-container",children:hg(kg,{question:e,forceDisableHtml:t.forceDisableHtml})}),hg(wg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function Rg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=kf((()=>it(l)?l:G(l)&&l.length>0&&it(parseInt(l[0]))?parseInt(l[0]):Y(l)&&it(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Xp().isPreviewMode,y=t=>m?o(t):a(t);return hg(jc,{children:[hg("div",{className:"question-container",children:[hg(kg,{question:i,forceDisableHtml:r}),hg("div",{className:"rating-section",children:[hg("div",{className:"rating-options",children:["emoji"===i.display&&hg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Dg[i.scale])?void 0:e.map(((t,e)=>hg("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&hg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:$g(i.scale).map(((t,e)=>hg(Pg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&hg("div",{className:"rating-text",children:[hg("div",{children:i.lowerBoundLabel}),hg("div",{children:i.upperBoundLabel})]})]})]}),hg(wg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:tt(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Pg(t){var e=t.num,i=t.setActiveNumber;return hg("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function Ag(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,a=t.onPreviewSubmit,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=xf(null),d=Cf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Zp(e,Gp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=kf((()=>((t,e)=>Y(t)||Mg(t)?t:e===zf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=kf((()=>((t,e)=>{if(Y(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Mg(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(o,d))),m=g[0],y=g[1],b=Xp().isPreviewMode,_=e.type===zf.SingleChoice,w=e.type===zf.MultipleChoice,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(_)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),b&&a(t)));w&&G(c)&&(c.includes(t)?f(c.filter((e=>e!==t))):f([...c,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>p({},t,{inputValue:e}))),_&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),_&&f(null))},T=()=>!(e.optional||!tt(c)&&(!G(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?G(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return hg(jc,{children:[hg("div",{className:"question-container",children:[hg(kg,{question:e,forceDisableHtml:i}),hg("fieldset",{className:"multiple-choice-options limit-height",children:[hg("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),d.map(((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,a=s+"Open",o=n?m.isSelected:_?c===t:G(c)&&c.includes(t);return hg("label",{className:n?"choice-option-open":"",children:[hg("div",{className:"response-choice",children:[hg("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),hg("span",{children:n?t+":":t})]}),n&&hg("input",{type:"text",ref:h,id:a,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),hg(wg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var Fg=[1,2,3,4,5],Og=[1,2,3,4,5,6,7],Lg=[0,1,2,3,4,5,6,7,8,9,10],Dg={2:[gg,mg],3:[cg,vg,dg],5:[fg,cg,vg,dg,pg]};function $g(t){switch(t){case 5:default:return Fg;case 7:return Og;case 10:return Lg}}var Ng=Ji("[Surveys]");function qg(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?Uf.End:s;if(n.branching.type===Uf.End)return Uf.End;if(n.branching.type===Uf.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Uf.ResponseBased){if(n.type===zf.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Uf.End?Uf.End:s}}else if(n.type===zf.Rating){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===Uf.End?Uf.End:s}}return s}return Ng.warn("Falling back to next question index due to unexpected branching type"),s}var jg=Ji("[SurveyTranslations]");function Bg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=So(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?So(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=So(r);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(us):void 0,locale:Ko()},jg)}(e);if(!i)return jg.info("No user language detected"),{survey:t,language:null};var r=Mo(t,i,jg);return{survey:r.survey,language:r.matchedKey}}var Hg=-1,zg=t,Ug=r,Wg="ph:show_survey_widget",Vg="PHWidgetSurveyClickListener";function Gg(t,e){try{var i=t.getBoundingClientRect(),r=zg.innerHeight,n=zg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:Np.zIndex}}catch(t){return Qf.warn("Failed to calculate trigger position:",t),null}}class Zg{constructor(t){var e=this;this.ui=new Map,this.li=new Map,this.hi=new Map,this.ci=new Set,this.di=null,this.vi=!1,this.fi=null,this.pi=null,this.gi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(vs);if(t)for(var e of t)sg(e)&&Vp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,a,o,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.mi(t),v=d.survey,c=d.language;e.di=c,e.gi=null,e.yi=i;var f=e.bi(v,i);e.wi(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.ki(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.Si(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===jf.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Ug.querySelector(f.appearance.widgetSelector);k&&(_=Gg(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||Np.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Hp(f,e._posthog).shadow;e.hi.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.xi,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(e.gi=C,0>=S)return e.vi=!0,of(hg(Xg,p({},C)),x);var T=()=>{if(!e.Ci(f))return Qf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.xi(f);(()=>{e.vi=!0;var r=e.mi(t),n=r.survey,s=r.language;e.di=s;var a=e.bi(n,i),o=p({},C,{survey:a,surveyLanguage:s});e.gi=o,of(hg(Xg,p({},o,{survey:p({},a,{appearance:p({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},M=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,E=it(M)?Math.max(0,Date.now()-M):0,I=Math.max(0,1e3*S-E);if(0>=I)return T();var R=zg.setTimeout((()=>{e.ui.delete(f.id),T()}),I);e.ui.set(f.id,R)}},this.Mi=t=>{var e=this.mi(t),i=e.survey,r=e.language,n=Hp(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.hi.set(s,s.host),a&&of(hg(em,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Ti=t=>{var e=this.li.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Vg),this.li.delete(t),Qf.info("Removed click listener for survey "+t))},this.Ii=t=>{this.Ri(t)||(this.Ai(t),this.Ti(t.id))},this.Ri=t=>{try{var e,i=Ug.querySelector(og(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ei=(t,e)=>{var i=Ug.querySelector(e),r=this.li.get(t.id);if(i){if(this.Mi(t),r){if(i===r.element)return;Qf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Ti(t.id)}if(!i.hasAttribute(Vg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===jf.NextToTrigger?Gg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Np.maxWidth)):{};zg.dispatchEvent(new CustomEvent(Wg,{detail:{surveyId:t.id,position:n}}))};ar(i,"click",n),i.setAttribute(Vg,"true"),this.li.set(t.id,{element:i,listener:n,survey:t}),Qf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Ii(t)},this.renderPopover=t=>{var e=this.mi(t),i=e.survey,r=e.language,n=Hp(i,this._posthog).shadow;this.hi.set(n,n.host),of(hg(Xg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.xi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.mi(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.Li(s,a,i)),of(hg(Xg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.xi,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.Ci(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Hf.Popover||t.type===Hf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.ui.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Oi(i),a=new Set;s.forEach((t=>{if(t.type===Hf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===qf.Tab)return void e.Mi(t);(null==(r=t.appearance)?void 0:r.widgetType)===qf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Ei(t,null==(s=t.appearance)?void 0:s.widgetSelector))}tt(e.Di)&&t.type===Hf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.li.forEach((t=>{var i=t.survey;a.has(i.id)||e.Ii(i)}))}),t)},this.Si=t=>{tt(this.Di)||Qf.error("Survey "+this.Di+" already in focus. Cannot add survey "+t.id+"."),this.Di=t.id},this.xi=t=>{this.Di!==t.id&&Qf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.wi(t.id),this.Di=null,this.di=null,this.vi=!1,this.gi=null,this.yi=void 0,this.Ai(t)},this._posthog=t,this.Di=null,this.fi=()=>this.Pi(),ar(zg,"languagechange",this.fi),this.pi=t.onFeatureFlags((()=>this.Pi()))}Pi(){if(!tt(this.Di)){var t=this._posthog.get_property(vs),e=null==t?void 0:t.find((t=>t.id===this.Di));if(e){var i=this.mi(e),r=i.survey,n=i.language;if(n!==this.di&&(this.di=n,this.vi)){var s=this.bi(r,this.yi),a=Hp(s,this._posthog).shadow;of(hg(Xg,p({},this.gi,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.xi,surveyLanguage:n})),a)}}}}get Ni(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,sp))&&void 0!==t?t:this._posthog.featureFlags}bi(t,e){return null!=e&&e.position||null!=e&&e.selector?p({},t,{appearance:p({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}wi(t){var e=this.ui.get(t);e&&(clearTimeout(e),this.ui.delete(t))}cancelSurvey(t){this.ui.has(t)&&(Qf.info("Cancelled pending survey "+t),this.wi(t),this.Di===t&&(this.Di=null,this.di=null,this.vi=!1,this.gi=null,this.yi=void 0))}setAutomaticDisplayDispose(t){this.Fi=t}dispose(){var t;null==(t=this.Fi)||t.call(this),this.Fi=void 0,this.fi&&(zg.removeEventListener("languagechange",this.fi),this.fi=null),this.pi&&(this.pi(),this.pi=null),this.ui.forEach(((t,e)=>this.wi(e))),this.li.forEach(((t,e)=>this.Ti(e))),this.hi.forEach(((t,e)=>{of(null,e),null==t||t.remove()})),this.hi.clear(),this.Di=null}Oi(t){return t.sort(((t,e)=>{var i,r,n=sg(t),s=sg(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===Wf,o=e.schedule===Wf;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}mi(t){return Bg(t,this._posthog)}Li(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};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!K(l)){var u=decodeURIComponent(o),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(zg.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Qf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.qi(t,n,e);return!!s&&(this.ji(t,s,i,e),this.ci.add(t.id),s.isSurveyCompleted)}ji(t,e,i,r){var n=e.responses,s=e.submissionId,a=e.isSurveyCompleted,o=e.skippedResponses;(Object.keys(o).length>0&&t.enable_partial_responses||a)&&zp({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}ki(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=G(a)?a.map(String):[String(a)]}Qf.info("[Survey] Processing initial responses");var o=this.qi(t,n,r);return!!o&&(this.ji(t,o,i,r),o.isSurveyCompleted)}qi(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=bo(t.id);try{switch(t.type){case zf.SingleChoice:if(!t.choices||0===t.choices.length)return void Qi.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Qi.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case zf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Qi.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Qi.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Qi.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case zf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Qi.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Qi.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Qi.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return Qf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=vp(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=bo(l.id);K(i[u])||(n[u]=i[u])}s.push(r);var h=qg(t,r,l.id?i[bo(l.id)]:null);if(h===Uf.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),o=a.startQuestionIndex,l=a.skippedResponses,u=a.skippedIndices,h=o>=t.questions.length;return rg(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Qp(t.questions),visitedIndices:u,surveyLanguage:i}),Qf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Qf.error("[Survey Prefill] Error handling prefill:",t),null}}Bi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Ni,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}Hi(e){return!e.conditions||eg(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,a;if(!e||0===e.length)return!0;if(!u)return!1;var o=Me(u,{userAgentDataPlatform:null==i||null==(n=i.userAgentData)?void 0:n.platform,maxTouchPoints:null==i?void 0:i.maxTouchPoints,screenWidth:null==t||null==(s=t.screen)?void 0:s.width,screenHeight:null==t||null==(a=t.screen)?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return Ao[null!=r?r:"icontains"](e,[o])}(null==(r=e.conditions)?void 0:r.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Dp||!Dp.querySelector(t.conditions.selector))}(e)}$i(t){var e;return Kp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.Ni)&&e.hasLoadedFlags?{satisfied:this.Bi(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(!Jf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!rp.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.Bi(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.Bi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.$i(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,bp.ni("lastSeenSurveyDate"))?(t=>!!bp.ni(ep(t))&&!Kp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=a.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.Ui(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Ui(t){var e;if(!Eo(t)&&!Kf(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}zi(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.Bi(e)}))}Ci(t){return this.checkSurveyEligibility(t).eligible&&this.Hi(t)&&this.Ui(t)&&this.zi(t)}Ai(t){try{var e=Ug.querySelector(og(t,!0));null!=e&&e.shadowRoot&&(of(null,e.shadowRoot),this.hi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Qf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Si,removeSurveyFromFocus:this.xi,surveyInFocus:this.Di,surveyTimeouts:this.ui,handleWidget:this.Mi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ei,sortSurveysByAppearanceDelay:this.Oi,checkFlags:this.zi.bind(this),isSurveyFeatureFlagEnabled:this.Bi.bind(this),onLanguageChange:this.Pi.bind(this),currentLanguage:this.di,surveyIsRendered:this.vi}}}function Qg(t,e){if(Ug&&zg){var i,r=new Zg(t);if(t.config.disable_surveys_automatic_display)return Qf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Qf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{K(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{K(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Ug.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return ar(Ug,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Ug.removeEventListener("visibilitychange",a)})),r}}function Jg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;Sf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Hf.Widget,s=eg(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===qf.Tab&&i;if(!s)return Qf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Qf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};ar(zg,"popstate",i),ar(zg,"hashchange",i);var s=zg.history.pushState,l=zg.history.replaceState;return zg.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()},zg.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()},()=>{zg.removeEventListener("popstate",i),zg.removeEventListener("hashchange",i),zg.history.pushState=s,zg.history.replaceState=l}}}),[a,e,r,n,o])}var Kg=200;function Yg(t){switch(void 0===t&&(t=Bf.Right),t){case Bf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Bf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Bf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Xg(t){var e,i,r,n,s,a,o,l,u,h,d,v,c=t.survey,f=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,E=t.onPopupSurveyDismissed,I=void 0===E?()=>{}:E,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=xf(null),N=Number.isInteger(b),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,a,o,l){var u=kf(r||0===i||t.type===Hf.ExternalSurvey),h=u[0],d=u[1],v=kf(!1),c=v[0],f=v[1],g=xf(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Kg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Kg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Sf((()=>{if(e){if(!r){var n,s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();f(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(eg(t,e)){d(!0),zg.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Vf.SHOWN,p({[Gf.SURVEY_NAME]:t.name,[Gf.SURVEY_ID]:t.id,[Gf.SURVEY_ITERATION]:t.current_iteration,[Gf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Gf.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};ar(zg,"PHSurveyClosed",y),ar(zg,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return K(u)&&a(),()=>{K(u)||clearTimeout(u),K(n)||clearTimeout(n),zg.removeEventListener("PHSurveyClosed",y),zg.removeEventListener("PHSurveySent",s)}}}else Qf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Jg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,q,N,w,S,D,O,L),B=j.isPopupVisible,H=j.hidePopupWithAnimation,z=j.isSurveySent||b===c.questions.length||!0===F,U=kf(!1),W=U[0],V=U[1],G=Cf((()=>!!ng(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?b===Hg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=Cf((()=>{var t=ng(c),e=(null==t?void 0:t.surveySubmissionId)||vp();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Wp(c,g,N,L):Wp(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,I,C,M,A,L]);return B?hg(Yp.Provider,{value:J,children:hg("div",{className:"ph-survey",style:p({},lg(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:z?hg(Cg,{header:(null==(o=c.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(l=c.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!f,contentType:null==(u=c.appearance)?void 0:u.thankYouMessageDescriptionContentType,appearance:c.appearance||Np,onClose(){H(),P()}}):Q?hg(Tg,{header:(null==(h=c.appearance)?void 0:h.introScreenHeader)||"",description:(null==(d=c.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!f,contentType:null==(v=c.appearance)?void 0:v.introScreenDescriptionContentType,appearance:c.appearance||Np,onStart:()=>V(!0)}):hg(tm,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function tm(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=Cf((()=>{var t=ng(r);if(!t)return null;var e=it(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(ag(r),null)}),[r]),o=kf((()=>(null!=a&&a.responses&&Qf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=Tf(Yp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,b=h.properties,_=h.surveyLanguage,w=kf((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=it(t)&&t>=0&&r.questions.length>t?t:0;return it(d)&&d>=0?d:e})),k=w[0],S=w[1],x=kf((()=>{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=kf((()=>{var t,e=ng(r);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),E=M[0],I=M[1],R=Cf((()=>Qp(Jp(r,a))),[r.id,a]),P=Cf((()=>{if(!R||new Set(R).size!==R.length)return Jp(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]);Sf((()=>{!y||K(d)||0>d||S(d)}),[d,y]);var A=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),F=P.at(k);return F?hg("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&hg(Sg,{onClick(){v()}}),hg("div",{className:"survey-box","data-question-index":k,children:im({question:F,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||Np,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var a=bo(n),o=p({},l,{[a]:e});u(o);var h=P[i],d=null!=h&&h.id?p({},E,{[h.id]:h.question}):E;I(d);var v=qg(r,i,e),c=v===Uf.End,f=[...C,i];if(c||(T(f),S(v),rg(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:v,questionOrder:Qp(P),visitedIndices:f,surveyLanguage:_,questionSnapshots:d})),r.enable_partial_responses||c){var g=new Set(f.map((t=>{var e;return null==(e=P[t])?void 0:e.id})).filter((t=>!!t)).map((t=>bo(t)))),y=Object.fromEntries(Object.entries(o).filter((t=>g.has(t[0]))));zp({responses:y,survey:r,surveySubmissionId:m,isSurveyCompleted:c,posthog:s,properties:b,surveyLanguage:_,questionSnapshots:d})}}else Qf.error("onNextButtonClick called without a questionId.");else Qf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:f,initialValue:F.id?l[bo(F.id)]:void 0,canGoBack:A,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),rg(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:Qp(P),visitedIndices:e,surveyLanguage:_,questionSnapshots:E})}}})})]}):null}function em(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=kf(!0),f=c[0],p=c[1],g=kf(!1),m=g[0],y=g[1],b=kf({}),_=b[0],w=b[1],k=xf(void 0),S=()=>{y(!m)};if(Sf((()=>{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&&(Qf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return ar(zg,Wg,e),()=>{K(k.current)||(clearTimeout(k.current),k.current=void 0),zg.removeEventListener(Wg,e)}}}else Qf.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]),Jg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Wf&&p(!1),K(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return hg(jc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&hg("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Bf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:Yg(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&hg(Xg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var im=t=>{var e=t.question,i=t.onSubmit,r=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){r(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case zf.Open:return Nc(Eg,p({},n,{question:e,key:e.id}));case zf.Link:return Nc(Ig,p({},n,{question:e,key:e.id}));case zf.Rating:return Nc(Rg,p({},n,{question:e,key:e.id}));case zf.SingleChoice:case zf.MultipleChoice:return Nc(Ag,p({},n,{question:e,key:e.id}));default:return Qf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=Qg,v.extendPostHogWithSurveys=Qg;var rm=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},nm=1e4,sm=(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),am=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return sm(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 a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return sm(e,JSON.stringify(t.slice(0,n)),i)},om=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,lm=(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}},um=(t,e,i)=>{if(!i.truncated)if(Q(t)){if(i.seen.has(t))return void lm(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(um(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else lm(e,t,i)},hm=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!om(t))return!n||sm(e,"null",i);if(tt(t)||(t=>{try{return it(t)||nt(t)}catch(t){return!1}})(t))return sm(e,JSON.stringify(t),i);if("string"==typeof t)return am(t,e,i);if(!Q(t)&&!G(t))return sm(e,JSON.stringify(t),i);if(r.has(t))return am("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Z(a))return hm(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return am(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return sm(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 hm(l,e,i,r,n,s)}if(G(t)){if(!sm(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!sm(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!hm(d,e,i,r,!0))return!1}return sm(e,"]",i)}if(!sm(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{um(f,c,s)}catch(t){}if(om(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(!sm(e,p,i))return!1;var b=e.length,_=hm(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 sm(e,"}",i)},dm=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Q(t[0])?{result:{},keysRemaining:50,sizeRemaining:nm,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||sm(i," ",r))&&hm(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)||{}}},vm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},cm=t=>"canCapture"in t,fm=t=>cm(t)?t.canCapture?t.getExtension(ap):void 0:t.is_capturing()?t.logs:void 0;v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:v.location.host},n=!1,s=function(t){var s=v.console[t];i.push(Uv(v.console,t,(i=>{var a=(i=>function(){for(var s=!1,a=arguments.length,o=new Array(a),l=0;a>l;l++)o[l]=arguments[l];try{var u=e;if(o.length>0&&!n&&u){var h=fm(u);if(h){n=!0,s=!0;var d=dm(o,nm),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(cm(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;Z(n)&&n.call(e,i)}})(u,h,{level:vm[t],body:c,attributes:p({"log.source":"console."+t},g,f)})}}}catch(t){}finally{s&&(n=!1),i.apply(v.console,o)}})(i);return a.__rrweb_original__=rm(s),a})))};for(var a of Object.keys(vm))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=fm(t);if(i)for(var r of e)try{var n=dm(r.args,nm);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:vm[r.level],body:n.body,attributes:p({"log.source":"console."+r.level,host:v.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var pm=Ji("[Error tracking]"),gm="webkit-masked-url:",mm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",gm],ym=["__firefox__","__gCrWeb"];function bm(){return new gi([new Ii,new qi,new Pi,new Ri,new $i,new Di,new Fi,new Ni],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 n=[],s=e.split("\n"),a=r;s.length>a;a++){var o=s[a];if(1024>=o.length){var l=Mi.test(o)?o.replace(Mi,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,t);if(h){n.push(h);break}}if(n.length>=Ei)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Ei).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||mi});var i}))}(n)}}("web:javascript",Si,Ti))}var _m=Ji("[ExceptionAutocapture]"),wm=bm(),km=e=>{var i=t;i||_m.info("window not available, cannot wrap onerror");var r=i.onerror;return i.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var a=wm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Y(e)&&Y(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}});return e(a),!!Z(r)&&null!==(t=r(...n))&&void 0!==t&&t},i.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onerror)||delete t.__POSTHOG_INSTRUMENTED__,i.onerror=r}},Sm=function(e,i){void 0===i&&(i=!1);var r=t;r||_m.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=wm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),Z(n)?null!==(r=n(t))&&void 0!==r&&r:i},r.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,r.onunhandledrejection=n}},xm={wrapOnError:km,wrapUnhandledRejection:Sm,wrapConsoleError(t){var e=console;e||_m.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var a=n.find((t=>t instanceof Error)),o=wm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Z(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.errorWrappingFunctions=xm,v.posthogErrorWrappingFunctions=xm;var Cm=(t,e)=>{if(Z(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!tt(i)&&"object"==typeof i&&G(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){_m.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){_m.error("Failed to capture exception for a legacy client",t)}};km((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),Sm(n,!0)}};v.extendPostHogWithExceptionAutoCapture=Cm,v.extendPostHogWithExceptionAutocapture=Cm;var Tm="X-POSTHOG-SESSION-ID",Mm="X-POSTHOG-WINDOW-ID",Em="X-POSTHOG-DISTINCT-ID",Im=[Tm,Mm,Em],Rm=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Pm=(t,e)=>({}.hasOwnProperty.call(t,e)),Am=t=>"object"==typeof t&&!tt(t)||Z(t),Fm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Om=e=>{try{var i;return Fm(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(i=t.location)?void 0:i.href).toString()}catch(t){return}},Lm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(G(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(Tm,o.sessionId),n.set(Mm,l),a=!0}var u=(t=>Z(t)?t():t)(e);return u&&u!==Is&&(n.set(Em,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Dm={_patchFetch:(e,i,r)=>Uv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=Om(n);if(l)if(Fm(n)){var u=new Request(n,s);Lm(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(Am(s)?s.headers:void 0);if(Lm(e,i,r,l,h)){var d=((t,e)=>{if(K(t)||tt(t))return{headers:e};if(Am(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))),Rm.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&&Rm.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?p({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(s,h);d&&(o=[n,d])}}}catch(t){o=a}return t.apply(this,o)})),_patchXHR:(e,i,r)=>Uv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=Om(s);d&&Lm(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return Im.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Dm,v.postHogTracingHeadersPatchFns=Dm,"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});let $m=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)}}};var Nm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},qm=t=>{if("loading"===document.readyState)return"loading";var e=Nm();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"},jm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Bm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[jm(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},Hm=new WeakMap;function zm(t,e){var i=Hm.get(e);return i||(i=new WeakMap,Hm.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Um=-1,Wm=()=>Um,Vm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Um=e.timeStamp,t(e))}),!0)},Gm=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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()))))},Qm=()=>{var t,e;return null!==(t=null==(e=Nm())?void 0:e.activationStart)&&void 0!==t?t:0},Jm=-1,Km=new Set,Ym=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Xm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Km)e();isFinite(Jm)||(Jm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Xm,!0))}},ty=function(t){if(void 0===t&&(t=!1),t&&(Jm=1/0),0>Jm){var e,i=Qm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Jm=null!=r?r:Ym(),addEventListener("visibilitychange",Xm,!0),addEventListener("prerenderingchange",Xm,!0),Vm((()=>{setTimeout((()=>{Jm=Ym()}))}))}return{get firstHiddenTime(){return Jm},onHidden(t){Km.add(t)}}},ey=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Nm(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Wm()?o&&(document.prerendering||Qm()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},iy=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=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 s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},ry=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},ny=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},sy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class ay{constructor(){this.u=void 0}}var oy,ly=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},uy=[1800,3e3],hy=function(t,e){void 0===e&&(e={});var i=ry(e);ly((()=>{var r,n=zm(e,ay),s=ty(),a=ey("FCP"),o=iy(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Qm(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Gm(t,a,uy,e.reportAllChanges),Vm((i=>{a=ey("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Wm()),r=Gm(t,a,uy,e.reportAllChanges),Zm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&iy(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&ny(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=ey("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Gm(t,a,uy,e.reportAllChanges))(!0)}))}),e)}))},dy=[.1,.25],vy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],cy=function(t,e){void 0===e&&(e={});var i=zm(e=Object.assign({},e),$m),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=vy(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:Bm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=ty();hy(sy((()=>{var r,n=ey("CLS",0),s=zm(e,$m),a=(i,a,o,l,u)=>{n=ey("CLS",0,i,a,o,l,u),s.o=0,r=Gm(t,n,dy,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];ry(e)&&h.push("soft-navigation");var d=iy(h,u);d&&(r=Gm(t,n,dy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Vm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Wm()),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=vy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:qm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},fy=function(t,e){void 0===e&&(e={});var i=zm(e=Object.assign({},e),ay);ry(e)&&(i.u=new Map),hy((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:qm(Wm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Nm(),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:qm(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},py=0,gy=1/0,my=0,yy=t=>{for(var e of t)e.interactionId&&(gy=Math.min(gy,e.interactionId),my=Math.max(my,e.interactionId),py=my?(my-gy)/7+1:0)},by=()=>{var t;return oy?py:null!==(t=performance.interactionCount)&&void 0!==t?t:0};let _y=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return by()-this.h}D(){this.h=by(),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){var s=this.v.splice(10);for(var a of s)this.p.delete(a.id)}null==(n=this.M)||n.call(this,r)}}}};var wy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=sy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},ky=[200,500],Sy=function(t,e){void 0===e&&(e={});var i=zm(e=Object.assign({},e),_y),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(wy(h),l=!0)},h=()=>{var t=new Set(i.v.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];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||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&a.set(t,i),u()},i.M=t=>{if(!o.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:Bm(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(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};iy(["long-animation-frame"],(t=>{r=r.concat(t),u()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=ty();ly((()=>{var r;"interactionCount"in performance||oy||(oy=iy(["event"],yy,{durationThreshold:0}));var n,s=ey("INP"),a=zm(e,_y),o=(i,r,o,l,u)=>{a.D(),s=ey("INP",-1,i,r,o,l,u),n=Gm(t,s,ky,e.reportAllChanges)},l=()=>{var t=a.S(s.navigationType);t&&t.k!==s.value&&(s.value=t.k,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),wy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];ry(e)&&d.push("soft-navigation");var v=iy(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Gm(t,s,ky,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Vm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Wm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:qm(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),l=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,l),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),v=d(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:o.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:l,processedEventEntries:h,longAnimationFrameEntries:v,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:l-u,loadState:qm(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,a=t.inputDelay,o=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+a>c.startTime?"input-delay":i+a+o>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+a+o&&(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)};let xy=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],Cy=50,Ty=[];iy(["resource"],(t=>{for(var e of t)Ty.push(e),Ty.length>Cy&&Ty.shift()}));var My=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(Cy=e.resourceBufferSize);var i=zm(e,xy),r=new WeakMap;ry(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:Bm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=ry(e);ly((()=>{var n,s=ty(),a=ey("LCP"),o=zm(e,xy),l=(r,o,l,u,h)=>{a=ey("LCP",-1,r,o,l,u,h),n=Gm(t,a,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=ty(!0))},u=t=>{o.u&&t.navigationId&&ny(o.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-Qm(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=iy(d,h);if(v){n=Gm(t,a,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;wy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Vm((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Wm()),n=Gm(t,a,$,e.reportAllChanges),Zm((()=>{a.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 n,s,a,o,l,u,h=t.entries.at(-1),d=h.url&&(Ty.findLast((t=>t.name===h.url))||performance.getEntriesByType("resource").findLast((t=>t.name===h.url)));e.target=r.get(h),e.lcpEntry=h,h.url&&(e.url=h.url),d&&(e.lcpResourceEntry=d);var v=0,c=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(s=u=Nm())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(a=null==(o=u)?void 0:o.responseStart)&&void 0!==a?a:0):(v=t.navigationStartTime||0,u=null==(l=i.u)?void 0:l.get(t.navigationId)),u){var f=Math.max(0,c-v),g=Math.max(f,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=p({},e,{timeToFirstByte:f,resourceLoadDelay:g-f,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))}),e)},Ey=-1,Iy=()=>Ey,Ry=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ey=e.timeStamp,t(e))}),!0)},Py=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||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))}},Ay=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Fy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Oy=()=>{var t,e;return null!==(t=null==(e=Fy())?void 0:e.activationStart)&&void 0!==t?t:0},Ly=-1,Dy=new Set,$y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Ny=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Dy)e();isFinite(Ly)||(Ly="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Ny,!0))}},qy=function(t){if(void 0===t&&(t=!1),t&&(Ly=1/0),0>Ly){var e,i=Oy(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Ly=null!=r?r:$y(),addEventListener("visibilitychange",Ny,!0),addEventListener("prerenderingchange",Ny,!0),Ry((()=>{setTimeout((()=>{Ly=$y()}))}))}return{get firstHiddenTime(){return Ly},onHidden(t){Dy.add(t)}}},jy=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Fy(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Iy()?o&&(document.prerendering||Oy()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.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==o?void 0:o.name),navigationStartTime:a||0}},By=new WeakMap;function Hy(t,e){var i=By.get(e);return i||(i=new WeakMap,By.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class zy{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)}}}var Uy=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=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 s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},Wy=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},Vy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Gy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Zy{constructor(){this.l=void 0}}var Qy,Jy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Ky=[1800,3e3],Yy=function(t,e){void 0===e&&(e={});var i=Wy(e);Jy((()=>{var r,n=Hy(e,Zy),s=qy(),a=jy("FCP"),o=Uy(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Oy(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Py(t,a,Ky,e.reportAllChanges),Ry((i=>{a=jy("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Iy()),r=Py(t,a,Ky,e.reportAllChanges),Ay((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Uy(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Vy(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=jy("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Py(t,a,Ky,e.reportAllChanges))(!0)}))}),e)}))},Xy=[.1,.25],tb=function(t,e){void 0===e&&(e={});var i=qy();Yy(Gy((()=>{var r,n=jy("CLS",0),s=Hy(e,zy),a=(i,a,o,l,u)=>{n=jy("CLS",0,i,a,o,l,u),s.i=0,r=Py(t,n,Xy,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("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);o()},h=["layout-shift"];Wy(e)&&h.push("soft-navigation");var d=Uy(h,u);d&&(r=Py(t,n,Xy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Ry((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Iy()),Ay(r)})),setTimeout(r))})))},eb=0,ib=1/0,rb=0,nb=t=>{for(var e of t)e.interactionId&&(ib=Math.min(ib,e.interactionId),rb=Math.max(rb,e.interactionId),eb=rb?(rb-ib)/7+1:0)},sb=()=>{var t;return Qy?eb:null!==(t=performance.interactionCount)&&void 0!==t?t:0};class ab{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return sb()-this.u}M(){this.u=sb(),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){var s=this.v.splice(10);for(var a of s)this.m.delete(a.id)}null==(n=this.T)||n.call(this,r)}}}}var ob=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Gy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},lb=[200,500],ub=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=qy();Jy((()=>{var r;"interactionCount"in performance||Qy||(Qy=Uy(["event"],nb,{durationThreshold:0}));var n,s=jy("INP"),a=Hy(e,ab),o=(i,r,o,l,u)=>{a.M(),s=jy("INP",-1,i,r,o,l,u),n=Py(t,s,lb,e.reportAllChanges)},l=()=>{var t=a.L(s.navigationType);t&&t.P!==s.value&&(s.value=t.P,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),ob((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Wy(e)&&d.push("soft-navigation");var v=Uy(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Py(t,s,lb,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Ry((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Iy())})))}))}};class hb{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}}var db=[2500,4e3],vb=function(t,e){void 0===e&&(e={});var i=!1,r=Wy(e);Jy((()=>{var n,s=qy(),a=jy("LCP"),o=Hy(e,hb),l=(r,o,l,u,h)=>{a=jy("LCP",-1,r,o,l,u,h),n=Py(t,a,db,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=qy(!0))},u=t=>{o.l&&t.navigationId&&Vy(o.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-Oy(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Uy(d,h);if(v){n=Py(t,a,db,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;ob((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Ry((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Iy()),n=Py(t,a,db,e.reportAllChanges),Ay((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},cb={onLCP:My,onCLS:cy,onFCP:fy,onINP:Sy,withoutAttribution:{onLCP:vb,onCLS:tb,onFCP:Yy,onINP:ub}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=cb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=cb,v.postHogWebVitalsCallbacks=cb;var fb={onLCP:vb,onCLS:tb,onFCP:Yy,onINP:ub};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=fb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=fb,v.postHogWebVitalsCallbacks=fb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>fb;var pb={onLCP:My,onCLS:cy,onFCP:fy,onINP:Sy,withoutAttribution:{onLCP:vb,onCLS:tb,onFCP:Yy,onINP:ub}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=pb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=pb,v.postHogWebVitalsCallbacks=pb;var gb={onLCP:vb,onCLS:tb,onFCP:Yy,onINP:ub};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=gb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=gb,v.postHogWebVitalsCallbacks=gb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>gb;class mb{constructor(t){this.disabled=!1===t;var e=Q(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}}var yb="$copy_autocapture",bb=Ji("[AutoCapture]");function _b(t,e){return e.length>t?e.slice(0,t)+"...":e}function wb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!xr(e));return e}function kb(e,i){var r,n,s=i.e,a=i.maskAllElementAttributes,o=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!xr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!Cr(c,"body")&&Er>d.length;)if(Mr(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!xr(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var g,m,y=[],b={},_=!1,w=!1;if(Yi(d,(t=>{var e=Zr(t);if(Cr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&nn(i))&&(h?Pe(i):i)}j(Pr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Lr.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?_b(1024,sn(t)):_b(1024,Fr(t)));var o=Pr(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),Yi(t.attributes,(function(i){var s;if((!Qr(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&nn(i.value)&&(!Y(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=Ir(o).join(" ")),a["attr__"+i.name]=_b(1024,"href"===i.name&&n?Pe(o):o)}}));for(var l=1,u=1,h=t;h=wb(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!Zr(t))return{};var e={};return Yi(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&&nn(r)&&(e[i]=r)}})),e}(t);Yi(r,((t,e)=>{({}).hasOwnProperty.call(b,e)||(b[e]=t)}))})),w)return{props:{},explicitNoCapture:w};if(o||(y[0].$el_text=Cr(e,"a")||Cr(e,"button")?sn(e):Fr(e)),_){var k,S;y[0].attr__href=_;var x=null==(k=hr(_))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=_)}return{props:Xi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,G(m)?function(t){var e=t.map((t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=p({},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 tr(s).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[on(t[0].toString())]=on(e.toString())})),(r+=":")+tr(a).map((t=>t[0]+'="'+t[1]+'"')).join("")}));return e.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:ln(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return tr(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(m)):"")},null!=(r=y[0])&&r.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},b)}}class Sb{constructor(t){this.name="autocapture",this.Is=!1,this.Rs=null,this.Ps=!1,this.As=!1,this.gn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Fs=!1,this.Os=t,this.Os.refresh(this.gn),this.rageclicks=new mb(this.gn.rageclick),this.Ls=null}setup(t){this.Ds(),this.$s=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Fs?e.dispose():(this.Ns=e,this.startIfEnabled())}dispose(){var t;this.Fs||(this.Fs=!0,this.$s=void 0,null==(t=this.Ns)||t.dispose(),this.Ns=void 0,this.qs())}js(){return this.Os.refresh(this.gn),this.gn}Ds(){var t,e;return this.js(),this.gn.url_allowlist=null==(t=this.gn.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.gn.url_ignorelist=null==(e=this.gn.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.gn}Bs(){if(this.isBrowserSupported()){if(t&&r){var e=this.Hs=e=>{e=e||(null==t?void 0:t.event);try{this.zs(e)}catch(t){bb.error("Failed to capture event",t)}};if(ar(r,"submit",e,{capture:!0}),ar(r,"change",e,{capture:!0}),ar(r,"click",e,{capture:!0}),this.js().capture_copied_text){var i=this.Us=e=>{e=e||(null==t?void 0:t.event);try{this.zs(e,yb)}catch(t){bb.error("Failed to capture clipboard event",t)}};ar(r,"copy",i,{capture:!0}),ar(r,"cut",i,{capture:!0}),ar(r,"paste",i,{capture:!0})}}}else bb.info("Disabling Automatic Event Collection because this browser is not supported")}qs(){this.Hs&&(null==r||r.removeEventListener("submit",this.Hs,!0),null==r||r.removeEventListener("change",this.Hs,!0),null==r||r.removeEventListener("click",this.Hs,!0),this.Hs=void 0),this.Us&&(null==r||r.removeEventListener("copy",this.Us,!0),null==r||r.removeEventListener("cut",this.Us,!0),null==r||r.removeEventListener("paste",this.Us,!0),this.Us=void 0),this.Is=!1}startIfEnabled(){!this.Fs&&this.$s&&this.isEnabled&&!this.Is&&(this.Bs(),this.Is=!0)}onRemoteConfig(t){if(!this.Fs)if(this.Ps=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.As=e.elementsChainAsString);var i,r=e.autocapture_opt_out;nt(r)&&(null==(i=this.$s)||i.kv.set(En,r),this.Rs=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Ls=t}getElementSelectors(t){var e,i=[];return null==(e=this.Ls)||e.forEach((e=>{var n=null==r?void 0:r.querySelectorAll(e);null==n||n.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e;if(this.Fs)return!1;var i=null==(t=this.$s)?void 0:t.kv.get(En),r=this.Rs,n=this.js(),s=n.remoteRequestsDisabled&&!this.Ps;if(tt(r)&&!nt(i)&&!s)return!1;var a=null!==(e=this.Rs)&&void 0!==e?e:!!i;return!!n.enabled&&!a}zs(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Or(e);Tr(r)&&(r=r.parentNode||null);var n,s=this.Ds();"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Wr(r,s.rageclick)&&this.zs(e,"$rageclick");var a=i===yb,o=a?p({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,i,r,n,s,a){var o;if(!t||Vr(e))return!1;if(null!=r&&r.url_allowlist&&!Rr(r.url_allowlist,a))return!1;if(null!=r&&r.url_ignorelist&&Rr(r.url_ignorelist,a))return!1;if(null!=r&&r.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>i.type===t)))return!1}var u=Gr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(K(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,r))return!1;if(!Dr(d,null==r?void 0:r.css_selector_allowlist))return!1;if(Dr(d,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Nr))return!1;try{var v=t.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===i.type)return!0}catch(t){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return h?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Lr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,u=kb(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.As,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(h.$element_selectors=d),i===yb){var v=e.type||"clipboard";if("paste"!==v){var c,f,g=null==t||null==(c=t.getSelection())?void 0:c.toString(),m=Ar(g);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!==(f=null==g?void 0:g.length)&&void 0!==f?f:0}h.$copy_type=v}return null==(l=this.$s)||l.capture(i,h).catch((t=>bb.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return Z(null==r?void 0:r.querySelectorAll)}}var xb={};function Cb(e,i){var r=xb[e];if(r)return r;var n=i[e];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return xb[e]=n.bind(i);var s=i.document;if(s&&Z(s.createElement)){var a,o=!1;try{(a=s.createElement("iframe")).hidden=!0,s.head.appendChild(a);var l,u,h=a.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return j(t,"AppleWebKit")&&!j(t,"Chrome")}(null!==(l=null==(u=i.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(a.classList.add("rr-block","ph-no-capture"),o=!0))}catch(t){Qi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!o&&null!=(d=a)&&d.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?xb[e]=n.bind(i):n}function Tb(t,e){var i=Or(t);return i?p({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 Eb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Ib="canvas,video,audio,embed,object",Rb=1e3;function Pb(t,e){return it(t)&&t>=e}function Ab(t){return t>=0&&Rb>t?t:void 0}function Fb(t,e){return e?Ab(t-e):void 0}class Ob{Zi(t){var e,i,r,n,s,a,o,l,u=this.Gi((null==t?void 0:t.__onCapture)||this.Qi.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!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o: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.Ji=[],this.Yi=0,this.Gi=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.Ki=t=>{var e=Tb(t,{type:"click"});tt(e)||this.Xi(e)||this.en(e),this.tn()},this.rn=()=>{var t=Date.now();this.nn=t,t%50==0&&this.Ji.forEach((e=>{K(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.an=()=>{this.sn=Date.now()},this.Wt=()=>{var t=Date.now();this.un=t,this.ln("visibilityChangedDelayMs",t)},this.hn=()=>{var t=Date.now();this.cn=t,this.ln("focusChangedDelayMs",t)},this.dn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.vn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.fn=()=>{this.vn=void 0},this.pn=t=>{var e,i=this.vn;if(this.vn=void 0,!K(i)&&this.gn.max_dead_swipes_per_page_load>this.Yi){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var a=s.clientX-i.x,o=s.clientY-i.y,l=a*a+o*o,u=this.gn.swipe_threshold_px;if(l>=u*u&&![this.nn,this.mn,this.sn].some((t=>it(t)&&t>=i.timestamp))){var h;if(this.yn()&&(null!==(h=null==r||null==r.elementsFromPoint?void 0:r.elementsFromPoint(i.x,i.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(Ib))))return;var d=Tb(n,{type:"swipe",swipeDirection:Mb(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});tt(d)||this.Xi(d)||this.en(d),this.tn()}}}},this.instance=t,this.gn=this.Zi(e),this._onCapture=this.gn.__onCapture}start(t){this.bn(),this.wn(),this.kn(),this._n(),this.Sn(),this.xn(t),this.gn.capture_dead_swipes&&this.Cn()}xn(t){if(!this.Mn){var e=function(t){return Cb("MutationObserver",t)}(v);this.Mn=new e((t=>{this.Tn(t)})),this.Mn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Mn)||t.disconnect(),this.Mn=void 0,v.removeEventListener("click",this.Ki),v.removeEventListener("scroll",this.rn,{capture:!0}),v.removeEventListener("selectionchange",this.an),v.removeEventListener("touchstart",this.dn,{capture:!0}),v.removeEventListener("touchend",this.pn,{capture:!0}),v.removeEventListener("touchcancel",this.fn,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.Wt),v.removeEventListener("blur",this.hn),v.removeEventListener("focus",this.hn),this.vn=void 0}Tn(t){this.mn=Date.now()}bn(){ar(v,"click",this.Ki)}en(t){t.visibilityChangedDelayMs=Fb(t.timestamp,this.un),t.focusChangedDelayMs=Fb(t.timestamp,this.cn),this.Ji.push(t)}tn(){this.Ji.length&&K(this.In)&&(this.In=v.setTimeout((()=>{this.Rn()}),1e3))}wn(){ar(v,"scroll",this.rn,{capture:!0})}kn(){ar(v,"selectionchange",this.an)}_n(){ar(r,"visibilitychange",this.Wt)}Sn(){ar(v,"blur",this.hn),ar(v,"focus",this.hn)}ln(t,e){this.Ji.forEach((i=>{var r=Ab(e-i.timestamp);it(r)&&(K(i[t])||i[t]>r)&&(i[t]=r)}))}Cn(){ar(v,"touchstart",this.dn,{capture:!0,passive:!0}),ar(v,"touchend",this.pn,{capture:!0,passive:!0}),ar(v,"touchcancel",this.fn,{capture:!0,passive:!0})}yn(){var t=K(this.An)||it(this.mn)&&this.mn>this.An;return(K(this.En)||t)&&(this.An=Date.now(),this.En=!(null==r||!r.querySelector(Ib))),!!this.En}Xi(t){return!t||("swipe"===t.type?this.Ln(t):this.On(t))}Ln(e){if(Sr(e.node))return!0;var i=this.Ji.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!Cr(e.node,"html")&&xr(e.node)&&function(e,i){var r;if(!t||Vr(e))return!1;var n=nt(i)?Hr:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Hr;return!Dr(Gr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.gn.css_selector_ignorelist}))}On(e){return!(this.gn.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.Ln(e)||(r=e.node,!(!t||Vr(r))&&Gr(r,!1).targetElementList.some((t=>Cr(t,"a"))));var i,r}Rn(){if(this.Ji.length){clearTimeout(this.In),this.In=void 0;var t=this.Ji;for(var e of(this.Ji=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.mn&&this.mn>=e.timestamp?this.mn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.sn&&this.sn>=e.timestamp?this.sn-e.timestamp:void 0;var r=Pb(e.scrollDelayMs,this.gn.scroll_threshold_ms),n=Pb(e.selectionChangedDelayMs,this.gn.selection_change_threshold_ms),s=Pb(e.mutationDelayMs,this.gn.mutation_threshold_ms),a=Pb(e.absoluteDelayMs,1.1*this.gn.mutation_threshold_ms),o=it(e.scrollDelayMs)&&this.gn.scroll_threshold_ms>e.scrollDelayMs,l=it(e.mutationDelayMs)&&this.gn.mutation_threshold_ms>e.mutationDelayMs,u=it(e.selectionChangedDelayMs)&&this.gn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=it(e.visibilityChangedDelayMs),d=it(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=Eb(e);if("$dead_swipe"===v){if(this.Yi>=this.gn.max_dead_swipes_per_page_load)continue;this.Yi++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.mn,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.gn.mutation_threshold_ms>e.absoluteDelayMs&&this.Ji.push(e)}this.tn()}}Qi(t,e){var i=Eb(t);this.instance.capture(i,p({},e,kb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.gn.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)})}}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Ob(t,e);var Lb=Ji("[ExternalScriptsLoader]"),Db=t=>{var e=null==r?void 0:r.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]},$b=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Lb.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=Db(e);if(n){if(n.__posthog_loading_callback_fired)return i();var s=n.__posthog_loading_error;return s?i(s):(n.addEventListener("load",(t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)})),void n.addEventListener("error",(t=>{n.__posthog_loading_error=t,i(t)})))}var a=()=>{if(!r)return i("document not found");if(Db(e))return $b(t,e,i);var n=r.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)},n.onerror=t=>{n.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(n=t.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(n);else{var s,a=r.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(n,a[0]):r.body.appendChild(n)}};null!=r&&r.body?a():null==r||r.addEventListener("DOMContentLoaded",a)},Nb={},qb=(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)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__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=Nb[n];if("fallback"===r&&s){if(Db(s))return void $b(t,s,i);delete Nb[n]}$b(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=qb(t,e);Nb[n]=o;var l=Db(n);null==l||null==(a=l.parentNode)||a.removeChild(l),$b(t,o,i)}else i(void 0,s)}:i)}else $b(t,qb(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");$b(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);$b(t,r,i)};class jb{constructor(t){this._instance=t}get gn(){return this._instance.config}get consent(){return this.Ws()?0:this.Vs}isOptedOut(){return this.gn.cookieless_mode===Us||this.isRejected()||-1===this.consent&&this.gn.cookieless_mode===zs}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.gn.opt_out_capturing_by_default}optInOut(t){this.Gs.ii(this.Zs,t?1:0,this.gn.cookie_expiration,this.gn.cross_subdomain_cookie,this.gn.secure_cookie)}reset(){this.Gs.ai(this.Zs,this.gn.cross_subdomain_cookie)}get Zs(){var 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 Vs(){var t=this.Gs.ni(this.Zs);return ft(t)?1:j(pt,t)?0:-1}get Gs(){var t=this.gn.opt_out_capturing_persistence_type,e="localStorage"===t?bp:mp,i=e.ri()?e:Pp;if(!this.Qs||this.Qs!==i){this.Qs=i;var r="localStorage"===t?mp:bp;r.ni(this.Zs)&&(this.Qs.ni(this.Zs)||this.optInOut(ft(r.ni(this.Zs))),r.ai(this.Zs,this.gn.cross_subdomain_cookie))}return this.Qs}Ws(){return!!this.gn.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack,null==i?void 0:i.globalPrivacyControl].some((t=>ft(t)))}}var Bb=Ji("[Dead Clicks]"),Hb=()=>!0,zb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(On)),r=t.instance.config.capture_dead_clicks;return nt(r)?r:!!Q(r)||i};class Ub{get lazyLoadedDeadClicksAutocapture(){return this.Js}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({[On]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ks((()=>{this.Ys()})):this.stop()}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Bb.error("failed to load script",e):t()}))}Ys(){var t;if(r){if(!this.Js&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Q(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Js=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Js.start(r),Bb.info("starting...")}}else Bb.error("`document` not found. Cannot start.")}stop(){this.Js&&(this.Js.stop(),this.Js=void 0,Bb.info("stopping..."))}}var Wb=Ji("[SegmentIntegration]");var Vb="posthog-js";function Gb(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,a,l,h,d;if("*"!==o&&!o.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,f=(null==(i=e.exception)?void 0:i.values)||[],g=f.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=f[0])?void 0:a.value)||e.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}class Zb{constructor(t,e,i,r,n,s){this.name=Vb,this.setupOnce=function(a){a(Gb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Qb{constructor(t){this.Xs=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Qi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ta=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.ea()}ea(){var t;this.ia=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Xs)}destroy(){var t;null==(t=this.ia)||t.call(this),this.ia=void 0}doPageView(e,i){var r,n=this.ra(e,i);return this.ta={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(t){var e;return this.ra(t,null==(e=this.ta)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ta)?void 0:t.pageViewId}}ra(t,e){var i=this.ta;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,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(K(s)||K(a)||K(o)||K(l)||K(u)||K(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?gt(a/s,0,1,Qi):1,v=s>1?gt(o/s,0,1,Qi):1,c=l>1?gt(u/l,0,1,Qi):1,f=l>1?gt(h/l,0,1,Qi):1;r=Xi(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$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}}var Jb=["flags","surveys"],Kb={[kn]:{exposure:"hidden"},[Tn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Mn]:{exposure:"hidden"},[En]:{exposure:"event"},[In]:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[Rn]:{exposure:"event"},[Pn]:{exposure:"hidden"},[An]:{exposure:"event"},[Fn]:{exposure:"event"},[On]:{exposure:"event"},[Ln]:{exposure:"hidden"},[$n]:{exposure:"event"},[Nn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Un]:{exposure:"hidden"},[Wn]:{exposure:"event"},[qn]:{exposure:"event",shouldSkipFromEventProperties:t=>tt(t)},[Vn]:{exposure:"event"},[Gn]:{exposure:"event"},[Zn]:{exposure:"event"},[Yn]:{exposure:"event"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden",storageGroup:"flags"},[es]:{exposure:"hidden",storageGroup:"flags"},[is]:{exposure:"hidden"},[rs]:{exposure:"hidden",storageGroup:"flags"},[ns]:{exposure:"hidden",storageGroup:"flags"},[ss]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[as]:{exposure:"hidden",storageGroup:"flags"},[os]:{exposure:"hidden"},[ls]:{exposure:"hidden"},[us]:{exposure:"hidden"},[hs]:{exposure:"hidden"},[vs]:{exposure:"hidden",storageGroup:"surveys"},[cs]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[fs]:{exposure:"event"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ys]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[ds]:{exposure:"event"},[_s]:{exposure:"hidden"},[ws]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ks]:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[xs]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Es]:{exposure:"hidden"},[jn]:{exposure:"event"},[Bn]:{exposure:"event"},[Hn]:{exposure:"event"},[zn]:{exposure:"event"},[Ps]:{exposure:"event"},[As]:{exposure:"event"},[Fs]:{exposure:"event"},[Os]:{exposure:"event"},[Ls]:{exposure:"event"},[Ds]:{exposure:"event"},[$s]:{exposure:"event"},[Ns]:{exposure:"event"},[qs]:{exposure:"event"},[js]:{exposure:"event"},[Bs]:{exposure:"event"}},Yb=[[Qn,{exposure:"hidden"}],[Jn,{exposure:"hidden"}],[Kn,{exposure:"hidden"}]],Xb=t=>{var e=Kb[t];if(e)return e;for(var i of Yb){var r=i[1];if(0===t.indexOf(i[0]))return r}},t_={flags:ws,surveys:cs},e_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],i_=t=>t+"_cookie_identity_change_pending",r_="main",n_=[ts,es,rs,ns,ss,ws,as,us],s_=t=>-1!==n_.indexOf(t),a_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},o_=t=>{if(!t)return{};var e=JSON.parse(t);return Q(e)?e:{}},l_=(t,e)=>{Yi(t,((i,r)=>{var n=Xb(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class u_{constructor(e,i,r){if(void 0===r&&(r=!0),this.na={},this.sa=!1,this.aa=!1,this.oa=!1,this.la=!1,this.ua=new Map,this.ha=!1,this.da=!1,this.va=!1,this.ca=new Set,this.gn=e,this.fa=r,this.props={},this.pa=void 0,this.ga=(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"})(e),this.Gs=this.ma(e),this.aa=this.ya(e),this.load(),this.ba(),e.debug&&Qi.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();ar(t,"beforeunload",n,{capture:!1}),ar(t,"pagehide",n,{capture:!1}),this._a=e=>{if(this.sa&&(!e.storageArea||e.storageArea===(null==t?void 0:t.localStorage))&&e.key)if(e.key!==this.ga){if(this.aa){var i=Jb.find((t=>e.key===this.wa(t)));i&&this.ka(e.key,i)}}else this.ka(e.key,r_)},ar(t,"storage",this._a)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach((t=>{var e=t[0],i=t[1],r=this.ua.get(e);if(s_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach((t=>n.add(t))),n.size&&this.Sa(e,n)}else this.Sa(e,!0)}))}onCrossTabFeatureFlagChange(t){return this.ca.add(t),()=>this.ca.delete(t)}destroy(){this._a&&t&&(t.removeEventListener("storage",this._a),this._a=void 0),this.ca.clear()}ka(t,e,i){if(void 0===i&&(i=!0),this.xa)return!1;var r,n;try{if(n=bp.ni(t),tt(n)){var s=this.Ca(e);return s.storageValue=null,e!==r_&&(s.persisted=!1),!1}r=o_(n)}catch(t){return!1}var a=e===r_?r:bp.si(this.ga);if(a&&this.Ta(a))return!1;var o=this.Ma(r,e,i);return e===r_&&this.aa&&!a_(this.Ea().main,r)||this.Ia(r,e,!0,n),o}Ta(t){var e=this.props[Sn],i=t[Sn];return!K(e)&&!K(i)&&e!==i}Ia(t,e,i,r){var n=this.Ca(e);n.storageValue=r,e!==r_&&(n.persisted=i);try{n.fingerprint=this.Ra(t,e)}catch(t){n.fingerprint=void 0}}Ma(t,e,i){var r=!1;return n_.forEach((i=>{var n,s=null==(n=Xb(i))?void 0:n.storageGroup;if(!(e===r_&&this.aa&&s||e!==r_&&s!==e)){var a=i in t,o=this.Pa(i,a?t[i]:void 0),l=this.ua.has(i)?i in this.props:a;l===i in this.props&&a_(o,this.props[i])||(l?this.Aa(i,o,!1):this.Fa(i,!1),r=!0)}})),r&&i&&this.ca.forEach((t=>t())),r}Oa(){if(!this.sa)return!1;try{this.va=!1;var t,e=bp.ni(this.ga),i=this.Ca(r_),r=!1,n=!1;if(e!==i.storageValue)if(tt(e))i.storageValue=null;else{if(t=o_(e),this.va=!this.da&&this.Ta(t),this.va)return!1;n=this.Ma(t,r_,!1),!this.aa||a_(this.Ea().main,t)?this.Ia(t,r_,!0,e):i.storageValue=e,r=!0}return this.aa&&Jb.forEach((e=>{var i=bp.ni(this.wa(e)),s=this.Ca(e),a=t||{},o=r&&n_.some((t=>{var i;return(null==(i=Xb(t))?void 0:i.storageGroup)===e&&t in a}));if(i!==s.storageValue||o){if(tt(i))return s.storageValue=null,s.persisted=!1,void(o&&(n=this.Ma(a,e,!1)||n));var l=o_(i);n=this.Ma(l,e,!1)||n,this.Ia(l,e,!0,i)}})),n}catch(t){return!1}}Sa(t,e){this.ua.set(t,e);var i=Xb(t);null!=i&&i.volatile||(this.Ca((this.aa?null==i?void 0:i.storageGroup:void 0)||r_).fingerprint=void 0,this.La(t))}Da(){n_.forEach((t=>this.ua.set(t,!0)))}ba(){if(this.sa)try{var t=bp.ni(this.ga),e=o_(t);this.Ca(r_).storageValue=t,n_.forEach((t=>{var i,r=this.aa?null==(i=Xb(t))?void 0:i.storageGroup:void 0,n=r?bp.ni(this.wa(r)):null;if(r){var s=this.Ca(r);s.storageValue=n,s.persisted=!tt(n)}var a=r&&!tt(n)?o_(n):e;t in this.props?this.$a(t,a[t],this.props[t]):t in a&&this.Sa(t,!0)}))}catch(t){}}Pa(t,e){var i=this.ua.get(t);if(!i)return e;if(!0===i)return this.props[t];if(t===es){var r=new Set(G(e)?e:[]),n=new Set(G(this.props[t])?this.props[t]:[]);return i.forEach((t=>n.has(t)?r.add(t):r.delete(t))),Array.from(r)}var s=Q(e)?p({},e):{},a=Q(this.props[t])?this.props[t]:{};return i.forEach((t=>{t in a?s[t]=a[t]:delete s[t]})),s}$a(t,e,i){if(s_(t)){var r=this.ua.get(t);if(!0!==r){var n=e;if(this.sa)try{var s,a=this.aa?null==(s=Xb(t))?void 0:s.storageGroup:void 0,o=a?this.wa(a):this.ga;n=o_(bp.ni(o))[t]}catch(t){}var l=new Set(r||[]);if(t===es){if(!K(e)&&!G(e)||!K(n)&&!G(n)||!G(i))return void this.Sa(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(!Q(i))return void(a_(n,i)?this.ua.delete(t):this.Sa(t,!0));if(!K(e)&&!Q(e)||K(e)&&J(i)&&K(n))return void this.Sa(t,!0);var v=Q(e)?e:{},c=Q(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.Sa(t,l):this.ua.delete(t)}}}Na(){var t,e=null==(t=this.gn)?void 0:t.persistence_save_debounce_ms;return it(e)&&e>0?e:0}qa(t){if(this.gn.cookieWinsOnConflict&&"localstorage+cookie"===this.gn.persistence.toLowerCase())if(t)try{var e=Cp(t,this.gn.cookie_persisted_properties||[]),i=Mp(e,this.gn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=mp.ni(this.ga)||void 0;n&&Ip(this.ga,n)===r&&(this.ja=r,this.Ba=n)}catch(t){}else try{var s=mp.ni(this.ga)||void 0;this.ja=s?Ip(this.ga,s):void 0,this.Ba=s}catch(t){}}syncCookieProperties(){return this.Ha(this.gn)}Ha(t,e){if(void 0===e&&(e=!1),this.xa&&!e||this.la||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=mp.ni(this.ga)||void 0}catch(t){}if(!i||i===this.Ba)return!1;var r,n=Ip(this.ga,i);try{r=xp(JSON.parse(i))}catch(t){return!1}if((mp.ni(this.ga)||void 0)!==i)return!1;this.ja=n,this.Ba=i;var s=Ep(this.ga,i),a=[...wp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(K(e)||tt(e)||""===e||t===ks&&e!==Ws&&e!==Vs)&&(o[t]=!0,delete r[t])})),J(r))return!1;var l=Sn in r||r[ks]===Ws||r[ks]===Vs,u=this.props,h=u[Sn],d=u[ks],v=Xi({},u);[...wp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==Sn&&t!==ks)){var e=v[t];!s.isValid&&-1!==wp.indexOf(t)&&(!1===e||0===e)||delete v[t]}})),this.props=Xi(v,r),n_.forEach((t=>{var e=t in this.props;t in u===e&&a_(u[t],this.props[t])||(e?this.$a(t,u[t],this.props[t]):this.Sa(t,!0))})),!l||ks in r||ks in this.props||this.Aa(ks,Ws);var c=this.props[Sn],f=this.props[ks];return!l||c===h&&f===d||(this.da=!0,this.oa=!0,Fp.ii(i_(this.ga),!0),this.Fa(us),this.Fa(es),this.Fa(ts),this.Fa(rs),this.Fa(ns),this.Fa(ss),this.Fa(ws),this.Fa(_s),this.Fa(ys),f===Ws&&(d===Vs||r[ks]===Ws||!K(h)&&c!==h)&&(l_(this.props,r),this.Fa(hs)),f===Vs?this.props.$user_id=c:delete this.props.$user_id,this.Fa(Tn)),!0}consumeCookieIdentityChange(){var t=i_(this.ga),e=this.oa||!!Fp.ni(t);return this.oa=!1,e&&Fp.ai(t),e}za(t){return void 0===t&&(t=!1),!(this.la||this.xa&&!t||!this.gn.cookieWinsOnConflict||"localstorage+cookie"!==this.gn.persistence.toLowerCase()||(this.la=!0,0))}Ua(){this.la&&(K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0),delete this.na[r_],this.Va(!0))}Ga(t){if(void 0===t&&(t=!0),this.la)try{t?this.Ua():K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0)}finally{this.la=!1}}isDisabled(){return!!this.xa}ma(e){-1===e_.indexOf(e.persistence.toLowerCase())&&(Qi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...wp,...e];return p({},bp,{si(t){try{var e,n={};try{e=mp.ni(t)||void 0,n=e?xp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(bp.ni(t)||"{}");if(i){var o=Ep(t,e),l=[...wp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];tt(e)||""===e||t===ks&&e!==Ws&&e!==Vs||(u[t]=e)}));var h=Sn in u||u[ks]===Ws||u[ks]===Vs;if(Object.keys(u).length>0){var d,v=a[Sn],c=null!==(d=a[ks])&&void 0!==d?d:Ws;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==Sn&&t!==ks)){var e=a[t];!o.isValid&&-1!==wp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||ks in n||ks in a||(a[ks]=Ws),!h||(Sn in u?u[Sn]:a[Sn])===v&&(ks in u?u[ks]:a[ks])===c||(_p.forEach((t=>delete a[t])),u[ks]===Vs&&Sn in u?a.$user_id=u[Sn]:delete a.$user_id,u[ks]!==Vs&&(delete a[ds],delete a[hs]),delete a.__alias)}s=Xi(a,u)}else s=Xi(n,a);return bp.ii(t,s),s}catch(t){}return null},ii(t,r,n,s,a,o){var l=bp.ii(t,r,void 0,void 0,o);try{var u=Cp(r,e);if(Object.keys(u).length){if(i){var h=kp(t),d=Mp(u,e);if(mp.ii(h,d,n,s,a,o),mp.ni(h)!==JSON.stringify(d)){mp.ai(h,s);var v=Cp(r);return mp.ii(t,v,n,s,a,o),l}}mp.ii(t,u,n,s,a,o)}}catch(t){bp.oi(t)}return l},ai(e,i){try{null==t||t.localStorage.removeItem(e),mp.ai(e,i),mp.ai(kp(e),i)}catch(t){bp.oi(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&bp.ri()?(i=bp,n=!0):"localstorage+cookie"===s&&r.ri()?(i=r,n=!0):"sessionstorage"===s&&Fp.ri()?i=Fp:"memory"===s?i=Pp:"cookie"===s&&mp.ri()?i=mp:r.ri()?(i=r,n=!0):i=mp.ri()?mp:Pp,this.sa=n,i}wa(t){return this.ga+"__"+t}ya(t){return this.sa&&!!t.split_storage}properties(){var t={};return Yi(this.props,((e,i)=>{var r=Xb(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.xa||t){var e=this.gn.cookieWinsOnConflict&&"localstorage+cookie"===this.gn.persistence.toLowerCase(),i=e?bp.si(this.ga):null,r={};if(e)try{Yi(r=xp(mp.si(this.ga)),((t,e)=>{(K(t)||tt(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.Gs.si(this.ga);if(n&&(this.props=Xi({},n)),this.aa&&this.Za(),e&&n){var s,a,o=null==i?void 0:i[Sn],l=null!==(s=null==i?void 0:i[ks])&&void 0!==s?s:Ws,u=n[Sn],h=null!==(a=n[ks])&&void 0!==a?a:Ws;if(u!==o||h!==l){this.oa=!0,Fp.ii(i_(this.ga),!0);var d=Xi({},this.props);_p.forEach((t=>delete d[t])),h===Ws&&(l===Vs||r[ks]===Ws||!K(o)&&u!==o)&&(l_(d,r),delete d[hs]),this.props=d;var v=new Set;_p.forEach((t=>{var e,i=null==(e=Xb(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Yi(this.props,((i,r)=>{var n;(null==(n=Xb(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),J(e)?(bp.ai(this.wa(t)),this.na[t]={}):bp.ii(this.wa(t),e)&&(this.na[t]={persisted:!0,fingerprint:this.Ra(e,t)})}))}}Fp.ni(i_(this.ga))&&(this.oa=!0)}}Za(){for(var t of Jb){var e=bp.si(this.wa(t));if(e&&!J(e)){var i=this.Ca(t);i.persisted=!0,this.Qa(t)||(i.fingerprint=this.Ra(e,t)),this.Ja(t,e)||Xi(this.props,e)}}}Qa(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Xb(e))?void 0:i.storageGroup)===t}))}Ja(t,e){var i=t_[t];if(!i)return!1;var r=e[i],n=this.props[i];return it(r)&&it(n)&&n>r}refreshKey(t){var e;if(!this.xa){var i=this.aa?null==(e=Xb(t))?void 0:e.storageGroup:void 0,r=i?bp.si(this.wa(i)):this.Gs.si(this.ga);if(r&&t in r)this.Aa(t,r[t]);else{if(i){var n=this.Gs.si(this.ga);if(n&&t in n)return void this.Aa(t,n[t])}this.Fa(t)}}}save(){if(!this.xa){var t=this.Na();t>0?K(this.Wa)&&(this.Wa=setTimeout((()=>{this.Wa=void 0,this.Va()}),t)):this.Va()}}flush(){K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0,this.Va())}Va(t){if(void 0===t&&(t=!1),!(this.xa||this.la&&!t)){t||this.syncCookieProperties();var e=!t&&!this.ha;e||(this.va=!1);var i=!!e&&this.Oa();if(this.va)this.gn.debug&&Qi.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.aa)return this.Ka(),void(i&&this.ca.forEach((t=>t())));var r=this.Ya(this.Gs,this.ga,this.props,r_);"written"===r&&this.qa(this.props),"failed"!==r&&(this.ua.clear(),this.da=!1),i&&this.ca.forEach((t=>t()))}}}Ka(){var t=this,e=this.Ea(),i=e.main,r=e.groups,n=this.Ya(this.Gs,this.ga,i,r_);"written"===n&&this.qa(i),"failed"!==n&&(this.da=!1,n_.forEach((t=>{var e;null!=(e=Xb(t))&&e.storageGroup||this.ua.delete(t)})));var s=function(e){var i,n=r[e];if(J(n)&&(null==(i=t.na[e])||!i.persisted))return n_.forEach((i=>{var r;(null==(r=Xb(i))?void 0:r.storageGroup)===e&&t.ua.delete(i)})),1;var s=t.Ya(bp,t.wa(e),n,e);"failed"!==s&&n_.forEach((i=>{var r=Xb(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.ua.delete(i)}))};for(var a of Jb)s(a)}Ea(){var t={},e={flags:{},surveys:{}};return Yi(this.props,((i,r)=>{var n,s=null==(n=Xb(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ra(t,e){if(e===r_)return JSON.stringify(t)+"|"+this.Xa+"|"+this.eo+"|"+this.io;var i={};return Yi(t,((t,e)=>{var r;i[e]=null!=(r=Xb(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}Ya(t,e,i,r){var n,s=this.Ca(r);if(r!==r_&&!s.dirty&&!K(s.fingerprint))return"skipped";try{if((n=this.Ra(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.ii(e,i,this.Xa,this.eo,this.io,this.gn.debug)?(s.dirty=!1,r!==r_&&(s.persisted=!0),K(n)||(s.fingerprint=n),this.sa&&(s.storageValue=bp.ni(e)),"written"):(this.gn.debug&&Qi.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.Da(),K(this.Wa)||(clearTimeout(this.Wa),this.Wa=void 0),this.Gs.ai(this.ga,!1),this.Gs.ai(this.ga,!0),!i&&this.fa)for(var r of Jb)bp.ai(this.wa(r));i?delete this.na[r_]:this.na={},this.ja=void 0,this.Ba=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Q(t)){this.syncCookieProperties(),K(e)&&(e="None"),this.Xa=K(i)?this.ro:i;var r=!1;if(Yi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Aa(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Q(t)){this.syncCookieProperties(),this.Xa=K(e)?this.ro:e;var i=!1;if(Yi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Q(e)||G(e))&&(this.Aa(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.Fa(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.pa){var e=Zo(this.gn.custom_campaign_params,this.gn.mask_personal_data_properties,this.gn.custom_personal_data_properties);J(rr(e))||this.register(e),this.pa=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Jo(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Xo(),$referring_domain:null!=r&&r.referrer&&(null==(t=hr(r.referrer))?void 0:t.host)||Yo},void 0)}set_initial_person_info(){this.props[Cs]||this.props[Ts]||this.register_once({[Ms]:tl(this.gn.mask_personal_data_properties,this.gn.custom_personal_data_properties,this.gn.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Yi([Ts,Cs],(e=>{var i=this.props[e];i&&Yi(i,(function(e,i){t["$initial_"+H(i)]=e}))}));var e=this.props[Ms];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=el(t,e),r={};return Yi(i,(function(t,e){r["$initial_"+H(e)]=t})),r}(e,this.gn.disable_capture_url_hashes);Xi(t,i)}return t}safe_merge(t){return Yi(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){var r=t.persistence!==e.persistence,n=!((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||[]),s=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,o=t.disable_persistence||!!i,l=!!this.xa&&!o;o||this.Ha(e,l),this.gn=t,!o&&(r||n||a)&&(this.ja=void 0,this.Ba=void 0,this.Ha(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this.ma(t):this.Gs,h=this.ya(t),d=s||h!==this.aa,v=!o&&(d||t.cross_subdomain_cookie!==this.eo||t.secure_cookie!==this.io)&&this.za(l);this.ha=d;try{if(this.ro=this.Xa=t.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.Gs=u,this.aa=h,this.props=c,this.save()}else a&&(this.Gs=u,o||(delete this.na[r_],this.Va()))}finally{this.ha=!1,v&&this.Ga()}}set_disabled(t){this.xa=t,this.xa?this.remove():this.save()}set_cross_subdomain(t){t!==this.eo&&(this.eo=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.io&&(this.io=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[Mn]||{};i[t]=e,this.Aa(Mn,i),this.save()}remove_event_timer(t){var e=this.props[Mn]||{},i=e[t];return K(i)||(delete e[t],this.Aa(Mn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Aa(t,e),this.save()}Aa(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&(t!==Sn&&t!==ks||n===e||(this.da=!0),this.$a(t,n,e),null!=(r=Xb(t))&&r.volatile||this.La(t))}Fa(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(s_(t)&&this.Sa(t,!0),this.La(t))}La(t){var e,i=null==(e=Xb(t))?void 0:e.storageGroup;i&&(this.Ca(i).dirty=!0)}Ca(t){return this.na[t]||(this.na[t]={})}}var h_=Ji("[RateLimiter]");class d_{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=>{h_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void h_.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,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(xs))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(it(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.no(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(xs,o),{isRateLimited:l,remainingTokens:o.tokens}}so(t){var e=this.instance.config.property_denylist;return!G(e)||!e.includes(t)}ao(){var t;if(this.so("$current_url")&&this.so("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}no(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ao(),a=this.so("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". 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}}var v_=Ji("[RemoteConfig]");class c_{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}oo(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}lo(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 v_.info("Using preloaded remote config",this.remoteConfig),void this.uo(this.remoteConfig);if(this._instance.ho())return void v_.warn("Remote config is disabled. Falling back to local config.");this.oo((t=>{if(!t)return v_.info("No config found after loading remote JS config. Falling back to JSON."),void this.lo((t=>{this.uo(t.json,t)}));this.uo(t)}))}catch(t){v_.error("Error loading remote config",t),this.uo()}}uo(t,e){!t&&e&&(0===e.statusCode?e.error||v_.warn("Failed to fetch remote config from PostHog."):v_.error("Failed to fetch remote config from PostHog."));try{this._instance.uo(t?{ok:!0,config:t}:{ok:!1})}catch(t){v_.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){v_.error("Error loading feature flags",t)}}}var f_=!!a||!!s,p_="text/plain",g_=!1,m_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},y_=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],a=n[1],o=p({},e),l=null!==(r=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=o[n])&&void 0!==e?e:r[1];return delete o[n],n+"="+s})))&&void 0!==r?r:[],u=dr(o);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},b_=t=>{if(t.do)return t.do;var e=t.data,i=t.compression;if(e){if(i===Lf){var r=co(fo(ur(e)),{mtime:0});return{contentType:p_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Df){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(ur(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:ur(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=ur(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},__=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:y_(t.url,{compression:Df}),encodedBody:b_(p({},t,{compression:Df,do:void 0}))}:{url:m_(t.url,"compression"),encodedBody:b_(p({},t,{compression:void 0,do:void 0}))};try{e=b_(t)}catch(e){if(Ne(t.compression,vr(t.url,"compression")))return Qi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Ne(t.compression,vr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?$e(new Uint8Array(i)):ArrayBuffer.isView(i)&&$e(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(g_=!0,r()):{url:t.url,encodedBody:e}},w_=t=>{try{return __(t)}catch(e){return Qi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},k_=function(){var t=f((function*(t){var e=ur(t.data),i=yield ze(e,Gi.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{do:{contentType:p_,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),S_=/Failed to fetch|NetworkError|Load failed/i,x_=t=>"TypeError"===(null==t?void 0:t.name)&&S_.test((null==t?void 0:t.message)||""),C_=t=>{var e=w_(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},a=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Yi(t.headers,(function(t,e){h.append(e,t)})),a&&h.append("Content-Type",a);var d=null,v=!1;if(o){var c=new o;d={signal:c.signal,timeout:setTimeout((()=>{var e;v=!0,c.abort(Re("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||x_(e)?Qi.warn(e):Qi.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;s(i,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&!t.vo&&52428.8>(u||0),body:l,signal:null==(g=d)?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){Qi.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},T_=t=>{try{var e,r=__(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(i.sendBeacon(n,u))return;var h=G(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(G(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>G(t.data)?e:p({},t.data,{batch:e});return T_(p({},t,{data:v(h.slice(0,d))})),void T_(p({},t,{data:v(h.slice(d))}))}Qi.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),C_(p({},t,{vo:!0}))}catch(t){Qi.warn("Beacon send failed",t)}},M_=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return y_(i===Lf?m_(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Lf?{}:{compression:i}))},E_=[];s&&E_.push({transport:"fetch",method:C_}),a&&E_.push({transport:"XHR",method(t){var e=w_(t);if(e){var i=new a,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Yi(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)}}}),null!=i&&i.sendBeacon&&E_.push({transport:"sendBeacon",method:T_});var I_=3e3;class R_{constructor(t,e){this.co=!0,this.fo=[],this.po=gt((null==e?void 0:e.flush_interval_ms)||I_,250,5e3,Qi.createLogger("flush interval"),I_),this.mo=t}enqueue(t){this.fo.push(t),this.yo||this.bo()}unload(){this._o();var t=this.fo.length>0?this.wo():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.ko(p({},t,{transport:"sendBeacon"}))}))}enable(){this.co=!1,this.bo()}bo(){var t=this;this.co||(this.yo=setTimeout((()=>{if(this._o(),this.fo.length>0){var e=this.wo(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&G(i.data)&&Yi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ko(i)};for(var r in e)i()}}),this.po))}ko(t){try{this.mo(t)}catch(t){Qi.error(t)}}_o(){clearTimeout(this.yo),this.yo=void 0}wo(){var t={};return Yi(this.fo,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;K(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.fo=[],t}}var P_=["retriesPerformedSoFar"];class A_{constructor(e){this.So=!1,this.xo=3e3,this.fo=[],this._instance=e,this.fo=[],this.Co=!0,!K(t)&&"onLine"in t.navigator&&(this.Co=t.navigator.onLine,this.To=()=>{this.Co=!0,this.Mo()},this.Eo=()=>{this.Co=!1},ar(t,"online",this.To),ar(t,"offline",this.Eo))}get length(){return this.fo.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,P_);rt(e)&&(i.url=y_(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.es(p({retriesPerformedSoFar:e},i));0===t.statusCode&&Qi.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!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}es(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;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.fo.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Qi.warn(n),this.So||(this.So=!0,this.Io())}Io(){if(this.Ro&&clearTimeout(this.Ro),0===this.fo.length)return this.So=!1,void(this.Ro=void 0);this.Ro=setTimeout((()=>{this.Co&&this.fo.length>0&&this.Mo(),this.Io()}),this.xo)}Mo(){var t=Date.now(),e=[],i=this.fo.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.fo=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Ro&&(clearTimeout(this.Ro),this.Ro=void 0),this.So=!1,K(t)||(this.To&&(t.removeEventListener("online",this.To),this.To=void 0),this.Eo&&(t.removeEventListener("offline",this.Eo),this.Eo=void 0)),this.fo)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Qi.error(t)}}this.fo=[]}}class F_{constructor(t){this.Po=()=>{var t,e,i,r;this.Ao||(this.Ao={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Ao.lastScrollY=Math.ceil(s),this.Ao.maxScrollY=Math.max(s,null!==(t=this.Ao.maxScrollY)&&void 0!==t?t:0),this.Ao.maxScrollHeight=Math.max(a,null!==(e=this.Ao.maxScrollHeight)&&void 0!==e?e:0),this.Ao.lastContentY=o,this.Ao.maxContentY=Math.max(o,null!==(i=this.Ao.maxContentY)&&void 0!==i?i:0),this.Ao.maxContentHeight=Math.max(l,null!==(r=this.Ao.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Fo(){return this._instance.config.scroll_root_selector}getContext(){return this.Ao}resetContext(){var t=this.Ao;return setTimeout(this.Po,0),t}startMeasuringScrollPosition(){ar(t,"scroll",this.Po,{capture:!0}),ar(t,"scrollend",this.Po,{capture:!0}),ar(t,"resize",this.Po)}scrollElement(){if(!this.Fo)return null==t?void 0:t.document.documentElement;var e=G(this.Fo)?this.Fo:[this.Fo];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Oo(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Fo){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Oo("y")}scrollX(){return this.Oo("x")}}var O_=t=>tl(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 L_{constructor(t,e,i,r){this.Tt=t=>{var e=this.Lo();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Do(this._instance)};this.$o.register({[Ss]:i})}},this._instance=t,this.No=e,this.$o=i,this.Do=r||O_,this.No.onSessionId(this.Tt)}Lo(){return this.$o.props[Ss]}getSetOnceProps(){var t,e=null==(t=this.Lo())?void 0:t.props;return e?"r"in e?el(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 Yi(rr(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+H(i)]=e})),t}}class D_{on(t,e){return this.qo[t]||(this.qo[t]=[]),this.qo[t].push(e),()=>{this.qo[t]=this.qo[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.qo[t]||[])i(e);for(var r of this.qo["*"]||[])r(t,e)}constructor(){this.qo={}}}var $_=Ji("[SessionId]"),N_=864e5;class q_{on(t,e){return this.jo.on(t,e)}constructor(t,e,i){var r;if(this.Bo=null,this.Ho=null,this.zo=[],this.Uo=void 0,this.Wo=!1,this.jo=new D_,this.Vo=(t,e)=>!(!rt(t)||!rt(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Us)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.gn=t.config,this.$o=t.persistence,this.It=void 0,this.Pe=void 0,this._sessionStartTimestamp=null,this.Go=void 0,this._sessionActivityTimestamp=null,this.Zo=e||vp,this.Qo=i||vp;var n=this.gn.persistence_name||this.gn.token;if(this._sessionTimeoutMs=1e3*gt(this.gn.session_idle_timeout_seconds||1800,60,36e3,$_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Jo(),this.Ko="ph_"+n+"_window_id",this.Yo="ph_"+n+"_primary_window_exists",this.Xo()){var s=Fp.si(this.Ko),a=Fp.si(this.Yo);s&&!a?this.It=s:Fp.ai(this.Ko),Fp.ii(this.Yo,!0)}null!=(r=this.gn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.gn.bootstrap.sessionID),this.tl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return K(this.zo)&&(this.zo=[]),this.zo.push(t),this.Pe&&t(this.Pe,this.It),()=>{this.zo=this.zo.filter((e=>e!==t))}}Xo(){return"memory"!==this.gn.persistence&&!this.$o.xa&&Fp.ri()}el(t){t!==this.It&&(this.It=t,this.Xo()&&Fp.ii(this.Ko,t))}il(){return this.It?this.It:this.Xo()?Fp.si(this.Ko):null}rl(t){var e=this.Bo;return!tt(e)&&!tt(t)&&5e3>Math.abs(t-e)}nl(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Pe||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Pe=t,n&&!r||n&&this.rl(e)||(this.Bo=e,this.$o.register({[Un]:[e,t,i]}))}sl(){var t,e=null==(t=this.gn)?void 0:t.persistence_save_debounce_ms;return rt(e)&&e>0}al(){this.sl()?this.$o.refreshKey(Un):(this.$o.flush(),this.$o.load())}ol(){var t;if(!tt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Bo){this.al();var e=this.ll();e[1]===this.Pe&&e[2]===this._sessionStartTimestamp&&(this.Bo=this._sessionActivityTimestamp,this.$o.register({[Un]:[this._sessionActivityTimestamp,null!==(t=this.Pe)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.$o.flush())}}ul(){var t=this.ll()[0],e=rt(t)?t:0,i=rt(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}hl(t){return this.al(),this.Vo(t,this.ul())}ll(){var t=this.$o.props[Un];return G(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Bo=null,this.Go=void 0,clearTimeout(this.dl),this.dl=void 0,this.nl(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 $_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void $_.error("Invalid sessionID in bootstrap",t)}}(t);return!K(i)&&(e?this.Go={sessionId:t,sessionStartTimestamp:i}:this.nl(t,(new Date).getTime(),i),!0)}destroy(){this.Wo=!0,this.ol(),clearTimeout(this.dl),this.dl=void 0,this.Uo&&t&&(t.removeEventListener(Qs,this.Uo,{capture:!1}),this.Uo=void 0),this.zo=[]}tl(){this.Uo=()=>{this.ol(),this.Xo()&&Fp.ai(this.Yo)},ar(t,Qs,this.Uo,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.gn.cookieless_mode===Us)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Pe;if(i)this.Ho=r;else if(tt(this.Ho)||this.Ho>r||r-this.Ho>=1e3){var s,a;null==(s=(a=this.$o).syncCookieProperties)||s.call(a),this.Ho=r}var o=this.ll(),l=o[1],u=o[2],h=!K(n)&&l!==n,d=this.ul(),v=this.il(),c=this.Go,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>N_),p=c?f:rt(u)&&Math.abs(r-u)>N_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Vo(r,d);if(_){(_=this.hl(r))||$_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.ll();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Zo(),v=this.Qo(),$_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Go=void 0,g=!0}else v||(v=this.Qo(),g=!0),(m=m||l!==b)&&($_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=rt(d)&&t&&!p?d:r,x=rt(u)?u:(new Date).getTime();this.el(v),this.nl(l,S,x),t||this.Jo();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.zo.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}Jo(){this.Wo||(clearTimeout(this.dl),this.dl=setTimeout((()=>{if(!this.Wo)if(this.hl((new Date).getTime())){var t=this.Pe;this.resetSessionId(),this.jo.emit("forcedIdleReset",{idleSessionId:t})}else this.Jo()}),1.1*this.sessionTimeoutMs))}}var j_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&q(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>q(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function B_(){return B_=f((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Y(r)&&r.length>0?r:void 0}catch(t){return void Qi.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/"];class V_{constructor(t){this.vl={},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.vl[this.apiHost]||(this.vl[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":H_),this.vl[this.apiHost]}cl(t){if(U_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}fl(t){var e=hr(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}pl(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,a=(null==(s=hr(i))?void 0:s.href)||i;r=n(new URL(a)).toString()}if(n&&"api"===t&&W_.some((t=>0===e.indexOf(t)))){var o=this.fl(r);if(o){var l,u=this.apiHost,h=this.gl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.gl=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this.gl,i=this.fl(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.pl(t,e,this.uiHost+e);if("flags"===t)return this.pl(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.cl(e);if(i)return this.pl(t,e,""+i+e)}if(this.region===H_)return this.pl(t,e,this.apiHost+e);var r=z_+e;switch(t){case"assets":return this.pl(t,e,"https://"+this.region+"-assets."+r);case"api":return this.pl(t,e,"https://"+this.region+"."+r)}}}var G_=Ji("[PostHog ExternalIntegrations]"),Z_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Q_{constructor(t){this._instance=t}Ks(t,e){var i;null==(i=v.__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],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ks(Z_[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=v.__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()}}}class J_{constructor(t,e){this.A=t,this.$s=e,this.ml=new Map,this.Fs=!1}add(t){var e=this;return f((function*(){if(e.Fs)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.ml.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.ml.set(t.name,t);try{var i=t.setup(e.$s);i&&(yield i)}catch(i){var r=e.ml.get(t.name)===t;r&&e.ml.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.yl(t)}}))()}getExtension(t){return this.ml.get(t)}dispose(){if(!this.Fs){this.Fs=!0;var t=Array.from(this.ml.values()).reverse();for(var e of(this.ml.clear(),t))this.yl(e)}}yl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Z(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)}}}class K_{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);K(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)}}var Y_="extensionsRemoteConfig";class X_{constructor(t){this.Fs=!1,this.instance=t,this.A=Qi,this.bl=t._l,this.kv=new K_(t),this.onEvent=t=>Of(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.Fs)return Of((()=>{}));var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.wl.on(Y_,e);return this.bl&&e(this.bl),Of(i)},this.kl=new J_(Qi.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(xn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(xn);return"string"==typeof t?t:void 0}get library(){return{name:Gi.LIB_NAME,version:Gi.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.kl.add(t)}getExtension(t){return this.kl.getExtension(t)}capture(t,e,i){var r=this;return f((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 Of(this.instance.Sl(t))}handleRemoteConfig(t){this.Fs||(this.bl=t,this.instance.wl.emit(Y_,t))}sendRequest(t,e){var i=this;return f((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?y_(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?x.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.Fs||(this.Fs=!0,this.kl.dispose())}}var 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",aw="Invalid value for property_denylist config: ",ow=["token","distinct_id",Rs],lw="posthog",uw=!f_&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),hw=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},dw=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:sr(null==r?void 0:r.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!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:n&&Y(null==n?void 0:n.search)&&-1!==n.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.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){Qi.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:Gs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:I_},error_tracking:{},_onCapture:iw},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:jr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:hw(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)}))(e))},vw=[["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"]],cw=t=>{var e={};for(var i of vw){var r=i[0],n=i[1];K(t[r])||(e[n]=t[r])}var s=Xi({},e,t),a=t.__preview_external_dependency_versioned_paths;return K(a)||(K(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Y(a)&&K(t.asset_host)&&(s.asset_host=a)),G(t.property_blacklist)&&(K(t.property_denylist)?s.property_denylist=t.property_blacklist:G(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Qi.error(aw+t.property_denylist)),s};class fw{constructor(){this.__forceAllowLocalhost=!1}get xl(){return this.__forceAllowLocalhost}set xl(t){Qi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class pw{Cl(t){if(t){var e=this.ml.indexOf(t);-1!==e&&this.ml.splice(e,1)}}Tl(t,e){return this.Cl(t),this.ml.push(e),null==e.initialize||e.initialize(),e}Ml(){return this.config.cookieless_mode===Us||this.config.cookieless_mode===zs&&this.consent.isRejected()}El(){if(!this.Il&&!this.config.segment&&!this.Ml()){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Rl||(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', or keep this persistence and pass a stable ID through bootstrap.distinctID."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, or keep persistence disabled and pass a stable ID through bootstrap.distinctID."),this.Il=!0,console.warn("[PostHog.js]",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)))}}Pl(){if(!this.Ml()&&this.get_distinct_id()===Is){var t=this.persistence;if(t){this.Al()||t.load(!0);var e=this.get_distinct_id();if(!e||e===Is){var i=this.config.get_device_id(vp());this.register({distinct_id:i,$device_id:i}),t.set_property(ks,Ws)}this.Fl()}}}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 t;this.webPerformance=new fw,this.Ol=!1,this.version=Gi.LIB_VERSION,this.Ll=new Set,this.Dl="",this.wl=new D_,this.ml=[],this.$l=[],this.Rl=!1,this.Il=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=dw(),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.Nl=!1,this.ql=null,this.jl=null,this.Bl=null,this.scrollManager=new F_(this),this.pageViewManager=new Qb(this),this.rateLimiter=new d_(this),this.requestRouter=new V_(this),this.consent=new jb(this),this.externalIntegrations=new Q_(this);var e=null!==(t=pw.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Qi.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==lw){var r,n=null!==(r=tw[i])&&void 0!==r?r:new pw;return n._init(t,e,i),tw[i]=n,tw[lw][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s,a;void 0===i&&(i={});var o,l=Y(e)?e.trim():"";if(!l)return Qi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return l!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=dw(i.defaults),i.debug=this.Hl(i.debug),this.zl=i,this.Ul=[],i.person_profiles?this.jl=i.person_profiles:i.process_person&&(this.jl=i.process_person);var u=dw(i.defaults),h=cw(i),d=Xi({},u,h,{name:r,token:l});Q(u.rageclick)&&Q(h.rageclick)&&(d.rageclick=Xi({},u.rageclick,h.rageclick)),Q(u.session_recording)&&Q(h.session_recording)&&(d.session_recording=Xi({},u.session_recording,h.session_recording)),this.set_config(d),this.config.on_xhr_error&&Qi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Lf;var v=this.Al();if(this.persistence=new u_(this.config,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new u_(p({},this.config,{persistence:"sessionStorage"}),v,!1),this.Dl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!v&&Fp.ri()){var c=Fp.si(this.Dl);G(c)&&c.forEach((t=>{Y(t)&&this.Ll.add(t)}))}else Fp.ai(this.Dl);var f=p({},this.persistence.props),g=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Wl=new R_((t=>this.Vl(t)),this.config.request_queue_config),this.Gl=new A_(this),this.__request_queue=[];var m=this.Ml();m||(this.sessionManager=new q_(this),this.sessionPropsManager=new L_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Zl()}))),this.Ql(),this.config.__preview_deferred_init_extensions?(Qi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Jl(m)}),0)):(Qi.info("Initializing extensions synchronously"),this.Jl(m)),Gi.DEBUG=Gi.DEBUG||this.config.debug,Gi.DEBUG&&Qi.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(n=i.bootstrap)&&n.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(s=i.bootstrap)?void 0:s.distinctID;if(this.Rl=!!y&&!X(y),void 0!==(null==(a=i.bootstrap)?void 0:a.distinctID)){var b=i.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(ks);if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Ws)this.identify(b);else if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Vs)Qi.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(vp()),S=i.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(ks,i.bootstrap.isIdentifiedID?Vs:Ws),this.register({distinct_id:b,$device_id:S})}}if(m)this.register_once({distinct_id:Is,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(vp());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(ks,Ws)}return ar(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||vp();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(ks,Vs)),e()},n=i.user();"then"in n&&Z(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||Wb.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Wb.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Wb.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Js),identify:t=>e(t,Ys),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Kl())):this.Kl(),Z(this.config._onCapture)&&this.config._onCapture!==iw&&(Qi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Qi.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({[Cn]:t})})).catch(iw),this}Yl(t){var e=t;return Y(e.name)&&Z(e.setup)}Xl(t,e){this.Yl(t)?e.push((()=>{this.tu().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Qi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.ml.push(t)}Ql(){var t,e,i,r,n,s,a=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=pw.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.eu)||r.call(this),this.eu=void 0,this.featureFlags=new a(this)),Z(this.featureFlags.onReloading)&&Z(this.featureFlags.setup)?this.eu||(this.eu=this.featureFlags.onReloading((()=>{this.wl.emit("featureFlagsReloading",!0)})),this.tu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}Jl(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},pw.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.ml.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.ml.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.ml.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.ml.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.ml.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.Xl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.Xl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.Xl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.ml.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.ml.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.ml.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.ml.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.ml.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.ml.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.ml.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,zb)),u.toolbar&&this.ml.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.ml.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.ml.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.iu){var t=this.iu;this.iu=void 0,this.ml.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.ru(h,l)}ru(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ru(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Qi.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ps]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[As]:r}),this.config.__preview_deferred_init_extensions&&Qi.info("PostHog extensions initialized ("+r+"ms)")}uo(t){var e;if(!r||!r.body)return Qi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.uo(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.iu=t),this._l=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=j(n.supportedCompression,Lf)?Lf:j(n.supportedCompression,Df)?Df:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.jl?this.jl:Gs}),null==(e=this.nu)||e.handleRemoteConfig(t),this.ml.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Kl(){try{this.config.loaded(this)}catch(t){Qi.critical("`loaded` function failed",t)}if(this.su(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var t=n.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.Ml())&&this.au()}),1),this.ou=new c_(this),this.ou.load()}su(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Wl)||t.enable())}_dom_loaded(){this.is_capturing()&&Ki(this.__request_queue,(t=>this.Vl(t))),this.__request_queue=[],this.su()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.lu()&&this.capture(Ks),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Wl)||r.unload(),null==(n=this.Gl)||n.unload()):this.lu()&&this.capture(Ks,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?uw?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=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(K(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,n=p({},t);n.timeout=n.timeout||6e4;var s,a,o,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&K(n.compression)&&n.data&&(n.compression=Df),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(G(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(o=h.properties)?void 0:o.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),G(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=M_(n.url,n.method,n.compression,n.timestampMode);var v=E_.filter((t=>!n.disableTransport||!t.transport||!n.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){x_(t)?Qi.warn(t):Qi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Lf&&l&&"undefined"!=typeof Promise&&!g_?k_(n).then((t=>{f(t)})).catch((e=>{if(qe(e))return g_=!0,void f(p({},n,{compression:void 0,url:M_(t.url,t.method,void 0,t.timestampMode)}));je(e)&&(g_=!0),f(n)})):c(n)})(p({},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}))}Vl(t){this.Gl?this.Gl.retriableRequest(t):this._send_request(t)}_execute_array(t){ew++;try{var e,i=[],r=[],n=[];Ki(t,(t=>{if(t)if(G(e=t[0]))n.push(t);else if(Z(t))try{t.call(this)}catch(e){Qi.error("Error executing queued PostHog call",t,e)}else G(t)&&"alias"===e?i.push(t):G(t)&&-1!==e.indexOf("capture")&&Z(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ki(t,(function(t){try{if(G(t[0])){var i=e;Yi(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Qi.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{ew--}}push(t){if(ew>0&&G(t)&&Y(t[0])){var e=pw.prototype[t[0]];Z(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Wl){if(this.is_capturing())if(!K(t)&&Y(t)){this.Pl();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=e&&e.$current_url&&!Y(null==e?void 0:e.$current_url)&&(Qi.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.uu||Qi.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=(null==i?void 0:i.timestamp)||h,v=Ie(null==i?void 0:i.uuid,vp),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Js&&this.config.__preview_capture_bot_pageviews&&l&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),u&&(c.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var f="$feature_flag_called"===t&&!1===c.properties.$feature_flag_has_experiment&&!0===this.get_property(as);(null==i?void 0:i.$set)&&!f&&(c.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(c.$unset=g);var m=f?void 0:this.hu(null==i?void 0:i.$set_once,t!==Xs,t===Ys);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,a=t=>Y(t)?t.slice(0,n):t,o=new Set,c=function t(e,i){if(e!==Object(e))return a?a(e):e;if(!o.has(e)){var r;if(o.add(e),G(e))r=[],Ki(e,(e=>{r.push(t(e))}));else{var n={};Yi(e,((e,i)=>{o.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,K(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),f&&(c.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return k.forEach(r),e.forEach(r),i}(c.properties,ow)),t===Vf.DISMISSED||t===Vf.SENT){var y=null==e?void 0:e[Gf.SURVEY_ID],b=null==e?void 0:e[Gf.SURVEY_ITERATION];ip({id:y,current_iteration:b}),c.$set=p({},c.$set,{[ko({id:y,current_iteration:b},t===Vf.SENT?"responded":"dismissed")]:!0})}else t===Vf.SHOWN&&(c.$set=p({},c.$set,{[Gf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var _=null==e?void 0:e.$product_tour_type;_&&(c.$set=p({},c.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(J(w)||this.setPersonPropertiesForFlags(w),!et(this.config.before_send)){var S=this.Xn(c);if(!S)return;(c=S).uuid=Ie(c.uuid,vp)}this.wl.emit("eventCaptured",c);var x=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:x,data:c,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(x)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Vl(C):this.Wl.enqueue(C),c}Qi.critical("This capture call is ignored due to client rate limiting.")}}else Qi.error("No event name provided to posthog.capture")}else Qi.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}getExtension(t){var e;return null==(e=this.nu)?void 0:e.getExtension(t)}tu(){var t;return null!==(t=this.nu)&&void 0!==t?t:this.nu=new X_(this)}Sl(t){this.$l.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.$l.indexOf(t);-1!==i&&this.$l.splice(i,1)}}}du(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Bl=null,this.persistence.get_property(ks)===Ws&&(null==(r=this.sessionPersistence)||r.clear(),this.Ll.clear(),this.vu()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.du();var l=o?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Ml()&&(h[Rs]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!Y(h.distinct_id)&&!it(h.distinct_id)||X(h.distinct_id))&&Qi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var a,o,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Uo,...i||[]]:[],c=Ce(u),f=c[0],p=c[1],g=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};K(r)||(m.detectGoogleSearchApp=r);var y={},b=null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,_=null==(o=navigator)?void 0:o.maxTouchPoints,w=null==t||null==(l=t.screen)?void 0:l.width,k=null==t||null==(h=t.screen)?void 0:h.height,S=null==t?void 0:t.devicePixelRatio;K(b)||(y.userAgentDataPlatform=b),K(_)||(y.maxTouchPoints=_),K(w)||(y.screenWidth=w),K(k)||(y.screenHeight=k),K(S)||(y.devicePixelRatio=S);var x,C=Xi(rr({$os:f,$os_version:p,$browser:we(u,navigator.vendor,g,m),$device:Te(u),$device_type:Me(u,y),$timezone:il(),$timezone_offset:rl()}),{$current_url:cr(s?Pe(null==n?void 0:n.href):null==n?void 0:n.href,v,Vo),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:u.length>1e3?u.substring(0,997)+"...":u,$browser_version:Se(u,navigator.vendor,g,m),$browser_language:Ko(),$browser_language_prefix:(x=Ko(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:Gi.LIB_NAME,$lib_version:Gi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Gi.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Gi.SDK_DIST_CHANNEL),C}(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(o,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&Xi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Xi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Gl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===H_&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Js||o?e!==Ks||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Xi(h,v),e===Js&&r&&(h.title=r.title),!K(l)){var y=s.getTime()-l;h.$duration=parseFloat((y/1e3).toFixed(3))}u&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties();Yi(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var w={};if(this.$l.length>0)for(var k of this.$l.slice())try{Xi(w,k())}catch(t){Qi.error("Failed to produce browser extension event properties",t)}(h=Xi({},c,b,_,p({},w,h))).$is_identified=this._isIdentified(),G(this.config.property_denylist)?Yi(this.config.property_denylist,(function(t){delete h[t]})):Qi.error(aw+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(Qi.error(sw),h=S(h,e));var x=this.cu();return h.$process_person_profile=x,x&&!o&&this.fu("_calculate_event_properties"),h}hu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.cu())return t;if(this.Ol&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=Xi({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Qi.error(sw),a=o(a,"$set_once")),e&&(this.Ol=!0),J(a)?void 0:a}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.du(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.Ll.add(t))),this.vu()}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.Ll.delete(t),this.vu()}pu(t,e){this.register({[t]:e})}Zl(){this.Ll.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.Ll.clear(),this.vu()}vu(){var t;if(this.Dl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.xa||!Fp.ri())Fp.ai(this.Dl);else{var e=[];this.Ll.forEach((t=>e.push(t))),e.length>0?Fp.ii(this.Dl,e):Fp.ai(this.Dl)}}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.wl.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=np),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})}gu(t){return!t||X(t)?(Qi.critical("Unique user id has not been set in posthog.identify"),!1):t===Is?(Qi.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())||(Qi.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 Qi.uninitializedWarning("posthog.identify");if(it(t)&&(t=t.toString(),Qi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.gu(t)&&this.fu("posthog.identify")){this.Pl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.du(!1),a=this.persistence.za(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(xn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(Tn)&&(this.unregister(Tn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(ks)||Ws)===Ws,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(ks,Vs),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ua(),this.capture(Ys,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Bl=Oo(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(ks,Vs);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Ua(),this.capture("$set",{$set:c,$set_once:f}),this.Bl=Oo(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ys)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Ga(o)}}}setPersonProperties(t,e){if((t||e)&&this.fu("posthog.setPersonProperties")){var i=Oo(this.get_distinct_id(),t,e);this.Bl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Bl=i):Qi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(G(t)?t:[t]).filter((t=>Y(t)&&t.length>0));0!==i.length&&this.fu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Bl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.du();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(Xs,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Qi.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.fu("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=nt(t)?t:null==t?void 0:t.resetDeviceID,i=nt(t)||null==t?void 0:t.bootstrap;this.mu(e,!1,i)}mu(t,e,i){var r,n,s;if(void 0===e&&(e=!1),Qi.info("reset"),!this.__loaded)return Qi.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.zl)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.ho());var o=this.get_property(xn),l=this.get_property(Cn),u=this.get_property(Nn),h=this.is_capturing();this.consent.reset(),e||!h||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 d=null==(s=this.persistence)||null==s.za?void 0:s.za(),v=!1;try{var c,f,g,m,y,b,_,w,k,S,x,C,T;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.Ll.clear(),this.vu(),K(u)||null==(S=this.persistence)||S.register({[Nn]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(y=this.conversations)||y.reset(),null==(b=this.logs)||b.reset(),null==(_=this.metrics)||_.reset(),null==(w=this.persistence)||w.set_property(ks,Ws),null==(k=this.sessionManager)||k.resetSessionId(),this.Bl=null,this.config.cookieless_mode===Us)this.register_once({distinct_id:Is,$device_id:null},"");else{var M=this.config.get_device_id(vp());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||K(l)||this.register({[Cn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Ml()||(null==(T=this.persistence)||T.set_property(ks,i.isIdentifiedID?Vs:Ws),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(K(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var E=p({},i);delete E.sessionID,this.config.bootstrap=E}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var I;d&&(null==(I=this.persistence)||null==I.Ga||I.Ga(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s,a,o;if(e.__loaded){e.tu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.Wl)||n.unload(),null==(s=e.Gl)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){Qi.error("Error while destroying feature flags",t)}null==(a=e.persistence)||a.destroy(),null==(o=e.sessionPersistence)||o.destroy()}else Qi.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.yu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.bu()}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(kn)?(Qi.critical("Attempting to create alias for existing People user - aborting."),-2):this.fu("posthog.alias")?(K(e)&&(e=this.get_distinct_id()),t!==e?(this.pu(Tn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Qi.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(Q(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Xi(this.config,cw(t));var f=this.Al();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new u_(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Hl(this.config.debug);nt(m)&&(this.config.debug=m),nt(this.config.debug)&&(this.config.debug?(Gi.DEBUG=!0,bp.ri()&&bp.ii("ph_debug",!0),Qi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Gi.DEBUG=!1,bp.ri()&&bp.ai("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ho()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.Fl(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Gi.LIB_NAME=t,Gi.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.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){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}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 t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:pw._u}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:lw;return e!==lw&&(e=lw+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(ks))===Vs||(null==(e=this.sessionPersistence)?void 0:e.get_property(ks))===Vs}cu(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Gs&&!this._isIdentified()&&J(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Es]))}lu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.cu()||this.fu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.fu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}fu(t){return"never"===this.config.person_profiles?(Qi.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.El(),this.pu(Es,!0),!0)}Al(){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&&this.config.cookieless_mode!==zs)}Fl(){var t,e,i,r,n,s=this.Al();return this.is_capturing()||null==(i=this.logs)||i.wu(),(null==(t=this.persistence)?void 0:t.xa)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.xa)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.Ll.clear(),this.vu()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Us){if(this.Ml()){var i,r,n,s,a,o;null==(i=this.sessionRecording)||i.dispose({discardBufferedEvents:!0}),this.mu(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new q_(this),this.pageViewManager=new Qb(this),this.persistence&&(this.sessionPropsManager=new L_(this,this.sessionManager,this.persistence));var l,u=null!==(s=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==s?s:null==(o=pw.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Tl(this.sessionRecording,new u(this)),this._l&&(null==(l=this.sessionRecording)||null==l.onRemoteConfig||l.onRemoteConfig(this._l)))}var h,d;this.consent.optInOut(!0),this.Fl(),this.su(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==zs&&(null==(h=this.surveys)||h.loadIfEnabled()),(K(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(d=null==t?void 0:t.captureEventName)&&void 0!==d?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.au()}else Qi.warn(rw)}opt_out_capturing(){if(this.config.cookieless_mode!==Us){var t,e,i=this.config.cookieless_mode===zs?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===zs&&this.consent.isOptedIn()&&this.mu(!0,!0),this.consent.optInOut(!1),this.Fl(),this.config.cookieless_mode===zs&&(this.register({distinct_id:Is,$device_id:null}),this.Cl(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.au(),this.su())}else Qi.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 this.config.cookieless_mode===Us||(this.config.cookieless_mode===zs?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Fl()}_is_bot(){return i?j_(i,this.config.custom_blocked_useragents):void 0}au(){r&&("visible"===r.visibilityState?this.Nl||(this.Nl=!0,this.capture(Js,{title:r.title},{send_instantly:!0}),this.ql&&(r.removeEventListener(Zs,this.ql),this.ql=null)):this.ql||(this.ql=this.au.bind(this),ar(r,Zs,this.ql)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ho(){var t=this.zl||{};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?(Qi.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&&!et(t[e]),a=i in t&&!et(t[i]);return s?t[e]:!!a&&(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,Qi)}Xn(t){var e;if(et(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(ot),r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),et(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return at(t.event)?Qi.warn(a+". This can cause unexpected behavior."):Qi.info(a),null}n.properties&&!J(n.properties)||Qi.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Qi.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var o of i)if(n.properties&&et(n.properties[o]))return Qi.warn("Event '"+t.event+"' had its '"+o+"' 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.ta)?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)})}Hl(t){var e=nt(t)&&!t,i=bp.ri()&&"true"===bp.ni("ph_debug");return!e&&(!!i||t)}}pw.__defaultExtensionClasses={},pw._u=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=ir(t.prototype[e[i]])}(pw,["identify"]);class gw{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Q(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.ho(),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}}var mw=Ji("[ExceptionAutocapture]"),yw=Ji("[TracingHeaders]"),bw=Ji("[Web Vitals]"),_w=9e5,ww=["CLS","FCP","INP","LCP"],kw=["INP","LCP"],Sw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],xw="[SessionRecording]",Cw=Ji(xw),Tw=Ji("[Heatmaps]");function Mw(t){return Q(t)&&"clientX"in t&&"clientY"in t&&it(t.clientX)&&it(t.clientY)}var Ew=Ji("[Product Tours]"),Iw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Ln))},Rw=["$set_once","$set"],Pw=Ji("[SiteApps]"),Aw="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",Lw="Disabled. Not loading surveys.";class Dw{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ku=!1,this.Su=[],this.xu=null,this.Cu=null,this.Fs=!1,this.Tu=new Set,this.onRemoteConfig=t=>{if(!this.Fs&&!this.gn.disableSurveys){if(!t.ok)return Qf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(et(e))return Qf.warn("Flags not loaded yet. Not loading surveys.");this.Mu=nt(e)?e:e.length>0,Qf.info("flags response received, isSurveysEnabled: "+this.Mu),this.loadIfEnabled()}},this.Os=t,this.Eu=e}setup(t){if(!this.Fs)return this.Iu=t,Fw(t.kv.initialize(),(()=>{if(this.Iu===t&&!this.Fs){this.Iu=void 0,this.$s=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Fs?e.dispose():(this.Ns=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Fs||(this.Fs=!0,this.Iu=void 0,this.$s=void 0,null==(t=this.Ns)||t.dispose(),this.Ns=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Su=[],this.xu=null,this.Tu.forEach((t=>clearTimeout(t))),this.Tu.clear())}get gn(){return this.Os.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(Yf)||null!=r&&r.startsWith(Xf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Fs&&this.$s){var t=this.gn;if(!this._surveyManager)if(this.ku)Qf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Qf.info(Lw);else if(t.cookielessMode&&this.Os.isOptedOut())Qf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Os.getExtensions();if(e){if(!K(this.Mu)||t.advancedEnableSurveys){var i=this.Mu||t.advancedEnableSurveys;this.ku=!0;try{var r=e.generateSurveys;if(r)return this.Ru(r,i),void(this.ku=!1);var n=e.loadExternalDependency;if(!n)return this.Pu(Hs),void(this.ku=!1);n((t=>{try{if(this.Fs)return;var e=this.Os.getExtensions();t||null==e||!e.generateSurveys?this.Pu("Could not load surveys script",t):this.Ru(e.generateSurveys,i)}finally{this.ku=!1}}))}catch(t){throw this.ku=!1,this.Pu("Error initializing surveys",t),t}}}else Qf.error("PostHog Extensions not found.")}}}Ru(t,e){this.Fs||(this._surveyManager=t(e),this._surveyEventReceiver=this.Os.createEventReceiver(),Qf.info("Surveys loaded successfully"),this.Au({isLoaded:!0}))}Pu(t,e){Qf.error(t,e),this.Au({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Su.push(t),this._surveyManager&&this.Au({isLoaded:!0}),()=>{this.Su=this.Su.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.$s)&&void 0!==i?i:this.Eu;if(r&&!this.Fs){if(this.gn.disableSurveys)return Qf.info(Lw),t([]);var n=r.kv.get(vs);if(n&&!e)return t(n,{isLoaded:!0}),void(this.Fu()&&this.getSurveys((()=>{}),!0));if(this.xu)this.xu.then((e=>{this.Fs||t(e.surveys,e.context)})).catch((t=>Qf.error("Error in survey callback",t)));else{var s=this.Ou("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.gn.requestTimeoutMs}).then((t=>{try{return this.Lu(r,t)}catch(t){return Qf.error("Error processing surveys response",t),this.Lu(r,{statusCode:0,error:t})}}),(t=>this.Lu(r,{statusCode:0,error:t})));this.xu=s;var a=()=>{this.xu===s&&(this.xu=null)};s.then((e=>{a(),this.Fs||t(e.surveys,e.context)}),a).catch((t=>Qf.error("Error in survey callback",t)))}}}Ou(t,e){var i=this.$s;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(Ow)})))}Lu(t,e){if(this.Fs)return{surveys:[],context:{isLoaded:!1,error:Ow}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Qf.error(r):e.error||Qf.warn(r),this.Cu=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Cu=null;var n,s=e.json.surveys||[],a=s.filter((t=>Jf(t)&&(Eo(t)||Kf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[vs]:s,[cs]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}Fu(){return this.Du()&&!this.xu&&!this.$u()}Du(){var t,e,i=null==(t=null!==(e=this.$s)&&void 0!==e?e:this.Eu)?void 0:t.kv.get(cs);return it(i)&&Date.now()-i>3e5}$u(){return it(this.Cu)&&3e5>Date.now()-this.Cu}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};ip(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Au(t){for(var e of this.Su)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Qf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Qf.warn("init was not called")}Nu(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}qu(t){if(et(this._surveyManager))return{eligible:!1,reason:Ow};var e="string"==typeof t?this.Nu(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}ju(t){if(et(this._surveyManager))return{eligible:!1,reason:Ow};var e="string"==typeof t?this.Nu(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(et(this._surveyManager))return Qf.warn("init was not called"),{visible:!1,disabledReason:Ow};var e=this.ju(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return et(this._surveyManager)?(Qf.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.ju(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(et(this._surveyManager))Qf.warn("init was not called");else{var s="string"==typeof t?this.Nu(t):t;if(null!=s&&s.id)if(rp.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Qf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.Tu.delete(o),this.Fs||(Qf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,a,i),Qf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Tu.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Qf.warn("Survey element not found")}else Qf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Qf.warn("Survey not found")}}displaySurvey(t,e){var i;if(et(this._surveyManager))Qf.warn("init was not called");else{var r=this.Nu(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=p({},r,{appearance:p({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Zf&&e.initialResponses&&Qf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.qu(r);if(!s.eligible)return void Qf.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Qf.warn("Survey not found")}}cancelPendingSurvey(t){et(this._surveyManager)?Qf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function $w(t,e,i){if(et(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}}class Nw{constructor(t){this.Bu=new Set,this.Hu=new Set,this.zu=new D_,this.Uu=(t,e)=>this.Wu(t,e)&&this.Vu(t,e)&&this.Gu(t,e)&&this.Zu(t,e),this.Wu=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t}init(){var t,e;K(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Qu=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.Qu)||t.call(this),this.Qu=void 0,this.zu=new D_}register(t){var e,i;if(!K(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Bu.add(t),null==(e=t.steps)||e.forEach((t=>{this.Hu.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Bu.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.Bu.clear(),this.Hu.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Hu.has(t)||this.Hu.has(e.event))&&this.Bu.forEach((t=>{this.Ju(e,t)&&this.zu.emit("actionCaptured",t.name)}))}Ku(t){this.onAction("actionCaptured",(e=>t(e)))}Ju(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Uu(t,i))return!0;return!1}onAction(t,e){return this.zu.on(t,e)}Vu(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(!$w(r,e.url,e.url_matching||"contains"))return!1}return!0}Gu(t,e){return!!this.Yu(t,e)&&!!this.Xu(t,e)&&!!this.th(t,e)}Yu(t,e){var i;if(null==e||!e.href)return!0;var r=this.eh(t);if(r.length>0)return r.some((t=>$w(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&$w((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Xu(t,e){var i;if(null==e||!e.text)return!0;var r=this.eh(t);if(r.length>0)return r.some((t=>$w(t.text,e.text,e.text_matching||"exact")||$w(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!et(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>$w(t,s,a))))}th(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}eh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Zu(t,e){return null==e||!e.properties||0===e.properties.length||Fo(e.properties.reduce(((t,e)=>{var i=G(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)}}class qw{constructor(t){var e;this.ih=[],this._instance=t,this.rh=new Map,this.nh=new Map,this.sh=new Map,this.ah=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.oh(t)))}lh(t){return!1}uh(){return null}hh(t){}dh(){}fh(t,e){return!!t&&Fo(t.propertyFilters,null==e?void 0:e.properties)}ph(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}gh(t,e,i){var r=(i===$f?this.rh:this.nh).get(t),n=[];return this.mh((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.fh(s,e)}))}register(t){this.yh(t,!1)}replace(t){this.yh(t,!0)}yh(t,e){var i;K(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.bh(t,e),this._h(t,e))}_h(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.sh.clear(),0!==i.length){this.wh||(this.wh=new Nw(this._instance),this.wh.init(),this.wh.Ku((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.sh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.sh.set(e.name,n)}}))})),e?this.wh.replace(r):this.wh.register(r)}else{var n;e&&(null==(n=this.wh)||n.replace([]))}}kh(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)}))}bh(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})),a=this.ph(t,$f),o=this.ph(t,Nf);e?(this.rh=a,this.nh=o):(this.kh(this.rh,a),this.kh(this.nh,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.Qu)&&void 0!==i||(this.Qu=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Sh(),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 a=this.xh(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Ch([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Th(s),void this.Mh([s])}if(this.nh.has(t)){var o=this.gh(t,e,Nf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Ch(o.map((t=>t.id))),o.forEach((t=>this.Eh(t.id))))}if(this.rh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.rh.get(t)});var l=this.gh(t,e,$f);this.Ih(l.map((t=>t.id)))}}onAction(t){this.sh.has(t)&&this.Ih(this.sh.get(t)||[])}Ih(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.Th(n)&&this.Rh(n):r.push(n);r.length>0&&(this.ih=[...new Set([...this.ih,...r])]),this.Sh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Th(t){this.ih=this.ih.filter((e=>e!==t));var e=this.Ph();return!e.includes(t)&&(this.Ah([...e,t]),this.Fh(),!0)}Ch(t){var e=new Set(t);this.ih=this.ih.filter((t=>!e.has(t)));var i=this.Oh(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Ah(r),0===r.length&&this.Lh()),this.Mh(t)}Dh(){var t,e=this.uh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Rh(t){if(this.uh()){var e=this.Dh();this.hh(p({},e,{[t]:Date.now()}))}}Mh(t){if(this.uh()){var e=this.Dh(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(J(i)?this.dh():this.hh(i))}}$h(){this.uh()&&this.dh()}getActivationTimestamp(t){if(this.Ph().includes(t)){var e=this.Dh()[t];return it(e)?e:void 0}}Oh(){var t,e=this.Nh();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Ph(){var t,e,i=this.Oh();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.qh()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Fh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.jh(e)}Lh(){this.Bh()}oh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.qh()];if(i&&i!==t){var r=this.Oh(),n=this.Dh();r.length>0&&(this.Ah([]),r.filter((t=>it(n[t]))).forEach((t=>this.Eh(t)))),this.Lh(),this.$h()}}getActivatedIds(){return[...new Set([...this.Ph(),...this.ih])].filter((t=>!this.Hh(t)))}dispose(){var t,e,i;null==(t=this.ah)||t.call(this),this.ah=void 0,null==(e=this.Qu)||e.call(this),this.Qu=void 0,null==(i=this.wh)||i.dispose(),this.wh=void 0}reset(){this.ih=[],this.Oh().length>0&&this.Ah([]),this.Lh(),this.$h()}getEventToItemsMap(){return this.rh}zh(){return this.wh}}class jw extends qw{constructor(t){super(t)}Nh(){return fs}qh(){return ps}uh(){return gs}hh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[gs]:t})}dh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(gs)}lh(t){var e,i;this.mh((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return it(r)&&r>0}Uh(){return Vf.SHOWN}mh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Eh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Sh(){return Qf}Ah(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[fs]:t})}jh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ps]:t})}Bh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ps)}Hh(){return!1}xh(t,e){var i;return this.mh((t=>{i=t.find((t=>t.id===e))})),!i||Io(i)?t===Vf.SHOWN?"consume":"ignore":t===Vf.SHOWN?"persist":t===Vf.DISMISSED||t===Vf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Bw{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);K(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)}}class Hw{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==v?void 0:v.__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)}}var zw=null!=t&&t.location?fr(t.location.hash,"__posthog")||fr(location.hash,"state"):null,Uw="_postHogToolbarParams",Ww=Ji("[Toolbar]"),Vw=Ji("[FeatureFlags]");class Gw{constructor(t,e){void 0===e&&(e=!1),this.Wh=!1,this.update(t,e)}update(t,e){this.Vh=((t,e)=>{var i,r,n,s,a;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!==(a=t.evaluation_contexts)&&void 0!==a?a:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:G(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Wh||(Vw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wh=!0),K(t.flag_keys)||G(t.flag_keys)||Vw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Vh}}var Zw=Ji("[FeatureFlags]"),Qw=Ji("[FeatureFlags]",{debugEnabled:!0}),Jw="\" failed. Feature flags didn't load in time.",Kw="connection_error",Yw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Xw=t=>{var e={};for(var i of tr(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)=>Ro(e,t),not_regex:(t,e)=>!Ro(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class ik{get gn(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{ik.Gh("retrieved web experiments from the server"),e.Zh=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.Zh&&(ik.Gh("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.Zh)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Y(r)&&t.variants[r]&&e.Qh(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];ik.Jh(s,e._instance)&&e.Qh(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())ik.Gh(tk);else if(!this.gn.disable_web_experiments){if(et(this.Zh))return this.Zh=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ik.Gh("applying feature flags",t),t.forEach((t=>{var e;if(this.Zh&&null!=(e=this.Zh)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.Zh)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.Qh(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=ik.getWindowLocation();if(null!=t&&t.search){var e=vr(null==t?void 0:t.search,"__experiment_id"),i=vr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(ik.Gh("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.Kh(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.gn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.gn.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.gn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Kh(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(ik.Gh("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.Qh(r[0].name,e,r[0].variants[e].transforms))}static Jh(t,e){return!et(t.conditions)&&ik.Yh(t,e)&&ik.Xh(t)}static Yh(t,e){var i;if(et(t.conditions)||et(null==(i=t.conditions)?void 0:i.url))return!0;var r=ik.getWindowLocation();if(r){var n,s,a,o=mr(e,r.href);return null==(n=t.conditions)||!n.url||ek[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static Xh(t){var e;if(et(t.conditions)||et(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Zo();if(i.utm_source){var r,n,s,a,o,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==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.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 Gh(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Qi.info("[WebExperiments] "+t,i)}Qh(t,e,i){this._is_bot()?ik.Gh(tk):"control"!==e?i.forEach((i=>{if(i.selector){var r;ik.Gh("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):ik.Gh("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?j_(i,this.gn.custom_blocked_useragents):void 0}}var rk=Ji("[Conversations]"),nk="Conversations not available yet.";function sk(t,e){var r,n,s,a,o,l,u,h=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,d=null!==(n=null==t?void 0:t.maxBufferSize)&&void 0!==n?n:100,v=null!=e&&e.consoleCapture?void 0:null!==(s=null==t?void 0:t.maxLogsPerInterval)&&void 0!==s?s:1e3,c=K(v)?Math.max(d,2048):Math.max(d,v),f=p({},function(){var t="",e="";try{var r=null==i?void 0:i.userAgent;if(r){var n=Ce(r);t=n[0],e=n[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(Xe,t)?Xe[t]:t}(t);return p({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(a=null!==(o=null==f?void 0:f["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==a?a:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==f?void 0:f["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(u=null==f?void 0:f["deployment.environment"])&&void 0!==u?u:null==t?void 0:t.environment,resourceAttributes:f,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:h,maxBufferSize:d,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:h,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var ak=["debug","log","warn","error","info"],ok="console",lk="__posthogHandledLogsRequestError",uk=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[lk]=!0,i},hk=t=>!!t&&"object"==typeof t&&!0===t[lk],dk={featureFlags:class{constructor(t){this.name=sp,this.td=!1,this.featureFlagEventHandlers=[],this.A=Zw,this.ed={},this.rd={},this.nd=[],this.sd=!1,this.ad=!1,this.od=0,this.ld=!1,this.ud=!1,this.hd=!1,this.dd=!1,this.vd=0,this.zt=()=>{var t=this.fd();this.vd=0,t&&this.reloadFeatureFlags()},this.pd=()=>{var t,e=this.gd;K(e)||this.gn.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.md)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.yd())},this.Wt=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.pd()},"get"in t?this.Os=t:(this._instance=t,this.bd=new Gw(t.config,t.ho()),this.Os=this.bd)}updateConfig(t,e){var i;null==(i=this.bd)||i.update(t,e),this.$s&&this._d()}setup(t){return this.Iu=t,this.A=t.logger.createLogger("[FeatureFlags]"),Fw(t.kv.initialize(),(()=>{this.Iu===t&&(this.Iu=void 0,this.$s=t,this.wd(t))}))}wd(e){var i;if(this.$s===e)return t&&ar(t,"online",this.zt),this._d(),this.kd=e.registerDynamicEventProperties((()=>this.Sd()?this.ed:this.rd)),this.xd=null==(i=this._instance)||null==(i=i.persistence)?void 0:i.onCrossTabFeatureFlagChange((()=>{this.Cd(),this.Td()})),this.Cd(),this.initialize()}_d(){var t=this.gn.refreshIntervalMs,e=!this.gn.remoteRequestsDisabled&&r&&!K(t)&&t>0?t:void 0;e!==this.gd&&(this.Md(),K(e)||(this.gd=e,this.yd(),null!=r&&r.addEventListener&&ar(r,Zs,this.Wt)))}yd(){K(this.gd)||(K(this.Ed)||clearInterval(this.Ed),this.md=Date.now(),this.Ed=setInterval(this.pd,this.gd))}Md(){K(this.Ed)||(clearInterval(this.Ed),this.Ed=void 0,null==r||null==r.removeEventListener||r.removeEventListener(Zs,this.Wt)),this.gd=void 0,this.md=void 0}destroy(){this.Id()}dispose(){this.Id()}Id(){var e,i;this.Md(),this.od++,this.ud=!1,this.Iu=void 0,this.$s&&(this.Rd(),null==(e=this.kd)||e.dispose(),this.kd=void 0,null==(i=this.xd)||i.call(this),this.xd=void 0,this.nd=[],null==t||t.removeEventListener("online",this.zt),this.$s=void 0)}get gn(){return this.Os.get()}Pd(t){var e;return null==(e=this.$s)?void 0:e.kv.get(t)}ii(t){this.Ad((()=>{var e;return null==(e=this.$s)?void 0:e.kv.set(t)}))}Fd(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t[ts]){var n=this.Pd(ts)||{},s=t[ts]||{},a=e.flags||e.featureFlags,o=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?o:i&&!G(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Pd(ns)||{},d=t[ns]||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p={[es]:f,[ts]:f,[ns]:!!c||v};for(var g of(t[rs]&&(p[rs]=f),[ss,ws,as]))K(t[g])||(p[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(p)}}ai(t){this.Ad((()=>{var e;return null==(e=this.$s)?void 0:e.kv.remove(t)}))}Ad(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Cd(){var t={};for(var e of[es,ns,ss,os]){var i=this.Pd(e);K(i)||(t[e]=i)}this.ed=t;var r=p({},t),n=this.Pd(ts);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.rd=r}Sd(){var t=this.gn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Pd(ws);return"number"!=typeof e||Date.now()-e>t}Od(){return!!this.Sd()&&(this.dd||this.ad||(this.dd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ld(){var t=this.gn.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})):[]}Dd(){var t=this.gn.flagKeys;if(!K(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.gn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.$d({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Pd(ts))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Pd(ns))&&void 0!==n?n:{},o=p({},s,t),l=p({},a,e),u={};for(var h of Object.entries(o)){var d=h[0],v=h[1];u[d]={key:d,enabled:_(v),variant:w(v),reason:void 0,metadata:K(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.$d({flags:u})}get hasLoadedFlags(){return this.sd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Pd(rs),e=this.Pd(os),i=this.Pd(ls);if(!i&&!e)return t||{};var r=Xi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var a,o,l=r[s],u=null==e?void 0:e[s],h=K(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=K(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=p({},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=p({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(o=l.metadata)?void 0:o.payload})),r[s]=c}return this.td||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.td=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:_(r),variant:w(r),payload:b(e[i])}}))}getFlagVariants(){var t=this.Pd(ts),e=this.Pd(os);if(!e)return t||{};for(var i=Xi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.td||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.td=!0),i}getFlagPayloads(){var t=this.Pd(ns),e=this.Pd(ls);if(!e)return t||{};for(var i=Xi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.td||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.td=!0),i}reloadFeatureFlags(){this.ld||this.gn.featureFlagsDisabled||this.fd()||this.Nd||(this.nd.slice().forEach((t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}})),this.Nd=setTimeout((()=>{this.qd()}),5))}Rd(){clearTimeout(this.Nd),this.Nd=void 0}onReloading(t){return this.nd.push(t),()=>{this.nd=this.nd.filter((e=>e!==t))}}ensureFlagsLoaded(){this.sd||this.ad||this.Nd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ld=t}resetFlagCallReported(){this.ai(ys)}qd(t){this.Rd();var e=this.$s;if(e&&!this.gn.remoteRequestsDisabled&&!this.fd())if(this.ad)this.ud=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},e.initialPersonProperties,this.Pd(us)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Pd(hs),timezone:il()};K(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.gn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Ld();r.length&&(i.evaluation_contexts=r);var n=this.Dd();K(n)||(i.flag_keys=n);var s=this.gn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.od;this.ad=!0;var l=()=>{this.ud&&(this.ud=!1,this.qd())},u=t=>{this.ad=!1,o===this.od?(this.ii({[_s]:[Kw]}),this.A.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.gn.compression,sentAt:"body",timeoutMs:this.gn.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.ad=!1,o===this.od){if(this.jd(t.statusCode),a||this.ud||(this.$anon_distinct_id=void 0),!i.disable_flags||this.ud){this.hd=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Kw:"unknown_error"):200!==t.statusCode&&u.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.ii({[_s]:u}),h?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.$d(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}fd(){return pr(this.vd,3)}jd(t){this.vd=gr(t,this.vd,3,(()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.hd)if(this.sd||this.getFlags()&&this.getFlags().length>0){if(!this.Od()){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+Jw)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.hd)if(this.sd||this.getFlags()&&this.getFlags().length>0){if(!this.Od()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Pd(ss)||void 0,u=this.Pd(ws)||void 0,h=this.Pd(ys)||{};if(this.gn.deduplicateCallsPerSession){var d,v=null==(d=this.$s)?void 0:d.session.sessionId,c=this.Pd(bs);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.ii({[ys]:h,[bs]:i});else{var f,g,m,y,_,w,k,S,x,C,T,M;G(h[t])?h[t].push(o):h[t]=[o],this.ii(p({[ys]:h},i?{[bs]:i}:{}));var E=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Pd(_s))&&void 0!==f?f:[]];K(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.gn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.gn.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.hd};K(null==E||null==(w=E.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=E.metadata.has_experiment),K(null==E||null==(k=E.metadata)?void 0:k.version)||(R.$feature_flag_version=E.metadata.version);var P,A=null!==(S=null==E||null==(x=E.reason)?void 0:x.description)&&void 0!==S?S:null==E||null==(C=E.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=E&&null!=(T=E.metadata)&&T.id&&(R.$feature_flag_id=E.metadata.id),K(null==E?void 0:E.original_variant)&&K(null==E?void 0:E.original_enabled)||(R.$feature_flag_original_response=K(E.original_variant)?E.original_enabled:E.original_variant),null!=E&&null!=(M=E.metadata)&&M.original_payload&&(R.$feature_flag_original_payload=null==E||null==(P=E.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.Bd(R)}else i&&this.ii({[ys]:h,[bs]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:b(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+Jw)}Bd(t){try{var e;null==(e=this.$s)||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.Hd(t,e)}Hd(t,e){var i=this;return f((function*(){var r=i.$s;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Ld();s.length&&(n.evaluation_contexts=s);var a,o=i.Dd();K(o)||(n.flag_keys=o);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.gn.compression,sentAt:"body",timeoutMs:i.gn.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(a)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.hd)return e.defaultValue;if(!(this.sd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Jw),e.defaultValue;var i=this.getFeatureFlag(t,e);return K(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.$d(t,e,i)}$d(t,e,i){if(this.$s){this.sd=!0;var r=function(t,e,i,r,n,s){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=Zw);var a=((t,e)=>{var i=t.flags;return i?p({},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!K(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,s),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(G(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var c=0;l.length>c;c++)v[l[c]]=!0;return{[es]:l,[ts]:v,[as]:!1}}var f=l,g=u,m=o;if(null!=n&&n.partialResponse){var y=Object.keys(f),b=g||{};f=p({},e,f),g=p({},i,b),y.forEach((t=>{var e;t in b||null==(e=g)||delete e[t]})),m=p({},r,m)}else if(t.errorsWhileComputingFlags)if(o){var _=new Set(Object.keys(o).filter((t=>{var e;return!(null!=(e=o[t])&&e.failed)})));f=p({},e,Object.fromEntries(Object.entries(f).filter((t=>_.has(t[0])))));var w=Object.fromEntries(Object.entries(g||{}).filter((t=>_.has(t[0]))));g=p({},i,w),_.forEach((t=>{var e;t in w||null==(e=g)||delete e[t]})),m=p({},r,Object.fromEntries(Object.entries(m||{}).filter((t=>_.has(t[0])))))}else f=p({},e,f),g=p({},i,g),m=p({},r,m);return p({[es]:Object.keys(Xw(f)),[ts]:f||{},[ns]:g||{},[rs]:m||{},[as]:!0===t.minimalFlagCalledEvents},h?{[ss]:h}:{},d?{[ws]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);r&&(this.Fd(r,t,!(null==i||!i.partialResponse)),this.ii(r)),e||(this.dd=!1),this.Td(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.zd(t)}zd(t){if(this.$s){if(!1===t)return this.ai([os,ls]),this.Td(),void Qw.info("All overrides cleared");if(G(t))return this.ii({[os]:Yw(t)}),this.Td(),void Qw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.td=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[os]=G(n)?Yw(n):n),s&&(r[ls]=s),Object.keys(r).length&&this.ii(r),!1===n&&!1===s?this.ai([os,ls]):!1===n?this.ai(os):!1===s&&this.ai(ls),this.Td(),!1===n?Qw.info("Flag overrides cleared"):n&&Qw.info("Flag overrides set",{flags:n}),void(!1===s?Qw.info("Payload overrides cleared"):s&&Qw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ii({[os]:t}),this.Td(),void Qw.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.sd){var e=this.Ud(),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,n=(this.Pd(is)||[]).find((e=>e.flagKey===t)),s={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:s};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);var o=p({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[es]:[t],[ts]:[t],[us]:Object.keys(s)}),this.ii({[es]:Object.keys(Xw(o)),[ts]:o,[us]:p({},this.Pd(us)||{},s)}),this.Td();try{var l;null==(l=this.$s)||l.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.Pd(is);!r||e?this.Wd(t,i):t(r)}Wd(t,e){var i=this;return f((function*(){var r=i.$s;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.ii({[is]:n=a.json.earlyAccessFeatures})}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)}}}))()}Ud(){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)),{})}}Td(t){this.Cd();var e=this.Ud(),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.Vd(t,e)}Vd(t,e){void 0===e&&(e=!0);var i=this.Pd(us)||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,s={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(s[a]=n[a]));this.ii({[us]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Pd(us)||{});t.forEach((t=>{delete i[t]})),this.ii({[us]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.ai(us),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Pd(hs)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.ii({[hs]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Pd(hs)||{};this.ii({[hs]:p({},e,{[t]:{}})})}else this.ai(hs)}reset(){this.od++,this.ud=!1,this.ed={},this.rd={},this.sd=!1,this.ld=!1,this.hd=!1,this.$anon_distinct_id=void 0,this.Rd(),this.td=!1,this.vd=0}}},vk={sessionRecording:class{get gn(){return this._instance.config}get $o(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Gd)||!t.isStarted)}get status(){var t,e;return this.Zd===aa||this.Zd===oa?this.Zd:null!==(t=null==(e=this.Gd)?void 0:e.status)&&void 0!==t?t:this.Zd}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Zd=ta,this.Qd=void 0,this.Jd=!1,this.qt=(()=>{var e;if(null==r||!r.visibilityState||"visible"===r.visibilityState)return!0;var i=null==t||null==(e=t.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=i&&i.length)||i.some((t=>"visible"===t.name))})(),this.Wt=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.qt=!0,null==(t=this.Gd)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Cw.error("started without valid sessionManager"),new Error(xw+" started without valid sessionManager. This is a bug.");if(this.gn.cookieless_mode===Us)throw new Error(xw+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&ar(r,"visibilitychange",this.Wt)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.Jd=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.Wt),i?this.Kd(!0):this.stopRecording()}get Yd(){var e,i=!(null==(e=this._instance.get_property(Nn))||!e.enabled),r=!this.gn.disable_session_recording,n=this.gn.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.Jd||this.Yd&&null!=(e=this.Gd)&&e.isStarted)){var i=!K(Object.assign)&&!K(Array.from);this.Yd&&i?(this.Xd(t),Cw.info("starting")):(this.Zd=ta,this.stopRecording())}}Xd(t){var e,i;if(this.Yd)if(this.Zd!==aa&&this.Zd!==oa&&(this.Zd=sa),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording)this.tv(t);else{var r,n=this._instance.sessionManager;null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.ev,(e=>{if(!this.Jd&&this.Yd&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Fs]:!0}),Cw.error("could not load recorder",e)):void this.tv(t);this.Zd=ta}))}}stopRecording(){var t,e;null==(t=this.Qd)||t.call(this),this.Qd=void 0,null==(e=this.Gd)||e.stop()}Kd(t){var e,i;void 0===t&&(t=!1),null==(e=this.Qd)||e.call(this),this.Qd=void 0,null==(i=this.Gd)||i.discard({discardProducerEvents:t})}iv(){var t,e;null==(t=this.$o)||t.unregister(Wn),null==(e=this.$o)||e.unregister(qn)}rv(t,e){if(et(t))return null;var i,r=it(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Cw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}nv(t){if(this.$o){var e,i,r=this.$o,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.rv(null==(e=this.gn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.rv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;et(a)&&this.iv();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Nn]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({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:K(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};n(),null==(e=this.Qd)||e.call(this),this.Qd=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.nv(e),void this.Kd()):(this.nv(e),void this.startIfEnabledOrStop()):(this.Zd===aa&&(this.Zd=oa,Cw.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.Gd)&&i.log?this.Gd.log(t,e):Cw.warn("log called before recorder was ready")}get ev(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Nn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}sv(){var t,e=this._instance.get_property(Nn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Cw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!et(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=El}tv(t){var e,i,r;if(!this.Jd&&this.Yd&&this._instance.sessionManager){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Cw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Fs]:!0});var n;if(this.Gd||(this.Gd=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.qt),this.Gd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.sv()){if(this.Zd===oa||this.Zd===aa)return;return this.Zd=aa,Cw.info("persisted remote config is stale, requesting fresh config before starting"),void new c_(this._instance).load()}this.Zd=sa,null==(i=(r=this.Gd).setDocumentWasEverVisible)||i.call(r,this.qt),this.Gd.start(t)}else this.Zd=ta}onRRwebEmit(t){var e;null==(e=this.Gd)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Gd||null==(e=this.$o)||e.register({[Bn]:!0}),null==(t=this.Gd)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Gd||null==(e=this.$o)||e.register({[jn]:!0}),null==(t=this.Gd)||t.overrideSampling()}overrideTrigger(t){var e,i;this.Gd||null==(i=this.$o)||i.register({["url"===t?Hn:zn]:!0}),null==(e=this.Gd)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Gd)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Gd)||!i.tryAddCustomEvent(t,e))}}},ck={autocapture:class extends Sb{constructor(t){super(new gw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.av=this.ov()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.lv();return!!(t.path||t.search||this.uv(t))}startIfEnabled(){this.isEnabled&&(Qi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.av=this.ov(),this.startIfEnabled()}stop(){this.hv&&this.hv(),this.hv=void 0,this.dv&&this.dv(),this.dv=void 0,Qi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.vv("pushState"),this.vv("replaceState"),this.fv(),this.uv()&&this.pv())}vv(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Uv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.gv(e)}))}}ov(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}lv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Q(t)?t:{}}uv(t){return void 0===t&&(t=this.lv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}mv(t){var e=this.lv(),i=this.av;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.uv(e)&&t.hash!==i.hash))}gv(t){try{var e=this.ov();if(!e)return;this.mv(e)&&this._instance.capture(Js,{navigation_type:t}),this.av=e}catch(e){Qi.error("Error capturing "+t+" pageview",e)}}fv(){if(!this.hv){var e=()=>{this.gv("popstate")};ar(t,"popstate",e),this.hv=()=>{t&&t.removeEventListener("popstate",e)}}}pv(){if(!this.dv){var e=()=>{this.gv("hashchange")};ar(t,"hashchange",e),this.dv=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get gn(){return this.instance.config}constructor(t){var e;this.yv=!1,this.Is=!1,this.bv=null,this.instance=t,this.yv=!(null==(e=this.instance.persistence)||!e.props[In]),this.rageclicks=new mb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Q(this.gn.capture_heatmaps)&&this.gn.capture_heatmaps.flush_interval_milliseconds&&(t=this.gn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.gn.capture_heatmaps)?et(this.gn.enable_heatmaps)?this.yv:this.gn.enable_heatmaps:!1!==this.gn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Is)return;Tw.info("starting..."),this._v(),this.Wt()}else{var t;clearInterval(null!==(t=this.bv)&&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({[In]:i}),this.yv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Dt;return this.Dt=void 0,t}Sv(t){Mw(t.originalEvent)&&this.Ki(t.originalEvent,"deadclick")}Wt(){this.bv&&clearInterval(this.bv),this.bv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.Mo.bind(this),this.flushIntervalMilliseconds):null}_v(){t&&r&&(this.xv=this.Mo.bind(this),ar(t,Qs,this.xv),this.Cv=e=>this.Ki(e||(null==t?void 0:t.event)),ar(r,"click",this.Cv,{capture:!0}),this.Tv=e=>this.Mv(e||(null==t?void 0:t.event)),ar(r,"mousemove",this.Tv,{capture:!0}),this.Ev=new Ub(this.instance,Hb,this.Sv.bind(this)),this.Ev.startIfEnabledOrStop(),this.Iv=this.Wt.bind(this),ar(r,Zs,this.Iv),this.Is=!0)}wv(){var e;t&&r&&(this.xv&&t.removeEventListener(Qs,this.xv),this.Cv&&r.removeEventListener("click",this.Cv,{capture:!0}),this.Tv&&r.removeEventListener("mousemove",this.Tv,{capture:!0}),this.Iv&&r.removeEventListener(Zs,this.Iv),clearTimeout(this.Rv),null==(e=this.Ev)||e.stop(),this.Is=!1)}Pv(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(e,i,r){for(var n=e;n&&xr(n)&&!Cr(n,"body");){if(n===r)return!1;var s=void 0;try{var a,o,l;s=null==(a=null!==(o=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:t)?void 0:a.getComputedStyle(n).position}catch(t){return!1}if(j(i,s))return!0;n=$r(n)}return!1}(Or(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:n),y:e.clientY+(a?0:r),target_fixed:a,type:i}}Ki(t,e){var i;if(void 0===e&&(e="click"),!Sr(t.target)&&Mw(t)){var r=this.Pv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Wr(Or(t),this.instance.config.rageclick)&&this.ys(p({},r,{type:"rageclick"})),this.ys(r)}}Mv(t){!Sr(t.target)&&Mw(t)&&(clearTimeout(this.Rv),this.Rv=setTimeout((()=>{this.ys(this.Pv(t,"mousemove"))}),500))}ys(e){if(t){var i=this.gn.disable_capture_url_hashes?Pe(t.location.href):t.location.href,r=this.gn.custom_personal_data_properties,n=this.gn.mask_personal_data_properties?[...Uo,...r||[]]:[],s=cr(i,n,Vo);this.Dt=this.Dt||{},this.Dt[s]||(this.Dt[s]=[]),this.Dt[s].push(e)}}Mo(){this.Dt&&!J(this.Dt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ub,webVitalsAutocapture:class{constructor(t){var e;this.yv=!1,this.Is=!1,this.Dt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Av=()=>{clearTimeout(this.Fv),this.Fv=void 0,0!==this.Dt.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.Dt.url},this.Dt.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.Dt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ov=t=>{var e;if(this.Dt=this.Dt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(null==t?void 0:t.name)||et(null==t?void 0:t.value))bw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Lv(i);if(!K(r)){var n=it(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Dv||this.Dv>t.value){this.Dt.navigationKey!==n&&(this.Av(),this.Fv=setTimeout(this.Av,this.flushToCaptureTimeoutMs)),K(this.Dt.navigationKey)&&(this.Dt.navigationKey=n,this.Dt.url=r),this.Dt.firstMetricTimestamp=K(this.Dt.firstMetricTimestamp)?Date.now():this.Dt.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Q(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of Sw){var u="url"===l&&"string"==typeof t.attribution[l]?this.Lv(t.attribution[l]):t.attribution[l];K(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;K(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.Dt.metrics.push(a),this.Dt.metrics.length===this.allowedMetrics.length&&this.Av()}else bw.error("Ignoring metric with value >= "+this.Dv,t)}}},this.$v=()=>{if(!this.Is){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Nv])||("web-vitals"===this.Nv&&K(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!K(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!K(l),t=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,e=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,r=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(t&&e&&i&&r){var h={reportSoftNavs:this.useSoftNavs},d=n&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Ov.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Ov.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Ov.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Ov.bind(this),d),this.Is=!0}else bw.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.yv=!(null==(e=this._instance.persistence)||!e.props[Fn]),this.startIfEnabled()}get qv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Q(this.qv)?null==(t=this.qv)?void 0:t.web_vitals_allowed_metrics:void 0;return et(i)?(null==(e=this._instance.persistence)?void 0:e.props[$n])||ww:i}get flushToCaptureTimeoutMs(){return(Q(this.qv)?this.qv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Q(this.qv)?this.qv.web_vitals_attribution:void 0;return nt(t)?t?ww:[]:G(t)?t:kw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=Q(this.qv)?this.qv.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get Dv(){var t=Q(this.qv)&&it(this.qv.__web_vitals_max_value)?this.qv.__web_vitals_max_value:_w;return t>0&&6e4>=t?_w:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return bw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Q(this.qv)?this.qv.web_vitals:nt(this.qv)?this.qv:void 0;return nt(e)?e:this.yv}startIfEnabled(){this.isEnabled&&!this.Is&&(bw.info("enabled, starting..."),this.Ks(this.$v))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Fn]:i}),this._instance.persistence.register({[$n]:r})),this.yv=i,this.startIfEnabled()}}}get Nv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ks(t){var e=v.__PosthogExtensions__,i=this.Nv,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&K(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?bw.error("failed to load script",e):t()}))}Lv(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Pe(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Uo,...n||[]]:[];return cr(r,s,Vo)}bw.error("Could not determine current URL")}}},fk={exceptionObserver:class{constructor(e){var i;this.$v=()=>{var e;if(t&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jv&&this.gn.capture_unhandled_errors&&(this.jv=i(this.captureException.bind(this))),!this.Bv&&this.gn.capture_unhandled_rejections&&(this.Bv=r(this.captureException.bind(this))),!this.Hv&&this.gn.capture_console_errors&&(this.Hv=n(this.captureException.bind(this)))}catch(t){mw.error("failed to start",t),this.zv()}}},this._instance=e,this.Uv=!(null==(i=this._instance.persistence)||!i.props[Rn]),this.pe=new mt(p({},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:mw})),this.gn=this.Wv(),this.startIfEnabledOrStop()}Wv(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Q(t)?e=p({},e,t):(K(t)?this.Uv:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.gn.capture_console_errors||this.gn.capture_unhandled_errors||this.gn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(mw.info("enabled"),this.zv(),this.Ks(this.$v)):this.zv()}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return mw.error("failed to load script",e);t()}))}zv(){var t,e,i;null==(t=this.jv)||t.call(this),this.jv=void 0,null==(e=this.Bv)||e.call(this),this.Bv=void 0,null==(i=this.Hv)||i.call(this),this.Hv=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Uv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Rn]:this.Uv}),this.gn=this.Wv(),this.startIfEnabledOrStop())}}onConfigChange(){this.gn=this.Wv()}captureException(t){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";this.pe.consumeRateLimit(n)?mw.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Vv=[],this.Gv=bm(),this._instance=t,this.Vv=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Pn))&&void 0!==e?e:[],this.Zv=Ui(this.Qv()),this.Jv=new Wi(this.Zv)}onConfigChange(){this.Zv=Ui(this.Qv()),this.Jv.setConfig(this.Zv)}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:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Vv=s,this._instance.persistence&&this._instance.persistence.register({[Pn]:this.Vv,[An]:a})}}}get Kv(){var t,e=!!this._instance.get_property(An),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.Gv.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Zv.enabled)try{if(!Y(t)||0===t.trim().length)return void pm.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)=>Hi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.Yv(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&pm.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.Jv.add(p({[ji]:t,[Bi]:(new Date).toISOString()},r))}catch(t){pm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Xv(e)){if(this.tc(e))return this.ec("Exception dropped: matched a suppression rule"),void pm.info("Skipping exception capture because a suppression rule matched");if(!this.Kv&&this.ic(e))return this.ec("Exception dropped: thrown by a browser extension"),void pm.info("Skipping exception capture because it was thrown by an extension");if(!this.Kv&&this.rc(e))return this.ec("Exception dropped: thrown by an injected browser script"),void pm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.nc(e))return this.ec("Exception dropped: thrown by the PostHog SDK"),void pm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Zv.enabled&&et(t.$exception_steps)?this.sc(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",uu:!0});return n&&this.Jv.clear(),n}catch(t){return pm.error("Failed to capture exception event. Dropping this exception.",t),void this.Jv.clear()}}catch(t){return void pm.error("Failed to process exception event. Ignoring this exception.",t)}var s}sc(t){try{var e=this.Jv.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return pm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ec(t){this.Zv.enabled&&this.Jv.add({[ji]:t,[Bi]:(new Date).toISOString()})}Yv(t){return Q(t)?p({},t):{}}Qv(){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 Y(i)&&i.length>0&&t.$exception_types.push(i),Y(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Vv.some((t=>{var i=t.values.map((t=>{var i=Ao[t.operator],r=e[t.key];if(!i||!r)return!1;var n=G(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 pm.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&&mm.some((t=>e.startsWith(t)))}));return 0!==i.length&&(!i.every((t=>{var e=t.filename;return!!e&&e.startsWith(gm)}))||t.some((t=>{var e=t.value;return Y(e)&&e.includes("isolatedAPI.contexts.topHostname")}))&&!e.some((t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(gm))})))}rc(t){return t.some((t=>{var e=t.value;return Y(e)&&ym.some((t=>e.includes(t)))}))}nc(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:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Xv(t){return!et(t)&&G(t)}}},pk=p({productTours:class{get $o(){return this._instance.persistence}constructor(t){this.ac=null,this.oc=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.$o&&this.$o.register({[Ln]:!!e.productTours}),!Iw(this._instance))return!this.ac&&et(null==(i=this.$o)?void 0:i.props[ms])||Ew.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&&Iw(this._instance)&&this.Ks((()=>this.lc()))}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?Ew.error("Could not load product tours script",e):t()}))}lc(){var t;!this.ac&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.ac=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!G(this.oc)||e){var i=this.$o;if(i){var r=i.props[ms];if(G(r)&&!e)return this.oc=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(Iw(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=G(e.json.product_tours)?e.json.product_tours:[];this.oc=s,i&&i.register({[ms]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.oc,{isLoaded:!0})}getActiveProductTours(t){et(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.Ks((()=>{var e;this.lc(),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.oc=null,null==(t=this.$o)||t.unregister(ms)}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)}}},dk),gk={siteApps:class{constructor(t){this.uc=0,this._instance=t,this.hc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}dc(t,e){if(e){var i=this.globalsForEvent(e);this.hc.push(i),this.hc.length>1e3&&(this.hc=this.hc.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._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.vc=()=>{t(),this.hc=[],this.vc=void 0}}}globalsForEvent(t){var e,i,r,n,s,a,o;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(h)){var v=d[0];l[v]={id:u[v],type:v,properties:d[1]}}var c=t.$set_once,f=t.$set;return{event:p({},g(t,Rw),{properties:p({},t.properties,f?{$set:p({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},f)}:{},c?{$set_once:p({},null!==(r=null==(n=t.properties)?void 0:n.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(s=null==(a=t.properties)?void 0:a.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=t.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}cc(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)||(Pw.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)||(Pw.error("prepare_external_dependency_script returned null"),null):t}fc(){var t,e,i,n,s,a,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==r?void 0:r.defaultView,h=null==u||null==(t=u.Node)?void 0:t.prototype;if(!u||!h)return()=>{};if(this.uc++,this.gc)return this.mc();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.cc(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!tt(t)));return f(h,"appendChild",(t=>function(e){var i=p(e);return i?t.call(this,i):e})),f(h,"insertBefore",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e})),f(h,"replaceChild",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i})),[null==(e=u.Element)?void 0:e.prototype,null==(i=u.Document)?void 0:i.prototype,null==(n=u.DocumentFragment)?void 0:n.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==(s=u.Element)?void 0:s.prototype,null==(a=u.CharacterData)?void 0:a.prototype,null==(o=u.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==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",(t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null})),this.gc=()=>{d.forEach((t=>t())),this.gc=void 0},this.mc()}mc(){var t=!1;return()=>{var e;t||(t=!0,this.uc--,0===this.uc&&(null==(e=this.gc)||e.call(this)))}}yc(t,e){void 0===e&&(e=!0);var i=this.fc();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.hc.length&&(Pw.info("Processing "+this.hc.length+" events for site app with id "+t.id),this.hc.forEach((t=>this.yc((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.vc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Pw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.yc((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Pw.error(Aw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Pw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}bc(){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)}_c(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.yc((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Pw.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.bc(),void this._instance.on("eventCaptured",(t=>this._c(t)))):void Pw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.vc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Pw.error(Aw+e,t)}))};for(var o of s.siteApps)a()}else Pw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},mk={tracingHeaders:class{constructor(t){this.wc=void 0,this.kc=void 0,this.Sc=void 0,this.$v=()=>{var t,e,i=this.xc();i?(K(this.wc)&&(this.wc=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),K(this.kc)&&(this.kc=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.zv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ks(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return yw.error("failed to load script",e);t()}))}Cc(){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}xc(){var t=this.Cc();return G(t)?(G(this.Sc)?this.Sc.splice(0,this.Sc.length,...t):this.Sc=[...t],t.length>0?this.Sc:void 0):(G(this.Sc)&&this.Sc.splice(0),this.Sc=t||void 0,this.Sc)}zv(){var t,e;null==(t=this.wc)||t.call(this),null==(e=this.kc)||e.call(this),this.wc=void 0,this.kc=void 0}startIfEnabledOrStop(){this.xc()?this.Ks(this.$v):this.zv()}}},yk=p({surveys:class extends Dw{constructor(t){var e;super(new Hw(t),{get projectToken(){return e.config.token},kv:new Bw(e=t)}),this._instance=t}Ou(t,e){var i=e.query?y_(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})}))}}},dk),bk={toolbar:class{constructor(t){this.instance=t}Tc(t){v.ph_toolbar_state=t}Mc(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,n){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===n&&(n=void 0),or(this.instance.config))return!1;if(!t||!r)return!1;e=null!=e?e:t.location,n=null!=n?n:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}i=null==t?void 0:t.localStorage}var s,a=zw||fr(e.hash,"__posthog")||fr(e.hash,"state"),o=a?er((()=>JSON.parse(atob(decodeURIComponent(a)))))||er((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(Uw)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Ec(t){var e=v.ph_load_toolbar||v.ph_load_editor;!et(e)&&Z(e)?e(t,this.instance):Ww.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(br));if(!t||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(t.localStorage.setItem(Uw,JSON.stringify(p({},s,{source:void 0}))),2===this.Mc())this.Ec(s);else if(0===this.Mc()){var a;this.Tc(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Ww.error("[Toolbar] Failed to load",t),void this.Tc(0);this.Tc(2),this.Ec(s)})),ar(t,"turbolinks:load",(()=>{this.Tc(0),this.loadToolbar(s)}))}return!0}Ic(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)}}},_k=p({experiments:ik},dk),wk={conversations:class{constructor(t){this.Rc=void 0,this._conversationsManager=null,this.Pc=!1,this.je=null,this.Ac=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Fc=t.ok,t.ok)){var e=t.config.conversations;et(e)||(nt(e)?this.Rc=e:(this.Rc=e.enabled,this.je=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Rc=void 0,this.je=null,this.Fc=void 0,this.Ac=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Pc||this._instance.config.disable_conversations||or(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!K(this.Rc)&&this.Rc)if(this.je&&this.je.token){this.Pc=!0;try{var e=t.initConversations;if(e)return this.Oc(e),void(this.Pc=!1);var i=t.loadExternalDependency;if(!i)return void this.Lc(Hs);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Lc("Could not load conversations script",e):this.Oc(t.initConversations),this.Pc=!1}))}catch(t){this.Lc("Error initializing conversations",t),this.Pc=!1}}else rk.error("Conversations enabled but missing token in remote config.")}}Oc(t){if(this.je)try{this._conversationsManager=t(this.je,this._instance),this.Ac=!1,rk.info("Conversations loaded successfully")}catch(t){this.Lc("Error completing conversations initialization",t)}else rk.error("Cannot complete initialization: remote config is null")}Lc(t,e){rk.error(t,e),this._conversationsManager=null,this.Pc=!1,this.Ac=!0}show(){this._conversationsManager?this._conversationsManager.show():rk.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Rc&&!tt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":or(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Fc?"remote_config_failed":K(this.Rc)?this.Fc?"disabled_in_project":"remote_config_pending":this.Rc?et(this.je)||!this.je.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.Pc?"initializing":this.Ac?"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 f((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(rk.warn(nk),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(rk.warn(nk),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(rk.warn(nk),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(rk.warn(nk),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(rk.warn(nk),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(rk.warn(nk),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(rk.warn(nk),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}yu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}bu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},kk={logs:class{constructor(e){var i,r=this;this.name=ap,this.Dc=!1,this.$c=!1,this.Nc=!1,this.A=Ji("[logs]"),this.qc=p({},this.A,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(hk)||r.A.error(...e)}}),this.fo=[],this.jc=[],this.vd=0,this.Fs=!1,this.Bc=[],this.Hc=[],this.zc=!1,this.Uc=!1,this.Wc=()=>{var t,e;this.Fs||(this.vd=0,null==(t=this.Vc)||t.onReconnect(),null==(e=this.Gc)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.Dc=!0),t&&ar(t,"online",this.Wc)}Zc(t,e,i,r){var n,s=sk(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new ai(this.Qc(t,e),s,this.qc,(()=>this.Jc()),(t=>t()),void 0,r),s]}Kc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Vc||this.Yc!==e){var i;null==(i=this.Vc)||i.reset(),this.Yc=e;var r=this.Zc((()=>this.fo),(t=>{this.fo=t}));this.Vc=r[0],this.Xc=r[1]}return this.Vc}tf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Gc||this.ef!==e){var i;null==(i=this.Gc)||i.reset(),this.ef=e;var r=this.Zc((()=>this.jc),(t=>{this.jc=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ok);this.Gc=r[0],this.if=r[1]}return this.Gc}setup(t){var e;if(!this.Fs){this.$s=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.Dc=!0),(this.Dc||this.rf()&&this.nf())&&this.sf();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.Fs?r.dispose():(this.Ns=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.Fs||(this.Fs=!0,this.af(),null==(e=this.Ns)||e.dispose(),this.Ns=void 0,this.$s=void 0,this.Nc=!1,null==t||t.removeEventListener("online",this.Wc),null==(i=this.lf)||i.call(this),this.lf=void 0,null==(r=this.Vc)||r.reset(),null==(n=this.Gc)||n.reset())}onRemoteConfig(t){var e,i;if(!this.Fs){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;et(r)?this.uf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[Dn]:!!r}),r?(this.Dc=!0,this.$c||this.sf(),this.loadIfEnabled()):this.uf())}}reset(){var t,e,i,r;this.af(),null==(t=this.Vc)||t.clearQueue(),this.fo=[],null==(e=this.Vc)||e.reset(),null==(i=this.Gc)||i.clearQueue(),this.jc=[],null==(r=this.Gc)||r.reset(),this.vd=0}captureLog(t){this.Fs||this.Kc().captureLog(t)}captureConsoleLog(t){this.Fs||this.tf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Fs||this.tf().captureLog(t,{context:e,occurredAtMs:i})}nf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[Dn])}rf(){var t,e;return null==(t=this._instance)||null==t.ho||!t.ho()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}wu(){var t;this.af(),null==(t=this.Gc)||t.clearQueue(),this.jc=[]}uf(){this.Dc||this.af()}sf(){var t,e=this;if(!this.zc&&null!=v&&v.console){var i=sk(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=rm(v.console[t])}catch(t){return 0}if(!r)return 0;e.Hc.push(Uv(v.console,t,(n=>{var s=function(){for(var r=arguments.length,s=new Array(r),a=0;r>a;a++)s[a]=arguments[a];try{e.hf(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of ak)r(n);this.zc=!0,this.df=setTimeout((()=>{this.af()}),3e4)}}hf(t,e,i){var r;if(this.zc&&!this.Uc&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Bc.length){this.Uc=!0;try{this.Bc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Jc()})}finally{this.Uc=!1}}}else this.af()}af(){if(this.Bc=[],this.zc){for(var t of(this.zc=!1,this.df&&(clearTimeout(this.df),this.df=void 0),this.Hc))t();this.Hc=[]}}vf(){var t=this.Bc;return this.af(),t}get logger(){return this.cf||(this.cf={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.cf}flushLogs(t){t?this.ff(t):(this.Vc&&this.Vc.flush().catch((t=>this.pf(t))),this.Gc&&this.Gc.flush().catch((t=>this.pf(t))))}pf(t){hk(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Fs&&this.Dc&&!this.$c&&!this.Nc){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.af();var e=t.loadExternalDependency;if(!e)return this.A.error(Hs),void this.af();this.Nc=!0;try{e(this._instance,"logs",(e=>{if(this.Nc=!1,!this.Fs&&this.Dc){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.af();else{var r,n,s=this.vf();this.lf=i.initializeLogs(null!==(r=this.$s)&&void 0!==r?r:this._instance),this.$c=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.$s)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.Nc=!1,t}}}Qc(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===S.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===S.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},ss:t=>this.ss(t),getLibraryId:()=>Gi.LIB_NAME,getLibraryVersion:()=>Gi.LIB_VERSION}}ss(t){return new Promise((e=>{if(pr(this.vd,3))e({kind:"fatal",error:uk(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:uk(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.mf(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:uk(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)})}}})}}))}mf(t){(0!==t||this._instance.__loaded)&&(this.vd=gr(t,this.vd,3,(()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}ff(t){this.fo.length>0&&this.yf(t,this.fo,this.Xc,Gi.LIB_NAME,(t=>{this.fo=t})),this.jc.length>0&&this.yf(t,this.jc,this.if,ok,(t=>{this.jc=t}))}yf(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=si(s,ni(i,Gi.LIB_NAME,Gi.LIB_VERSION),r,Gi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.gf(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}gf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Jc(){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,et(n)||(e.sessionStartTimestamp=n),et(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Pe(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},Sk={metrics:class{constructor(t){this.A=Ji("[metrics]"),this._instance=t}initialize(){}Kc(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Vc&&this.Yc===i||(null==(e=this.Vc)||e.reset(),this.Yc=i,this.Vc=new hi(this.Qc(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,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.Vc}count(t,e,i){void 0===e&&(e=1),this.Kc().count(t,e,i)}gauge(t,e,i){this.Kc().gauge(t,e,i)}histogram(t,e,i){this.Kc().histogram(t,e,i)}flush(t){if(!this.Vc)return Promise.resolve();if(t){var e=this.Vc.drainWindow();return e&&this.Ss(e,t),Promise.resolve()}return this.Vc.flush().catch((t=>this.A.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Vc)||t.reset()}Qc(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ss:t=>e.Ss(t),getLibraryId:()=>Gi.LIB_NAME,getLibraryVersion:()=>Gi.LIB_VERSION}}Ss(t,e){return new Promise((i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(s),i(t))},s=setTimeout((()=>n({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(p({method:"POST",url:this.bf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)n({kind:"ok"});else if(413===e)n({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)n({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;n({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}bf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},xk=p({},dk,vk,ck,fk,pk,gk,yk,mk,bk,_k,wk,kk,Sk);pw.__defaultExtensionClasses=p({},xk),function(){Gi.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||G(e._i)){var i=tw[lw]=new pw;if(e){var n=[];Yi(e._i,(function(t){if(t&&G(t)){var r=i.init(t[0],t[1],t[2]),s=e[t[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}}))}i.__SV=1,v.posthog=i,function(){function e(){e.done||(e.done=!0,uw=!1,Yi(tw,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():ar(r,"DOMContentLoaded",e,{capture:!1}):t&&Qi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.js.map
|