posthog-js 1.426.2 → 1.426.3

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.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t="u">typeof window?window:void 0,e="u">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=["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"],_=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return b.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function w(t,e){return-1!==t.indexOf(e)}var k=function(t){return t.trim()},S=function(t){return t.replace(/^\$/,"")};function x(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 C=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}({}),T=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),M="min_length",I="max_length",E=["$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"],R=["token"],P=Object.prototype,A=P.hasOwnProperty,F=P.toString,O=Array.isArray||function(t){return"[object Array]"===F.call(t)},L=t=>"function"==typeof t,D=t=>t===Object(t)&&!O(t),N=t=>{if(D(t)){for(var e in t)if(A.call(t,e))return!1;return!0}return!1},q=t=>void 0===t,j=t=>"[object String]"==F.call(t),B=t=>j(t)&&0===t.trim().length,H=t=>null===t,z=t=>q(t)||H(t),U=t=>"[object Number]"==F.call(t)&&t==t,W=t=>U(t)&&t>0,V=t=>"[object Boolean]"===F.call(t),G=t=>t instanceof FormData,Z=t=>w(E,t),Q=t=>w(R,t);function J(t){return null===t||"object"!=typeof t}function K(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Y(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 tt(t,Error)}}function X(t){return"u">typeof Event&&tt(t,Event)}function tt(t,e){try{return t instanceof e}catch(t){return!1}}var et=[!0,"true",1,"1","yes"],it=t=>w(et,t),rt=[!1,"false",0,"0","no"];function nt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),U(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),nt(null!=n?n:i,e,i,r))}class st{constructor(t){this.C={},this.I=t.I,this.R=nt(t.bucketSize,0,100,t.A),this.O=nt(t.refillRate,0,this.R,t.A),this.N=nt(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 at="Mobile",ot="iOS",lt="Android",ut="Tablet",ht=lt+" "+ut,dt="iPad",vt="Apple",ct=vt+" Watch",ft="Safari",pt="BlackBerry",gt="Samsung",mt=gt+"Browser",yt=gt+" Internet",bt="Chrome",_t=bt+" OS",wt=bt+" "+ot,kt="Internet Explorer",St=kt+" "+at,xt="Opera",Ct=xt+" Mini",Tt="Edge",Mt="Microsoft "+Tt,It="Firefox",Et=It+" "+ot,Rt="Nintendo",Pt="PlayStation",At="Xbox",Ft=lt+" "+at,Ot=at+" "+ft,Lt="Windows",Dt=Lt+" Phone",$t="Nokia",Nt="Ouya",qt="Generic",jt=qt+" "+at.toLowerCase(),Bt=qt+" "+ut.toLowerCase(),Ht="Konqueror",zt="Oculus Browser",Ut="Vivaldi",Wt="Yandex",Vt="Whale",Gt="DuckDuckGo",Zt="Pale Moon",Qt="Waterfox",Jt="Brave",Kt="Claude",Yt="Codex",Xt="ChatGPT",te="Google Search App",ee="(\\d+(\\.\\d+)?)",ie=new RegExp("Version/"+ee),re=new RegExp("("+Kt+"|"+Yt+"|"+Xt+")\\/"+ee),ne=new RegExp(At,"i"),se=new RegExp(Pt+" \\w+","i"),ae=new RegExp(Rt+" \\w+","i"),oe=new RegExp(pt+"|PlayBook|BB10","i"),le={"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"},ue=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Jt:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&w(t,"GSA/")?te:w(t," OPR/")&&w(t,"Mini")?Ct:w(t," OPR/")?xt:oe.test(t)?pt:w(t,"IE"+at)||w(t,"WPDesktop")?St:w(t,"OculusBrowser")?zt:w(t,mt)?yt:w(t,Tt)||w(t,"Edg/")?Mt:w(t,Ut+"/")?Ut:w(t,"YaBrowser/")?Wt:w(t,Vt+"/")?Vt:w(t,Gt+"/")||w(t,"Ddg/")?Gt:w(t,Kt+"/")?Kt:w(t,Yt+"/")?Yt:w(t,Xt+"/")?Xt:w(t,"FBIOS")?"Facebook "+at:w(t,"UCWEB")||w(t,"UCBrowser")?"UC Browser":w(t,"CriOS")?wt:w(t,"CrMo")||w(t,bt)?bt:w(t,lt)&&w(t,ft)?Ft:w(t,"FxiOS")?Et:w(t.toLowerCase(),Ht.toLowerCase())?Ht:w(t,Jt+"/")?Jt:((t,e)=>e&&w(e,vt)||function(t){return w(t,ft)&&!w(t,bt)&&!w(t,lt)}(t))(t,e)?w(t,at)?Ot:ft:w(t,"PaleMoon/")?Zt:w(t,Qt+"/")?Qt:w(t,It)?It:w(t,"MSIE")||w(t,"Trident/")?kt:w(t,"Gecko")?It:"")},he={[St]:[new RegExp("rv:"+ee)],[Mt]:[new RegExp(Tt+"?\\/"+ee)],[bt]:[new RegExp("("+bt+"|CrMo)\\/"+ee)],[wt]:[new RegExp("CriOS\\/"+ee)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ee)],[ft]:[ie],[Ot]:[ie],[xt]:[new RegExp("(Opera|OPR)\\/"+ee)],[It]:[new RegExp(It+"\\/"+ee)],[Et]:[new RegExp("FxiOS\\/"+ee)],[Ht]:[new RegExp("Konqueror[:/]?"+ee,"i")],[pt]:[new RegExp(pt+" "+ee),ie],[Ft]:[new RegExp("android\\s"+ee,"i")],[yt]:[new RegExp(mt+"\\/"+ee)],[zt]:[new RegExp("OculusBrowser\\/"+ee)],[Ut]:[new RegExp(Ut+"\\/"+ee)],[Wt]:[new RegExp("YaBrowser\\/"+ee)],[Vt]:[new RegExp(Vt+"\\/"+ee)],[Jt]:[new RegExp(Jt+"\\/"+ee)],[Kt]:[re],[Yt]:[re],[Xt]:[re],[Gt]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ee)],[Zt]:[new RegExp("PaleMoon\\/"+ee)],[Qt]:[new RegExp(Qt+"\\/"+ee)],[te]:[new RegExp("GSA\\/"+ee)],[kt]:[new RegExp("(rv:|MSIE )"+ee)],Mozilla:[new RegExp("rv:"+ee)]},de=function(t,e,i,r){var n=ue(t,e,i,r),s=he[n];if(q(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},ve=[[new RegExp(At+"; "+At+" (.*?)[);]","i"),t=>[At,t&&t[1]||""]],[new RegExp(Rt,"i"),[Rt,""]],[new RegExp(Pt,"i"),[Pt,""]],[oe,[pt,""]],[new RegExp(Lt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Dt,""];if(new RegExp(at).test(e)&&!/IEMobile\b/.test(e))return[Lt+" "+at,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=le[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Lt,r]}return[Lt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[ot,[t[3],t[4],t[5]||"0"].join(".")]:[ot,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=q(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+lt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+lt+")","i"),t=>t&&t[2]?[lt,[t[2],t[3],t[4]||"0"].join(".")]:[lt,""]],[/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/,[_t,""]],[/Linux|debian/i,["Linux",""]]],ce=function(t){for(var e=0;ve.length>e;e++){var i=ve[e],r=i[1],n=i[0].exec(t),s=n&&(L(r)?r(n,t):r);if(s)return s}return["",""]},fe=function(t){return ae.test(t)?Rt:se.test(t)?Pt:ne.test(t)?At:new RegExp(Nt,"i").test(t)?Nt:new RegExp("("+Dt+"|WPDesktop)","i").test(t)?Dt:/iPad/.test(t)?dt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ct:oe.test(t)?pt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp($t,"i").test(t)?$t:/(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(at).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)?lt:ht:new RegExp("(pda|"+at+")","i").test(t)?jt:new RegExp(ut,"i").test(t)&&!new RegExp(ut+" pc","i").test(t)?Bt:""},pe=function(t,e){var i,r,n,s,a=fe(t);return a===dt||a===ht||"Kobo"===a||"Kindle Fire"===a||a===Bt?ut:a===Rt||a===At||a===Pt||a===Nt?"Console":a===ct?"Wearable":a?at:"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)?at:ut:"Desktop"},ge=20,me=1e3,ye=1e4,be="[Circular]",_e="[Truncated]",we="[Unserializable]",ke="[Function]";function Se(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 xe,Ce,Te,Me=/^[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)&&Me.test(i)?t:e();var i}function Ee(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)}function Oe(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return Te&&i.length===Ce||(Ce=i.length,Te=i.reduce(((i,r)=>{xe||(xe={});var n=xe[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,xe[r]=[l,u];break}}return i}),{})),Te}}class Le{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&&O(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:Oe(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 De="?";function $e(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?De:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return q(r)||(s.lineno=r),q(n)||(s.colno=n),s}var Ne=(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]:De,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},qe=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,je=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Be=/\((\S*)(?::(\d+))(?::(\d+))\)/,He=(t,e)=>{var i=qe.exec(t);if(i)return $e(e,i[1],De,+i[2],+i[3]);var r=je.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=Be.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=Ne(r[1]||De,r[2]);return $e(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},ze=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ue=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,We=(t,e)=>{var i=ze.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=Ue.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]||De,a=Ne(s,n);return $e(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Ve=/\(error: (.*)\)/,Ge=50;class Ze{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=j(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 K(t,"DOMException")}isDOMError(t){return K(t,"DOMError")}}class Qe{match(t){return Y(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 Je{match(t){return!!K(t,"ErrorEvent")&&(null!=t.error||this.Vi(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.Zi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Vi(t){return j(t.message)&&t.message.length>0}Zi(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(j(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Ke=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ye{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(Ke);return r&&(e=r[1],i=r[2]),[e,i]}}var Xe=["fatal","error","warning","log","info","debug"];function ti(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 ei{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(X(t))return t.constructor.name;var e="name"in t?t.name:void 0;return j(e)&&!B(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: "+ti(t)}isSeverityLevel(t){return j(t)&&!B(t)&&Xe.indexOf(t)>=0}getStack(t){try{return j(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:j(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(Y(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class ii{match(t){return X(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ti(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class ri{match(t){return J(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 ni{match(t){return K(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!X(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 J(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 si="$message",ai="$timestamp",oi=new Set([si,ai]),li={enabled:!0,max_bytes:32768};function ui(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:li.enabled,max_bytes:di(t.max_bytes,li.max_bytes)}:p({},li)}class hi{constructor(t){this.Pn=[],this.Fn=0,this.mn=ui(t)}setConfig(t){this.mn=ui(t),this.$n()}add(t){var e=function(t){var e;try{e=x(t)}catch(t){return}try{var i=JSON.parse(e);if(!D(i))return;var r=i,n=r[si],s=r[ai];if(!j(n)||0===n.trim().length)return;if(!j(s)&&!U(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.mn.max_bytes||(this.Pn.push({step:e.step,bytes:i}),this.Fn+=i,this.$n())}}getAttachable(){return this.Pn.map((t=>t.step))}clear(){this.Pn=[],this.Fn=0}size(){return this.Pn.length}$n(){for(;this.Fn>this.mn.max_bytes&&this.Pn.length>0;){var t=this.Pn.shift();t&&(this.Fn-=t.bytes)}}}function di(t,e){if(!U(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var vi=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function ci(t){return"string"==typeof t||t}function fi(t){return"string"==typeof t?t:void 0}var pi,gi=["$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"],mi="NativeGzipValidationError",yi=t=>t.length>=2&&31===t[0]&&139===t[1],bi=(t,e)=>t===T.GZipJS||e===T.GZipJS||"gzip"===e,_i=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),wi=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return _i(t)||e===mi},ki=t=>{throw Ee(mi,"Native gzip produced invalid output: "+t)},Si=function(){var t=f((function*(t,e){18>t.size&&ki("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());yi(i)&&8===i[2]||ki("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(pi)return pi;pi=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;pi[t]=e>>>0}return pi})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&ki("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&ki("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function xi(t,e,i){return Ci.apply(this,arguments)}function Ci(){return Ci=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 Si(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),Ci.apply(this,arguments)}var Ti=0x8000000000000000,Mi="9223372036854775808",Ii={}.propertyIsEnumerable;function Ei(t,e){try{return Ai(t,e,{ancestors:new WeakSet,remainingNodes:ye},0)}catch(t){return[]}}function Ri(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:_e};if(i.remainingNodes--,V(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt(Mi);return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=Ti||-Ti>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:Se(t)};if("function"==typeof t)return{stringValue:ke};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:be};if(r>=ge)return{stringValue:_e};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?Se(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return Ri(o.call(t),e,i,r+1)}catch(t){}return O(t)?{arrayValue:{values:Pi(t,e,i,r+1)}}:{kvlistValue:{values:Ai(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:Se(String(t))}}function Pi(t,e,i,r){for(var n=[],s=Math.min(t.length,me),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(z(o))continue;n.push(Ri(o,e,i,r))}catch(t){n.push({stringValue:we})}return t.length>a&&n.push({stringValue:_e}),n}function Ai(t,e,i,r){var n=[];for(var s in t)if(Ii.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=me||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(H(a)||q(a))continue;n.push({key:Se(s),value:Ri(a,e,i,r)})}catch(t){n.push({key:Se(s),value:{stringValue:we}})}}return n}function Fi(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 Oi={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var Li={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}},Di=Li.info;function $i(t){try{return Se(String(t))}catch(t){return we}}function Ni(t,e,i,r){var n,s=Li[t.level||"info"]||Di,a=s.text,o=s.number,l=(void 0===(n=U(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),z(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),z(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=we}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:$i(t.body)},attributes:Ei(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),q(t.trace_flags)||(g.flags=t.trace_flags),g}function qi(t,e,i){return Fi(t,e,i)}function ji(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ei(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Bi=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.mn=e,this.A=i,this.Nn=r,this.qn=n,this.jn=s,this.Bn=a,this.Hn=null,this.zn=0,this.Un=0,this.Wn=0,this.Vn=0,this.Gn=0,this.Zn=!1,this.Qn=e.maxBufferSize,this.Jn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.Kn=e.flushIntervalMs,this.Yn=e.maxBatchRecordsPerPost,this.Xn=e.rateCapWindowMs,this.ts=e.maxLogsPerInterval}clearQueue(){this.Un++,this._instance.setPersistedProperty(C.LogsQueue,[])}reset(){this.es(),this.Vn=0,this.Gn=0,this.Zn=!1,this.Wn=0,this.Yn=this.mn.maxBatchRecordsPerPost}onReconnect(){this.Wn=0,this.rs()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.ns(t);if(null!==r)if(r.body){if(this.ss()){var n={record:Ni(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Nn(),this.A,null==e?void 0:e.occurredAtMs)};this.qn((()=>this.os(n)))}}else this.A.info("Log was rejected in beforeSend function")}}ns(t){var e=this.mn.beforeSend;if(!e)return t;var i=O(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}ss(){if(void 0===this.ts)return!0;var t=Date.now(),e=t-this.Vn;return this.Xn>e&&e>=0||(this.Vn=t,this.Gn=0,this.Zn=!1),this.ts>this.Gn?(this.Gn++,!0):(this.Zn||(this.A.warn("captureLog dropping logs: exceeded "+this.ts+" logs per "+this.Xn+"ms"),this.Zn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.Hn||(t.Hn=t.ls().finally((()=>{t.Hn=null}))),t.Hn}))()}ls(){var t=this;return f((function*(){var e;t.es();var i=null!==(e=t._instance.getPersistedProperty(C.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.Un;t.zn=0;var l=Math.min(i.length,t.Yn),u=i.slice(0,l),h=u.map((t=>t.record)),d=ji(h,t.us(),null!==(s=t.Bn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.hs(d);if(t.Un!==o)return;if("too-large"===v.kind&&u.length>1)t.Yn=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.Yn);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.mn.maxBatchRecordsPerPost>t.Yn&&(t.Yn=Math.min(t.mn.maxBatchRecordsPerPost,t.Yn+1)),yield t.ds(u.length),i=null!==(a=t._instance.getPersistedProperty(C.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}ds(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.zn),n=null!==(i=e._instance.getPersistedProperty(C.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(C.LogsQueue,n.slice(r)),yield e.jn()}))()}us(){return qi(this.mn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}os(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(C.LogsQueue))&&void 0!==e?e:[];this.Jn>i.length||(i.shift(),this.zn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(C.LogsQueue,i),this.Qn>i.length?this.vs():this.rs()}}vs(t){void 0===t&&(t=this.Kn),this.cs||(this.cs=Pe((()=>{this.cs=void 0,this.rs()}),t))}fs(){var t=Math.min(Math.max(0,this.Wn-1),6);return this.Kn*Math.pow(2,t)}ps(){var t=this._instance.getPersistedProperty(C.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.es();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((()=>{}))}))}))()}rs(){this.flush().then((()=>{this.Wn=0}),(t=>{this.Wn++,this.A.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.ps()&&this.vs(this.fs())}))}es(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};var Hi=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function zi(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 Wi=class{constructor(t,e,i){this._instance=t,this.mn=e,this.A=i,this.gs=new Map,this.Hn=null,this.ys=!1,this.bs=new Map,this._s=new Set,this.ws=0}count(t,e,i){void 0===e&&(e=1),this.ks({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.ks({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.ks({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.Hn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.Ss()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.Hn===r&&(this.Hn=null)}));return this.Hn=r,r}drainWindow(){if(0===this.gs.size)return null;var t=this.gs;return this.gs=new Map,this.ys=!1,this.bs=new Map,this._s=new Set,this.xs(t)}reset(){this.ws++,this.es(),this.gs=new Map,this.Hn=null,this.ys=!1,this.bs=new Map,this._s=new Set}ks(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.ns(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.gs.get(r);if(!n){if(!this.Cs())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.gs.set(r,n)}var s=this.bs.get(e.name);void 0===s?this.bs.set(e.name,e.type):s===e.type||this._s.has(e.name)||(this._s.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.Ts(n,e.value),this.vs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Cs(){return this.mn.maxSeriesPerFlush>this.gs.size||(this.ys||(this.ys=!0,this.A.warn("Metric series cap reached ("+this.mn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ts(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(Hi.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,Hi)]+=1}}ns(t){var e=this.mn.beforeSend;if(!e)return t;var i=O(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}vs(){this.cs||(this.cs=Pe((()=>{this.cs=void 0,this.flush().catch((t=>{this.A.error("Metrics flush failed:",t)}))}),this.mn.flushIntervalMs))}es(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}Ss(){var t=this;return f((function*(){if(0!==t.gs.size){var e=t.gs;t.gs=new Map,t.ys=!1,t.bs=new Map,t._s=new Set;var i=t.ws,r=yield t._instance.Ms(t.xs(e));if(i===t.ws)switch(r.kind){case"ok":return;case"retry-later":return t.Is(e),void t.vs();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)}}}))()}xs(t){return e=this.Es(t),i=function(t,e,i){return Fi(t,e,i)}(this.mn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ei(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Es(t){var e=zi(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=Ei(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),l=zi(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:Hi})}return Array.from(i.values())}Is(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.gs.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.Cs()&&this.gs.set(n,s)}}};function Vi(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var Gi={DEBUG:!1,LIB_VERSION:"0.7.2",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)&&!q(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){O(t)&&t.forEach(e)}function Yi(t,e){if(!z(t))if(O(t))t.forEach(e);else if(G(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)A.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){(j(t)&&t.length>0||U(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(!j(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 x(t)}},hr=t=>{var e=null==r?void 0:r.createElement("a");return q(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){q(t)||q(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(!O(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("=");O(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(!L(r))return e;try{var n=r(e);return j(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 q(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 Ir=1e3;function Er(t){return t?k(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 Er(e)}function Ar(t){return z(t)?null:k(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:"")})),k(e)}function Or(t){var e;return q(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(q(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(V(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")?w(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||q(t))return!1;var i;if(!0===t)i=qr;else{if(!O(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++>=Ir||e.has(r))return!1;e.add(r);var n=Pr(r);if(w(n,"ph-sensitive")||w(n,"ph-no-capture"))return!1}if(w(Pr(t),"ph-include"))return!0;var s=t.type||"";if(j(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!j(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),z(t))return!1;if(j(t)){t=k(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 O(e)?e:Er(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=>{z(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(z(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return j(n)&&(n=parseInt(n)),n>i?un+" "+r+" body too large to record ("+n+" bytes)":t}function _n(t,e){if(z(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="$fbc",In="$fbc_persistence",En="__timers",Rn="$autocapture_disabled_server_side",Pn="$heatmaps_enabled_server_side",An="$exception_capture_enabled_server_side",Fn="$error_tracking_suppression_rules",On="$error_tracking_capture_extension_exceptions",Ln="$web_vitals_enabled_server_side",Dn="$dead_clicks_enabled_server_side",$n="$product_tours_enabled_server_side",Nn="$logs_capture_enabled_server_side",qn="$web_vitals_allowed_metrics",jn="$session_recording_remote_config",Bn="$replay_sample_rate",Hn="$replay_override_sampling",zn="$replay_override_linked_flag",Un="$replay_override_url_trigger",Wn="$replay_override_event_trigger",Vn="$sesid",Gn="$session_is_sampled",Zn="$session_past_minimum_duration",Qn="$session_recording_url_trigger_activated_session",Jn="$session_recording_event_trigger_activated_session",Kn="$posthog_sr_group_event_trigger_",Yn="$posthog_sr_group_url_trigger_",Xn="$posthog_sr_group_sampling_",ts="$debug_first_full_snapshot_timestamp",es="$sess_rec_flush_size",is="$enabled_feature_flags",rs="$active_feature_flags",ns="$early_access_features",ss="$feature_flag_details",as="$feature_flag_payloads",os="$feature_flag_request_id",ls="$minimal_flag_called_events",us="$override_feature_flags",hs="$override_feature_flag_payloads",ds="$stored_person_properties",vs="$stored_group_properties",cs="$groups",fs="$surveys",ps="$surveys_loaded_at",gs="$surveys_activated",ms="$surveys_activated_session",ys="$surveys_activated_timestamps",bs="ph_product_tours",_s="$flag_call_reported",ws="$flag_call_reported_session_id",ks="$feature_flag_errors",Ss="$feature_flag_evaluated_at",xs="$user_state",Cs="$client_session_props",Ts="$capture_rate_limit",Ms="$initial_campaign_params",Is="$initial_referrer_info",Es="$initial_person_info",Rs="$epp",Ps="$posthog_cookieless",As="$cookieless_mode",Fs="$sdk_debug_extensions_init_method",Os="$sdk_debug_extensions_init_time_ms",Ls="$sdk_debug_recording_script_not_loaded",Ds="$sdk_debug_replay_event_trigger_status",$s="$sdk_debug_replay_linked_flag_trigger_status",Ns="$sdk_debug_replay_matched_recording_trigger_groups",qs="$sdk_debug_replay_pending_trigger_conditions",js="$sdk_debug_replay_remote_trigger_matching_config",Bs="$sdk_debug_replay_trigger_groups_count",Hs="$sdk_debug_replay_url_trigger_status",zs="$session_recording_start_reason",Us="PostHog loadExternalDependency extension not found.",Ws="on_reject",Vs="always",Gs="anonymous",Zs="identified",Qs="identified_only",Js="visibilitychange",Ks="beforeunload",Ys="$pageview",Xs="$pageleave",ta="$identify",ea="$groupidentify",ia="disabled",ra="sampled",na="active",sa="buffering",aa="paused",oa="lazy_loading",la="awaiting_config",ua="missing_config",ha="rrweb_error",da="trigger",va=da+"_activated",ca=da+"_pending",fa=da+"_"+ia;function pa(t,e,i,r,n,s){return 0===e?fa:(null==t?void 0:t.get_property(i?r+i:n))===s?va:ca}function ga(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 ma(t){return t.includes(va)?va:t.includes(ca)?ca:fa}function ya(t){var e=new Set(t);switch(e.delete(fa),e.size){case 0:return fa;case 1:return Array.from(e)[0];default:return ca}}class ba{constructor(t){this.j=t}triggerStatus(t){return ma(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return ma(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class _a{constructor(t){this.j=t}triggerStatus(t){return ya(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return ya(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class wa{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return va}stop(){}}var ka=t=>"sessionRecording"in t;class Sa{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=(ka(t)?D(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(ka(t)?D(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 pa(this._instance,this.B.length,this.V,Yn,Qn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Hs]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=yr(this._instance);if(!t)return!1;try{return ga(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=ga(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=ga(n,this.H,this.U);a&&!s?t():!a&&s&&e();var o=this.G(r)===va,l=ga(n,this.B,this.$);!o&&l&&i("url",n)}}stop(){this.W=""}}class xa{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[$s]:t}),t}triggerStatusNoSideEffects(){var t=ca;return z(this.linkedFlag)&&(t=fa),this.linkedFlagSeen&&(t=va),t}onConfig(t,e){var i;if(this.linkedFlag=(ka(t)?D(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!z(this.linkedFlag)&&!this.linkedFlagSeen){var r=j(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=j(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(D(i)&&r in i){var a=i[r];s=V(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 Ca{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(ka(t)?D(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return pa(this._instance,this.Y.length,this.V,Kn,Jn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Ds]:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Y.length){var r=this.K(i)===va,n=this.Y.includes(t);!r&&n&&e("event",t)}}stop(){}}class Ta{constructor(t,e,i){if(this._instance=t,this.group=e,this.X=new Sa(t,e.id),this.ee=new Ca(t,e.id),this.te=new xa(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 ba(s):new _a(s)}else this.re=new wa}triggerStatus(t){return this.re.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.re.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==ca?[]:[{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===ca)).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?Yn+this.group.id:Kn+this.group.id]:e})}stop(){this.X.stop(),this.ee.stop(),this.te.stop()}}function Ma(t){if(t.rrwebError)return ha;if(!t.receivedFlags)return sa;if(!t.isRecordingEnabled)return ia;if(t.urlTriggerMatching.urlBlocked)return aa;var e=!0===t.isSampled,i=new ba([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ra:i===va?na:i===ca?sa:!1===t.isSampled?ia:na}function Ia(t){if(t.rrwebError)return ha;if(!t.receivedFlags)return sa;if(!t.isRecordingEnabled)return ia;if(t.urlTriggerMatching.urlBlocked)return aa;var e=new _a([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==fa,r=V(t.isSampled);return i&&e===ca?sa:i&&e===fa||r&&!t.isSampled?ia:!0===t.isSampled?ra:na}function Ea(){var t=[];return function(e,i){if(D(i)||O(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Ra(t){var e=JSON.stringify(t,Ea());return e?new Blob([e]).size:0}function Pa(t){if(H(t))return 4;if(q(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(O(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=q(r)||H(r)?4:Pa(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];q(l)||(a||(s+=1),a=!1,s+=o.length+3+Pa(l))}return s;default:return 0}}function Aa(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[Aa({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Aa({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 Fa=Uint8Array,Oa=Uint16Array,La=Uint32Array,Da=new Fa([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]),$a=new Fa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Na=new Fa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qa=function(t,e){for(var i=new Oa(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new La(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]},ja=qa(Da,2),Ba=ja[1];ja[0][28]=258,Ba[258]=28;for(var Ha=qa($a,0)[1],za=new Oa(32768),Ua=0;32768>Ua;++Ua){var Wa=(43690&Ua)>>>1|(21845&Ua)<<1;za[Ua]=((65280&(Wa=(61680&(Wa=(52428&Wa)>>>2|(13107&Wa)<<2))>>>4|(3855&Wa)<<4))>>>8|(255&Wa)<<8)>>>1}var Va=function(t,e,i){for(var r=t.length,n=0,s=new Oa(e);r>n;++n)++s[t[n]-1];var a,o=new Oa(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new Oa(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[za[d]>>>l]=u}else for(a=new Oa(r),n=0;r>n;++n)a[n]=za[o[t[n]-1]++]>>>15-t[n];return a},Ga=new Fa(288);for(Ua=0;144>Ua;++Ua)Ga[Ua]=8;for(Ua=144;256>Ua;++Ua)Ga[Ua]=9;for(Ua=256;280>Ua;++Ua)Ga[Ua]=7;for(Ua=280;288>Ua;++Ua)Ga[Ua]=8;var Za=new Fa(32);for(Ua=0;32>Ua;++Ua)Za[Ua]=5;var Qa=Va(Ga,9,0),Ja=Va(Za,5,0),Ka=function(t){return(t/8>>0)+(7&t&&1)},Ya=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Oa?Oa:t instanceof La?La:Fa)(i-e);return r.set(t.subarray(e,i)),r},Xa=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},to=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},eo=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 Fa(0),0];if(1==n){var a=new Fa(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 Oa(v+1),f=io(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 Fa(c),f]},io=function(t,e,i){return-1==t.s?Math.max(io(t.l,e,i+1),io(t.r,e,i+1)):e[t.s]=i},ro=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Oa(++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]},no=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},so=function(t,e,i){var r=i.length,n=Ka(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)},ao=function(t,e,i,r,n,s,a,o,l,u,h){Xa(e,h++,i),++n[256];for(var d=eo(n,15),v=d[0],c=d[1],f=eo(s,15),p=f[0],g=f[1],m=ro(v),y=m[0],b=m[1],_=ro(p),w=_[0],k=_[1],S=new Oa(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=eo(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Na[I-1]];--I);var E,R,P,A,F=u+5<<3,O=no(n,Ga)+no(s,Za)+a,L=no(n,v)+no(s,p)+a+14+3*I+no(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return so(e,h,t.subarray(l,l+u));if(Xa(e,h,1+(O>L)),h+=2,O>L){E=Va(v,c,0),R=v,P=Va(p,g,0),A=p;var D=Va(T,M,0);for(Xa(e,h,b-257),Xa(e,h+5,k-1),Xa(e,h+10,I-4),h+=14,x=0;I>x;++x)Xa(e,h+3*x,T[Na[x]]);h+=3*I;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Xa(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Xa(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=Qa,R=Ga,P=Ja,A=Za;for(x=0;o>x;++x)if(r[x]>255){var B;to(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Xa(e,h,r[x]>>>23&31),h+=Da[B]);var H=31&r[x];to(e,h,P[H]),h+=A[H],H>3&&(to(e,h,r[x]>>>5&8191),h+=$a[H])}else to(e,h,E[r[x]]),h+=R[r[x]];return to(e,h,E[256]),h+R[256]},oo=new La([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lo=function(){for(var t=new La(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),uo=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=lo[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},ho=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Fa(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=so(l,u,t.subarray(h,d)):(l[h]=true,u=so(l,u,t.subarray(h,a)))}else{for(var v=oo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Oa(32768),m=new Oa(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 La(25e3),k=new Oa(288),S=new Oa(32),x=0,C=0,T=(h=0,0),M=0,I=0;a>h;++h){var E=_(h),R=32767&h,P=m[E];if(g[R]=P,m[E]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=ao(t,l,0,w,k,S,C,T,I,h-I,u),T=x=C=0,I=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&E==_(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|Ba[O]<<18|Ha[L];var G=31&Ba[O],Z=31&Ha[L];C+=Da[G]+$a[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=ao(t,l,true,w,k,S,C,T,I,h-I,u)}return Ya(o,0,r+Ka(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)},vo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},co=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&&vo(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)}},fo=function(t){return 10+(t.filename&&t.filename.length+1||0)};function po(t,e){void 0===e&&(e={});var i=uo(),r=t.length;i.p(t);var n=ho(t,e,fo(e),8),s=n.length;return co(n,e),vo(n,s-8,i.d()),vo(n,s-4,r),n}function go(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Fa(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 Fa(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 Ya(r,0,n)}function mo(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class yo{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=Pa(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 st({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=U(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.426.2",Gi.LIB_NAME="web";class bo{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(es,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.we(es);return D(e=i)&&j(e.sessionId)&&U(e.size)&&i.sessionId===t?i.size:0}}function _o(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<nt(100*e,0,100,Qi)}function wo(t){return"$survey_response_"+t}function ko(t,e){if(!e)return null;var i=t[wo(e)];return O(i)?[...i]:i}function So(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!q(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=ko(t,e.id);q(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:ko(t,e.id)}}))},t,r)}function xo(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 Co(t){return"string"==typeof t&&t.trim()?t.trim():null}function To(t){return t.toLowerCase()}function Mo(t,e,i){if(!t||!e)return null;var r=To(e),n=Object.keys(t).find((t=>To(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=>To(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var Io=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Eo(t,e,i){var r,n=Mo(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),q(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of Io){var d=l[h];q(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return Io.some((e=>!q(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=Mo(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 q(s.question)||(a.question=s.question,o=!0),q(s.description)||(a.description=s.description,o=!0),q(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!q(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!q(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!q(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return O(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 Ro(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Po(t){var e;return Ro(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ao=(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}},Fo=t=>t.toLowerCase(),Oo={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=>Ao(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ao(e,t))))),icontains:(t,e)=>e.map(Fo).some((e=>t.map(Fo).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Fo).every((e=>t.map(Fo).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 Lo(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=Oo[i.operator];return!!n&&n(i.values,[String(r)])}))}function Do(t,e,i){return ur({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var $o=new Set(["is_not","not_icontains","not_regex"]);function No(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(q(n)||H(n))return $o.has(s);var a=Oo[s];return!!a&&!q(t.value)&&!H(t.value)&&a(O(t.value)?t.value.map(String):[String(t.value)],O(n)?n.map(String):[String(n)])}))}var qo=Ji("[SessionRecording]");function jo(t,e){return e?t:"!"+t}function Bo(t,e){return t===e||t!=="!"+e&&null}class Ho{constructor(t,e,i,r,n,s,a){this._e=null,this.Se=Ia,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=U(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Te=new ba([this.ee,this.X]),this.Se=Ma):(this.Te=new _a([this.ee,this.X]),this.Se=Ia),this._instance.register_for_session({[js]: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 U(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&&z(this.Ie))return this.Ie=t((t=>{try{this.ee.checkEventTriggerConditions(t.event,i,e)}catch(t){qo.error("Could not activate event trigger",t)}})),this.Ie}makeSamplingDecisions(t){var e,i,r,n=this._e;if(!U(n))return null==(i=this._instance.persistence)||i.unregister(Gn),void(null==(r=this._instance.persistence)||r.unregister(Bn));var s=this._instance.get_property(Gn),a=this._instance.get_property(Bn),o=Bo(s,t),l=U(a)&&a!==n,u=q(a)&&s===t,h=l||u||!V(o),d=h?_o(t,n):o;h&&(d?this.xe("sampled"):qo.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Gn]:jo(t,d),[Bn]:H(a)&&s===t?null:n})}ensureSamplingDecision(t){if(U(this._e)){var e=this._instance.get_property(Gn);V(Bo(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Jn),null==(e=this._instance.persistence)||e.unregister(Qn),null==(i=this._instance.persistence)||i.unregister(Gn),null==(r=this._instance.persistence)||r.unregister(Bn),null==(n=this._instance.persistence)||n.unregister(Zn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Te)?void 0:e.triggerStatus(t))===ca}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===ca)).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 zo{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({[js]:"v2_trigger_groups",[Bs]:t.triggerGroups.length}),this.X.onConfig(t)):qo.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ha;if(t.urlTriggerMatching.urlBlocked)return aa;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return ia;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===va){var o=s.group.id,l=i.get(o);q(l)?Qi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===ca&&(r=!0)}return n?ra:r?sa:ia}({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;U(r)&&(H(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 qo.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(ds),o=s.some((e=>!e.properties||0===e.properties.length||No(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){qo.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=Xn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(D(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=U(c)&&c!==s,l=v===t&&U(c)&&c===s&&V(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!V(l),g=p?_o(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(Gn),null==(e=this._instance.persistence)||e.unregister(Bn),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(Kn+o),null==(s=this._instance.persistence)||s.unregister(Yn+o),null==(a=this._instance.persistence)||a.unregister(Xn+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({[Ns]:e})}hasPendingTriggers(t){for(var e of this.Re)if(e.triggerStatus(t)===ca)return!0;return!1}getPendingTriggerConditions(t){return this.Re.flatMap((e=>e.triggerStatusNoSideEffects(t)!==ca?[]: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||No(i,e,this._instance.get_property(ds))}Oe(t){var e=this;this.Re.forEach((t=>t.stop())),this.Re=[],this.Ae.clear();var i=function(t){var i=new Ta(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 Uo=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}},Wo="https?://(.*)",Vo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Go=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Vo],Zo="<masked>",Qo=["li_fat_id"];function Jo(t,e,i){if(!r)return{};var n,s=e?[...Vo,...i||[]]:[],a=Ko(cr(r.URL,s,Zo),t),o=(n={},Yi(Qo,(function(t){var e=Uo(t);n[t]=e||null})),n);return Xi(o,a)}function Ko(t,e){var i=Go.concat(e||[]),r={};return Yi(i,(function(e){var i=vr(t,e);r[e]=i||null})),r}function Yo(t){var e=function(t){return t?0===t.search(Wo+"google.([^/?]*)")?"google":0===t.search(Wo+"bing.com")?"bing":0===t.search(Wo+"yahoo.com")?"yahoo":0===t.search(Wo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!H(e)){n.$search_engine=e;var s=r?vr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Xo(){return navigator.language||navigator.userLanguage}var tl="$direct";function el(){return(null==r?void 0:r.referrer)||tl}function il(t,e,i){void 0===i&&(i=!1);var r=t?[...Vo,...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:el().substring(0,1e3),u:a?cr(a,r,Zo):void 0}}function rl(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==tl?tl: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=Ko(s);Xi(a,l)}if(r){var u=Yo(r);Xi(a,u)}return a}function nl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function sl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var al=1e5,ol="https://schema.org",ll=[],ul="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(" "),hl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),dl="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(" "),vl="Accommodation AdministrativeArea Country Place State".split(" "),cl={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:hl,publisher:dl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ll},Offer:{seller:dl},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:dl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:dl,areaServed:vl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ll}},fl={},pl=[[hl,fl],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),cl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),cl.Event],[dl,cl.Organization],[vl,cl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),cl.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),fl]],gl="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 ml(t,e){return A.call(t,e)?t[e]:void 0}function yl(t){var e=typeof t;return H(t)||"string"===e||"number"===e||"boolean"===e}function bl(t){return yl(t)||O(t)&&t.every(yl)?t:void 0}function _l(t){if(A.call(cl,t))return cl[t];for(var e of pl){var i=e[1];if(e[0].includes(t))return i}return gl.includes(t)?fl:void 0}function wl(t,e){if(!D(t))return null;var i=ml(t,"@type"),r=function(t){return("string"==typeof t?[t]:O(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!_l(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=bl(ml(t,"@id"));for(var a of(q(s)||(n["@id"]=s),ul)){var o=bl(ml(t,a));q(o)||(n[a]=o)}for(var l of r){var u=_l(l),h=function(){var e=ml(t,d),i=u[d];if(!0===i){var r=bl(e);q(r)||(n[d]=r)}else if(O(e)){var s=e.map((t=>wl(t,i))).filter(D);s.length&&(n[d]=s)}else{var a=wl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function kl(t){if(!D(t))return null;var e=ml(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=wl(t);if(i)return p({"@context":ol},i);var r=ml(t,"@graph");if(!O(r))return null;var n=r.map((t=>wl(t))).filter(D);return n.length?{"@context":ol,"@graph":n}:null}function Sl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function xl(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 Cl(t){return Sl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Sl)}function Tl(t){return q(t)?void 0:Math.round(t)}function Ml(t){return D(t)?t.network_timing:t}var Il,El,Rl=36e5,Pl=943718.4,Al="[SessionRecording]",Fl=Ji(Al),Ol=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Ll=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Dl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function $l(){var t;return null==(t=Dl())?void 0:t.record}function Nl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Ea())}}function ql(t){return mo(po(go(Nl(t))))}function jl(t){return Bl.apply(this,arguments)}function Bl(){return(Bl=f((function*(t){var e=Nl(t),i=yield xi(e,Gi.DEBUG,{rethrow:!0});return mo(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var Hl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,zl=!1;function Ul(t){return O(t)&&0===t.length?Il=null!=Il?Il:ql([]):ql(t)}function Wl(t){return Vl.apply(this,arguments)}function Vl(){return(Vl=f((function*(t){return O(t)&&0===t.length?Il||(El=null!=El?El:jl([]).then((t=>(Il=t,t))).catch((t=>{throw Il=void 0,El=void 0,t}))):jl(t)}))).apply(this,arguments)}function Gl(t){return Hl&&!zl&&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:Pa(t)}}function Ql(t,e){return p({},t,{data:e,cv:"2024-10"})}function Jl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Kl(t){try{if(t.type===m.FullSnapshot)return Zl(Ql(t,ql(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Zl(Jl(t,{texts:Ul(t.data.texts),attributes:Ul(t.data.attributes),removes:Ul(t.data.removes),adds:Ul(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Zl(Jl(t,{adds:t.data.adds?ql(t.data.adds):void 0,removes:t.data.removes?ql(t.data.removes):void 0}))}catch(t){Fl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ra(t)}}function Yl(){return Yl=f((function*(t){try{if(t.type===m.FullSnapshot)return Zl(Ql(t,yield jl(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([Wl(t.data.texts),Wl(t.data.attributes),Wl(t.data.removes),Wl(t.data.adds)]);return Zl(Jl(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?jl(t.data.adds):void 0,t.data.removes?jl(t.data.removes):void 0]);return Zl(Jl(t,{adds:i[0],removes:i[1]}))}}catch(e){return wi(e)&&(zl=!0),Fl.error("could not compress event asynchronously - trying synchronous compression",e),Kl(t)}return{event:t,size:Ra(t)}})),Yl.apply(this,arguments)}function Xl(t,e){return t.type===m.Custom&&t.data.tag===e}function tu(t){return Xl(t,"sessionIdle")}function eu(t){return Xl(t,"$session_ending")}function iu(t){return Xl(t,"$session_starting")}class ru{get sessionId(){return this.Pe}get Ne(){if(!this._instance.sessionManager)throw new Error(Al+" 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 Bo(this._instance.get_property(Gn),this.sessionId)}get _e(){var t,e=null==(t=this.je)?void 0:t.sampleRate;return U(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(ts),this.ot=!1,null==(n=Dl())||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=!1,this.Ot=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Zn])===this.Pe},this.Dt=()=>{var t,e;if(0===this.Pt.data.length)return null;var i=null==(t=this.Pt.data[0])?void 0:t.timestamp,r=null==(e=this.Pt.data[this.Pt.data.length-1])?void 0:e.timestamp;return U(i)&&U(r)?r-i:null},this.Nt=()=>{var t,e,i=this.Be;if(!U(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Ft;return U(r)&&r>=0&&i>r}if(this.Ot())return!1;var n,s=this.Dt();return!!H(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Zn]:this.Pe}),!1)},this.qt=()=>{this.status!==sa?(this.Xe&&this.et&&this.jt&&!this.tt&&(this.Xe=!1),this.Bt(),this.Ht()):this.$t()},this.Ut=()=>{this.qt()},this.zt=()=>{this.Le("browser offline",{})},this.Wt=()=>{this.Le("browser online",{})},this.Vt=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.jt=!0),this.Le("window "+r.visibilityState,{}))},this._instance=t,this.jt=null==e||e;var i=this.Ne.checkAndGetSessionAndWindowId(),n=i.windowId;this.Pe=i.sessionId,this.It=n,this.te=new xa(this._instance),this.X=new Sa(this._instance),this.ee=new Ca(this._instance),this.Pt=this.$t(),this.Ne.sessionTimeoutMs>this.Fe||Fl.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 bo(this._instance)}setDocumentWasEverVisible(t){t&&(this.jt=!0)}get Zt(){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 q(d)&&q(v)&&q(c)&&q(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Gt(){var t;if(!this.ut){var e=null==(t=this.je)?void 0:t.masking;if(!z(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!q(r)&&r!==n}));0!==r.length&&(this.ut=!0,Fl.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 Qt(){var t;return nt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Ji("canvas recording resolution scale"),1)}get Jt(){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:nt(h,0,12,Ji("canvas recording fps"),4),quality:nt(d,0,1,Ji("canvas recording quality"),.4)}}get Yt(){var t,e=!(null==(t=this.je)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Kt(){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=Ml(this._instance.config.capture_performance),l=Ml(null==r?void 0:r.capturePerformance),u=!!(V(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Xt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Yt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Kt&&L(s))if(!lr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=L(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=L(t.session_recording.maskNetworkRequestFn);return h&&L(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=L(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 z(n)&&r?(wn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!q(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.Kt,a)))}else Fl.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?Re(t):t}tr(t,e){void 0===e&&(e=!1);var i=e?Re(t):this.er(t),r=this._instance.config.mask_personal_data_properties?[...Vo,...this._instance.config.custom_personal_data_properties||[]]:[];return this.rr(cr(i,r,Zo))}rr(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}ir(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}):Fl.warn("could not emit queued rrweb event.",e,t),!1}}Le(t,e){return this.ir(Ll((()=>$l().addCustomEvent(t,e))))}nr(){var t;return this.ze&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Ge}ar(t){if(!this.nr())return!1;try{var e=$l();return!!e&&(e.addCustomEvent("$json_ld",t),this.nr())}catch(t){return!1}}sr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ur)?void 0:e.scan(t)}))}lr(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.tr(e.origin+e.pathname+e.search);this.hr!==i&&(this.hr=i,this.Le("$url_changed",{href:i}))}catch(t){}}cr(){if(this.Ze.length){var t=[...this.Ze];this.Ze=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ir(t)}))}}Ce(){return this.ir(Ll((()=>$l().takeFullSnapshot())))}get dr(){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 U(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}vr(){if(this.pr&&clearInterval(this.pr),!0!==this.Ge){var t=this.dr;t&&(this.pr=setInterval((()=>{this.Ce()}),t))}}Me(t){"event"===t&&this.gr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.vr()}mr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.ur)||t.scan(),clearInterval(this.pr),Fl.info("recording paused due to URL blocker"),this.Le("recording paused",{reason:"url blocker"}))}yr(){var t;this.X.urlBlocked&&(null==(t=this.ur)||t.scan(),this.X.urlBlocked=!1,this.Ce(),this.sr(),this.vr(),this.Le("recording resumed",{reason:"left blocked url"}),Fl.info("recording resumed"))}br(t,e){var i;if("event"===t&&this.gr(),!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?Qn:Jn]:this.sessionId}),null==(n=this.He)||n.updateActiveTriggers(this.sessionId),this.Me(),this.Ht(),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(jn);if(t){var e;try{e=D(t)?t:JSON.parse(t)}catch(t){return void Fl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Lt){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>Rl)return Fl.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(jn))}return e}}wr(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.kr(),this.$t());var a=this.Ne.checkAndGetSessionAndWindowId(),o=a.windowId;this.Pe=a.sessionId,this.It=o,null==(i=this._instance.persistence)||i.unregister(ts),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 zo(this._instance,this.X,this.xe.bind(this),this.Le.bind(this),this.Me.bind(this)):new Ho(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.br(t,e))),this.wr(Hn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Hn)})),this.wr(zn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(zn)})),this.wr(Wn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Wn)})),this.wr(Un,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Un)})),this.He.makeSamplingDecisions(this.sessionId),this._r(),this.it||(ar(t,"beforeunload",this.qt),ar(t,"pagehide",this.Ut),ar(t,"offline",this.zt),ar(t,"online",this.Wt),ar(r,"visibilitychange",this.Vt),!this.xt&&L(this.Ne.onSessionId)&&(this.xt=this.Ne.onSessionId(this.Tt)),!this.Ct&&L(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)}))})):L(this.Ne.on)||Fl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),z(this.St)&&(this.St=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.tr(t.properties.$current_url):"";if(!e)return;this.Le("$pageview",{href:e})}}catch(t){Fl.error("Could not add $pageview to rrweb session",t)}}))),this.status===na&&this.xe(e||"recording_initialized"))}else Fl.info("remote config must be stored in persistence before recording can start")}Sr(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.qt),null==t||t.removeEventListener("pagehide",this.Ut),null==t||t.removeEventListener("offline",this.zt),null==t||t.removeEventListener("online",this.Wt),null==r||r.removeEventListener("visibilitychange",this.Vt),clearInterval(this.pr),this.Cr(),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.Mr(),this.kr()}kr(){this.kt+=1,this.bt=[],this.wt=0,this.Tr=void 0,this._t=!1}Mr(){var t,e,i;null==(t=this.Ir)||t.stop(),this.Ze=[],null==(e=this.ur)||e.stop(),this.ur=void 0,this.ze=!1,null==(i=this.Ue)||i.call(this),this.Ue=void 0}Rr(){if(!this.Tr||0===this.wt)return!1;if(this._t)return!0;this._t=!0;var t=this.kt;return this.Cr(),this.Mr(),this.Tr.catch((()=>{})).then((()=>{t===this.kt&&(this._t=!1,this.Ht(),this.$t(),this.Sr(),Fl.info("stopped"))})).catch((()=>{this._t=!1,this.Sr(),Fl.info("stopped")})),!0}stop(){this.Mr(),this.Rr()||(this.Ht(),this.$t(),this.Sr(),Fl.info("stopped"))}Et(t){this.Lt=!0;try{var e;this.stop(),this.Ar=void 0,this.Er=void 0,this.Je=0,this.Ye=0,this.Ke=0,null==(e=Dl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Lt=!1}this.Xe=t,this.et=!1}gr(){this.isStarted||(this.rt=!0),this.Xe&&(this.Xe=!1,this.et=!1,this.tt&&(this.tt=!1,this.Ce()),this.Lr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.$t(),this.Mr()),this.$t(),this.Sr(),Fl.info("discarded")}Or(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==ia?(this.Dr(t,r),this.Pr(s)):this.$t()}Nr(){try{this.Fr()}catch(t){this.st||(this.st=!0,Fl.error("could not track full snapshot cost",t))}}Fr(){var t,e=null==(t=Dl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Er&&(this.Er=e,this.Ar&&this.Ar.durationMs>=e.durationMs||(this.Ar=e),500>e.durationMs||Fl.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}))}Dr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(q(this.ft)||this.ft===e||this.yt===e||(this.yt=e,Fl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Ce())):this.ft=e}qr(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))}jr(t,e,i){t.processed||t.generation!==this.kt||(t.processed=!0,this.Or(t.event,e,i,t.targetSessionId,t.targetWindowId))}Br(t){try{var e=t.compressionEnabled?Kl(t.event):{event:t.event,size:Ra(t.event)};this.jr(t,e.event,e.size)}finally{this.qr(t)}}Bt(){[...this.bt].forEach((t=>{this.Br(t)}))}Hr(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?Gl(t)?yield function(t){return Yl.apply(this,arguments)}(t):Kl(t):{event:t,size:Ra(t)};i=a.event,r=a.size}catch(e){Fl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Ra(t)}n.jr(s,i,r)}finally{n.qr(s)}}));return function(){return i.apply(this,arguments)}}();this.Tr=this.Tr?this.Tr.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.cr(),t&&D(t))){if(t.type===m.Meta){var h=this.tr(t.data.href);if(this.hr=h,!h)return;t.data.href=h}else this.lr();if(null==(e=this.He)||e.checkUrlTriggers(this.sessionId,(()=>this.mr()),(()=>this.yr()),((t,e)=>this.br(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=Dl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.ot=!0),this.Nr(),Promise.resolve().then((()=>this.Nr())),this.vr(),null==(v=this.Ir)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[ts]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.He)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.$r();var p=this.Ir?this.Ir.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&D(e)&&6===e.type&&D(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 eu(t)?t.data.payload:null}(g),_=function(t){return iu(t)?t.data.payload:null}(g),w=function(t){return tu(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.Ur(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 tu(t)||eu(t)||iu(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.sr(!0):x||this.sr();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.wt>0||C&&Gl(g))this.Hr(g,C,k,S);else{var T=C?Kl(g):{event:g,size:Ra(g)};this.Or(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}):ia}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.gr(),this.xe("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Gn]:this.sessionId,[Bn]:null}),this.Ce(),this.gr(),this.xe("sampling_overridden")}overrideTrigger(t){this.br(t),this.gr()}zr(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.tr(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Cr(){this.Wr&&(clearTimeout(this.Wr),this.Wr=void 0)}Lr(){this.Wr||(this.Wr=setTimeout((()=>{this.Ht()}),2e3))}Vr(){return this.ft!==this.Pt.sessionId&&0!==this.Pt.data.length&&this.Pt.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!eu(t)&&!iu(t)))}Zr(){var t,e;return null!==(t=null==(e=this.He)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Gr(t){if(t!==sa)return q(this.Qr)||this._instance.register_for_session({[qs]:[]}),void(this.Qr=void 0);var e=this.Zr();if(0===e.length)return q(this.Qr)||this._instance.register_for_session({[qs]:[]}),void(this.Qr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Qr&&(this.Qr=r,this._instance.register_for_session({[qs]:e}),Fl.info("buffering: "+i))}Ht(){var t;if(this.Cr(),this.Xe)return this.Pt;if(this.Vr())return this.Pt.size>Pl?this.$t():this.Pt;var e=this.Pt;null==(t=this.He)||t.ensureSamplingDecision(this.sessionId);var i=this.Nt(),r=this.status;if(this.Gr(r),r===sa||r===aa||r===ia||i)return this.Lr(),this.Pt;if(this.Pt!==e)return this.Pt;if(e.data.length>0){var n,s=this.zr();Aa(e).forEach((t=>{var e;null==(e=this.Rt)||e.trackSize(t.sessionId,t.size),this.Jr({$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.$t()}Pr(t){var e,i=2+((null==(e=this.Pt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Pt.sessionId!==r;if(n||!0!==this.Ge&&!this.Xe&&this.Pt.size+t.$snapshot_bytes+i>Pl){var s=this.Pe;if(this.Pt=this.Ht(),this.Pe!==s)return;n&&this.Pt.data.length>0&&(this.Pt=this.$t()),this.Pt.sessionId=r,this.Pt.windowId=t.$window_id}this.Xe&&(this.tt||this.Pt.size+t.$snapshot_bytes+i>Pl)?this.tt||(this.tt=!0,this.Pt=this.$t()):(this.Pt.size+=t.$snapshot_bytes,this.Pt.data.push(t.$snapshot_data),this.Pt.sizes.push(t.$snapshot_bytes),!0===this.Ge||this.Xe||this.Lr())}Jr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.$e),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ft(){var t,e,i=null==(t=this.Pt)?void 0:t.data[(null==(e=this.Pt)?void 0:e.data.length)-1],r=this.Ne.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}$r(){if(!this.Pt||0===this.Pt.data.length)return this.$t();for(var t=-1,e=this.Pt.data.length-1;e>=0;e--)if(this.Pt.data[e].type===m.Meta){t=e;break}return 0>t?this.$t():(this.Pt.data=this.Pt.data.slice(t),this.Pt.sizes=this.Pt.sizes.slice(t),this.Pt.size=this.Pt.sizes.reduce(((t,e)=>t+e),0),this.Pt)}$t(){return this.Pt={size:0,data:[],sizes:[],sessionId:this.Pe,windowId:this.It},this.Pt}xe(t,e){this._instance.register_for_session({[zs]:t}),Fl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Le("$recording_started",p({reason:t},e))}Yr(t){var e;return 3===t.type&&-1!==Ol.indexOf(null==(e=t.data)?void 0:e.source)}Ur(t){var e=this.Yr(t);e||!0===this.Ge||t.timestamp-this.We>this.Fe&&(this.Ge=!0,clearInterval(this.pr),this.Le("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.We,threshold:this.Fe,bufferLength:this.Pt.data.length,bufferSize:this.Pt.size,sessionId:this.Pe,windowId:this.It}),this.Ht());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.gr(),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.sr(),this.vr()}}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=Dl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Pt.data.length,$sdk_debug_replay_internal_buffer_size:this.Pt.size,$sdk_debug_current_session_duration:this.Ft,$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:Tl(null==(i=this.Ar)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Tl(null==(r=this.Ar)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Ar)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Ar)?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:Tl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Tl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Tl(null==(o=Dl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Dl())||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}}_r(){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={};q(v.mousemove)||(c.mousemove=v.mousemove),q(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.Jt&&this.Jt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Jt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Jt.quality},o.canvasResolutionScale=this.Qt,o.canvasMasking={configured:()=>{var t;return L(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(L(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.ct||(this.ct=!0,Fl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Zt&&(o.maskAllInputs=null===(i=this.Zt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Zt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Zt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Zt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ht||(this.ht=!0,Fl.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.Gt();var f=$l();if(f){this.Ir=null!==(e=this.Ir)&&void 0!==e?e:new yo(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";Fl.info(i,{node:e}),this.log(Al+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Je+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.dr,onDroppedOversizedMutation:t=>{0===this.Ye&&this.log(Al+" 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.Xt();if(this.Ue=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.dt||(this.dt=!0,Fl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Ue)return this.it=!0,void Fl.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.ur&&(this.ur=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=al,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(xl(i,e.blockClass,e.blockSelector)||xl(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>al)return null;try{var e=JSON.parse(t),i=O(e)?e.map(kl):kl(e);if(H(i)||O(i)&&(!i.length||i.some(H)))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(H(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 Cl(t))a(e)};for(var i of t)if("childList"===i.type)Sl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&Sl(r)&&a(r)}else"attributes"===i.type&&Sl(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()&&Cl(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.nr()},emit:t=>this.ar(t)}),this.X.isCurrentUrlBlocked()&&this.ur.scan()),this.We=Date.now(),this.Ge=V(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 Fl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Le(t,e)}}var nu,su=["type"],au=Object.defineProperty,ou=(t,e,i)=>((t,e,i)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),lu=(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))(lu||{}),uu=(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))(uu||{}),hu=(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))(hu||{}),du=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(du||{}),vu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(vu||{}),cu=(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))(cu||{}),fu=(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))(fu||{});function pu(t,e){return-1!==t.indexOf(e)}var gu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},mu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},yu={};function bu(t){if(yu[t])return yu[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 gu?gu[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 mu?mu[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 yu[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 pu(t,"AppleWebKit")&&!pu(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),yu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var _u={};function wu(t,e,i){var r,n=t+"."+String(i);if(_u[n])return _u[n].call(e);var s=bu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(_u[n]=a,a.call(e)):e[i]}var ku={};function Su(t,e,i){var r=t+"."+String(i);if(ku[r])return ku[r].bind(e);var n=bu(t)[i];return"function"!=typeof n?e[i]:(ku[r]=n,n.bind(e))}function xu(){return bu("MutationObserver").constructor}function Cu(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 Tu={childNodes:t=>wu("Node",t,"childNodes"),parentNode:t=>wu("Node",t,"parentNode"),parentElement:t=>wu("Node",t,"parentElement"),textContent:t=>wu("Node",t,"textContent"),contains:(t,e)=>Su("Node",t,"contains")(e),getRootNode:t=>Su("Node",t,"getRootNode")(),host:t=>t&&"host"in t?wu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?wu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Su("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Su("Element",t,"querySelectorAll")(e),mutationObserver:xu,patch:Cu},Mu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Iu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Eu=0,Ru=6e4;function Pu(){Eu+=1}function Au(){return Eu}function Fu(t,e){return e!==Eu||t>Ru}var Ou=0,Lu=0,Du=0,$u=Mu(),Nu=null,qu=null,ju=[],Bu=0,Hu=0,zu={slowestBatchMs:0},Uu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Wu=t=>t&&t>0?t:null;function Vu(t){(Ou+=1)>1||($u=Mu(),ju=[],Bu=0,qu=Wu(t),Lu=Iu(),Du=Eu)}function Gu(){return 0===Ou?Nu||Mu():(Ou-=1)>0?$u:($u.durationMs=Iu()-Lu,$u.deferredStylesheetCount=Bu,Uu.deferredCount+=Bu,qu=null,Fu($u.durationMs,Du)?$u:Nu=$u)}var Zu=32;function Qu(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+=Qu(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+=Qu(l,e,i+1))}}}catch(t){}}return r}function Ju(t){if(0!==Ou){var e=Qu(t,null,0);$u.cssRuleCount+=e,Hu>0&&($u.nonDeferrableCssRuleCount+=e)}}function Ku(t){Hu+=1;try{return t()}finally{Hu-=1}}function Yu(t){Ou>0&&($u.stylesheetMs+=t)}function Xu(t){if(0===Ou||null===qu)return!1;var e=$u.cssRuleCount-$u.nonDeferrableCssRuleCount;return e>=qu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Qu(e,i,0)}catch(t){return 0}}(t)>qu}function th(){Uu.failedCount+=1}function eh(t){t>0&&(Uu.abandonedCount+=t)}function ih(t){return t.nodeType===t.ELEMENT_NODE}function rh(t){var e=t&&"host"in t&&"mode"in t&&Tu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Tu.shadowRoot(e)===t)}function nh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function sh(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 ah(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 oh=0;function lh(t){var e=0===oh,i=e?Iu():0;oh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Ju(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),sh(Array.from(r,(t=>uh(t,n))).join(""))}catch(t){return null}finally{oh-=1,e&&Yu(Iu()-i)}}function uh(t,e){var i;if(dh(t)){var r;try{r=lh(t.styleSheet)||ah(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return Mh(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return vh(t)&&t.selectorText.includes(":")&&(n=hh(n)),e?Mh(n,e):n}function hh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function dh(t){return"styleSheet"in t}function vh(t){return"selectorText"in t}var ch=/^-?[A-Za-z_][\w-]*$/,fh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ph(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||ah(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=Mh(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&&dh(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(vh(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&&!ch.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]?ch.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":fh.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?Mh(r,n):r,fixColons:"sheet"===i.kind&&vh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&vh(i)&&i.selectorText.includes(":")&&(s=hh(s)),t.parts.push(t.sheetHref?Mh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Ju(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,!dh(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;Ju(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=Iu(),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?hh(h):h}else u=sh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Yu(Iu()-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 gh{constructor(){ou(this,"idNodeMap",new Map),ou(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))),ih(t)){var i=Tu.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 mh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&yh(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function yh(t){return t.toLowerCase()}var bh=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 _h(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&&bh.has(yh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var wh="__rrweb_original__";function kh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?yh(e):null}catch(t){return null}}var Sh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xh=/^(?:[a-z+]+:)?\/\//i,Ch=/^www\..*/i,Th=/^(data:)([^,]*),(.*)/i;function Mh(t,e){return(t||"").replace(Sh,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(xh.test(l)||Ch.test(l))return"url("+u+l+u+")";if(Th.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 Ih,Eh,Rh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Ph=4096,Ah=1e5,Fh=10,Oh=new Map,Lh=1,Dh=new RegExp("[^a-z0-9-_:]"),$h=-2;function Nh(){return Lh++}var qh=/^[^ \t\n\r\u000c]+/,jh=/^[, \t\n\r\u000c]+/,Bh=new WeakMap;function Hh(t,e){return e&&""!==e.trim()?zh(t,e):e}function zh(t,e){var i=Bh.get(t);if(i||(i=t.createElement("a"),Bh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Uh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Rh:t}(t,e.maxBase64ImageLength):t}function Wh(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=Hh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(Ah>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Ph||t.naturalHeight>Ph)return e;var n=Oh.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(Oh.size>=Fh){var u=Oh.keys().next().value;void 0!==u&&Oh.delete(u)}return Oh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Uh(u,s)}if("image"===e)return Uh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Hh(t,r);return"image"===e&&h.startsWith("data:")?Uh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(jh),e.length>i;){var s=r(qh);if(","===s.slice(-1))s=Hh(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Hh(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?Mh(r,zh(t)):"object"===e&&"data"===i?Hh(t,r):r:Hh(t,r)}function Vh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Gh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Gh(Tu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Gh(Tu.parentNode(t),e,i)}function Zh(t,e,i,r){var n;if(ih(t)){if(!Tu.childNodes(n=t).length)return!1}else{if(null===Tu.parentElement(t))return!1;n=Tu.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Gh(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function Qh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Jh=new Map;function Kh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Yh(t){return null==t?"":t.toLowerCase()}var Xh=50,td=!1,ed=!1;function id(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,I=e.onIframeLoad,E=e.iframeLoadTimeout,R=void 0===E?5e3:E,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?Xh:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return ed=!0,td||(td=!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)),Ou>0&&($u.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:fu.Document,childNodes:[],compatMode:t.compatMode}:{type:fu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:fu.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=yh(t.tagName);return Dh.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var I=t.attributes[M];Vh(S,I.name)||(C[I.name]=Wh(s,S,yh(I.name),I.value,t,f))}if("link"===S&&a&&!k){var E=t.sheet;if(!E){var R=function(t){return t.href}(t);R&&!(E=Kh(s,R))&&R.includes(".css")&&(E=Kh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;E&&(Xu(E)?Ou>0&&(ju.push(t),Bu+=1):P=lh(E)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||Tu.textContent(t)||"").trim().length){var A=Ku((()=>lh(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=mh({element:t,type:kh(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((wh in n?n[wh]: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){Ih||(Ih=s.createElement("canvas"),Eh=Ih.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",z=B.crossOrigin,U=(e,i)=>j?_h({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{Qh(B,"load",W);try{Ih.width=B.naturalWidth,Ih.height=B.naturalHeight,Eh.drawImage(B,0,0);var t=Ih.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]=_h({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:fu.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=Tu.parentNode(t),o=a&&a.tagName,l=Tu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(Xu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=lh(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=Mh(l,zh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,Tu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:fu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:fu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:fu.Comment,textContent:Tu.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===fu.Comment)return!0;if(t.type===fu.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&&(Yh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Yh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Yh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Yh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Yh(t.attributes.property).match(/^(og|twitter|fb):/)||Yh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Yh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Yh(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(Yh(t.attributes.name))||Yh(t.attributes.property).match(/^article:/)||Yh(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(Yh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===fu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?$h:Nh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===$h)return null;M&&M(t);var J=!u;if(Q.type===fu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=Tu.shadowRoot(t);K&&nh(K)&&(Q.isShadowHost=!0)}if((Q.type===fu.Document||Q.type===fu.Element)&&J){b.headWhitespace&&Q.type===fu.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:I,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z};if(Q.type===fu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Tu.childNodes(t))){var tt=id(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(ih(t)&&(et=Tu.shadowRoot(t)))for(var it of Array.from(Tu.childNodes(et))){var rt=id(it,Y);rt&&(nh(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=Tu.parentNode(t);if(nt&&rh(nt)&&nh(nt)&&(Q.isShadow=!0),Q.type===fu.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),Qh(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?Qh(t,"load",a):(o=!0,Qh(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),Qh(t,"load",a)}}return t.addEventListener("load",a),()=>{Qh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&I){var i=id(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:I,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z});i&&I(t,i)}}),R);null==P||P(t,st)}return Q.type===fu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Jh.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=id(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:I,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:z});e&&A(t,e)}})()}finally{Jh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),Jh.set(e,v)}}}(t,0,O),Q}function rd(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 nd{constructor(){ou(this,"parentElement",null),ou(this,"parentNode",null),ou(this,"ownerDocument"),ou(this,"firstChild",null),ou(this,"lastChild",null),ou(this,"previousSibling",null),ou(this,"nextSibling",null),ou(this,"ELEMENT_NODE",1),ou(this,"TEXT_NODE",3),ou(this,"nodeType"),ou(this,"nodeName"),ou(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nd))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 sd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>ad(i,t,e,r)}function ad(t,e,i,r){od((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function od(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var ld="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ud={map:{},getId(){return console.error(ld),-1},getNode(){return console.error(ld),null},removeNodeFromMap(){console.error(ld)},has(){return console.error(ld),!1},reset(){console.error(ld)}};function hd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,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 dd(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>dd(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ud=new Proxy(ud,{get(t,e,i){return"map"===e&&console.error(ld),Reflect.get(t,e,i)}}));var vd=Date.now;function cd(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=Tu.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=Tu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function fd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function gd(t){return t?t.nodeType===t.ELEMENT_NODE?t:Tu.parentElement(t):null}function md(t,e,i,r){if(!t)return!1;var n=gd(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(Gh(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function yd(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===$h}function bd(t,e){if(rh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Tu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||bd(r,e))}function _d(t){return Boolean(t.changedTouches)}function wd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function kd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Sd(t){return!!t&&(t instanceof nd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Tu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(vd=()=>(new Date).getTime());class xd{constructor(){ou(this,"id",1),ou(this,"styleIDMap",new WeakMap),ou(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Cd(t){var e,i=null;return"getRootNode"in t&&(null==(e=Tu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Tu.host(Tu.getRootNode(t))&&(i=Tu.host(Tu.getRootNode(t))),i}function Td(t){var e=t.ownerDocument;return!!e&&(Tu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Cd(i);)i=e;return i}(t);return Tu.contains(e,i)}(t))}function Md(t){return"__ln"in t}class Id{constructor(){ou(this,"length",0),ou(this,"head",null),ou(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Md(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Md(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Ed,Rd=(t,e)=>t+"@"+e;class Pd{constructor(){ou(this,"frozen",!1),ou(this,"locked",!1),ou(this,"texts",[]),ou(this,"attributes",[]),ou(this,"attributeMap",new WeakMap),ou(this,"generatedAttributes",new WeakMap),ou(this,"removes",[]),ou(this,"mapRemoves",[]),ou(this,"movedMap",{}),ou(this,"addedSet",new Set),ou(this,"movedSet",new Set),ou(this,"droppedSet",new Set),ou(this,"removesSubTreeCache",new Set),ou(this,"mutationCb"),ou(this,"blockClass"),ou(this,"blockSelector"),ou(this,"maskTextClass"),ou(this,"maskTextSelector"),ou(this,"inlineStylesheet"),ou(this,"maskInputOptions"),ou(this,"maskTextFn"),ou(this,"maskInputFn"),ou(this,"maskAllElementAttributes"),ou(this,"maskAttributeFn"),ou(this,"keepIframeSrcFn"),ou(this,"recordCanvas"),ou(this,"canvasMaskingConfigured"),ou(this,"inlineImages"),ou(this,"slimDOMOptions"),ou(this,"dataURLOptions"),ou(this,"doc"),ou(this,"mirror"),ou(this,"iframeManager"),ou(this,"stylesheetManager"),ou(this,"shadowDomManager"),ou(this,"canvasManager"),ou(this,"processedNodeManager"),ou(this,"unattachedDoc"),ou(this,"canvasManagerReleased",!1),ou(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),ou(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=Iu(),r=Au();try{this.processBufferedMutations()}finally{t=Iu()-i,e=r,Ou>0||Fu(t,null!=e?e:Eu)||t>zu.slowestBatchMs&&(zu.slowestBatchMs=t)}}})),ou(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new Id,r=t=>{for(var e=t,i=$h;i===$h;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=Tu.parentNode(n);if(s&&Td(n)&&"TEXTAREA"!==s.tagName){var a=rh(s)?this.mirror.getId(Cd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=id(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=>{wd(t,this.mirror)&&this.iframeManager.addIframe(t),kd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Sd(t)&&!md(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Tu.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)Fd(this.removesSubTreeCache,s)&&!this.movedSet.has(Tu.parentNode(s))||n(s);for(var a of this.addedSet)Od(this.droppedSet,a)||Fd(this.removesSubTreeCache,a)?Od(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(Tu.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(Tu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=Tu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Tu.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=Tu.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]=_h({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)})),ou(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),ou(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(Tu.childNodes(t),(t=>Tu.textContent(t)||"")).join("");e.attributes.value=mh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:kh(t),value:i,maskInputFn:this.maskInputFn})})),ou(this,"processMutation",(t=>{var e;if(!yd(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=Tu.textContent(t.target);md(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,gd(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=kh(u);l=mh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(md(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"),!Vh(n.tagName,o)){var c=Wh(this.doc,yh(n.tagName),yh(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(md(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=rh(t.target)?this.mirror.getId(Tu.host(t.target)):this.mirror.getId(t.target);md(t.target,this.blockClass,this.blockSelector,!1)||yd(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Ad(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||bd(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Rd(i,r)]?Ad(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!rh(t.target)||!nh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Tu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),ou(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(yd(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[Rd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);md(t,this.blockClass,this.blockSelector,!1)||(Tu.childNodes(t).forEach((t=>this.genAdds(t))),Sd(t)&&Tu.childNodes(Tu.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 Ad(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),Tu.childNodes(r).forEach((t=>i.push(t)))}}function Fd(t,e,i){return 0!==t.size&&function(t,e,i){var r=Tu.parentNode(e);return!!r&&t.has(r)}(t,e)}function Od(t,e){if(0===t.size)return!1;for(var i=Tu.parentNode(e);i;){if(t.has(i))return!0;i=Tu.parentNode(i)}return!1}var Ld=function(t,e){return void 0===e&&(e="rrweb"),Ed?function(){try{return t(...arguments)}catch(t){if(Ed&&!0===Ed(t,e))return;throw t}}:t},Dd=[];function $d(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Nd(t,e){var i,r=new Pd;r.init(t);try{i=new(xu())(Ld(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),Dd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function qd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=$d(t);if(a&&!md(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=cd(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=[sd("scroll",Ld(hd(Ld((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(sd("scrollend",Ld(l),i)),()=>u.forEach((t=>t()))}function jd(t,e){for(var i=Dd.length-1;i>=0;i--){var r=Dd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Dd.splice(i,1))}}}var Bd=["INPUT","TEXTAREA","SELECT"],Hd=new WeakMap;function zd(t){return function t(e,i){if(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 Ud(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var Wd=5e3;function Vd(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:Tu.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}}),Ld((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Gd(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=Ld((()=>{if(r){r.destroy(),r.reset();var e=Dd.indexOf(r);-1!==e&&Dd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Nd(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=hd(Ld((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Ld(hd(Ld((t=>{var e=$d(t),i=_d(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=vd()),l.push({x:r,y:a,id:n.getId(e),timeOffset:vd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?uu.Drag:t instanceof MouseEvent?uu.MouseMove:uu.TouchMove)})),a,{trailing:!1})),d=[sd("mousemove",h,r),sd("touchmove",h,r),sd("drag",h,r)];return Ld((()=>{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(hu).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=yh(t),o=(t=>i=>{var a=$d(i);if(!md(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=du.Mouse;break;case"touch":o=du.Touch;break;case"pen":o=du.Pen}o===du.Touch&&(hu[t]===hu.MouseDown?l="TouchStart":hu[t]===hu.MouseUp&&(l="TouchEnd"))}else _d(i)&&(o=du.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===du.Touch||l.startsWith("Mouse")&&o===du.Mouse)&&(o=null)):hu[t]===hu.Click&&(o=u,u=null);var h=_d(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Ld(e)(p({type:hu[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(hu[t]){case hu.MouseDown:case hu.MouseUp:a=a.replace("mouse","pointer");break;case hu.TouchStart:case hu.TouchEnd:return}l.push(sd(a,o,i))})),Ld((()=>{l.forEach((t=>t()))}))}(t)),c.push(qd(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return sd("resize",Ld(hd(Ld((()=>{var t=fd(),e=pd();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=$d(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=Tu.parentElement(e)),e&&c&&Bd.indexOf(c)>=0&&!md(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=kh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=mh({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=Hd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Hd.set(t,i);var s=r.getId(t);Ld(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>sd(t,Ld(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=>dd(t[0],t[1],{set(){Ld(d)({target:this,isTrusted:!1})}},!1,f)))),Ld((()=>{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=Ld((t=>hd(Ld((s=>{var a=$d(s);if(a&&!md(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=[sd("play",o(cu.Play),a),sd("pause",o(cu.Pause),a),sd("seeked",o(cu.Seeked),a),sd("volumechange",o(cu.VolumeChange),a),sd("ratechange",o(cu.RateChange),a)];return Ld((()=>{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,Wd),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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&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:Ld(((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=Ud(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=lh(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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};Qd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Qd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Qd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Qd("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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ud(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),l];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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ud(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Ld((()=>{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(Vd(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:Ld(((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=Ud(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=zd(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:Ld(((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=Ud(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=zd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Ld((()=>{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=Cu(i.fonts,"add",(function(t){return function(i){return setTimeout(Ld((()=>{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),Ld((()=>{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=Ld((()=>{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;md(s,l,u,!0)||md(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),sd("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Cu(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 Qd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Jd{constructor(t){ou(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ou(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 Kd{constructor(t){ou(this,"iframes",new WeakMap),ou(this,"crossOriginIframeMap",new WeakMap),ou(this,"crossOriginIframeMirror",new Jd(Nh)),ou(this,"crossOriginIframeStyleMirror"),ou(this,"crossOriginIframeRootIdMap",new WeakMap),ou(this,"mirror"),ou(this,"mutationCb"),ou(this,"wrappedEmit"),ou(this,"loadListener"),ou(this,"pageHideListener"),ou(this,"stylesheetManager"),ou(this,"recordCrossOriginIframes"),ou(this,"messageHandler"),ou(this,"nestedIframeListeners",new Map),ou(this,"attachedWindows",new WeakMap),ou(this,"attachedDocuments",new WeakMap),ou(this,"attachedIframes",new Map),ou(this,"loadListenerDisposers",new WeakMap),ou(this,"iframeElementsById",new Map),ou(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>od(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{ad(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);od((()=>{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)}))}od((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||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 lu.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:lu.IncrementalSnapshot,data:{source:uu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case lu.Meta:case lu.Load:case lu.DomContentLoaded:return!1;case lu.Plugin:return e;case lu.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case lu.IncrementalSnapshot:switch(e.data.source){case uu.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 uu.Drag:case uu.TouchMove:case uu.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case uu.ViewportResize:return!1;case uu.MediaInteraction:case uu.MouseInteraction:case uu.Scroll:case uu.CanvasMutation:case uu.Input:return this.replaceIds(e.data,t,["id"]),e;case uu.StyleSheetRule:case uu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case uu.Font:return e;case uu.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case uu.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===fu.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&&(ad(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(ad(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{od((()=>this.mirror.removeNodeFromMap(t)))})),od((()=>jd(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&ad(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{ad(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 Yd{constructor(t){ou(this,"shadowDoms",new WeakSet),ou(this,"mutationCb"),ou(this,"scrollCb"),ou(this,"bypassOptions"),ou(this,"mirror"),ou(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(nh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=Tu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Nd(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=Dd.indexOf(o);-1!==t&&Dd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:qd(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(Tu.host(t))),this.restoreHandlers.push({doc:n,handler:Vd({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:Cu(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=Tu.shadowRoot(this);return s&&Td(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var Xd="skip-frame";function tv(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 ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",iv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),rv=0;64>rv;rv++)iv[ev.charCodeAt(rv)]=rv;var nv=new Map,sv=(t,e,i)=>{if(t&&(lv(t,e)||"object"==typeof t)){var r=function(t,e){var i=nv.get(t);return i||nv.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function av(t,e,i,r){if(t instanceof Array)return t.map((t=>av(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+=ev[i[e]>>2],n+=ev[(3&i[e])<<4|i[e+1]>>4],n+=ev[(15&i[e+1])<<2|i[e+2]>>6],n+=ev[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:[av(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:[av(t.data,e,i,r),t.width,t.height]}:lv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:sv(t,e,i)}:t}var ov=(t,e,i,r)=>t.map((t=>av(t,e,i,r))),lv=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},uv=["webgl","webgl2"];function hv(t){return"nodeType"in t}function dv(t,e,i,r){var 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 Cu(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||hv(s)&&md(s,e,i,!0))return r.call(this,n);hv(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=Cu(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(!md(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&uv.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 vv(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=Cu(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(sv(d,s,this),this.canvas&&"tagName"in this.canvas&&!md(this.canvas,r,n,!0)){var v=ov(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=dd(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!md(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var cv,fv,pv,gv='(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',mv="undefined"!=typeof self&&self.Blob&&new Blob([gv],{type:"text/javascript;charset=utf-8"});function yv(t){var e;try{if(!(e=mv&&(self.URL||self.webkitURL).createObjectURL(mv)))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(gv),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class bv{constructor(t){ou(this,"pendingCanvasMutations",new Map),ou(this,"rafStamps",{latestId:0,invokeId:null}),ou(this,"mirror"),ou(this,"mutationCb"),ou(this,"resetObservers"),ou(this,"frozen",!1),ou(this,"locked",!1),ou(this,"rafIdTimestamp",null),ou(this,"rafIdFlush",null),ou(this,"refCount",0),ou(this,"torndown",!1),ou(this,"resetFrameDedup",null),ou(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=dv(e,i,r,!0),u=new Map;try{a=new yv}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:vu["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=>{md(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 Xd}if(void 0!==a){if(!Array.isArray(a)||!a.every(tv))return Xd;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===Xd)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=dv(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=Cu(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 md(this.canvas,i,r,!0)||setTimeout((()=>{var i=ov(l,e,this,n);t(this.canvas,{type:vu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=dd(e.CanvasRenderingContext2D.prototype,a,{set(e){md(this.canvas,i,r,!0)||t(this.canvas,{type:vu["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(...vv(e.WebGLRenderingContext.prototype,vu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...vv(e.WebGL2RenderingContext.prototype,vu.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,su)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class _v{constructor(t){var e;ou(this,"trackedLinkElements",new WeakSet),ou(this,"pendingDeferredSheets",new Set),ou(this,"mutationCb"),ou(this,"adoptedStyleSheetCb"),ou(this,"maskAllElementAttributes"),ou(this,"maskAttributeFn"),ou(this,"styleMirror",new xd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=ph(r))}catch(t){}if(!i||!r)return th(),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=Iu(),d=Au(),v=!0;try{if(s)return o=!0,th(),!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?(th(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(th(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Fu(l=Iu()-h,null!=(u=d)?u:Eu)||(Uu.totalMs+=l,l>Uu.slowestSliceMs&&(Uu.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:_h({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=Iu();try{Ku((()=>{try{var e=t.rules||t.cssRules;e&&Ju(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:uh(e,t.href),index:i})))})}))}finally{Yu(Iu()-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(),Jh.forEach((t=>t.abort())),Jh.clear()}trackStylesheetInLinkElement(t){}}class wv{constructor(){ou(this,"nodeMap",new WeakMap),ou(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 kv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Sv=document.createElement("iframe");document.body.appendChild(Sv),Array.from=(null==(nu=Sv.contentWindow)?void 0:nu.Array.from)||Array.from,document.body.removeChild(Sv)}}catch(t){console.debug("Unable to override Array.from",t)}var xv=new gh,Cv=new Set([uu.Mutation,uu.MediaInteraction,uu.StyleSheetRule,uu.CanvasMutation,uu.Font,uu.Log,uu.StyleDeclaration,uu.AdoptedStyleSheet]);function Tv(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 Mv(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,I=void 0!==M&&M,E=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;Ed=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),xv.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=rd(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};cv=(t,e)=>{var i,a=t;if(a.timestamp=vd(),!(null==(i=Dd[0])?void 0:i.isFrozen())||a.type===lu.FullSnapshot||a.type===lu.IncrementalSnapshot&&Cv.has(a.data.source)||Dd.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===lu.FullSnapshot)ut=a,ft=0;else if(a.type===lu.IncrementalSnapshot){if(a.data.source===uu.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&fv(!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=xv.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()}cv({type:lu.IncrementalSnapshot,data:p({source:uu.Mutation},t)})},yt=t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.Scroll},t)}),bt=t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.CanvasMutation},t)}),_t=new _v({mutationCb:mt,adoptedStyleSheetCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new Kd({mirror:xv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:cv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:xv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new wv,xt=null==N?void 0:N.configured;pv=new bv({recordCanvas:z,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:xv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Yd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:pv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:xv});fv=function(t){if(void 0===t&&(t=!1),B){Vu(w);try{cv({type:lu.Meta,data:{href:window.location.href,width:pd(),height:fd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Dd.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new gh: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,I=i.dataURLOptions,E=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=rd(void 0!==M&&M);Vu(j);try{return id(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:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Gu()}}(document,{mirror:xv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:dt,dataURLOptions:at,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){wd(t,xv)&&wt.addIframe(t),kd(t,xv)&&_t.trackLinkElement(t),Sd(t)&&Ct.addShadowRoot(Tu.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=ju,ju=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(cv({type:lu.FullSnapshot,data:{node:r,initialOffset:cd(window)}},t),Dd.forEach((t=>t.unlock())),pv.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&&od((()=>{a=e.beginDeferredLinkInlining(i,xv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;od((()=>{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,eh(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=Tv(h):i())}};return n=Tv(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);eh(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,xv.getId(document))}finally{Gu()}var s}};try{var Tt=[];for(var Mt of(Tt.push(sd("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(sd(Mt,Pu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{od(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)})),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=xv.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var It=t=>{var e;return Ld(Gd)({mutationCb:mt,mousemoveCb:(t,e)=>cv({type:lu.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.ViewportResize},t)}),inputCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.Input},t)}),mediaInteractionCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.MediaInteraction},t)}),styleSheetRuleCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.StyleSheetRule},t)}),styleDeclarationCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.Font},t)}),selectionCb(t){cv({type:lu.IncrementalSnapshot,data:p({source:uu.Selection},t)})},customElementCb(t){cv({type:lu.IncrementalSnapshot,data:p({source:uu.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:I,maskAttributeFn:E,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:xv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:pv,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=>cv({type:lu.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=xv.getId(t),i=It(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),wt.addPageHideListener((t=>{var e=xv.getId(t);null==vt||vt(e),jd(t)}));var Et=-1,Rt=t=>cv({type:lu.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?xv.getId(s):-1;a!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{fv();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(sd("fullscreenchange",Pt)),Tt.push(sd("webkitfullscreenchange",Pt)),Tt.push(sd("mozfullscreenchange",Pt)),Tt.push(sd("MSFullscreenChange",Pt)),kv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(sd("DOMContentLoaded",(()=>{cv({type:lu.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(sd("load",(()=>{cv({type:lu.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>od(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),xv.reset(),kv=!1,Ed=void 0}}catch(t){console.warn(t)}}Mv.addCustomEvent=(t,e)=>{if(!kv)throw new Error("please add custom event after start recording");cv({type:lu.Custom,data:{tag:t,payload:e}})},Mv.freezePage=()=>{Dd.forEach((t=>t.freeze()))},Mv.takeFullSnapshot=t=>{if(!kv)throw new Error("please take full snapshot after start recording");fv(t)},Mv.mirror=xv;var Iv=Object.defineProperty,Ev=(t,e,i)=>((t,e,i)=>e in t?Iv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Rv{constructor(t){Ev(this,"fileName"),Ev(this,"functionName"),Ev(this,"lineNumber"),Ev(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 Pv=/(^|@)\S+:\d+/,Av=/^\s*at .*(\S+:\d+|\(native\))/m,Fv=/^(eval@)?(\[native code])?$/,Ov={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Av)?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(Av)}),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 Rv({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Fv)}),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 Rv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Rv({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 Rv({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 Rv({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(Pv)&&!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 Rv({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Lv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var 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 Dv(t){return Array.isArray(t)}function $v(t){return"object"==typeof t&&null!==t&&!Dv(t)}function Nv(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if($v(t[r])&&Nv(t[r],e-1))return!0;return!1}function qv(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if($v(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||$v(a)&&Nv(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]=Dv(u)?Lv(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 jv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Bv(t,e,i){var r,n=i?Object.assign({},jv,i):jv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=Ov.parse(e.error).map((t=>t.toString())),s=[qv(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=[qv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[qv("Uncaught (in promise)",n.stringifyOptions),qv(e.reason,n.stringifyOptions)]);var s=Ov.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=Ov.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>qv(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[qv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{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 Hv=t=>({name:"rrweb/console@1",observer:Bv,options:t}),zv=t=>"u">typeof Document&&t instanceof Document,Uv=()=>{},Wv=t=>{var e;if(L(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Vv(t,e,i){try{if(!(e in t))return Uv;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 L(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=Wv(i);s;){if(s.next===n)return void(s.next=r.next);s=Wv(i=s.next)}else t[e]=r.next}}catch(t){return Uv}}function Gv(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=Ji("[Recorder]"),Qv=t=>"navigation"===t.entryType,Jv=t=>"resource"===t.entryType;function Kv(t,e){return!!e&&(V(e)||e[t])}function Yv(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Xv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function tc(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Yv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Xv))return!1;if(V(i))return!0;if(O(i))return n(i);var s=i[e];return V(s)?s:n(s)}function ec(t,e,i,r,n,s){return ic.apply(this,arguments)}function ic(){return ic=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(Jv(a=t[s])&&a.initiatorType===e&&(q(r)||a.startTime>=r)&&(q(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),ec(t,e,i,r,n,s+1))})),ic.apply(this,arguments)}function rc(t){var e=t.body,i=t.options,r=t.url;if(z(e))return null;var n=Gv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(j(e))return e;if(zv(e))return e.textContent;if(G(e))return dr(e);if(D(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 nc=t=>!H(t)&&("navigation"===t.entryType||"resource"===t.entryType);function sc(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:q(a)?void 0:Math.round(a),endTime:q(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(nc(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 ac=["video/","audio/"];function oc(t){return D(t)&&L(t.getReader)&&L(t.tee)}var lc=500,uc="[SessionReplay] Timeout while trying to read body",hc="[SessionReplay] Failed to read body";function dc(t){return hc+": "+t}function vc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function cc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(uc)),lc);try{t.clone().text().then((t=>e(t)),(t=>e(dc(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(hc)}}))}(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(vc(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch((()=>{}))}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(uc)),lc);try{o=t.clone()}catch(t){return void a(hc)}var u=o.body;if(oc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(hc)}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(vc(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(dc(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(dc(t))))}catch(t){a(hc)}}))}(t,i)}function fc(){return fc=f((function*(t){var e=t.r,i=t.options,r=Gv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):cc(e,i)})),fc.apply(this,arguments)}function pc(){return pc=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=ac.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Gv(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return H(r)?cc(e,i):Promise.resolve(r)})),pc.apply(this,arguments)}var gc=null;function mc(t,e,i){if(!("performance"in e))return()=>{};if(gc)return Zv.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=>Qv(t)||Jv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>sc({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=>Qv(t)||Jv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>sc({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=Kv("request",i.recordHeaders),n=Kv("response",i.recordHeaders),s=Vv(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=>(tc({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=rc({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),tc({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=rc({body:d.response,options:i,url:o})),ec(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=sc({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=Kv("request",i.recordHeaders),n=Kv("response",i.recordHeaders),s=Vv(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),!oc(null==o?void 0:o.body)&&tc({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return fc.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=Yv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f);try{tc({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return pc.apply(this,arguments)}({r:u,options:i,url:a}))}catch(t){Zv.error("Failed to record fetch response for network capture",t)}return u}finally{ec(e,"fetch",l.url,h,d).then((e=>{var i,r=sc({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)),gc=()=>{s(),a(),o(),gc=null}}var yc=t=>({name:"rrweb/network@1",observer:mc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hv,getRecordNetworkPlugin:yc},v.__PosthogExtensions__.rrweb={record:Mv,version:"v2",wasMaxDepthReached:()=>ed,resetMaxDepthState(){ed=!1,td=!1},getLastSnapshotCost:()=>Nu,getMutationCost:()=>p({},zu),resetSnapshotCostState(){Ou=0,Lu=0,Du=0,Eu=0,$u=Mu(),Nu=null,qu=null,ju=[],Bu=0,Hu=0,zu={slowestBatchMs:0},Uu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:Mv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:Hv},v.getRecordNetworkPlugin=yc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new ru(t,e);var bc,_c,wc,kc,Sc,xc,Cc,Tc,Mc,Ic,Ec,Rc,Pc,Ac,Fc,Oc={},Lc=[],Dc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$c=Array.isArray;function Nc(t,e){for(var i in e)t[i]=e[i];return t}function qc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function jc(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?bc.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 Bc(t,a,r,n,null)}function Bc(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?++wc:n,__i:-1,__u:0};return null==n&&null!=_c.vnode&&_c.vnode(s),s}function Hc(t){return t.children}function zc(t,e){this.props=t,this.context=e}function Uc(t,e){if(null==e)return t.__?Uc(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?Uc(t):null}function Wc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Nc({},e);s.__v=e.__v+1,_c.vnode&&_c.vnode(s),ef(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Uc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,nf(r,s,n),e.__e=e.__=null,s.__e!=i&&Vc(s)}}function Vc(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})),Vc(t)}function Gc(t){(!t.__d&&(t.__d=!0)&&kc.push(t)&&!Zc.__r++||Sc!=_c.debounceRendering)&&((Sc=_c.debounceRendering)||xc)(Zc)}function Zc(){try{for(var t,e=1;kc.length;)kc.length>e&&kc.sort(Cc),t=kc.shift(),e=kc.length,Wc(t)}finally{kc.length=Zc.__r=0}}function Qc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Lc,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]=Bc(null,a,null,null,null):$c(a)?a=t.__k[s]=Bc(Hc,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Bc(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=Kc(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=Uc(o)),of(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]||Oc,c.__i=d,g=ef(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&af(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=Jc(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 Jc(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=Jc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Uc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Kc(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 Yc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Dc.test(e)?i:i+"px"}function Xc(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||Yc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Yc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ec,"$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[Ic]=r[Ic]:(i[Ic]=Rc,t.addEventListener(e,s?Ac:Pc,s)):t.removeEventListener(e,s?Ac:Pc,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 tf(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Mc])e[Mc]=Rc++;else if(i[Ic]>e[Mc])return;return i(_c.event?_c.event(e):e)}}}function ef(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=_c.__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 zc(y,_),v.constructor=C,v.render=lf),$&&$.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=Nc({},v.__s)),Nc(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)})),Lc.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=_c.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Lc.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=Nc(Nc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Hc&&null==h.key?sf(h.props.children):h,o=Qc(t,$c(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--;)qc(s[x]);rf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||rf(e);_c.__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||Oc,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&&(_c.__m&&_c.__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&&bc.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||Xc(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||Xc(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=""),Qc("template"==e.type?t.content:t,$c(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Uc(i,0),o,l),null!=s)for(u=s.length;u--;)qc(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])&&Xc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Xc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=_c.diffed)&&h(e),128&e.__u?void 0:o}function rf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(rf))}function nf(t,e,i){for(var r=0;i.length>r;r++)af(i[r],i[++r],i[++r]);_c.__c&&_c.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){_c.__e(t,e.__v)}}))}function sf(t){return"object"!=typeof t||null==t||t.__b>0?t:$c(t)?t.map(sf):void 0!==t.constructor?null:Nc({},t)}function af(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){_c.__e(t,i)}}function of(t,e,i){var r,n;if(_c.unmount&&_c.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||af(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){_c.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&of(r[n],e,i||"function"!=typeof t.type);i||qc(t.__e),t.__c=t.__=t.__e=void 0}function lf(t,e,i){return this.constructor(t,i)}function uf(t,e,i){var r,n,s;e==document&&(e=document.documentElement),_c.__&&_c.__(t,e),r=e.__k,n=[],s=[],ef(e,t=e.__k=jc(Hc,null,[t]),r||Oc,Oc,e.namespaceURI,r?null:e.firstChild?bc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),nf(n,t,s),t.props.children=null}bc=Lc.slice,_c={__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}},wc=0,zc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Nc({},this.state),"function"==typeof t&&(t=t(Nc({},i),this.props)),t&&Nc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Gc(this))},zc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Gc(this))},zc.prototype.render=Hc,kc=[],xc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cc=function(t,e){return t.__v.__b-e.__v.__b},Zc.__r=0,Tc=Math.random().toString(8),Mc="__d"+Tc,Ic="__a"+Tc,Ec=/(PointerCapture)$|Capture$/i,Rc=0,Pc=tf(!1),Ac=tf(!0),Fc=0;var hf,df,vf,cf,ff=0,pf=[],gf=_c,mf=gf.__b,yf=gf.__r,bf=gf.diffed,_f=gf.__c,wf=gf.unmount,kf=gf.__;function Sf(t,e){gf.__h&&gf.__h(df,t,ff||e),ff=0;var i=df.__H||(df.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function xf(t){return ff=1,function(t,e,i){var r=Sf(hf++,2);if(r.t=t,!r.__c&&(r.__=[Lf(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=df,!df.__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};df.__f=!0;var s=df.shouldComponentUpdate,a=df.componentWillUpdate;df.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)},df.shouldComponentUpdate=n}return r.__N||r.__}(Lf,t)}function Cf(t,e){var i=Sf(hf++,3);!gf.__s&&Of(i.__H,e)&&(i.__=t,i.u=e,df.__H.__h.push(i))}function Tf(t){return ff=5,Mf((function(){return{current:t}}),[])}function Mf(t,e){var i=Sf(hf++,7);return Of(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function If(t){var e=df.context[t.__c],i=Sf(hf++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(df)),e.props.value):t.__}function Ef(){for(var t;t=pf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Af),e.__h.some(Ff),e.__h=[]}catch(i){e.__h=[],gf.__e(i,t.__v)}}}gf.__b=function(t){df=null,mf&&mf(t)},gf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),kf&&kf(t,e)},gf.__r=function(t){yf&&yf(t),hf=0;var e=(df=t.__c).__H;e&&(vf===df?(e.__h=[],df.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Ef(),hf=0)),vf=df},gf.diffed=function(t){bf&&bf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==pf.push(e)&&cf===gf.requestAnimationFrame||((cf=gf.requestAnimationFrame)||Pf)(Ef)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),vf=df=null},gf.__c=function(t,e){e.some((function(t){try{t.__h.some(Af),t.__h=t.__h.filter((function(t){return!t.__||Ff(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],gf.__e(i,t.__v)}})),_f&&_f(t,e)},gf.unmount=function(t){wf&&wf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{Af(t)}catch(t){e=t}})),i.__H=void 0,e&&gf.__e(e,i.__v))};var Rf="function"==typeof requestAnimationFrame;function Pf(t){var e,i=function(){clearTimeout(r),Rf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Rf&&(e=requestAnimationFrame(i))}function Af(t){var e=df,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),df=e}function Ff(t){var e=df;t.__c=t.__(),df=e}function Of(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Lf(t,e){return"function"==typeof e?e(t):e}var Df="gzip-js",$f="base64",Nf="events",qf="cancelEvents",jf={Tab:"tab",Selector:"selector"},Bf={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"},Hf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},zf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Uf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Wf={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Vf="always",Gf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Zf={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"},Qf="popover";function Jf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&L(i.then)&&i.then(void 0,(()=>{}))}}}}var Kf=Ji("[Surveys]");function Yf(t){return!(!t.start_date||t.end_date)}function Xf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var tp="seenSurvey_",ep="inProgressSurvey_",ip=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),rp=t=>ip(tp,t),np=t=>{try{var e=rp(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Kf.error("Failed to persist survey seen state",t)}},sp=[zf.Popover,zf.Widget,zf.API],ap={ignoreConditions:!1,ignoreDelay:!1,displayType:Qf},op="featureFlags",lp="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return U(t)&&isFinite(t)&&Math.floor(t)===t});class up{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 up(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 up(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 hp{generate(){var t=this.generateOrAbort();if(!q(t))return t;this.Kr=0;var e=this.generateOrAbort();if(q(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Kr)this.Kr=t,this.Xr();else{if(this.Kr>=t+1e4)return;this.ei++,this.ei>4398046511103&&(this.Kr++,this.Xr())}return up.fromFieldsV7(this.Kr,Math.trunc(this.ei/Math.pow(2,30)),this.ei&Math.pow(2,30)-1,this.ti.nextUint32())}Xr(){this.ei=1024*this.ti.nextUint32()+(1023&this.ti.nextUint32())}constructor(){this.Kr=0,this.ei=0,this.ti=new cp}}var dp,vp=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!q(t.crypto)&&crypto.getRandomValues&&(vp=t=>crypto.getRandomValues(t));class cp{nextUint32(){return this.Pt.length>this.ri||(vp(this.Pt),this.ri=0),this.Pt[this.ri++]}constructor(){this.Pt=new Uint32Array(8),this.ri=1/0}}var fp=()=>pp().toString(),pp=()=>(dp||(dp=new hp)).generate(),gp="",mp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var yp=null,bp={ii(){if(!H(yp))return yp;if(yp=!1,r)try{var t="__ph_cookie_support_"+fp();bp.ni(t,"xyz"),yp='"xyz"'===Uo(t),bp.oi(t)}catch(t){yp=!1}return yp},si(t){Qi.error("cookieStore error: "+t)},ai:Uo,ui(t){var e;try{e=JSON.parse(bp.ai(t))||{}}catch(t){}return e},ni(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),gp)return gp;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_"+fp();!gp&&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",gp=a)}return gp}(t);if(!i){var n=(t=>{var e=t.match(mp);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}},oi(t,e){if(null!=r&&r.cookie)try{bp.ni(t,"",-1,e)}catch(t){return}}},_p=null,wp={ii(){if(!H(_p))return _p;var e=!0;if(q(t))e=!1;else try{var i="__mplssupport__";wp.ni(i,"xyz"),'"xyz"'!==wp.ai(i)&&(e=!1),wp.oi(i)}catch(t){e=!1}return e||Qi.error("localStorage unsupported; falling back to cookie store"),_p=e,e},si(t){Qi.error("localStorage error: "+t)},ai(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){wp.si(t)}return null},ui(t){try{return JSON.parse(wp.ai(t))||{}}catch(t){}return null},ni(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){wp.si(t)}return!1},oi(e){try{null==t||t.localStorage.removeItem(e)}catch(t){wp.si(t)}}},kp=[ds,rs,is,ss,as,os,Ss,ks,_s],Sp=[xn,Sn,Vn,Gn,Rs,Es,In,xs],xp=t=>t+"_cpm",Cp=["__proto__","constructor","prototype"],Tp=t=>{if(!D(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===Cp.indexOf(i)&&(e[i]=t[i])})),e},Mp=function(t,e){void 0===e&&(e=[]);var i={};return[...Sp,...e].forEach((e=>{var r=t[e];q(r)||H(r)||""===r||(i[e]=r)})),i},Ip=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)},Ep=(t,e)=>({p:e,f:Ip(JSON.stringify(t))}),Rp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=bp.ui(xp(t)),r=(null==i?void 0:i.f)===Ip(e)&&O(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Pp=(t,e)=>e+"|"+(bp.ai(xp(t))||""),Ap={},Fp={ii:()=>!0,si(t){Qi.error("memoryStorage error: "+t)},ai:t=>t in Ap?Ap[t]:null,ui:t=>t in Ap?Ap[t]:null,ni:(t,e)=>(Ap[t]=e,!0),oi(t){delete Ap[t]}},Op=null,Lp={ii(){if(!H(Op))return Op;if(Op=!0,q(t))Op=!1;else try{var e="__support__";Lp.ni(e,"xyz"),'"xyz"'!==Lp.ai(e)&&(Op=!1),Lp.oi(e)}catch(t){Op=!1}return Op},si(t){Qi.error("sessionStorage error: ",t)},ai(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Lp.si(t)}return null},ui(t){try{return JSON.parse(Lp.ai(t))||null}catch(t){}return null},ni(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Lp.si(t)}return!1},oi(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Lp.si(t)}}},Dp=Ji("[Stylesheet Loader]"),$p=t,Np=r,qp="#020617",jp={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:Bf.Right,widgetType:jf.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:qp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Bp=[Bf.Center,Bf.Left,Bf.Right];function Hp(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 zp(t){var e;void 0===t&&(t=jp.backgroundColor),"#"===t[0]&&(e=Hp(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=Hp(i)),!e)return qp;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?qp:"white"}return qp}var Up=(t,e,i)=>{var r=ug(t),n=Np.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Np.createElement("div");((t,e,i)=>{var r=p({},jp,i),n=t.style,s=!Bp.includes(r.position)||e===zf.Widget&&(null==i?void 0:i.widgetType)===jf.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)||zp(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",zp(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||zp(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",zp(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)||zp(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 L(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Dp.error("prepare_external_dependency_stylesheet returned null"),null)})(Np,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Np.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Wp=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?(np(i),n.capture(Gf.SENT,p({[Zf.SURVEY_NAME]:i.name,[Zf.SURVEY_ID]:i.id,[Zf.SURVEY_ITERATION]:i.current_iteration,[Zf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Zf.SURVEY_SUBMISSION_ID]:r,[Zf.SURVEY_COMPLETED]:s},o&&{[Zf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},So(e,i,l),a,{$set:{[xo(i,"responded")]:!0}})),s&&($p.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),lg(i),n.reloadFeatureFlags())):Kf.error("[survey sent] event not captured, PostHog instance not found.")},Vp=(t,e,i)=>{return p({[Zf.SURVEY_NAME]:t.name,[Zf.SURVEY_ID]:t.id,[Zf.SURVEY_ITERATION]:t.current_iteration,[Zf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Zf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!z(t))))},(null==e?void 0:e.surveyLanguage)&&{[Zf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Zf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},So(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Gp=(t,e,i,r)=>{if(e){if(!i){var n=ag(t),s=n?n.surveyLanguage:r;e.capture(Gf.DISMISSED,p({},Vp(t,n,e),s&&{[Zf.SURVEY_LANGUAGE]:s},{$set:{[xo(t,"dismissed")]:!0}})),lg(t),np(t),$p.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Kf.error("[survey dismissed] event not captured, PostHog instance not found.")},Zp=(t,e)=>{if(e){var i=(t=>ip("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ag(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Gf.ABANDONED,Vp(t,r,e),{transport:"sendBeacon"})}}else Kf.error("[survey abandoned] event not captured, PostHog instance not found.")},Qp=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Jp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,Kp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Yp=(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?Jp(t.questions,Qp(t.questions)):t.questions;var i},Xp=t=>Po(t)||og(t),tg=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,Gc(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"+Fc++,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}),eg=()=>If(tg),ig=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Nc({},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?bc.call(arguments,2):i),Bc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function rg(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 Oo[a](s,[n])}var ng=t=>ip(ep,t),sg=(t,e)=>{try{localStorage.setItem(ng(t),JSON.stringify(e))}catch(t){Kf.error("Error setting in-progress survey state in localStorage",t)}},ag=t=>{try{var e=localStorage.getItem(ng(t));if(e)return JSON.parse(e)}catch(t){Kf.error("Error getting in-progress survey state from localStorage",t)}return null},og=t=>{var e=ag(t);return!z(null==e?void 0:e.surveySubmissionId)},lg=t=>{try{localStorage.removeItem(ng(t))}catch(t){Kf.error("Error clearing in-progress survey state from localStorage",t)}};function ug(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function hg(t,e,i){if(void 0===e&&(e=Bf.Right),t===zf.ExternalSurvey)return{};switch(e){case Bf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Bf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Bf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Bf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Bf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Bf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Bf.Left:return{left:"30px"};case Bf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===zf.Widget&&i===jf.Tab?"60px":"30px"}}}var dg=0;function vg(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:--dg,__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 _c.vnode&&_c.vnode(u),u}var cg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),fg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),pg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),gg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),mg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),yg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vg("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"})}),bg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vg("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"})}),_g=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return vg("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:[vg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),vg("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})]})},wg=vg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[vg("g",{"clip-path":"url(#clip0_2415_6911)",children:[vg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:vg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),vg("g",{mask:"url(#mask0_2415_6911)",children:[vg("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"}),vg("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"}),vg("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"}),vg("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"}),vg("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"}),vg("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"})]})]}),vg("defs",{children:vg("clipPath",{id:"clip0_2415_6911",children:vg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function kg(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return vg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",wg]})}function Sg(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=If(tg).isPreviewMode,v=!!u&&!!h,c=!l&&vg("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 vg("div",{className:"bottom-section",children:[v?vg("div",{className:"form-buttons form-buttons-with-back",children:[vg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&vg(kg,{urlParams:{utm_source:"survey-footer"}})]})}function xg(t){var e=t.question,i=t.forceDisableHtml;return vg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[vg(e.type===Uf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&ig({component:jc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Cg(t){return vg("button",{className:"form-cancel",onClick:t.onClick,disabled:If(tg).isPreviewMode,"aria-label":"Close survey",type:"button",children:_g({fill:"black"})})}vg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vg("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 Tg=t;function Mg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=If(tg).isPopup;return Cf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return ar(Tg,"keydown",t),()=>{Tg.removeEventListener("keydown",t)}}),[a]),vg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&vg(Cg,{onClick:()=>a()}),vg("h3",{className:"thank-you-message-header",children:e}),i&&ig({component:jc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&vg(Sg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function Ig(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=If(tg),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return vg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&vg(Cg,{onClick:()=>u()}),e&&vg("h3",{className:"intro-screen-header",children:e}),i&&ig({component:jc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),vg(Sg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var Eg=t=>O(t)&&t.every((t=>j(t)));function Rg(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=eg().isPreviewMode,d=Tf(null),v=xf((()=>j(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Cf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=Mf((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case M: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 I: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=Vi(e.validation,M),b=Vi(e.validation,I),_=Mf((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return vg(Hc,{children:[vg("div",{className:"question-container",children:[vg(xg,{question:e,forceDisableHtml:i,htmlFor:g}),vg("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}),_&&vg("div",{className:"validation-hint",children:_})]}),vg(Sg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Pg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return vg(Hc,{children:[vg("div",{className:"question-container",children:vg(xg,{question:e,forceDisableHtml:t.forceDisableHtml})}),vg(Sg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function Ag(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=xf((()=>U(l)?l:O(l)&&l.length>0&&U(parseInt(l[0]))?parseInt(l[0]):j(l)&&U(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=eg().isPreviewMode,y=t=>m?o(t):a(t);return vg(Hc,{children:[vg("div",{className:"question-container",children:[vg(xg,{question:i,forceDisableHtml:r}),vg("div",{className:"rating-section",children:[vg("div",{className:"rating-options",children:["emoji"===i.display&&vg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Ng[i.scale])?void 0:e.map(((t,e)=>vg("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&&vg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:qg(i.scale).map(((t,e)=>vg(Fg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&vg("div",{className:"rating-text",children:[vg("div",{children:i.lowerBoundLabel}),vg("div",{children:i.upperBoundLabel})]})]})]}),vg(Sg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:H(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Fg(t){var e=t.num,i=t.setActiveNumber;return vg("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 Og(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=Tf(null),d=Mf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Jp(e,Qp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=xf((()=>((t,e)=>j(t)||Eg(t)?t:e===Uf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=xf((()=>((t,e)=>{if(j(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Eg(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=eg().isPreviewMode,_=e.type===Uf.SingleChoice,w=e.type===Uf.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&&O(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||!H(c)&&(!O(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?O(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return vg(Hc,{children:[vg("div",{className:"question-container",children:[vg(xg,{question:e,forceDisableHtml:i}),vg("fieldset",{className:"multiple-choice-options limit-height",children:[vg("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:O(c)&&c.includes(t);return vg("label",{className:n?"choice-option-open":"",children:[vg("div",{className:"response-choice",children:[vg("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),vg("span",{children:n?t+":":t})]}),n&&vg("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)}))]})]}),vg(Sg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var Lg=[1,2,3,4,5],Dg=[1,2,3,4,5,6,7],$g=[0,1,2,3,4,5,6,7,8,9,10],Ng={2:[yg,bg],3:[pg,fg,cg],5:[gg,pg,fg,cg,mg]};function qg(t){switch(t){case 5:default:return Lg;case 7:return Dg;case 10:return $g}}var jg=Ji("[Surveys]");function Bg(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?Wf.End:s;if(n.branching.type===Wf.End)return Wf.End;if(n.branching.type===Wf.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Wf.ResponseBased){if(n.type===Uf.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===Wf.End?Wf.End:s}}else if(n.type===Uf.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===Wf.End?Wf.End:s}}return s}return jg.warn("Falling back to next question index due to unexpected branching type"),s}var Hg=Ji("[SurveyTranslations]");function zg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Co(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?Co(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=Co(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:L(t.get_property)?t.get_property(ds):void 0,locale:Xo()},Hg)}(e);if(!i)return Hg.info("No user language detected"),{survey:t,language:null};var r=Eo(t,i,Hg);return{survey:r.survey,language:r.matchedKey}}var Ug=-1,Wg=t,Vg=r,Gg="ph:show_survey_widget",Zg="PHWidgetSurveyClickListener";function Qg(t,e){try{var i=t.getBoundingClientRect(),r=Wg.innerHeight,n=Wg.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:jp.zIndex}}catch(t){return Kf.warn("Failed to calculate trigger position:",t),null}}class Jg{constructor(t){var e=this;this.li=new Map,this.hi=new Map,this.ci=new Map,this.di=new Set,this.vi=null,this.fi=!1,this.pi=null,this.gi=null,this.mi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(fs);if(t)for(var e of t)og(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.yi(t),v=d.survey,c=d.language;e.vi=c,e.mi=null,e.bi=i;var f=e.wi(v,i);e.ki(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Si(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.xi(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===Bf.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Vg.querySelector(f.appearance.widgetSelector);k&&(_=Qg(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||jp.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Up(f,e._posthog).shadow;e.ci.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.Ci,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(e.mi=C,0>=S)return e.fi=!0,uf(vg(em,p({},C)),x);var T=()=>{if(!e.Mi(f))return Kf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.Ci(f);(()=>{e.fi=!0;var r=e.yi(t),n=r.survey,s=r.language;e.vi=s;var a=e.wi(n,i),o=p({},C,{survey:a,surveyLanguage:s});e.mi=o,uf(vg(em,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,I=U(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Wg.setTimeout((()=>{e.li.delete(f.id),T()}),E);e.li.set(f.id,R)}},this.Ti=t=>{var e=this.yi(t),i=e.survey,r=e.language,n=Up(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.ci.set(s,s.host),a&&uf(vg(rm,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Ii=t=>{var e=this.hi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Zg),this.hi.delete(t),Kf.info("Removed click listener for survey "+t))},this.Ri=t=>{this.Ai(t)||(this.Ei(t),this.Ii(t.id))},this.Ai=t=>{try{var e,i=Vg.querySelector(ug(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Li=(t,e)=>{var i=Vg.querySelector(e),r=this.hi.get(t.id);if(i){if(this.Ti(t),r){if(i===r.element)return;Kf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Ii(t.id)}if(!i.hasAttribute(Zg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Bf.NextToTrigger?Qg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||jp.maxWidth)):{};Wg.dispatchEvent(new CustomEvent(Gg,{detail:{surveyId:t.id,position:n}}))};ar(i,"click",n),i.setAttribute(Zg,"true"),this.hi.set(t.id,{element:i,listener:n,survey:t}),Kf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Ri(t)},this.renderPopover=t=>{var e=this.yi(t),i=e.survey,r=e.language,n=Up(i,this._posthog).shadow;this.ci.set(n,n.host),uf(vg(em,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Ci,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.yi(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.Oi(s,a,i)),uf(vg(em,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Ci,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.Mi(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===zf.Popover||t.type===zf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.li.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Di(i),a=new Set;s.forEach((t=>{if(t.type===zf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===jf.Tab)return void e.Ti(t);(null==(r=t.appearance)?void 0:r.widgetType)===jf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Li(t,null==(s=t.appearance)?void 0:s.widgetSelector))}H(e.Pi)&&t.type===zf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.hi.forEach((t=>{var i=t.survey;a.has(i.id)||e.Ri(i)}))}),t)},this.xi=t=>{H(this.Pi)||Kf.error("Survey "+this.Pi+" already in focus. Cannot add survey "+t.id+"."),this.Pi=t.id},this.Ci=t=>{this.Pi!==t.id&&Kf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.ki(t.id),this.Pi=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0,this.Ei(t)},this._posthog=t,this.Pi=null,this.pi=()=>this.Ni(),ar(Wg,"languagechange",this.pi),this.gi=t.onFeatureFlags((()=>this.Ni()))}Ni(){if(!H(this.Pi)){var t=this._posthog.get_property(fs),e=null==t?void 0:t.find((t=>t.id===this.Pi));if(e){var i=this.yi(e),r=i.survey,n=i.language;if(n!==this.vi&&(this.vi=n,this.fi)){var s=this.wi(r,this.bi),a=Up(s,this._posthog).shadow;uf(vg(em,p({},this.mi,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Ci,surveyLanguage:n})),a)}}}}get Fi(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,op))&&void 0!==t?t:this._posthog.featureFlags}wi(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}ki(t){var e=this.li.get(t);e&&(clearTimeout(e),this.li.delete(t))}cancelSurvey(t){this.li.has(t)&&(Kf.info("Cancelled pending survey "+t),this.ki(t),this.Pi===t&&(this.Pi=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0))}setAutomaticDisplayDispose(t){this.qi=t}dispose(){var t;null==(t=this.qi)||t.call(this),this.qi=void 0,this.pi&&(Wg.removeEventListener("languagechange",this.pi),this.pi=null),this.gi&&(this.gi(),this.gi=null),this.li.forEach(((t,e)=>this.ki(e))),this.hi.forEach(((t,e)=>this.Ii(e))),this.ci.forEach(((t,e)=>{uf(null,e),null==t||t.remove()})),this.ci.clear(),this.Pi=null}Di(t){return t.sort(((t,e)=>{var i,r,n=og(t),s=og(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===Vf,o=e.schedule===Vf;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)}))}yi(t){return zg(t,this._posthog)}Oi(t,e,i){if(this.di.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&&!q(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}}(Wg.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Kf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.ji(t,n,e);return!!s&&(this.Bi(t,s,i,e),this.di.add(t.id),s.isSurveyCompleted)}Bi(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)&&Wp({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}Si(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=O(a)?a.map(String):[String(a)]}Kf.info("[Survey] Processing initial responses");var o=this.ji(t,n,r);return!!o&&(this.Bi(t,o,i,r),o.isSurveyCompleted)}ji(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=wo(t.id);try{switch(t.type){case Uf.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 Uf.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 Uf.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 Kf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=fp(),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=wo(l.id);q(i[u])||(n[u]=i[u])}s.push(r);var h=Bg(t,r,l.id?i[wo(l.id)]:null);if(h===Wf.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 sg(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Kp(t.questions),visitedIndices:u,surveyLanguage:i}),Kf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Kf.error("[Survey Prefill] Error handling prefill:",t),null}}Hi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Fi,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}$i(e){return!e.conditions||rg(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=pe(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 Oo[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==Np||!Np.querySelector(t.conditions.selector))}(e)}Ui(t){var e;return Xp(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.Fi)&&e.hasLoadedFlags?{satisfied:this.Hi(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(!Yf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!sp.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.Hi(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.Hi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.Ui(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,wp.ai("lastSeenSurveyDate"))?(t=>!!wp.ai(rp(t))&&!Xp(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.zi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}zi(t){var e;if(!Ro(t)&&!Xf(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))}Wi(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.Hi(e)}))}Mi(t){return this.checkSurveyEligibility(t).eligible&&this.$i(t)&&this.zi(t)&&this.Wi(t)}Ei(t){try{var e=Vg.querySelector(ug(t,!0));null!=e&&e.shadowRoot&&(uf(null,e.shadowRoot),this.ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Kf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.xi,removeSurveyFromFocus:this.Ci,surveyInFocus:this.Pi,surveyTimeouts:this.li,handleWidget:this.Ti,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Li,sortSurveysByAppearanceDelay:this.Di,checkFlags:this.Wi.bind(this),isSurveyFeatureFlagEnabled:this.Hi.bind(this),onLanguageChange:this.Ni.bind(this),currentLanguage:this.vi,surveyIsRendered:this.fi}}}function Kg(t,e){if(Vg&&Wg){var i,r=new Jg(t);if(t.config.disable_surveys_automatic_display)return Kf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Kf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{q(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{q(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Vg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return ar(Vg,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Vg.removeEventListener("visibilitychange",a)})),r}}function Yg(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;Cf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===zf.Widget,s=rg(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===jf.Tab&&i;if(!s)return Kf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Kf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};ar(Wg,"popstate",i),ar(Wg,"hashchange",i);var s=Wg.history.pushState,l=Wg.history.replaceState;return Wg.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()},Wg.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()},()=>{Wg.removeEventListener("popstate",i),Wg.removeEventListener("hashchange",i),Wg.history.pushState=s,Wg.history.replaceState=l}}}),[a,e,r,n,o])}var Xg=200;function tm(t){switch(void 0===t&&(t=Hf.Right),t){case Hf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Hf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Hf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function em(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,I=t.onPopupSurveyDismissed,E=void 0===I?()=>{}:I,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=Tf(null),N=Number.isInteger(b),j=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,B=function(t,e,i,r,n,s,a,o,l){var u=xf(r||0===i||t.type===zf.ExternalSurvey),h=u[0],d=u[1],v=xf(!1),c=v[0],f=v[1],g=Tf(!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 "+Xg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Xg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Cf((()=>{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(rg(t,e)){d(!0),Wg.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Gf.SHOWN,p({[Zf.SURVEY_NAME]:t.name,[Zf.SURVEY_ID]:t.id,[Zf.SURVEY_ITERATION]:t.current_iteration,[Zf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Zf.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(Wg,"PHSurveyClosed",y),ar(Wg,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return q(u)&&a(),()=>{q(u)||clearTimeout(u),q(n)||clearTimeout(n),Wg.removeEventListener("PHSurveyClosed",y),Wg.removeEventListener("PHSurveySent",s)}}}else Kf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Yg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,j,N,w,S,D,O,L),H=B.isPopupVisible,z=B.hidePopupWithAnimation,U=B.isSurveySent||b===c.questions.length||!0===F,W=xf(!1),V=W[0],G=W[1],Z=Mf((()=>!!ag(c)),[c]),Q=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),J=N?b===Ug:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Q&&!V&&!Z,K=Mf((()=>{var t=ag(c),e=(null==t?void 0:t.surveySubmissionId)||fp();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Gp(c,g,N,L):Gp(c,g,N),E()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,E,C,M,A,L]);return H?vg(tg.Provider,{value:K,children:vg("div",{className:"ph-survey",style:p({},hg(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:U?vg(Mg,{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||jp,onClose(){z(),P()}}):J?vg(Ig,{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||jp,onStart:()=>G(!0)}):vg(im,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function im(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=Mf((()=>{var t=ag(r);if(!t)return null;var e=U(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(lg(r),null)}),[r]),o=xf((()=>(null!=a&&a.responses&&Kf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=If(tg),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=xf((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=U(t)&&t>=0&&r.questions.length>t?t:0;return U(d)&&d>=0?d:e})),k=w[0],S=w[1],x=xf((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],M=xf((()=>{var t,e=ag(r);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),I=M[0],E=M[1],R=Mf((()=>Kp(Yp(r,a))),[r.id,a]),P=Mf((()=>{if(!R||new Set(R).size!==R.length)return Yp(r,a);var t=new Map(r.questions.map((t=>[t.id,t]))),e=R.map((e=>t.get(e))).filter((t=>!!t));return e.length===R.length?e:r.questions}),[R,r.questions,r,a]);Cf((()=>{!y||q(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?vg("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&vg(Cg,{onClick(){v()}}),vg("div",{className:"survey-box","data-question-index":k,children:nm({question:F,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||jp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var a=wo(n),o=p({},l,{[a]:e});u(o);var h=P[i],d=null!=h&&h.id?p({},I,{[h.id]:h.question}):I;E(d);var v=Bg(r,i,e),c=v===Wf.End,f=[...C,i];if(c||(T(f),S(v),sg(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:v,questionOrder:Kp(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=>wo(t)))),y=Object.fromEntries(Object.entries(o).filter((t=>g.has(t[0]))));Wp({responses:y,survey:r,surveySubmissionId:m,isSurveyCompleted:c,posthog:s,properties:b,surveyLanguage:_,questionSnapshots:d})}}else Kf.error("onNextButtonClick called without a questionId.");else Kf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:f,initialValue:F.id?l[wo(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),sg(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:Kp(P),visitedIndices:e,surveyLanguage:_,questionSnapshots:I})}}})})]}):null}function rm(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=xf(!0),f=c[0],p=c[1],g=xf(!1),m=g[0],y=g[1],b=xf({}),_=b[0],w=b[1],k=Tf(void 0),S=()=>{y(!m)};if(Cf((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Kf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return ar(Wg,Gg,e),()=>{q(k.current)||(clearTimeout(k.current),k.current=void 0),Wg.removeEventListener(Gg,e)}}}else Kf.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]),Yg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Vf&&p(!1),q(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return vg(Hc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&vg("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Hf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:tm(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&vg(em,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var nm=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 Uf.Open:return jc(Rg,p({},n,{question:e,key:e.id}));case Uf.Link:return jc(Pg,p({},n,{question:e,key:e.id}));case Uf.Rating:return jc(Ag,p({},n,{question:e,key:e.id}));case Uf.SingleChoice:case Uf.MultipleChoice:return jc(Og,p({},n,{question:e,key:e.id}));default:return Kf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=Kg,v.extendPostHogWithSurveys=Kg;var sm=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},am=1e4,om=(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),lm=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return om(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 om(e,JSON.stringify(t.slice(0,n)),i)},um=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,hm=(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}},dm=(t,e,i)=>{if(!i.truncated)if(D(t)){if(i.seen.has(t))return void hm(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(dm(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else hm(e,t,i)},vm=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!um(t))return!n||om(e,"null",i);if(H(t)||(t=>{try{return U(t)||V(t)}catch(t){return!1}})(t))return om(e,JSON.stringify(t),i);if("string"==typeof t)return lm(t,e,i);if(!D(t)&&!O(t))return om(e,JSON.stringify(t),i);if(r.has(t))return lm("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(L(a))return vm(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return lm(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return om(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 vm(l,e,i,r,n,s)}if(O(t)){if(!om(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!om(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!vm(d,e,i,r,!0))return!1}return om(e,"]",i)}if(!om(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{dm(f,c,s)}catch(t){}if(um(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(!om(e,p,i))return!1;var b=e.length,_=vm(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 om(e,"}",i)},cm=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=D(t[0])?{result:{},keysRemaining:50,sizeRemaining:am,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||om(i," ",r))&&vm(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)||{}}},fm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},pm=t=>"canCapture"in t,gm=t=>pm(t)?t.canCapture?t.getExtension(lp):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(Vv(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=gm(u);if(h){n=!0,s=!0;var d=cm(o,am),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(pm(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;L(n)&&n.call(e,i)}})(u,h,{level:fm[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__=sm(s),a})))};for(var a of Object.keys(fm))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=gm(t);if(i)for(var r of e)try{var n=cm(r.args,am);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:fm[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 mm=Ji("[Error tracking]"),ym="webkit-masked-url:",bm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",ym],_m=["__firefox__","__gCrWeb"];function wm(){return new Le([new Ze,new ni,new Je,new Qe,new ii,new ei,new Ye,new ri],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=Ve.test(o)?o.replace(Ve,"$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>=Ge)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Ge).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||De});var i}))}(n)}}("web:javascript",He,We))}var km=Ji("[ExceptionAutocapture]"),Sm=wm(),xm=e=>{var i=t;i||km.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=Sm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(j(e)&&j(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),!!L(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}},Cm=function(e,i){void 0===i&&(i=!1);var r=t;r||km.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=Sm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),L(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}},Tm={wrapOnError:xm,wrapUnhandledRejection:Cm,wrapConsoleError(t){var e=console;e||km.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=Sm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),L(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=Tm,v.posthogErrorWrappingFunctions=Tm;var Mm=(t,e)=>{if(L(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!H(i)&&"object"==typeof i&&O(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){km.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){km.error("Failed to capture exception for a legacy client",t)}};xm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),Cm(n,!0)}};v.extendPostHogWithExceptionAutoCapture=Mm,v.extendPostHogWithExceptionAutocapture=Mm;var Im="X-POSTHOG-SESSION-ID",Em="X-POSTHOG-WINDOW-ID",Rm="X-POSTHOG-DISTINCT-ID",Pm=[Im,Em,Rm],Am=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Fm=(t,e)=>({}.hasOwnProperty.call(t,e)),Om=t=>"object"==typeof t&&!H(t)||L(t),Lm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Dm=e=>{try{var i;return Lm(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}},$m=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(O(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(Im,o.sessionId),n.set(Em,l),a=!0}var u=(t=>L(t)?t():t)(e);return u&&u!==Ps&&(n.set(Rm,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Nm={_patchFetch:(e,i,r)=>Vv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=Dm(n);if(l)if(Lm(n)){var u=new Request(n,s);$m(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(Om(s)?s.headers:void 0);if($m(e,i,r,l,h)){var d=((t,e)=>{if(q(t)||H(t))return{headers:e};if(Om(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)=>Fm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Fm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Am.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&Am.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var 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)=>Vv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=Dm(s);d&&$m(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return Pm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Nm,v.postHogTracingHeadersPatchFns=Nm,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});let qm=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 jm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Bm=t=>{if("loading"===document.readyState)return"loading";var e=jm();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"},Hm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},zm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Hm(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},Um=new WeakMap;function Wm(t,e){var i=Um.get(e);return i||(i=new WeakMap,Um.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Vm=-1,Gm=()=>Vm,Zm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Vm=e.timeStamp,t(e))}),!0)},Qm=(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))}},Jm=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Km=()=>{var t,e;return null!==(t=null==(e=jm())?void 0:e.activationStart)&&void 0!==t?t:0},Ym=-1,Xm=new Set,ty=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ey=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Xm)e();isFinite(Ym)||(Ym="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ey,!0))}},iy=function(t){if(void 0===t&&(t=!1),t&&(Ym=1/0),0>Ym){var e,i=Km(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Ym=null!=r?r:ty(),addEventListener("visibilitychange",ey,!0),addEventListener("prerenderingchange",ey,!0),Zm((()=>{setTimeout((()=>{Ym=ty()}))}))}return{get firstHiddenTime(){return Ym},onHidden(t){Xm.add(t)}}},ry=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=jm(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Gm()?o&&(document.prerendering||Km()>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=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){}},sy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},ay=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},oy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class ly{constructor(){this.u=void 0}}var uy,hy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},dy=[1800,3e3],vy=function(t,e){void 0===e&&(e={});var i=sy(e);hy((()=>{var r,n=Wm(e,ly),s=iy(),a=ry("FCP"),o=ny(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Km(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Qm(t,a,dy,e.reportAllChanges),Zm((i=>{a=ry("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Gm()),r=Qm(t,a,dy,e.reportAllChanges),Jm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&ny(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&ay(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=ry("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Qm(t,a,dy,e.reportAllChanges))(!0)}))}),e)}))},cy=[.1,.25],fy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],py=function(t,e){void 0===e&&(e={});var i=Wm(e=Object.assign({},e),qm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=fy(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:zm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=iy();vy(oy((()=>{var r,n=ry("CLS",0),s=Wm(e,qm),a=(i,a,o,l,u)=>{n=ry("CLS",0,i,a,o,l,u),s.o=0,r=Qm(t,n,cy,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"];sy(e)&&h.push("soft-navigation");var d=ny(h,u);d&&(r=Qm(t,n,cy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Zm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Gm()),Jm(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=fy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Bm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},gy=function(t,e){void 0===e&&(e={});var i=Wm(e=Object.assign({},e),ly);sy(e)&&(i.u=new Map),vy((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Bm(Gm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=jm(),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:Bm(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)},my=0,yy=1/0,by=0,_y=t=>{for(var e of t)e.interactionId&&(yy=Math.min(yy,e.interactionId),by=Math.max(by,e.interactionId),my=by?(by-yy)/7+1:0)},wy=()=>{var t;return uy?my:null!==(t=performance.interactionCount)&&void 0!==t?t:0};let ky=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return wy()-this.h}D(){this.h=wy(),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 Sy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=oy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},xy=[200,500],Cy=function(t,e){void 0===e&&(e={});var i=Wm(e=Object.assign({},e),ky),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(Sy(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:zm(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};ny(["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=iy();hy((()=>{var r;"interactionCount"in performance||uy||(uy=ny(["event"],_y,{durationThreshold:0}));var n,s=ry("INP"),a=Wm(e,ky),o=(i,r,o,l,u)=>{a.D(),s=ry("INP",-1,i,r,o,l,u),n=Qm(t,s,xy,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),Sy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];sy(e)&&d.push("soft-navigation");var v=ny(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Qm(t,s,xy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Zm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Gm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Bm(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:Bm(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 Ty=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],My=50,Iy=[];ny(["resource"],(t=>{for(var e of t)Iy.push(e),Iy.length>My&&Iy.shift()}));var Ey=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(My=e.resourceBufferSize);var i=Wm(e,Ty),r=new WeakMap;sy(e)&&(i.u=new Map),i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:zm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=sy(e);hy((()=>{var n,s=iy(),a=ry("LCP"),o=Wm(e,Ty),l=(r,o,l,u,h)=>{a=ry("LCP",-1,r,o,l,u,h),n=Qm(t,a,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=iy(!0))},u=t=>{o.u&&t.navigationId&&ay(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-Km(),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=ny(d,h);if(v){n=Qm(t,a,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Sy((()=>{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,Gm()),n=Qm(t,a,$,e.reportAllChanges),Jm((()=>{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&&(Iy.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=jm())?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)},Ry=-1,Py=()=>Ry,Ay=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ry=e.timeStamp,t(e))}),!0)},Fy=(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))}},Oy=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Ly=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Dy=()=>{var t,e;return null!==(t=null==(e=Ly())?void 0:e.activationStart)&&void 0!==t?t:0},$y=-1,Ny=new Set,qy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,jy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ny)e();isFinite($y)||($y="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",jy,!0))}},By=function(t){if(void 0===t&&(t=!1),t&&($y=1/0),0>$y){var e,i=Dy(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;$y=null!=r?r:qy(),addEventListener("visibilitychange",jy,!0),addEventListener("prerenderingchange",jy,!0),Ay((()=>{setTimeout((()=>{$y=qy()}))}))}return{get firstHiddenTime(){return $y},onHidden(t){Ny.add(t)}}},Hy=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Ly(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Py()?o&&(document.prerendering||Dy()>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}},zy=new WeakMap;function Uy(t,e){var i=zy.get(e);return i||(i=new WeakMap,zy.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Wy{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 Vy=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){}},Gy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Zy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Qy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Jy{constructor(){this.l=void 0}}var Ky,Yy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xy=[1800,3e3],tb=function(t,e){void 0===e&&(e={});var i=Gy(e);Yy((()=>{var r,n=Uy(e,Jy),s=By(),a=Hy("FCP"),o=Vy(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Dy(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Fy(t,a,Xy,e.reportAllChanges),Ay((i=>{a=Hy("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Py()),r=Fy(t,a,Xy,e.reportAllChanges),Oy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Vy(["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=Hy("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Fy(t,a,Xy,e.reportAllChanges))(!0)}))}),e)}))},eb=[.1,.25],ib=function(t,e){void 0===e&&(e={});var i=By();tb(Qy((()=>{var r,n=Hy("CLS",0),s=Uy(e,Wy),a=(i,a,o,l,u)=>{n=Hy("CLS",0,i,a,o,l,u),s.i=0,r=Fy(t,n,eb,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"];Gy(e)&&h.push("soft-navigation");var d=Vy(h,u);d&&(r=Fy(t,n,eb,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Ay((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Py()),Oy(r)})),setTimeout(r))})))},rb=0,nb=1/0,sb=0,ab=t=>{for(var e of t)e.interactionId&&(nb=Math.min(nb,e.interactionId),sb=Math.max(sb,e.interactionId),rb=sb?(sb-nb)/7+1:0)},ob=()=>{var t;return Ky?rb:null!==(t=performance.interactionCount)&&void 0!==t?t:0};class lb{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return ob()-this.u}M(){this.u=ob(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort(((t,e)=>e.P-t.P)),this.v.length>10){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 ub=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Qy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},hb=[200,500],db=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=By();Yy((()=>{var r;"interactionCount"in performance||Ky||(Ky=Vy(["event"],ab,{durationThreshold:0}));var n,s=Hy("INP"),a=Uy(e,lb),o=(i,r,o,l,u)=>{a.M(),s=Hy("INP",-1,i,r,o,l,u),n=Fy(t,s,hb,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),ub((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Gy(e)&&d.push("soft-navigation");var v=Vy(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Fy(t,s,hb,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Ay((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Py())})))}))}};class vb{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}}var cb=[2500,4e3],fb=function(t,e){void 0===e&&(e={});var i=!1,r=Gy(e);Yy((()=>{var n,s=By(),a=Hy("LCP"),o=Uy(e,vb),l=(r,o,l,u,h)=>{a=Hy("LCP",-1,r,o,l,u,h),n=Fy(t,a,cb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=By(!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-Dy(),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=Vy(d,h);if(v){n=Fy(t,a,cb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;ub((()=>{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});Ay((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Py()),n=Fy(t,a,cb,e.reportAllChanges),Oy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},pb={onLCP:Ey,onCLS:py,onFCP:gy,onINP:Cy,withoutAttribution:{onLCP:fb,onCLS:ib,onFCP:tb,onINP:db}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=pb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=pb,v.postHogWebVitalsCallbacks=pb;var gb={onLCP:fb,onCLS:ib,onFCP:tb,onINP:db};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=gb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=gb,v.postHogWebVitalsCallbacks=gb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>gb;var mb={onLCP:Ey,onCLS:py,onFCP:gy,onINP:Cy,withoutAttribution:{onLCP:fb,onCLS:ib,onFCP:tb,onINP:db}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=mb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=mb,v.postHogWebVitalsCallbacks=mb;var yb={onLCP:fb,onCLS:ib,onFCP:tb,onINP:db};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=yb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=yb,v.postHogWebVitalsCallbacks=yb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>yb;class bb{constructor(t){this.disabled=!1===t;var e=D(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 _b="$copy_autocapture",wb=Ji("[AutoCapture]");function kb(t,e){return e.length>t?e.slice(0,t)+"...":e}function Sb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!xr(e));return e}function xb(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")&&Ir>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,k=!1;if(Yi(d,(t=>{var e=Zr(t);if(Cr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&nn(i))&&(h?Re(i):i)}w(Pr(t),"ph-no-capture")&&(k=!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()?kb(1024,sn(t)):kb(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)&&(!j(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=Er(o).join(" ")),a["attr__"+i.name]=kb(1024,"href"===i.name&&n?Re(o):o)}}));for(var l=1,u=1,h=t;h=Sb(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)}))})),k)return{props:{},explicitNoCapture:k};if(o||(y[0].$el_text=Cr(e,"a")||Cr(e,"button")?sn(e):Fr(e)),_){var S,x;y[0].attr__href=_;var C=null==(S=hr(_))?void 0:S.host,T=null==t||null==(x=t.location)?void 0:x.host;C&&T&&C!==T&&(g=_)}return{props:Xi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,O(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 Cb{constructor(t){this.name="autocapture",this.Rs=!1,this.Ps=null,this.As=!1,this.Fs=!1,this.mn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Os=!1,this.Ls=t,this.Ls.refresh(this.mn),this.rageclicks=new bb(this.mn.rageclick),this.Ds=null}setup(t){this.$s(),this.Ns=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Os?e.dispose():(this.qs=e,this.startIfEnabled())}dispose(){var t;this.Os||(this.Os=!0,this.Ns=void 0,null==(t=this.qs)||t.dispose(),this.qs=void 0,this.js())}Bs(){return this.Ls.refresh(this.mn),this.mn}$s(){var t,e;return this.Bs(),this.mn.url_allowlist=null==(t=this.mn.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.mn.url_ignorelist=null==(e=this.mn.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.mn}Hs(){if(this.isBrowserSupported()){if(t&&r){var e=this.zs=e=>{e=e||(null==t?void 0:t.event);try{this.Us(e)}catch(t){wb.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.Bs().capture_copied_text){var i=this.Ws=e=>{e=e||(null==t?void 0:t.event);try{this.Us(e,_b)}catch(t){wb.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 wb.info("Disabling Automatic Event Collection because this browser is not supported")}js(){this.zs&&(null==r||r.removeEventListener("submit",this.zs,!0),null==r||r.removeEventListener("change",this.zs,!0),null==r||r.removeEventListener("click",this.zs,!0),this.zs=void 0),this.Ws&&(null==r||r.removeEventListener("copy",this.Ws,!0),null==r||r.removeEventListener("cut",this.Ws,!0),null==r||r.removeEventListener("paste",this.Ws,!0),this.Ws=void 0),this.Rs=!1}startIfEnabled(){!this.Os&&this.Ns&&this.isEnabled&&!this.Rs&&(this.Hs(),this.Rs=!0)}onRemoteConfig(t){if(!this.Os)if(this.As=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Fs=e.elementsChainAsString);var i,r=e.autocapture_opt_out;V(r)&&(null==(i=this.Ns)||i.kv.set(Rn,r),this.Ps=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Ds=t}getElementSelectors(t){var e,i=[];return null==(e=this.Ds)||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.Os)return!1;var i=null==(t=this.Ns)?void 0:t.kv.get(Rn),r=this.Ps,n=this.Bs(),s=n.remoteRequestsDisabled&&!this.As;if(H(r)&&!V(i)&&!s)return!1;var a=null!==(e=this.Ps)&&void 0!==e?e:!!i;return!!n.enabled&&!a}Us(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Or(e);Tr(r)&&(r=r.parentNode||null);var n,s=this.$s();"$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.Us(e,"$rageclick");var a=i===_b,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(q(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=xb(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Fs,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===_b){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.Ns)||l.capture(i,h).catch((t=>wb.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return L(null==r?void 0:r.querySelectorAll)}}var Tb={};function Mb(e,i){var r=Tb[e];if(r)return r;var n=i[e];if((t=>L(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return Tb[e]=n.bind(i);var s=i.document;if(s&&L(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 w(t,"AppleWebKit")&&!w(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&&L(n)?Tb[e]=n.bind(i):n}function Ib(t,e){var i=Or(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Eb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Rb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Pb="canvas,video,audio,embed,object",Ab=1e3;function Fb(t,e){return U(t)&&t>=e}function Ob(t){return t>=0&&Ab>t?t:void 0}function Lb(t,e){return e?Ob(t-e):void 0}class Db{Gi(t){var e,i,r,n,s,a,o,l,u=this.Qi((null==t?void 0:t.__onCapture)||this.Ji.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.Yi=[],this.Ki=0,this.Qi=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.Xi=t=>{var e=Ib(t,{type:"click"});H(e)||this.en(e)||this.tn(e),this.rn()},this.nn=()=>{var t=Date.now();this.an=t,t%50==0&&this.Yi.forEach((e=>{q(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.sn=()=>{this.un=Date.now()},this.Vt=()=>{var t=Date.now();this.ln=t,this.hn("visibilityChangedDelayMs",t)},this.cn=()=>{var t=Date.now();this.dn=t,this.hn("focusChangedDelayMs",t)},this.vn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.fn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.pn=()=>{this.fn=void 0},this.gn=t=>{var e,i=this.fn;if(this.fn=void 0,!q(i)&&this.mn.max_dead_swipes_per_page_load>this.Ki){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.mn.swipe_threshold_px;if(l>=u*u&&![this.an,this.yn,this.un].some((t=>U(t)&&t>=i.timestamp))){var h;if(this.bn()&&(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(Pb))))return;var d=Ib(n,{type:"swipe",swipeDirection:Eb(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});H(d)||this.en(d)||this.tn(d),this.rn()}}}},this.instance=t,this.mn=this.Gi(e),this._onCapture=this.mn.__onCapture}start(t){this.wn(),this.kn(),this._n(),this.Sn(),this.xn(),this.Cn(t),this.mn.capture_dead_swipes&&this.Mn()}Cn(t){if(!this.Tn){var e=function(t){return Mb("MutationObserver",t)}(v);this.Tn=new e((t=>{this.In(t)})),this.Tn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Tn)||t.disconnect(),this.Tn=void 0,v.removeEventListener("click",this.Xi),v.removeEventListener("scroll",this.nn,{capture:!0}),v.removeEventListener("selectionchange",this.sn),v.removeEventListener("touchstart",this.vn,{capture:!0}),v.removeEventListener("touchend",this.gn,{capture:!0}),v.removeEventListener("touchcancel",this.pn,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.Vt),v.removeEventListener("blur",this.cn),v.removeEventListener("focus",this.cn),this.fn=void 0}In(t){this.yn=Date.now()}wn(){ar(v,"click",this.Xi)}tn(t){t.visibilityChangedDelayMs=Lb(t.timestamp,this.ln),t.focusChangedDelayMs=Lb(t.timestamp,this.dn),this.Yi.push(t)}rn(){this.Yi.length&&q(this.Rn)&&(this.Rn=v.setTimeout((()=>{this.An()}),1e3))}kn(){ar(v,"scroll",this.nn,{capture:!0})}_n(){ar(v,"selectionchange",this.sn)}Sn(){ar(r,"visibilitychange",this.Vt)}xn(){ar(v,"blur",this.cn),ar(v,"focus",this.cn)}hn(t,e){this.Yi.forEach((i=>{var r=Ob(e-i.timestamp);U(r)&&(q(i[t])||i[t]>r)&&(i[t]=r)}))}Mn(){ar(v,"touchstart",this.vn,{capture:!0,passive:!0}),ar(v,"touchend",this.gn,{capture:!0,passive:!0}),ar(v,"touchcancel",this.pn,{capture:!0,passive:!0})}bn(){var t=q(this.En)||U(this.yn)&&this.yn>this.En;return(q(this.Ln)||t)&&(this.En=Date.now(),this.Ln=!(null==r||!r.querySelector(Pb))),!!this.Ln}en(t){return!t||("swipe"===t.type?this.On(t):this.Dn(t))}On(e){if(Sr(e.node))return!0;var i=this.Yi.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=V(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.mn.css_selector_ignorelist}))}Dn(e){return!(this.mn.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.On(e)||(r=e.node,!(!t||Vr(r))&&Gr(r,!1).targetElementList.some((t=>Cr(t,"a"))));var i,r}An(){if(this.Yi.length){clearTimeout(this.Rn),this.Rn=void 0;var t=this.Yi;for(var e of(this.Yi=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.yn&&this.yn>=e.timestamp?this.yn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.un&&this.un>=e.timestamp?this.un-e.timestamp:void 0;var r=Fb(e.scrollDelayMs,this.mn.scroll_threshold_ms),n=Fb(e.selectionChangedDelayMs,this.mn.selection_change_threshold_ms),s=Fb(e.mutationDelayMs,this.mn.mutation_threshold_ms),a=Fb(e.absoluteDelayMs,1.1*this.mn.mutation_threshold_ms),o=U(e.scrollDelayMs)&&this.mn.scroll_threshold_ms>e.scrollDelayMs,l=U(e.mutationDelayMs)&&this.mn.mutation_threshold_ms>e.mutationDelayMs,u=U(e.selectionChangedDelayMs)&&this.mn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=U(e.visibilityChangedDelayMs),d=U(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=Rb(e);if("$dead_swipe"===v){if(this.Ki>=this.mn.max_dead_swipes_per_page_load)continue;this.Ki++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.yn,[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.mn.mutation_threshold_ms>e.absoluteDelayMs&&this.Yi.push(e)}this.rn()}}Ji(t,e){var i=Rb(t);this.instance.capture(i,p({},e,xb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.mn.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 Db(t,e);var $b=Ji("[ExternalScriptsLoader]"),Nb=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]},qb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return $b.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=Nb(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(Nb(e))return qb(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)},jb={},Bb=(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=jb[n];if("fallback"===r&&s){if(Nb(s))return void qb(t,s,i);delete jb[n]}qb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=Bb(t,e);jb[n]=o;var l=Nb(n);null==l||null==(a=l.parentNode)||a.removeChild(l),qb(t,o,i)}else i(void 0,s)}:i)}else qb(t,Bb(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");qb(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);qb(t,r,i)};class Hb{constructor(t){this._instance=t}get mn(){return this._instance.config}get consent(){return this.Vs()?0:this.Gs}isOptedOut(){return this.mn.cookieless_mode===Vs||this.isRejected()||-1===this.consent&&this.mn.cookieless_mode===Ws}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.mn.opt_out_capturing_by_default}optInOut(t){this.Zs.ni(this.Qs,t?1:0,this.mn.cookie_expiration,this.mn.cross_subdomain_cookie,this.mn.secure_cookie)}reset(){this.Zs.oi(this.Qs,this.mn.cross_subdomain_cookie)}get Qs(){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 Gs(){var t=this.Zs.ai(this.Qs);return it(t)?1:w(rt,t)?0:-1}get Zs(){var t=this.mn.opt_out_capturing_persistence_type,e="localStorage"===t?wp:bp,i=e.ii()?e:Fp;if(!this.Js||this.Js!==i){this.Js=i;var r="localStorage"===t?bp:wp;r.ai(this.Qs)&&(this.Js.ai(this.Qs)||this.optInOut(it(r.ai(this.Qs))),r.oi(this.Qs,this.mn.cross_subdomain_cookie))}return this.Js}Vs(){return!!this.mn.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack,null==i?void 0:i.globalPrivacyControl].some((t=>it(t)))}}var zb=Ji("[Dead Clicks]"),Ub=()=>!0,Wb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Dn)),r=t.instance.config.capture_dead_clicks;return V(r)?r:!!D(r)||i};class Vb{get lazyLoadedDeadClicksAutocapture(){return this.Ks}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({[Dn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ys((()=>{this.Xs()})):this.stop()}Ys(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?zb.error("failed to load script",e):t()}))}Xs(){var t;if(r){if(!this.Ks&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=D(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.Ks=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ks.start(r),zb.info("starting...")}}else zb.error("`document` not found. Cannot start.")}stop(){this.Ks&&(this.Ks.stop(),this.Ks=void 0,zb.info("stopping..."))}}var Gb=Ji("[SegmentIntegration]");function Zb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||fp();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(xs,Zs)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&L(s.then)?s.then(n):n(s)}(t,(i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Gb.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Gb.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Gb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,Ys)},identify(t){return i(t,ta)},screen(t){return i(t,"$screen")}}})(t,i)).then((()=>{e()}),(t=>{Gb.error("Failed to register the Segment integration",t),e()}))}),i)}var Qb="posthog-js";function Jb(t,e){var i=void 0===e?{}:e,r=i.organization,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 Kb{constructor(t,e,i,r,n,s){this.name=Qb,this.setupOnce=function(a){a(Jb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Yb{constructor(t){this.ta=(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.ea=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.ia()}ia(){var t;this.ra=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ta)}destroy(){var t;null==(t=this.ra)||t.call(this),this.ra=void 0}doPageView(e,i){var r,n=this.na(e,i);return this.ea={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.na(t,null==(e=this.ea)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ea)?void 0:t.pageViewId}}na(t,e){var i=this.ea;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(!(q(s)||q(a)||q(o)||q(l)||q(u)||q(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?nt(a/s,0,1,Qi):1,v=s>1?nt(o/s,0,1,Qi):1,c=l>1?nt(u/l,0,1,Qi):1,f=l>1?nt(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 Xb=["flags","surveys"],t_={[kn]:{exposure:"hidden"},[Tn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[En]:{exposure:"hidden"},[In]:{exposure:"hidden"},[Rn]:{exposure:"event"},[Pn]:{exposure:"hidden"},[Nn]:{exposure:"hidden"},[An]:{exposure:"event"},[Fn]:{exposure:"hidden"},[On]:{exposure:"event"},[Ln]:{exposure:"event"},[Dn]:{exposure:"event"},[$n]:{exposure:"hidden"},[qn]:{exposure:"event"},[jn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Vn]:{exposure:"hidden"},[Gn]:{exposure:"event"},[Bn]:{exposure:"event",shouldSkipFromEventProperties:t=>H(t)},[Zn]:{exposure:"event"},[Qn]:{exposure:"event"},[Jn]:{exposure:"event"},[ts]:{exposure:"event"},[es]:{exposure:"hidden"},[is]:{exposure:"hidden",storageGroup:"flags"},[rs]:{exposure:"hidden",storageGroup:"flags"},[ns]:{exposure:"hidden"},[ss]:{exposure:"hidden",storageGroup:"flags"},[as]:{exposure:"hidden",storageGroup:"flags"},[os]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ls]:{exposure:"hidden",storageGroup:"flags"},[us]:{exposure:"hidden"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden"},[vs]:{exposure:"hidden"},[fs]:{exposure:"hidden",storageGroup:"surveys"},[ps]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[gs]:{exposure:"event"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[bs]:{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"},[_s]:{exposure:"hidden"},[ws]:{exposure:"hidden"},[cs]:{exposure:"event"},[ks]:{exposure:"hidden"},[Ss]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xs]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Is]:{exposure:"hidden"},[Es]:{exposure:"hidden"},[Rs]:{exposure:"hidden"},[Hn]:{exposure:"event"},[zn]:{exposure:"event"},[Un]:{exposure:"event"},[Wn]:{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"},[Hs]:{exposure:"event"},[zs]:{exposure:"event"}},e_=[[Kn,{exposure:"hidden"}],[Yn,{exposure:"hidden"}],[Xn,{exposure:"hidden"}]],i_=t=>{var e=t_[t];if(e)return e;for(var i of e_){var r=i[1];if(0===t.indexOf(i[0]))return r}},r_={flags:Ss,surveys:ps},n_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],s_=t=>t+"_cookie_identity_change_pending",a_=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},o_="main",l_=[is,rs,ss,as,os,Ss,ls,ds],u_=t=>-1!==l_.indexOf(t),h_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},d_=t=>{if(!t)return{};var e=JSON.parse(t);return D(e)?e:{}},v_=(t,e)=>{Yi(t,((i,r)=>{var n=i_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class c_{constructor(e,i,r){if(void 0===r&&(r=!0),this.sa={},this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=new Map,this.va=!1,this.ca=!1,this.fa=!1,this.pa=!1,this.ga=new Set,this.mn=e,this.ma=r,this.props={},this.ya=void 0,this.ba=(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.Zs=this._a(e),this.la=this.wa(e),this.load(),this.ka(),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.Sa=e=>{if(this.aa&&(!e.storageArea||e.storageArea===(null==t?void 0:t.localStorage))&&e.key)if(e.key!==this.ba){if(this.la){var i=Xb.find((t=>e.key===this.xa(t)));i&&this.Ca(e.key,i)}}else this.Ca(e.key,o_)},ar(t,"storage",this.Sa)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach((t=>{var e=t[0],i=t[1],r=this.da.get(e);if(u_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach((t=>n.add(t))),n.size&&this.Ta(e,n)}else this.Ta(e,!0)}))}onCrossTabFeatureFlagChange(t){return this.ga.add(t),()=>this.ga.delete(t)}destroy(){this.Sa&&t&&(t.removeEventListener("storage",this.Sa),this.Sa=void 0),this.ga.clear()}Ca(t,e,i){if(void 0===i&&(i=!0),this.Ma)return!1;var r,n;try{if(n=wp.ai(t),H(n)){var s=this.Ia(e);return s.storageValue=null,e!==o_&&(s.persisted=!1),!1}r=d_(n)}catch(t){return!1}var a=e===o_?r:wp.ui(this.ba);if(a&&this.Ea(a))return!1;var o=this.Ra(r,e,i);return e===o_&&this.la&&!h_(this.Pa().main,r)||this.Aa(r,e,!0,n),o}Ea(t){var e=this.props[Sn],i=t[Sn];return!q(e)&&!q(i)&&e!==i}Aa(t,e,i,r){var n=this.Ia(e);n.storageValue=r,e!==o_&&(n.persisted=i);try{n.fingerprint=this.Fa(t,e)}catch(t){n.fingerprint=void 0}}Ra(t,e,i){var r=!1;return l_.forEach((i=>{var n,s=null==(n=i_(i))?void 0:n.storageGroup;if(!(e===o_&&this.la&&s||e!==o_&&s!==e)){var a=i in t,o=this.Oa(i,a?t[i]:void 0),l=this.da.has(i)?i in this.props:a;l===i in this.props&&h_(o,this.props[i])||(l?this.La(i,o,!1):this.Da(i,!1),r=!0)}})),r&&i&&this.ga.forEach((t=>t())),r}$a(){if(!this.aa)return!1;try{this.fa=!1;var t,e=wp.ai(this.ba),i=this.Ia(o_),r=!1,n=!1;if(e!==i.storageValue)if(H(e))i.storageValue=null;else{if(t=d_(e),this.fa=!this.ca&&this.Ea(t),this.fa)return!1;n=this.Ra(t,o_,!1),!this.la||h_(this.Pa().main,t)?this.Aa(t,o_,!0,e):i.storageValue=e,r=!0}return this.la&&Xb.forEach((e=>{var i=wp.ai(this.xa(e)),s=this.Ia(e),a=t||{},o=r&&l_.some((t=>{var i;return(null==(i=i_(t))?void 0:i.storageGroup)===e&&t in a}));if(i!==s.storageValue||o){if(H(i))return s.storageValue=null,s.persisted=!1,void(o&&(n=this.Ra(a,e,!1)||n));var l=d_(i);n=this.Ra(l,e,!1)||n,this.Aa(l,e,!0,i)}})),n}catch(t){return!1}}Ta(t,e){this.da.set(t,e);var i=i_(t);null!=i&&i.volatile||(this.Ia((this.la?null==i?void 0:i.storageGroup:void 0)||o_).fingerprint=void 0,this.Na(t))}qa(){l_.forEach((t=>this.da.set(t,!0)))}ka(){if(this.aa)try{var t=wp.ai(this.ba),e=d_(t);this.Ia(o_).storageValue=t,l_.forEach((t=>{var i,r=this.la?null==(i=i_(t))?void 0:i.storageGroup:void 0,n=r?wp.ai(this.xa(r)):null;if(r){var s=this.Ia(r);s.storageValue=n,s.persisted=!H(n)}var a=r&&!H(n)?d_(n):e;t in this.props?this.ja(t,a[t],this.props[t]):t in a&&this.Ta(t,!0)}))}catch(t){}}Oa(t,e){var i=this.da.get(t);if(!i)return e;if(!0===i)return this.props[t];if(t===rs){var r=new Set(O(e)?e:[]),n=new Set(O(this.props[t])?this.props[t]:[]);return i.forEach((t=>n.has(t)?r.add(t):r.delete(t))),Array.from(r)}var s=D(e)?p({},e):{},a=D(this.props[t])?this.props[t]:{};return i.forEach((t=>{t in a?s[t]=a[t]:delete s[t]})),s}ja(t,e,i){if(u_(t)){var r=this.da.get(t);if(!0!==r){var n=e;if(this.aa)try{var s,a=this.la?null==(s=i_(t))?void 0:s.storageGroup:void 0,o=a?this.xa(a):this.ba;n=d_(wp.ai(o))[t]}catch(t){}var l=new Set(r||[]);if(t===rs){if(!q(e)&&!O(e)||!q(n)&&!O(n)||!O(i))return void this.Ta(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(!D(i))return void(h_(n,i)?this.da.delete(t):this.Ta(t,!0));if(!q(e)&&!D(e)||q(e)&&N(i)&&q(n))return void this.Ta(t,!0);var v=D(e)?e:{},c=D(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach((t=>{t in v==t in i&&h_(v[t],i[t])||l.add(t)})),l.forEach((t=>{t in c==t in i&&h_(c[t],i[t])&&l.delete(t)}))}l.size?this.Ta(t,l):this.da.delete(t)}}}Ba(){var t,e=null==(t=this.mn)?void 0:t.persistence_save_debounce_ms;return U(e)&&e>0?e:0}Ha(t){if(this.mn.cookieWinsOnConflict&&"localstorage+cookie"===this.mn.persistence.toLowerCase())if(t)try{var e=Mp(t,this.mn.cookie_persisted_properties||[]),i=Ep(e,this.mn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=bp.ai(this.ba)||void 0;n&&Pp(this.ba,n)===r&&(this.za=r,this.Ua=n)}catch(t){}else try{var s=bp.ai(this.ba)||void 0;this.za=s?Pp(this.ba,s):void 0,this.Ua=s}catch(t){}}syncCookieProperties(){return this.Wa(this.mn)}Wa(t,e){if(void 0===e&&(e=!1),this.Ma&&!e||this.ha||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=bp.ai(this.ba)||void 0}catch(t){}if(!i||i===this.Ua)return!1;var r,n=Pp(this.ba,i);try{r=Tp(JSON.parse(i))}catch(t){return!1}if((bp.ai(this.ba)||void 0)!==i)return!1;this.za=n,this.Ua=i;var s=Rp(this.ba,i),a=[...Sp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(q(e)||H(e)||""===e||t===xs&&e!==Gs&&e!==Zs)&&(o[t]=!0,delete r[t])})),N(r))return!1;var l=Sn in r||r[xs]===Gs||r[xs]===Zs,u=this.props,h=u[Sn],d=u[xs],v=Xi({},u);[...Sp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==Sn&&t!==xs)){var e=v[t];!s.isValid&&-1!==Sp.indexOf(t)&&(!1===e||0===e)||delete v[t]}})),this.props=Xi(v,r),l_.forEach((t=>{var e=t in this.props;t in u===e&&h_(u[t],this.props[t])||(e?this.ja(t,u[t],this.props[t]):this.Ta(t,!0))})),!l||xs in r||xs in this.props||this.La(xs,Gs);var c=this.props[Sn],f=this.props[xs];return!l||c===h&&f===d||(this.ca=!0,this.ua=!0,Lp.ni(s_(this.ba),!0),this.Da(ds),this.Da(rs),this.Da(is),this.Da(ss),this.Da(as),this.Da(os),this.Da(Ss),this.Da(ks),this.Da(_s),f===Gs&&(d===Zs||r[xs]===Gs||!q(h)&&c!==h)&&(v_(this.props,r),this.Da(vs)),f===Zs?this.props.$user_id=c:delete this.props.$user_id,this.Da(Tn)),!0}consumeCookieIdentityChange(){var t=s_(this.ba),e=this.ua||!!Lp.ai(t);return this.ua=!1,e&&Lp.oi(t),e}Va(t){return void 0===t&&(t=!1),!(this.ha||this.Ma&&!t||!this.mn.cookieWinsOnConflict||"localstorage+cookie"!==this.mn.persistence.toLowerCase()||(this.ha=!0,0))}Ga(){this.ha&&(q(this.Za)||(clearTimeout(this.Za),this.Za=void 0),delete this.sa[o_],this.Qa(!0))}Ja(t){if(void 0===t&&(t=!0),this.ha)try{t?this.Ga():q(this.Za)||(clearTimeout(this.Za),this.Za=void 0)}finally{this.ha=!1}}isDisabled(){return!!this.Ma}_a(e){-1===n_.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=[...Sp,...e];return p({},wp,{ui(t){try{var e,n={};try{e=bp.ai(t)||void 0,n=e?Tp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(wp.ai(t)||"{}");if(i){var o=Rp(t,e),l=[...Sp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];H(e)||""===e||t===xs&&e!==Gs&&e!==Zs||(u[t]=e)}));var h=Sn in u||u[xs]===Gs||u[xs]===Zs;if(Object.keys(u).length>0){var d,v=a[Sn],c=null!==(d=a[xs])&&void 0!==d?d:Gs;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==Sn&&t!==xs)){var e=a[t];!o.isValid&&-1!==Sp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||xs in n||xs in a||(a[xs]=Gs),!h||(Sn in u?u[Sn]:a[Sn])===v&&(xs in u?u[xs]:a[xs])===c||(kp.forEach((t=>delete a[t])),u[xs]===Zs&&Sn in u?a.$user_id=u[Sn]:delete a.$user_id,u[xs]!==Zs&&(delete a[cs],delete a[vs]),delete a.__alias)}s=Xi(a,u)}else s=Xi(n,a);return wp.ni(t,s),s}catch(t){}return null},ni(t,r,n,s,a,o){var l=wp.ni(t,r,void 0,void 0,o);try{var u=Mp(r,e);if(Object.keys(u).length){if(i){var h=xp(t),d=Ep(u,e);if(bp.ni(h,d,n,s,a,o),bp.ai(h)!==JSON.stringify(d)){bp.oi(h,s);var v=Mp(r);return bp.ni(t,v,n,s,a,o),l}}bp.ni(t,u,n,s,a,o)}}catch(t){wp.si(t)}return l},oi(e,i){try{null==t||t.localStorage.removeItem(e),bp.oi(e,i),bp.oi(xp(e),i)}catch(t){wp.si(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=!1,a=e.persistence.toLowerCase();return"localstorage"===a&&wp.ii()?(i=wp,s=!0):"localstorage+cookie"===a&&r.ii()?(i=r,s=!0,n=!0):"sessionstorage"===a&&Lp.ii()?i=Lp:"memory"===a?i=Fp:"cookie"===a&&bp.ii()?(i=bp,n=!0):r.ii()?(i=r,s=!0,n=!0):bp.ii()?(i=bp,n=!0):i=Fp,this.aa=s,this.oa=n,i}xa(t){return this.ba+"__"+t}wa(t){return this.aa&&!!t.split_storage}properties(){var t={};return Yi(this.props,((e,i)=>{var r=i_(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.Ma||t){var e=this.mn.cookieWinsOnConflict&&"localstorage+cookie"===this.mn.persistence.toLowerCase(),i=e?wp.ui(this.ba):null,r={};if(e)try{Yi(r=Tp(bp.ui(this.ba)),((t,e)=>{(q(t)||H(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.Zs.ui(this.ba);if(n&&(this.props=Xi({},n)),this.la&&this.Ka(),e&&n){var s,a,o=null==i?void 0:i[Sn],l=null!==(s=null==i?void 0:i[xs])&&void 0!==s?s:Gs,u=n[Sn],h=null!==(a=n[xs])&&void 0!==a?a:Gs;if(u!==o||h!==l){this.ua=!0,Lp.ni(s_(this.ba),!0);var d=Xi({},this.props);kp.forEach((t=>delete d[t])),h===Gs&&(l===Zs||r[xs]===Gs||!q(o)&&u!==o)&&(v_(d,r),delete d[vs]),this.props=d;var v=new Set;kp.forEach((t=>{var e,i=null==(e=i_(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Yi(this.props,((i,r)=>{var n;(null==(n=i_(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),N(e)?(wp.oi(this.xa(t)),this.sa[t]={}):wp.ni(this.xa(t),e)&&(this.sa[t]={persisted:!0,fingerprint:this.Fa(e,t)})}))}}Lp.ai(s_(this.ba))&&(this.ua=!0)}}Ka(){for(var t of Xb){var e=wp.ui(this.xa(t));if(e&&!N(e)){var i=this.Ia(t);i.persisted=!0,this.Ya(t)||(i.fingerprint=this.Fa(e,t)),this.Xa(t,e)||Xi(this.props,e)}}}Ya(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=i_(e))?void 0:i.storageGroup)===t}))}Xa(t,e){var i=r_[t];if(!i)return!1;var r=e[i],n=this.props[i];return U(r)&&U(n)&&n>r}refreshKey(t){var e;if(!(this.Ma||t===In&&this.pa)){var i=this.la?null==(e=i_(t))?void 0:e.storageGroup:void 0,r=i?wp.ui(this.xa(i)):this.Zs.ui(this.ba);if(r&&t in r)this.La(t,r[t],!1);else{if(i){var n=this.Zs.ui(this.ba);if(n&&t in n)return void this.La(t,n[t],!1)}this.Da(t,!1)}}}save(){if(!this.Ma){var t=this.Ba();t>0?q(this.Za)&&(this.Za=setTimeout((()=>{this.Za=void 0,this.Qa()}),t)):this.Qa()}}flush(){q(this.Za)||(clearTimeout(this.Za),this.Za=void 0,this.Qa())}Qa(t){if(void 0===t&&(t=!1),!(this.Ma||this.ha&&!t)){t||(this.syncCookieProperties(),this.pa||this.mn.cookieWinsOnConflict&&"localstorage+cookie"===this.mn.persistence.toLowerCase()||this.refreshKey(In));var e=!t&&!this.va;e||(this.fa=!1);var i=!!e&&this.$a();if(this.fa)this.mn.debug&&Qi.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.la)return this.eo(),void(i&&this.ga.forEach((t=>t())));var r=this.io(this.Zs,this.ba,this.props,o_);"written"===r&&this.Ha(this.props),"failed"!==r&&(this.da.clear(),this.ca=!1,this.pa=!1),i&&this.ga.forEach((t=>t()))}}}eo(){var t=this,e=this.Pa(),i=e.main,r=e.groups,n=this.io(this.Zs,this.ba,i,o_);"written"===n&&this.Ha(i),"failed"!==n&&(this.ca=!1,this.pa=!1,l_.forEach((t=>{var e;null!=(e=i_(t))&&e.storageGroup||this.da.delete(t)})));var s=function(e){var i,n=r[e];if(N(n)&&(null==(i=t.sa[e])||!i.persisted))return l_.forEach((i=>{var r;(null==(r=i_(i))?void 0:r.storageGroup)===e&&t.da.delete(i)})),1;var s=t.io(wp,t.xa(e),n,e);"failed"!==s&&l_.forEach((i=>{var r=i_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.da.delete(i)}))};for(var a of Xb)s(a)}Pa(){var t={},e={flags:{},surveys:{}};return Yi(this.props,((i,r)=>{var n,s=null==(n=i_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Fa(t,e){if(e===o_)return JSON.stringify(t)+"|"+this.ro+"|"+this.no+"|"+this.so;var i={};return Yi(t,((t,e)=>{var r;i[e]=null!=(r=i_(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}io(t,e,i,r){var n,s=this.Ia(r);if(r!==o_&&!s.dirty&&!q(s.fingerprint))return"skipped";try{if((n=this.Fa(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.ni(e,i,this.ro,this.no,this.so,this.mn.debug)?(s.dirty=!1,r!==o_&&(s.persisted=!0),q(n)||(s.fingerprint=n),this.aa&&(s.storageValue=wp.ai(e)),"written"):(this.mn.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.qa(),q(this.Za)||(clearTimeout(this.Za),this.Za=void 0),this.Zs.oi(this.ba,!1),this.Zs.oi(this.ba,!0),!i&&this.ma)for(var r of Xb)wp.oi(this.xa(r));i?delete this.sa[o_]:this.sa={},this.za=void 0,this.Ua=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(D(t)){this.syncCookieProperties(),q(e)&&(e="None"),this.ro=q(i)?this.ao:i;var r=!1;if(Yi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.La(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(D(t)){this.syncCookieProperties(),this.ro=q(e)?this.ao:e;var i=!1;if(Yi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||D(e)||O(e))&&(this.La(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.Da(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.ya){var e=Jo(this.mn.custom_campaign_params,this.mn.mask_personal_data_properties,this.mn.custom_personal_data_properties),i=!N(rr(e));return i&&this.register(e),this.ya=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Yo(t):{})}update_referrer_info(){var t;this.register_once({$referrer:el(),$referring_domain:null!=r&&r.referrer&&(null==(t=hr(r.referrer))?void 0:t.host)||tl},void 0)}set_initial_person_info(){if(!this.props[Ms]&&!this.props[Is]){var t=il(this.mn.mask_personal_data_properties,this.mn.custom_personal_data_properties,this.mn.disable_capture_url_hashes);this.register_once({[Es]:this.oa?{r:a_(t.r),u:t.u?a_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Yi([Is,Ms],(e=>{var i=this.props[e];i&&Yi(i,(function(e,i){t["$initial_"+S(i)]=e}))}));var e=this.props[Es];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=rl(t,e),r={};return Yi(i,(function(t,e){r["$initial_"+S(e)]=t})),r}(e,this.mn.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.Ma&&!o;o||this.Wa(e,l),this.mn=t,!o&&(r||n||a)&&(this.za=void 0,this.Ua=void 0,this.Wa(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this._a(t):this.Zs;this.oo();var h=this.wa(t),d=s||h!==this.la,v=!o&&(d||t.cross_subdomain_cookie!==this.no||t.secure_cookie!==this.so)&&this.Va(l);this.va=d;try{if(this.ao=this.ro=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.Zs=u,this.la=h,this.props=c,this.save()}else a&&(this.Zs=u,o||(delete this.sa[o_],this.Qa()))}finally{this.va=!1,v&&this.Ja()}}oo(){var t=this.props[Es];if(this.oa&&D(t)&&"string"==typeof t.r){var e=a_(t.r),i="string"==typeof t.u?a_(t.u):t.u;e===t.r&&i===t.u||this.La(Es,p({},t,{r:e,u:i}))}}set_disabled(t){this.Ma=t,this.Ma?this.remove():this.save()}set_cross_subdomain(t){t!==this.no&&(this.no=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.so&&(this.so=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[En]||{};i[t]=e,this.La(En,i),this.save()}remove_event_timer(t){var e=this.props[En]||{},i=e[t];return q(i)||(delete e[t],this.La(En,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.La(t,e),this.save()}La(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&(t!==Sn&&t!==xs||n===e||(this.ca=!0),t!==In||h_(n,e)||(this.pa=!0),this.ja(t,n,e),null!=(r=i_(t))&&r.volatile||this.Na(t))}Da(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(u_(t)&&this.Ta(t,!0),t===In&&(this.pa=!0),this.Na(t))}Na(t){var e,i=null==(e=i_(t))?void 0:e.storageGroup;i&&(this.Ia(i).dirty=!0)}Ia(t){return this.sa[t]||(this.sa[t]={})}}var f_=Ji("[RateLimiter]");class p_{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=>{f_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void f_.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(Ts))&&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=(U(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.lo(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ts,o),{isRateLimited:l,remainingTokens:o.tokens}}uo(t){var e=this.instance.config.property_denylist;return!O(e)||!e.includes(t)}ho(){var t;if(this.uo("$current_url")&&this.uo("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}lo(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ho(),a=this.uo("$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 g_=Ji("[RemoteConfig]");class m_{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}do(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()}vo(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 g_.info("Using preloaded remote config",this.remoteConfig),void this.co(this.remoteConfig);if(this._instance.fo())return void g_.warn("Remote config is disabled. Falling back to local config.");this.do((t=>{if(!t)return g_.info("No config found after loading remote JS config. Falling back to JSON."),void this.vo((t=>{this.co(t.json,t)}));this.co(t)}))}catch(t){g_.error("Error loading remote config",t),this.co()}}co(t,e){!t&&e&&(0===e.statusCode?e.error||g_.warn("Failed to fetch remote config from PostHog."):g_.error("Failed to fetch remote config from PostHog."));try{this._instance.co(t?{ok:!0,config:t}:{ok:!1})}catch(t){g_.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){g_.error("Error loading feature flags",t)}}}var y_=!!a||!!s,b_="text/plain",__=!1,w_=(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:"")},k_=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},S_=t=>{if(t.po)return t.po;var e=t.data,i=t.compression;if(e){if(i===Df){var r=po(go(ur(e)),{mtime:0});return{contentType:b_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===$f){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}}},x_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:k_(t.url,{compression:$f}),encodedBody:S_(p({},t,{compression:$f,po:void 0}))}:{url:w_(t.url,"compression"),encodedBody:S_(p({},t,{compression:void 0,po:void 0}))};try{e=S_(t)}catch(e){if(bi(t.compression,vr(t.url,"compression")))return Qi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&bi(t.compression,vr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?yi(new Uint8Array(i)):ArrayBuffer.isView(i)&&yi(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(__=!0,r()):{url:t.url,encodedBody:e}},C_=t=>{try{return x_(t)}catch(e){return Qi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},T_=function(){var t=f((function*(t){var e=ur(t.data),i=yield xi(e,Gi.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{po:{contentType:b_,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),M_=/Failed to fetch|NetworkError|Load failed/i,I_=t=>"TypeError"===(null==t?void 0:t.name)&&M_.test((null==t?void 0:t.message)||""),E_=t=>{var e=C_(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(Ee("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||I_(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.mo&&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)}}},R_=t=>{try{var e,r=x_(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=O(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(O(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>O(t.data)?e:p({},t.data,{batch:e});return R_(p({},t,{data:v(h.slice(0,d))})),void R_(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"),E_(p({},t,{mo:!0}))}catch(t){Qi.warn("Beacon send failed",t)}},P_=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return k_(i===Df?w_(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Df?{}:{compression:i}))},A_=[];s&&A_.push({transport:"fetch",method:E_}),a&&A_.push({transport:"XHR",method(t){var e=C_(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&&A_.push({transport:"sendBeacon",method:R_});var F_=3e3;class O_{constructor(t,e){this.yo=!0,this.bo=[],this._o=nt((null==e?void 0:e.flush_interval_ms)||F_,250,5e3,Qi.createLogger("flush interval"),F_),this.wo=t}enqueue(t){this.bo.push(t),this.ko||this.So()}unload(){this.xo();var t=this.bo.length>0?this.Co():{},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.To(p({},t,{transport:"sendBeacon"}))}))}enable(){this.yo=!1,this.So()}So(){var t=this;this.yo||(this.ko=setTimeout((()=>{if(this.xo(),this.bo.length>0){var e=this.Co(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&O(i.data)&&Yi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.To(i)};for(var r in e)i()}}),this._o))}To(t){try{this.wo(t)}catch(t){Qi.error(t)}}xo(){clearTimeout(this.ko),this.ko=void 0}Co(){var t={};return Yi(this.bo,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;q(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.bo=[],t}}var L_=["retriesPerformedSoFar"];class D_{constructor(e){this.Mo=!1,this.Io=3e3,this.bo=[],this._instance=e,this.bo=[],this.Eo=!0,!q(t)&&"onLine"in t.navigator&&(this.Eo=t.navigator.onLine,this.Ro=()=>{this.Eo=!0,this.Po()},this.Ao=()=>{this.Eo=!1},ar(t,"online",this.Ro),ar(t,"offline",this.Ao))}get length(){return this.bo.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,L_);W(e)&&(i.url=k_(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.os(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)}}))}os(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.bo.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Qi.warn(n),this.Mo||(this.Mo=!0,this.Fo())}Fo(){if(this.Oo&&clearTimeout(this.Oo),0===this.bo.length)return this.Mo=!1,void(this.Oo=void 0);this.Oo=setTimeout((()=>{this.Eo&&this.bo.length>0&&this.Po(),this.Fo()}),this.Io)}Po(){var t=Date.now(),e=[],i=this.bo.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.bo=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Oo&&(clearTimeout(this.Oo),this.Oo=void 0),this.Mo=!1,q(t)||(this.Ro&&(t.removeEventListener("online",this.Ro),this.Ro=void 0),this.Ao&&(t.removeEventListener("offline",this.Ao),this.Ao=void 0)),this.bo)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Qi.error(t)}}this.bo=[]}}class $_{constructor(t){this.Lo=()=>{var t,e,i,r;this.Do||(this.Do={});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.Do.lastScrollY=Math.ceil(s),this.Do.maxScrollY=Math.max(s,null!==(t=this.Do.maxScrollY)&&void 0!==t?t:0),this.Do.maxScrollHeight=Math.max(a,null!==(e=this.Do.maxScrollHeight)&&void 0!==e?e:0),this.Do.lastContentY=o,this.Do.maxContentY=Math.max(o,null!==(i=this.Do.maxContentY)&&void 0!==i?i:0),this.Do.maxContentHeight=Math.max(l,null!==(r=this.Do.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get $o(){return this._instance.config.scroll_root_selector}getContext(){return this.Do}resetContext(){var t=this.Do;return setTimeout(this.Lo,0),t}startMeasuringScrollPosition(){ar(t,"scroll",this.Lo,{capture:!0}),ar(t,"scrollend",this.Lo,{capture:!0}),ar(t,"resize",this.Lo)}scrollElement(){var e;if(!this.$o)return null==t||null==(e=t.document)?void 0:e.documentElement;var i=O(this.$o)?this.$o:[this.$o];for(var r of i){var n,s=null==t||null==(n=t.document)?void 0:n.querySelector(r);if(s)return s}}No(e){var i,r,n="y"===e?"scrollTop":"scrollLeft";if(this.$o){var s=this.scrollElement();return s&&s[n]||0}return t?"y"===e?t.scrollY||t.pageYOffset||(null==(i=t.document)||null==(i=i.documentElement)?void 0:i.scrollTop)||0:t.scrollX||t.pageXOffset||(null==(r=t.document)||null==(r=r.documentElement)?void 0:r.scrollLeft)||0:0}scrollY(){return this.No("y")}scrollX(){return this.No("x")}}var N_=t=>il(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 q_{constructor(t,e,i,r){this.Tt=t=>{var e=this.qo();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.jo(this._instance)};this.Bo.register({[Cs]:i})}},this._instance=t,this.Ho=e,this.Bo=i,this.jo=r||N_,this.Ho.onSessionId(this.Tt)}qo(){return this.Bo.props[Cs]}getSetOnceProps(){var t,e=null==(t=this.qo())?void 0:t.props;return e?"r"in e?rl(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_"+S(i)]=e})),t}}class j_{on(t,e){return this.zo[t]||(this.zo[t]=[]),this.zo[t].push(e),()=>{this.zo[t]=this.zo[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.zo[t]||[])i(e);for(var r of this.zo["*"]||[])r(t,e)}constructor(){this.zo={}}}var B_=Ji("[SessionId]"),H_=864e5;class z_{on(t,e){return this.Uo.on(t,e)}constructor(t,e,i){var r;if(this.Wo=null,this.Vo=null,this.Go=[],this.Zo=void 0,this.Qo=!1,this.Uo=new j_,this.Jo=(t,e)=>!(!W(t)||!W(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Vs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.mn=t.config,this.Bo=t.persistence,this.It=void 0,this.Pe=void 0,this._sessionStartTimestamp=null,this.Ko=void 0,this._sessionActivityTimestamp=null,this.Yo=e||fp,this.Xo=i||fp;var n=this.mn.persistence_name||this.mn.token;if(this._sessionTimeoutMs=1e3*nt(this.mn.session_idle_timeout_seconds||1800,60,36e3,B_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.tl(),this.el="ph_"+n+"_window_id",this.il="ph_"+n+"_primary_window_exists",this.rl()){var s=Lp.ui(this.el),a=Lp.ui(this.il);s&&!a?this.It=s:Lp.oi(this.el),Lp.ni(this.il,!0)}null!=(r=this.mn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.mn.bootstrap.sessionID),this.nl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return q(this.Go)&&(this.Go=[]),this.Go.push(t),this.Pe&&t(this.Pe,this.It),()=>{this.Go=this.Go.filter((e=>e!==t))}}rl(){return"memory"!==this.mn.persistence&&!this.Bo.Ma&&Lp.ii()}sl(t){t!==this.It&&(this.It=t,this.rl()&&Lp.ni(this.el,t))}al(){return this.It?this.It:this.rl()?Lp.ui(this.el):null}ol(t){var e=this.Wo;return!H(e)&&!H(t)&&5e3>Math.abs(t-e)}ll(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.ol(e)||(this.Wo=e,this.Bo.register({[Vn]:[e,t,i]}))}ul(){var t,e=null==(t=this.mn)?void 0:t.persistence_save_debounce_ms;return W(e)&&e>0}hl(){this.ul()?this.Bo.refreshKey(Vn):(this.Bo.flush(),this.Bo.load())}dl(){var t;if(!H(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Wo){this.hl();var e=this.vl();e[1]===this.Pe&&e[2]===this._sessionStartTimestamp&&(this.Wo=this._sessionActivityTimestamp,this.Bo.register({[Vn]:[this._sessionActivityTimestamp,null!==(t=this.Pe)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Bo.flush())}}cl(){var t=this.vl()[0],e=W(t)?t:0,i=W(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}fl(t){return this.hl(),this.Jo(t,this.cl())}vl(){var t=this.Bo.props[Vn];return O(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Wo=null,this.Ko=void 0,clearTimeout(this.pl),this.pl=void 0,this.ll(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void B_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void B_.error("Invalid sessionID in bootstrap",t)}}(t);return!q(i)&&(e?this.Ko={sessionId:t,sessionStartTimestamp:i}:this.ll(t,(new Date).getTime(),i),!0)}destroy(){this.Qo=!0,this.dl(),clearTimeout(this.pl),this.pl=void 0,this.Zo&&t&&(t.removeEventListener(Ks,this.Zo,{capture:!1}),this.Zo=void 0),this.Go=[]}nl(){this.Zo=()=>{this.dl(),this.rl()&&Lp.oi(this.il)},ar(t,Ks,this.Zo,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.mn.cookieless_mode===Vs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Pe;if(i)this.Vo=r;else if(H(this.Vo)||this.Vo>r||r-this.Vo>=1e3){var s,a;null==(s=(a=this.Bo).syncCookieProperties)||s.call(a),this.Vo=r}var o=this.vl(),l=o[1],u=o[2],h=!q(n)&&l!==n,d=this.cl(),v=this.al(),c=this.Ko,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>H_),p=c?f:W(u)&&Math.abs(r-u)>H_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Jo(r,d);if(_){(_=this.fl(r))||B_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.vl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Yo(),v=this.Xo(),B_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Ko=void 0,g=!0}else v||(v=this.Xo(),g=!0),(m=m||l!==b)&&(B_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=W(d)&&t&&!p?d:r,x=W(u)?u:(new Date).getTime();this.sl(v),this.ll(l,S,x),t||this.tl();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.Go.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}tl(){this.Qo||(clearTimeout(this.pl),this.pl=setTimeout((()=>{if(!this.Qo)if(this.fl((new Date).getTime())){var t=this.Pe;this.resetSessionId(),this.Uo.emit("forcedIdleReset",{idleSessionId:t})}else this.tl()}),1.1*this.sessionTimeoutMs))}}var U_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&_(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>_(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function W_(){return W_=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 j(r)&&r.length>0?r:void 0}catch(t){return void Qi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),W_.apply(this,arguments)}var V_="custom",G_="i.posthog.com",Z_=/^\/static\//,Q_=["/s/","/e/","/i/"];class J_{constructor(t){this.gl={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+G_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.gl[this.apiHost]||(this.gl[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":V_),this.gl[this.apiHost]}ml(t){if(Z_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}yl(t){var e=hr(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}bl(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&&Q_.some((t=>0===e.indexOf(t)))){var o=this.yl(r);if(o){var l,u=this.apiHost,h=this._l;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this._l=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this._l,i=this.yl(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.bl(t,e,this.uiHost+e);if("flags"===t)return this.bl(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.ml(e);if(i)return this.bl(t,e,""+i+e)}if(this.region===V_)return this.bl(t,e,this.apiHost+e);var r=G_+e;switch(t){case"assets":return this.bl(t,e,"https://"+this.region+"-assets."+r);case"api":return this.bl(t,e,"https://"+this.region+"."+r)}}}var K_=Ji("[PostHog ExternalIntegrations]"),Y_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class X_{constructor(t){this._instance=t}Ys(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return K_.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ys(Y_[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 tw{constructor(t,e){this.A=t,this.Ns=e,this.wl=new Map,this.Os=!1}add(t){var e=this;return f((function*(){if(e.Os)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.wl.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.wl.set(t.name,t);try{var i=t.setup(e.Ns);i&&(yield i)}catch(i){var r=e.wl.get(t.name)===t;r&&e.wl.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.kl(t)}}))()}getExtension(t){return this.wl.get(t)}dispose(){if(!this.Os){this.Os=!0;var t=Array.from(this.wl.values()).reverse();for(var e of(this.wl.clear(),t))this.kl(e)}}kl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&L(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 ew{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);q(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 iw="extensionsRemoteConfig";class rw{constructor(t){this.Os=!1,this.instance=t,this.A=Qi,this.Sl=t.xl,this.kv=new ew(t),this.onEvent=t=>Jf(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.Os)return Jf((()=>{}));var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.Cl.on(iw,e);return this.Sl&&e(this.Sl),Jf(i)},this.Tl=new tw(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.Tl.add(t)}getExtension(t){return this.Tl.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 Jf(this.instance.Ml(t))}handleRemoteConfig(t){this.Os||(this.Sl=t,this.instance.Cl.emit(iw,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?k_(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?T.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.Os||(this.Os=!0,this.Tl.dispose())}}var nw={},sw=0,aw=()=>{},ow='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',lw="Surveys module not available",uw="sanitize_properties is deprecated. Use before_send instead",hw="Invalid value for property_denylist config: ",dw=/^[A-Za-z0-9_-]{1,400}$/,vw=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,cw=["token","distinct_id",As],fw="posthog",pw=!y_&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),gw=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},mw=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:aw,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&&j(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:Qs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:F_},error_tracking:{},_onCapture:aw},(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:gw(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},yw=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],bw=t=>{var e={};for(var i of yw){var r=i[0],n=i[1];q(t[r])||(e[n]=t[r])}var s=Xi({},e,t),a=t.__preview_external_dependency_versioned_paths;return q(a)||(q(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),j(a)&&q(t.asset_host)&&(s.asset_host=a)),O(t.property_blacklist)&&(q(t.property_denylist)?s.property_denylist=t.property_blacklist:O(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Qi.error(hw+t.property_denylist)),s};class _w{constructor(){this.__forceAllowLocalhost=!1}get Il(){return this.__forceAllowLocalhost}set Il(t){Qi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class ww{El(t){if(t){var e=this.wl.indexOf(t);-1!==e&&this.wl.splice(e,1)}}Rl(t,e){return this.El(t),this.wl.push(e),null==e.initialize||e.initialize(),e}Pl(){return this.config.cookieless_mode===Vs||this.config.cookieless_mode===Ws&&this.consent.isRejected()}Al(){if(!this.Fl&&!this.config.segment&&!this.Pl()){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Ol||(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.Fl=!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)))}}Ll(){if(!this.Pl()&&this.get_distinct_id()===Ps){var t=this.persistence;if(t){this.Dl()||t.load(!0);var e=this.get_distinct_id();if(!e||e===Ps){var i=this.config.get_device_id(fp());this.register({distinct_id:i,$device_id:i}),t.set_property(xs,Gs)}this.$l()}}}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 _w,this.Nl=!1,this.version=Gi.LIB_VERSION,this.ql=new Set,this.jl="",this.Cl=new j_,this.wl=[],this.Bl=[],this.Ol=!1,this.Fl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=mw(),this.SentryIntegration=Kb,this.sentryIntegration=t=>function(t,e){var i=Jb(t,e);return{name:Qb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Hl=!1,this.zl=null,this.Ul=null,this.Wl=null,this.scrollManager=new $_(this),this.pageViewManager=new Yb(this),this.rateLimiter=new p_(this),this.requestRouter=new J_(this),this.consent=new Hb(this),this.externalIntegrations=new X_(this);var e=null!==(t=ww.__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=j(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=j(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!==fw){var r,n=null!==(r=nw[i])&&void 0!==r?r:new ww;return n._init(t,e,i),nw[i]=n,nw[fw][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s,a;void 0===i&&(i={});var o,l=j(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=mw(i.defaults),i.debug=this.Vl(i.debug),this.Gl=i,this.Zl=[],i.person_profiles?this.Ul=i.person_profiles:i.process_person&&(this.Ul=i.process_person);var u=mw(i.defaults),h=bw(i),d=Xi({},u,h,{name:r,token:l});D(u.rageclick)&&D(h.rageclick)&&(d.rageclick=Xi({},u.rageclick,h.rageclick)),D(u.session_recording)&&D(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:Df;var v=this.Dl();if(this.persistence=new c_(this.config,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new c_(p({},this.config,{persistence:"sessionStorage"}),v,!1),this.jl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!v&&Lp.ii()){var c=Lp.ui(this.jl);O(c)&&c.forEach((t=>{j(t)&&this.ql.add(t)}))}else Lp.oi(this.jl);var f=p({},this.persistence.props),g=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ql=new O_((t=>this.Jl(t)),this.config.request_queue_config),this.Kl=new D_(this),this.__request_queue=[];var m=this.Pl();m||(this.sessionManager=new z_(this),this.sessionPropsManager=new q_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Yl()}))),this.Xl(),this.config.__preview_deferred_init_extensions?(Qi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.tu(m)}),0)):(Qi.info("Initializing extensions synchronously"),this.tu(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.Ol=!!y&&!B(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(xs);if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Gs)this.identify(b);else if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Zs)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(fp()),S=i.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(xs,i.bootstrap.isIdentifiedID?Zs:Gs),this.register({distinct_id:b,$device_id:S})}}if(m)this.register_once({distinct_id:Ps,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(fp());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(xs,Gs)}return ar(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?Zb(this,(()=>this.eu())):this.eu(),L(this.config._onCapture)&&this.config._onCapture!==aw&&(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 W_.apply(this,arguments)}().then((t=>{t&&this.register({[Cn]:t})})).catch(aw),this}iu(t){var e=t;return j(e.name)&&L(e.setup)}ru(t,e){this.iu(t)?e.push((()=>{this.nu().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Qi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.wl.push(t)}Xl(){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=ww.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.su)||r.call(this),this.su=void 0,this.featureFlags=new a(this)),L(this.featureFlags.onReloading)&&L(this.featureFlags.setup)?this.su||(this.su=this.featureFlags.onReloading((()=>{this.Cl.emit("featureFlagsReloading",!0)})),this.nu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}tu(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},ww.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.wl.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.wl.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.wl.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.wl.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.wl.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.ru(this.autocapture=new u.autocapture(this),h),u.surveys&&this.ru(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.ru(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.wl.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.wl.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.wl.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.wl.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.wl.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.wl.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.wl.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,Wb)),u.toolbar&&this.wl.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.wl.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.wl.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.au){var t=this.au;this.au=void 0,this.wl.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.ou(h,l)}ou(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ou(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({[Fs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Os]:r}),this.config.__preview_deferred_init_extensions&&Qi.info("PostHog extensions initialized ("+r+"ms)")}co(t){var e;if(!r||!r.body)return Qi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.co(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.au=t),this.xl=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=w(n.supportedCompression,Df)?Df:w(n.supportedCompression,$f)?$f:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Ul?this.Ul:Qs}),null==(e=this.lu)||e.handleRemoteConfig(t),this.wl.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}eu(){try{this.config.loaded(this)}catch(t){Qi.critical("`loaded` function failed",t)}if(this.uu(),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.Pl())&&this.hu()}),1),this.du=new m_(this),this.du.load()}uu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Ql)||t.enable())}_dom_loaded(){this.is_capturing()&&Ki(this.__request_queue,(t=>this.Jl(t))),this.__request_queue=[],this.uu()}_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.vu()&&this.capture(Xs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Ql)||r.unload(),null==(n=this.Kl)||n.unload()):this.vu()&&this.capture(Xs,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?pw?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=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,(q(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&&q(n.compression)&&n.data&&(n.compression=$f),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(O(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()),O(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=P_(n.url,n.method,n.compression,n.timestampMode);var v=A_.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){I_(t)?Qi.warn(t):Qi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Df&&l&&"undefined"!=typeof Promise&&!__?T_(n).then((t=>{f(t)})).catch((e=>{if(_i(e))return __=!0,void f(p({},n,{compression:void 0,url:P_(t.url,t.method,void 0,t.timestampMode)}));wi(e)&&(__=!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}))}Jl(t){this.Kl?this.Kl.retriableRequest(t):this._send_request(t)}_execute_array(t){sw++;try{var e,i=[],r=[],n=[];Ki(t,(t=>{if(t)if(O(e=t[0]))n.push(t);else if(L(t))try{t.call(this)}catch(e){Qi.error("Error executing queued PostHog call",t,e)}else O(t)&&"alias"===e?i.push(t):O(t)&&-1!==e.indexOf("capture")&&L(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ki(t,(function(t){try{if(O(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{sw--}}push(t){if(sw>0&&O(t)&&j(t[0])){var e=ww.prototype[t[0]];L(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}cu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(In);return j(e)&&vw.test(e)?{value:e,delivered:!1}:D(e)&&j(e.value)&&vw.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}fu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(In);var n=this.cu();if(!r){if(i)return j(e)&&vw.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[In]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(In);if(j(t)&&dw.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[In]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(In)}}pu(t){if(this.persistence){this.persistence.refreshKey(In);var e=this.cu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[In]:{value:t,delivered:!0}})}}capture(t,e,i){var r,n,s,a,o,l,u,h,d,v;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ql){if(this.is_capturing())if(!q(t)&&j(t)){this.Ll();var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var f=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==f||!f.isRateLimited){var g;null!=e&&e.$current_url&&!j(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.gu||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&&(g=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var m=new Date,y=(null==i?void 0:i.timestamp)||m,b=Ie(null==i?void 0:i.uuid,fp),_={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},y,b)};t===Ys&&this.config.__preview_capture_bot_pageviews&&c&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),f&&(_.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var w="$feature_flag_called"===t&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(ls);(null==i?void 0:i.$set)&&!w&&(_.$set=null==i?void 0:i.$set);var k=D(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&Mn in i.$set,x=S||!!k&&Mn in k,C=S?null==i||null==(r=i.$set)?void 0:r[Mn]:null==k?void 0:k[Mn],T=O(null==e?void 0:e.$unset)?e.$unset:[],M=(null==i?void 0:i.$unset)||[],I=-1!==T.indexOf(Mn)||-1!==M.indexOf(Mn),E=this.fu(null==(n=g)?void 0:n.fbclid,C,x,I);E&&!0===_.properties.$process_person_profile&&E.pending&&!x&&!w&&(_.$set=p({[Mn]:E.value},_.$set));var R=null==i?void 0:i.$unset;R&&(_.$unset=R);var P=w?void 0:this.mu(null==i?void 0:i.$set_once,t!==ea,t===ta);if(P&&(_.$set_once=P),null!=i&&i._noTruncate||(u=this.config.properties_string_max_length,h=_,d=t=>j(t)?t.slice(0,u):t,v=new Set,_=function t(e,i){if(e!==Object(e))return d?d(e):e;if(!v.has(e)){var r;if(v.add(e),O(e))r=[],Ki(e,(e=>{r.push(t(e))}));else{var n={};Yi(e,((e,i)=>{v.has(e)||(n[i]=t(e,i))})),r=n}return r}}(h)),_.timestamp=y,q(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return gi.forEach(r),e.forEach(r),i}(_.properties,cw)),t===Gf.DISMISSED||t===Gf.SENT){var A=null==e?void 0:e[Zf.SURVEY_ID],F=null==e?void 0:e[Zf.SURVEY_ITERATION];np({id:A,current_iteration:F}),_.$set=p({},_.$set,{[xo({id:A,current_iteration:F},t===Gf.SENT?"responded":"dismissed")]:!0})}else t===Gf.SHOWN&&(_.$set=p({},_.$set,{[Zf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var L=null==e?void 0:e.$product_tour_type;L&&(_.$set=p({},_.$set,{["$product_tour_last_seen_date/"+L]:(new Date).toISOString()}))}var B=p({},_.properties.$set,_.$set);if(N(B)||this.setPersonPropertiesForFlags(B),!z(this.config.before_send)){var H=this.ns(_);if(!H)return;(_=H).uuid=Ie(_.uuid,fp)}var U=null!==(s=null==(a=_.$set)?void 0:a[Mn])&&void 0!==s?s:D(null==(o=_.properties)?void 0:o.$set)?_.properties.$set[Mn]:void 0,W=null!=E&&E.pending&&U===E.value?E.value:void 0;this.Cl.emit("eventCaptured",_);var V=null!==(l=null==i?void 0:i._url)&&void 0!==l?l:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),G=p({method:"POST",url:V,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(V)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},W?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.pu(W)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||W?this.Jl(G):this.Ql.enqueue(G),_}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.lu)?void 0:e.getExtension(t)}nu(){var t;return null!==(t=this.lu)&&void 0!==t?t:this.lu=new rw(this)}Ml(t){this.Bl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Bl.indexOf(t);-1!==i&&this.Bl.splice(i,1)}}}yu(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Wl=null,this.persistence.get_property(xs)===Gs&&(null==(r=this.sessionPersistence)||r.clear(),this.ql.clear(),this.bu()),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.yu();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.Pl()&&(h[As]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!j(h.distinct_id)&&!U(h.distinct_id)||B(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?[...Vo,...i||[]]:[],c=ce(u),f=c[0],p=c[1],g=null!=(d="u">typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};q(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;q(b)||(y.userAgentDataPlatform=b),q(_)||(y.maxTouchPoints=_),q(w)||(y.screenWidth=w),q(k)||(y.screenHeight=k),q(S)||(y.devicePixelRatio=S);var x,C=Xi(rr({$os:f,$os_version:p,$browser:ue(u,navigator.vendor,g,m),$device:fe(u),$device_type:pe(u,y),$timezone:nl(),$timezone_offset:sl()}),{$current_url:cr(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:de(u,navigator.vendor,g,m),$browser_language:Xo(),$browser_language_prefix:(x=Xo(),"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.Kl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===V_&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Ys||o?e!==Xs||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Xi(h,v),e===Ys&&r&&(h.title=r.title),!q(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(),w=h.$groups,k=b.$groups;D(w)&&!N(w)&&(h.$groups=p({},D(k)?k:{},w)),Yi(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var S={};if(this.Bl.length>0)for(var x of this.Bl.slice())try{Xi(S,x())}catch(t){Qi.error("Failed to produce browser extension event properties",t)}(h=Xi({},c,b,_,p({},S,h))).$is_identified=this._isIdentified(),O(this.config.property_denylist)?Yi(this.config.property_denylist,(function(t){delete h[t]})):Qi.error(hw+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(Qi.error(uw),h=C(h,e));var T=this._u();return h.$process_person_profile=T,T&&!o&&this.wu("_calculate_event_properties"),h}mu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this._u())return t;if(this.Nl&&!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(uw),a=o(a,"$set_once")),e&&(this.Nl=!0),N(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.yu(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.ql.add(t))),this.bu()}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.ql.delete(t),this.bu()}ku(t,e){this.register({[t]:e})}Yl(){this.ql.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.ql.clear(),this.bu()}bu(){var t;if(this.jl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Ma||!Lp.ii())Lp.oi(this.jl);else{var e=[];this.ql.forEach((t=>e.push(t))),e.length>0?Lp.ni(this.jl,e):Lp.oi(this.jl)}}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.Cl.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:lw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:lw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:lw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ap),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:lw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:lw})}Su(t){return!t||B(t)?(Qi.critical("Unique user id has not been set in posthog.identify"),!1):t===Ps?(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(U(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.Su(t)&&this.wu("posthog.identify")){this.Ll();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.yu(!1),a=this.persistence.Va(),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(xs)||Gs)===Gs,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(xs,Zs),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ga(),this.capture(ta,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Wl=Do(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(xs,Zs);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Ga(),this.capture("$set",{$set:c,$set_once:f}),this.Wl=Do(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(_s)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Ja(o)}}}setPersonProperties(t,e){if((t||e)&&this.wu("posthog.setPersonProperties")){var i=Do(this.get_distinct_id(),t,e);this.Wl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Wl=i):Qi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(O(t)?t:[t]).filter((t=>j(t)&&t.length>0));0!==i.length&&this.wu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Wl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.yu();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),(s||i)&&this._u()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(ea,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.wu("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=V(t)?t:null==t?void 0:t.resetDeviceID,i=V(t)||null==t?void 0:t.bootstrap;this.xu(e,!1,i)}xu(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.Gl)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.fo());var o=this.get_property(xn),l=this.get_property(Cn),u=this.get_property(jn),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.Va?void 0:s.Va(),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.ql.clear(),this.bu(),q(u)||null==(S=this.persistence)||S.register({[jn]: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(xs,Gs),null==(k=this.sessionManager)||k.resetSessionId(),this.Wl=null,this.config.cookieless_mode===Vs)this.register_once({distinct_id:Ps,$device_id:null},"");else{var M=this.config.get_device_id(fp());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||q(l)||this.register({[Cn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Pl()||(null==(T=this.persistence)||T.set_property(xs,i.isIdentifiedID?Zs:Gs),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(q(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var I=p({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,v=!0}finally{var E;d&&(null==(E=this.persistence)||null==E.Ja||E.Ja(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s,a,o;if(e.__loaded){e.nu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.Ql)||n.unload(),null==(s=e.Kl)||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;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Cu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Tu()}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.wu("posthog.alias")?(q(e)&&(e=this.get_distinct_id()),t!==e?(this.ku(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(D(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Xi(this.config,bw(t));var f=this.Dl();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new c_(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Vl(this.config.debug);V(m)&&(this.config.debug=m),V(this.config.debug)&&(this.config.debug?(Gi.DEBUG=!0,wp.ii()&&wp.ni("ph_debug",!0),Qi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Gi.DEBUG=!1,wp.ii()&&wp.oi("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.fo()),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.$l(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Zb(this,aw,!1)}}_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:ww.Mu}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:fw;return e!==fw&&(e=fw+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(xs))===Zs||(null==(e=this.sessionPersistence)?void 0:e.get_property(xs))===Zs}_u(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Qs&&!this._isIdentified()&&N(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Rs]))}vu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this._u()||this.wu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wu(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.Al(),this.ku(Rs,!0),!0)}Dl(){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!==Ws)}$l(){var t,e,i,r,n,s=this.Dl();return this.is_capturing()||null==(i=this.logs)||i.Iu(),(null==(t=this.persistence)?void 0:t.Ma)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Ma)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.ql.clear(),this.bu()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Vs){if(this.Pl()){var i,r,n,s,a,o;null==(i=this.sessionRecording)||i.dispose({discardBufferedEvents:!0}),this.xu(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new z_(this),this.pageViewManager=new Yb(this),this.persistence&&(this.sessionPropsManager=new q_(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=ww.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Rl(this.sessionRecording,new u(this)),this.xl&&(null==(l=this.sessionRecording)||null==l.onRemoteConfig||l.onRemoteConfig(this.xl)))}var h,d;this.consent.optInOut(!0),this.$l(),this.uu(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ws&&(null==(h=this.surveys)||h.loadIfEnabled()),(q(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.hu()}else Qi.warn(ow)}opt_out_capturing(){if(this.config.cookieless_mode!==Vs){var t,e,i=this.config.cookieless_mode===Ws?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===Ws&&this.consent.isOptedIn()&&this.xu(!0,!0),this.consent.optInOut(!1),this.$l(),this.config.cookieless_mode===Ws&&(this.register({distinct_id:Ps,$device_id:null}),this.El(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.hu(),this.uu())}else Qi.warn(ow)}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===Vs||(this.config.cookieless_mode===Ws?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$l()}_is_bot(){return i?U_(i,this.config.custom_blocked_useragents):void 0}hu(){r&&("visible"===r.visibilityState?this.Hl||(this.Hl=!0,this.capture(Ys,{title:r.title},{send_instantly:!0}),this.zl&&(r.removeEventListener(Js,this.zl),this.zl=null)):this.zl||(this.zl=this.hu.bind(this),ar(r,Js,this.zl)))}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}))}fo(){var t=this.Gl||{};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&&!z(t[e]),a=i in t&&!z(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)}ns(t){var e;if(z(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Q),r=O(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),z(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return Z(t.event)?Qi.warn(a+". This can cause unexpected behavior."):Qi.info(a),null}n.properties&&!N(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&&z(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.ea)?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)})}Vl(t){var e=V(t)&&!t,i=wp.ii()&&"true"===wp.ai("ph_debug");return!e&&(!!i||t)}}ww.__defaultExtensionClasses={},ww.Mu=(()=>{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]])}(ww,["identify"]);class kw{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=D(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.fo(),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 Sw=Ji("[ExceptionAutocapture]"),xw=Ji("[TracingHeaders]"),Cw=Ji("[Web Vitals]"),Tw=9e5,Mw=["CLS","FCP","INP","LCP"],Iw=["INP","LCP"],Ew=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Rw="[SessionRecording]",Pw=Ji(Rw),Aw=Ji("[Heatmaps]");function Fw(t){return D(t)&&"clientX"in t&&"clientY"in t&&U(t.clientX)&&U(t.clientY)}var Ow=Ji("[Product Tours]"),Lw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property($n))},Dw=["$set_once","$set"],$w=Ji("[SiteApps]"),Nw="Error while initializing PostHog app with config id ",qw=(t,e)=>null!=t&&t.then?t.then(e):e(t),jw="SDK is not enabled or survey functionality is not yet loaded",Bw="Disabled. Not loading surveys.";class Hw{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Eu=!1,this.Ru=[],this.Pu=null,this.Au=null,this.Os=!1,this.Fu=new Set,this.onRemoteConfig=t=>{if(!this.Os&&!this.mn.disableSurveys){if(!t.ok)return Kf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(z(e))return Kf.warn("Flags not loaded yet. Not loading surveys.");this.Ou=V(e)?e:e.length>0,Kf.info("flags response received, isSurveysEnabled: "+this.Ou),this.loadIfEnabled()}},this.Ls=t,this.Lu=e}setup(t){if(!this.Os)return this.Du=t,qw(t.kv.initialize(),(()=>{if(this.Du===t&&!this.Os){this.Du=void 0,this.Ns=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Os?e.dispose():(this.qs=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Os||(this.Os=!0,this.Du=void 0,this.Ns=void 0,null==(t=this.qs)||t.dispose(),this.qs=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ru=[],this.Pu=null,this.Fu.forEach((t=>clearTimeout(t))),this.Fu.clear())}get mn(){return this.Ls.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(tp)||null!=r&&r.startsWith(ep))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Os&&this.Ns){var t=this.mn;if(!this._surveyManager)if(this.Eu)Kf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Kf.info(Bw);else if(t.cookielessMode&&this.Ls.isOptedOut())Kf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ls.getExtensions();if(e){if(!q(this.Ou)||t.advancedEnableSurveys){var i=this.Ou||t.advancedEnableSurveys;this.Eu=!0;try{var r=e.generateSurveys;if(r)return this.$u(r,i),void(this.Eu=!1);var n=e.loadExternalDependency;if(!n)return this.Nu(Us),void(this.Eu=!1);n((t=>{try{if(this.Os)return;var e=this.Ls.getExtensions();t||null==e||!e.generateSurveys?this.Nu("Could not load surveys script",t):this.$u(e.generateSurveys,i)}finally{this.Eu=!1}}))}catch(t){throw this.Eu=!1,this.Nu("Error initializing surveys",t),t}}}else Kf.error("PostHog Extensions not found.")}}}$u(t,e){this.Os||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ls.createEventReceiver(),Kf.info("Surveys loaded successfully"),this.qu({isLoaded:!0}))}Nu(t,e){Kf.error(t,e),this.qu({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ru.push(t),this._surveyManager&&this.qu({isLoaded:!0}),()=>{this.Ru=this.Ru.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Ns)&&void 0!==i?i:this.Lu;if(r&&!this.Os){if(this.mn.disableSurveys)return Kf.info(Bw),t([]);var n=r.kv.get(fs);if(n&&!e)return t(n,{isLoaded:!0}),void(this.ju()&&this.getSurveys((()=>{}),!0));if(this.Pu)this.Pu.then((e=>{this.Os||t(e.surveys,e.context)})).catch((t=>Kf.error("Error in survey callback",t)));else{var s=this.Bu("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.mn.requestTimeoutMs}).then((t=>{try{return this.Hu(r,t)}catch(t){return Kf.error("Error processing surveys response",t),this.Hu(r,{statusCode:0,error:t})}}),(t=>this.Hu(r,{statusCode:0,error:t})));this.Pu=s;var a=()=>{this.Pu===s&&(this.Pu=null)};s.then((e=>{a(),this.Os||t(e.surveys,e.context)}),a).catch((t=>Kf.error("Error in survey callback",t)))}}}Bu(t,e){var i=this.Ns;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(jw)})))}Hu(t,e){if(this.Os)return{surveys:[],context:{isLoaded:!1,error:jw}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Kf.error(r):e.error||Kf.warn(r),this.Au=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Au=null;var n,s=e.json.surveys||[],a=s.filter((t=>Yf(t)&&(Ro(t)||Xf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[fs]:s,[ps]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}ju(){return this.zu()&&!this.Pu&&!this.Uu()}zu(){var t,e,i=null==(t=null!==(e=this.Ns)&&void 0!==e?e:this.Lu)?void 0:t.kv.get(ps);return U(i)&&Date.now()-i>3e5}Uu(){return U(this.Au)&&3e5>Date.now()-this.Au}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};np(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}qu(t){for(var e of this.Ru)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Kf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!z(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Kf.warn("init was not called")}Wu(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}Vu(t){if(z(this._surveyManager))return{eligible:!1,reason:jw};var e="string"==typeof t?this.Wu(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Gu(t){if(z(this._surveyManager))return{eligible:!1,reason:jw};var e="string"==typeof t?this.Wu(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(z(this._surveyManager))return Kf.warn("init was not called"),{visible:!1,disabledReason:jw};var e=this.Gu(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return z(this._surveyManager)?(Kf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:jw})):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.Gu(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(z(this._surveyManager))Kf.warn("init was not called");else{var s="string"==typeof t?this.Wu(t):t;if(null!=s&&s.id)if(sp.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Kf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.Fu.delete(o),this.Os||(Kf.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),Kf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Fu.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Kf.warn("Survey element not found")}else Kf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Kf.warn("Survey not found")}}displaySurvey(t,e){var i;if(z(this._surveyManager))Kf.warn("init was not called");else{var r=this.Wu(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!==Qf&&e.initialResponses&&Kf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.Vu(r);if(!s.eligible)return void Kf.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 Kf.warn("Survey not found")}}cancelPendingSurvey(t){z(this._surveyManager)?Kf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function zw(t,e,i){if(z(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 Uw{constructor(t){this.Zu=new Set,this.Qu=new Set,this.Ju=new j_,this.Ku=(t,e)=>this.Yu(t,e)&&this.Xu(t,e)&&this.th(t,e)&&this.eh(t,e),this.Yu=(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;q(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.ih=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.ih)||t.call(this),this.ih=void 0,this.Ju=new j_}register(t){var e,i;if(!q(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Zu.add(t),null==(e=t.steps)||e.forEach((t=>{this.Qu.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Zu.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.Zu.clear(),this.Qu.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Qu.has(t)||this.Qu.has(e.event))&&this.Zu.forEach((t=>{this.rh(e,t)&&this.Ju.emit("actionCaptured",t.name)}))}nh(t){this.onAction("actionCaptured",(e=>t(e)))}rh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Ku(t,i))return!0;return!1}onAction(t,e){return this.Ju.on(t,e)}Xu(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(!zw(r,e.url,e.url_matching||"contains"))return!1}return!0}th(t,e){return!!this.sh(t,e)&&!!this.ah(t,e)&&!!this.oh(t,e)}sh(t,e){var i;if(null==e||!e.href)return!0;var r=this.lh(t);if(r.length>0)return r.some((t=>zw(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&zw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ah(t,e){var i;if(null==e||!e.text)return!0;var r=this.lh(t);if(r.length>0)return r.some((t=>zw(t.text,e.text,e.text_matching||"exact")||zw(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;!z(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=>zw(t,s,a))))}oh(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}lh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}eh(t,e){return null==e||!e.properties||0===e.properties.length||Lo(e.properties.reduce(((t,e)=>{var i=O(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 Ww{constructor(t){var e;this.uh=[],this._instance=t,this.hh=new Map,this.dh=new Map,this.fh=new Map,this.ph=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.gh(t)))}mh(t){return!1}yh(){return null}bh(t){}_h(){}wh(t,e){return!!t&&Lo(t.propertyFilters,null==e?void 0:e.properties)}kh(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}Sh(t,e,i){var r=(i===Nf?this.hh:this.dh).get(t),n=[];return this.xh((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.wh(s,e)}))}register(t){this.Ch(t,!1)}replace(t){this.Ch(t,!0)}Ch(t,e){var i;q(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Th(t,e),this.Mh(t,e))}Mh(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.fh.clear(),0!==i.length){this.Ih||(this.Ih=new Uw(this._instance),this.Ih.init(),this.Ih.nh((t=>this.onAction(t))));var r=[];i.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach((e=>{if(r.push(e),e.name){var i,n=null!==(i=this.fh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.fh.set(e.name,n)}}))})),e?this.Ih.replace(r):this.Ih.register(r)}else{var n;e&&(null==(n=this.Ih)||n.replace([]))}}Eh(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)}))}Th(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.kh(t,Nf),o=this.kh(t,qf);e?(this.hh=a,this.dh=o):(this.Eh(this.hh,a),this.Eh(this.dh,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.ih)&&void 0!==i||(this.ih=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Rh(),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.Ph(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Ah([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Fh(s),void this.Oh([s])}if(this.dh.has(t)){var o=this.Sh(t,e,qf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Ah(o.map((t=>t.id))),o.forEach((t=>this.Lh(t.id))))}if(this.hh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.hh.get(t)});var l=this.Sh(t,e,Nf);this.Dh(l.map((t=>t.id)))}}onAction(t){this.fh.has(t)&&this.Dh(this.fh.get(t)||[])}Dh(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.mh(n)?this.Fh(n)&&this.$h(n):r.push(n);r.length>0&&(this.uh=[...new Set([...this.uh,...r])]),this.Rh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fh(t){this.uh=this.uh.filter((e=>e!==t));var e=this.Nh();return!e.includes(t)&&(this.qh([...e,t]),this.jh(),!0)}Ah(t){var e=new Set(t);this.uh=this.uh.filter((t=>!e.has(t)));var i=this.Bh(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.qh(r),0===r.length&&this.Hh()),this.Oh(t)}zh(){var t,e=this.yh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}$h(t){if(this.yh()){var e=this.zh();this.bh(p({},e,{[t]:Date.now()}))}}Oh(t){if(this.yh()){var e=this.zh(),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&&(N(i)?this._h():this.bh(i))}}Uh(){this.yh()&&this._h()}getActivationTimestamp(t){if(this.Nh().includes(t)){var e=this.zh()[t];return U(e)?e:void 0}}Bh(){var t,e=this.Wh();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Nh(){var t,e,i=this.Bh();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Vh()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}jh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Gh(e)}Hh(){this.Zh()}gh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Vh()];if(i&&i!==t){var r=this.Bh(),n=this.zh();r.length>0&&(this.qh([]),r.filter((t=>U(n[t]))).forEach((t=>this.Lh(t)))),this.Hh(),this.Uh()}}getActivatedIds(){return[...new Set([...this.Nh(),...this.uh])].filter((t=>!this.Qh(t)))}dispose(){var t,e,i;null==(t=this.ph)||t.call(this),this.ph=void 0,null==(e=this.ih)||e.call(this),this.ih=void 0,null==(i=this.Ih)||i.dispose(),this.Ih=void 0}reset(){this.uh=[],this.Bh().length>0&&this.qh([]),this.Hh(),this.Uh()}getEventToItemsMap(){return this.hh}Jh(){return this.Ih}}class Vw extends Ww{constructor(t){super(t)}Wh(){return gs}Vh(){return ms}yh(){return ys}bh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ys]:t})}_h(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ys)}mh(t){var e,i;this.xh((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return U(r)&&r>0}Kh(){return Gf.SHOWN}xh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Lh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Rh(){return Kf}qh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[gs]:t})}Gh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ms]:t})}Zh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ms)}Qh(){return!1}Ph(t,e){var i;return this.xh((t=>{i=t.find((t=>t.id===e))})),!i||Po(i)?t===Gf.SHOWN?"consume":"ignore":t===Gf.SHOWN?"persist":t===Gf.DISMISSED||t===Gf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Gw{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);q(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 Zw{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 Vw(this._instance)}}var Qw=null!=t&&t.location?fr(t.location.hash,"__posthog")||fr(location.hash,"state"):null,Jw="_postHogToolbarParams",Kw=Ji("[Toolbar]"),Yw=Ji("[FeatureFlags]");class Xw{constructor(t,e){void 0===e&&(e=!1),this.Yh=!1,this.update(t,e)}update(t,e){this.Xh=((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:O(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Yh||(Yw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yh=!0),q(t.flag_keys)||O(t.flag_keys)||Yw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Xh}}var tk=Ji("[FeatureFlags]"),ek=Ji("[FeatureFlags]",{debugEnabled:!0}),ik="\" failed. Feature flags didn't load in time.",rk="connection_error",nk=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},sk=t=>{var e={};for(var i of tr(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},ak="Refusing to render web experiment since the viewer is a likely bot",ok={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Ao(e,t),not_regex:(t,e)=>!Ao(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class lk{get mn(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{lk.td("retrieved web experiments from the server"),e.ed=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.ed&&(lk.td("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.ed)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);j(r)&&t.variants[r]&&e.rd(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];lk.nd(s,e._instance)&&e.rd(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())lk.td(ak);else if(!this.mn.disable_web_experiments){if(z(this.ed))return this.ed=new Map,this.loadIfEnabled(),void this.previewWebExperiment();lk.td("applying feature flags",t),t.forEach((t=>{var e;if(this.ed&&null!=(e=this.ed)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ed)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.rd(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=lk.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&&(lk.td("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.sd(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.mn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.mn.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.mn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}sd(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(lk.td("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.rd(r[0].name,e,r[0].variants[e].transforms))}static nd(t,e){return!z(t.conditions)&&lk.ad(t,e)&&lk.od(t)}static ad(t,e){var i;if(z(t.conditions)||z(null==(i=t.conditions)?void 0:i.url))return!0;var r=lk.getWindowLocation();if(r){var n,s,a,o=mr(e,r.href);return null==(n=t.conditions)||!n.url||ok[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 od(t){var e;if(z(t.conditions)||z(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Jo();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 td(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)}rd(t,e,i){this._is_bot()?lk.td(ak):"control"!==e?i.forEach((i=>{if(i.selector){var r;lk.td("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)}))}})):lk.td("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?U_(i,this.mn.custom_blocked_useragents):void 0}}var uk=Ji("[Conversations]"),hk="Conversations not available yet.";function dk(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=q(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(Oi,t)?Oi[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 vk=["debug","log","warn","error","info"],ck="console",fk="__posthogHandledLogsRequestError",pk=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[fk]=!0,i},gk=t=>!!t&&"object"==typeof t&&!0===t[fk],mk={featureFlags:class{constructor(t){this.name=op,this.ld=!1,this.featureFlagEventHandlers=[],this.A=tk,this.ud={},this.hd={},this.dd=[],this.vd=!1,this.fd=!1,this.pd=0,this.gd=!1,this.md=!1,this.yd=!1,this.bd=!1,this._d=0,this.Wt=()=>{var t=this.wd();this._d=0,t&&this.reloadFeatureFlags()},this.kd=()=>{var t,e=this.Sd;q(e)||this.mn.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.xd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Cd())},this.Vt=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.kd()},"get"in t?this.Ls=t:(this._instance=t,this.Td=new Xw(t.config,t.fo()),this.Ls=this.Td)}updateConfig(t,e){var i;null==(i=this.Td)||i.update(t,e),this.Ns&&this.Md()}setup(t){return this.Du=t,this.A=t.logger.createLogger("[FeatureFlags]"),qw(t.kv.initialize(),(()=>{this.Du===t&&(this.Du=void 0,this.Ns=t,this.Id(t))}))}Id(e){var i;if(this.Ns===e)return t&&ar(t,"online",this.Wt),this.Md(),this.Ed=e.registerDynamicEventProperties((()=>this.Rd()?this.ud:this.hd)),this.Pd=null==(i=this._instance)||null==(i=i.persistence)?void 0:i.onCrossTabFeatureFlagChange((()=>{this.Ad(),this.Fd()})),this.Ad(),this.initialize()}Md(){var t=this.mn.refreshIntervalMs,e=!this.mn.remoteRequestsDisabled&&r&&!q(t)&&t>0?t:void 0;e!==this.Sd&&(this.Od(),q(e)||(this.Sd=e,this.Cd(),null!=r&&r.addEventListener&&ar(r,Js,this.Vt)))}Cd(){q(this.Sd)||(q(this.Ld)||clearInterval(this.Ld),this.xd=Date.now(),this.Ld=setInterval(this.kd,this.Sd))}Od(){q(this.Ld)||(clearInterval(this.Ld),this.Ld=void 0,null==r||null==r.removeEventListener||r.removeEventListener(Js,this.Vt)),this.Sd=void 0,this.xd=void 0}destroy(){this.Dd()}dispose(){this.Dd()}Dd(){var e,i;this.Od(),this.pd++,this.md=!1,this.Du=void 0,this.Ns&&(this.$d(),null==(e=this.Ed)||e.dispose(),this.Ed=void 0,null==(i=this.Pd)||i.call(this),this.Pd=void 0,this.dd=[],null==t||t.removeEventListener("online",this.Wt),this.Ns=void 0)}get mn(){return this.Ls.get()}Nd(t){var e;return null==(e=this.Ns)?void 0:e.kv.get(t)}ni(t){this.qd((()=>{var e;return null==(e=this.Ns)?void 0:e.kv.set(t)}))}jd(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t[is]){var n=this.Nd(is)||{},s=t[is]||{},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&&!O(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Nd(as)||{},d=t[as]||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p={[rs]:f,[is]:f,[as]:!!c||v};for(var g of(t[ss]&&(p[ss]=f),[os,Ss,ls]))q(t[g])||(p[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(p)}}oi(t){this.qd((()=>{var e;return null==(e=this.Ns)?void 0:e.kv.remove(t)}))}qd(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Ad(){var t={};for(var e of[rs,as,os,us]){var i=this.Nd(e);q(i)||(t[e]=i)}this.ud=t;var r=p({},t),n=this.Nd(is);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.hd=r}Rd(){var t=this.mn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Nd(Ss);return"number"!=typeof e||Date.now()-e>t}Bd(){return!!this.Rd()&&(this.bd||this.fd||(this.bd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Hd(){var t=this.mn.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})):[]}zd(){var t=this.mn.flagKeys;if(!q(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.mn,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=>!q(r[t]))).reduce(((t,e)=>(t[e]=r[e],t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.Ud({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Nd(is))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Nd(as))&&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:ci(v),variant:fi(v),reason:void 0,metadata:q(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Ud({flags:u})}get hasLoadedFlags(){return this.vd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Nd(ss),e=this.Nd(us),i=this.Nd(hs);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=q(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=q(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.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.ld=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:ci(r),variant:fi(r),payload:vi(e[i])}}))}getFlagVariants(){var t=this.Nd(is),e=this.Nd(us);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.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.ld=!0),i}getFlagPayloads(){var t=this.Nd(as),e=this.Nd(hs);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.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.ld=!0),i}reloadFeatureFlags(){this.gd||this.mn.featureFlagsDisabled||this.wd()||(this.fd&&(this.md=!0),this.Wd||(this.dd.slice().forEach((t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}})),this.Wd=setTimeout((()=>{this.Vd()}),5)))}$d(){clearTimeout(this.Wd),this.Wd=void 0}onReloading(t){return this.dd.push(t),()=>{this.dd=this.dd.filter((e=>e!==t))}}ensureFlagsLoaded(){this.vd||this.fd||this.Wd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.gd=t}resetFlagCallReported(){this.oi(_s)}Vd(t){this.$d();var e=this.Ns;if(e&&!this.mn.remoteRequestsDisabled&&!this.wd())if(this.fd)this.md=!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.Nd(ds)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Nd(vs),timezone:nl()};q(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.mn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Hd();r.length&&(i.evaluation_contexts=r);var n=this.zd();q(n)||(i.flag_keys=n);var s=this.mn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.pd;this.fd=!0;var l=()=>{this.md&&(this.md=!1,this.Vd())},u=t=>{this.fd=!1,o===this.pd?(this.ni({[ks]:[rk]}),this.A.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.mn.compression,sentAt:"body",timeoutMs:this.mn.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.fd=!1,o===this.pd){if(this.Gd(t.statusCode),a||this.md||(this.$anon_distinct_id=void 0),!i.disable_flags||this.md){this.yd=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?rk:"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.ni({[ks]: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.Ud(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}wd(){return pr(this._d,3)}Gd(t){this._d=gr(t,this._d,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.yd)if(this.vd||this.getFlags()&&this.getFlags().length>0){if(!this.Bd()){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+ik)}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.yd)if(this.vd||this.getFlags()&&this.getFlags().length>0){if(!this.Bd()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Nd(os)||void 0,u=this.Nd(Ss)||void 0,h=this.Nd(_s)||{};if(this.mn.deduplicateCallsPerSession){var d,v=null==(d=this.Ns)?void 0:d.session.sessionId,c=this.Nd(ws);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.ni({[_s]:h,[ws]:i});else{var f,g,m,y,b,_,w,k,S,x,C,T;O(h[t])?h[t].push(o):h[t]=[o],this.ni(p({[_s]:h},i?{[ws]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Nd(ks))&&void 0!==f?f:[]];q(s)&&I.push("flag_missing");var E={$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.mn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.mn.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.yd};q(null==M||null==(_=M.metadata)?void 0:_.has_experiment)||(E.$feature_flag_has_experiment=M.metadata.has_experiment),q(null==M||null==(w=M.metadata)?void 0:w.version)||(E.$feature_flag_version=M.metadata.version);var R,P=null!==(k=null==M||null==(S=M.reason)?void 0:S.description)&&void 0!==k?k:null==M||null==(x=M.reason)?void 0:x.code;P&&(E.$feature_flag_reason=P),null!=M&&null!=(C=M.metadata)&&C.id&&(E.$feature_flag_id=M.metadata.id),q(null==M?void 0:M.original_variant)&&q(null==M?void 0:M.original_enabled)||(E.$feature_flag_original_response=q(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(E.$feature_flag_original_payload=null==M||null==(R=M.metadata)?void 0:R.original_payload),I.length&&(E.$feature_flag_error=I.join(",")),this.Zd(E)}else i&&this.ni({[_s]:h,[ws]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:vi(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+ik)}Zd(t){try{var e;null==(e=this.Ns)||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.Qd(t,e)}Qd(t,e){var i=this;return f((function*(){var r=i.Ns;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Hd();s.length&&(n.evaluation_contexts=s);var a,o=i.zd();q(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.mn.compression,sentAt:"body",timeoutMs:i.mn.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.yd)return e.defaultValue;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+ik),e.defaultValue;var i=this.getFeatureFlag(t,e);return q(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.Ud(t,e,i)}Ud(t,e,i){if(this.Ns){this.vd=!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=tk);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!q(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(O(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{[rs]:l,[is]:v,[ls]:!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({[rs]:Object.keys(sk(f)),[is]:f||{},[as]:g||{},[ss]:m||{},[ls]:!0===t.minimalFlagCalledEvents},h?{[os]:h}:{},d?{[Ss]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);r&&(this.jd(r,t,!(null==i||!i.partialResponse)),this.ni(r)),e||(this.bd=!1),this.Fd(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.Jd(t)}Jd(t){if(this.Ns){if(!1===t)return this.oi([us,hs]),this.Fd(),void ek.info("All overrides cleared");if(O(t))return this.ni({[us]:nk(t)}),this.Fd(),void ek.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.ld=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[us]=O(n)?nk(n):n),s&&(r[hs]=s),Object.keys(r).length&&this.ni(r),!1===n&&!1===s?this.oi([us,hs]):!1===n?this.oi(us):!1===s&&this.oi(hs),this.Fd(),!1===n?ek.info("Flag overrides cleared"):n&&ek.info("Flag overrides set",{flags:n}),void(!1===s?ek.info("Payload overrides cleared"):s&&ek.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ni({[us]:t}),this.Fd(),void ek.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.vd){var e=this.Kd(),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.Nd(ns)||[]).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({[rs]:[t],[is]:[t],[ds]:Object.keys(s)}),this.ni({[rs]:Object.keys(sk(o)),[is]:o,[ds]:p({},this.Nd(ds)||{},s)}),this.Fd();try{var l;null==(l=this.Ns)||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.Nd(ns);!r||e?this.Yd(t,i):t(r)}Yd(t,e){var i=this;return f((function*(){var r=i.Ns;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.ni({[ns]: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)}}}))()}Kd(){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)),{})}}Fd(t){this.Ad();var e=this.Kd(),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.Xd(t,e)}Xd(t,e){void 0===e&&(e=!0);var i=this.Nd(ds)||{},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.ni({[ds]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Nd(ds)||{});t.forEach((t=>{delete i[t]})),this.ni({[ds]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.oi(ds),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Nd(vs)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.ni({[vs]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Nd(vs)||{};this.ni({[vs]:p({},e,{[t]:{}})})}else this.oi(vs)}reset(){this.pd++,this.md=!1,this.ud={},this.hd={},this.vd=!1,this.gd=!1,this.yd=!1,this.$anon_distinct_id=void 0,this.$d(),this.ld=!1,this._d=0}}},yk={sessionRecording:class{get mn(){return this._instance.config}get Bo(){return this._instance.persistence}get started(){var t;return!(null==(t=this.tv)||!t.isStarted)}get status(){var t,e;return this.ev===la||this.ev===ua?this.ev:null!==(t=null==(e=this.tv)?void 0:e.status)&&void 0!==t?t:this.ev}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ev=ia,this.iv=void 0,this.rv=!1,this.jt=(()=>{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.Vt=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.jt=!0,null==(t=this.tv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Pw.error("started without valid sessionManager"),new Error(Rw+" started without valid sessionManager. This is a bug.");if(this.mn.cookieless_mode===Vs)throw new Error(Rw+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&ar(r,"visibilitychange",this.Vt)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.rv=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.Vt),i?this.nv(!0):this.stopRecording()}get sv(){var e,i=!(null==(e=this._instance.get_property(jn))||!e.enabled),r=!this.mn.disable_session_recording,n=this.mn.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.rv||this.sv&&null!=(e=this.tv)&&e.isStarted)){var i=!q(Object.assign)&&!q(Array.from);this.sv&&i?(this.av(t),Pw.info("starting")):(this.ev=ia,this.stopRecording())}}av(t){var e,i;if(this.sv)if(this.ev!==la&&this.ev!==ua&&(this.ev=oa),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording)this.ov(t);else{var r,n=this._instance.sessionManager;null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.lv,(e=>{if(!this.rv&&this.sv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ls]:!0}),Pw.error("could not load recorder",e)):void this.ov(t);this.ev=ia}))}}stopRecording(){var t,e;null==(t=this.iv)||t.call(this),this.iv=void 0,null==(e=this.tv)||e.stop()}nv(t){var e,i;void 0===t&&(t=!1),null==(e=this.iv)||e.call(this),this.iv=void 0,null==(i=this.tv)||i.discard({discardProducerEvents:t})}uv(){var t,e;null==(t=this.Bo)||t.unregister(Gn),null==(e=this.Bo)||e.unregister(Bn)}hv(t,e){if(z(t))return null;var i,r=U(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Pw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}dv(t){if(this.Bo){var e,i,r=this.Bo,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.hv(null==(e=this.mn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.hv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;z(a)&&this.uv();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[jn]: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:q(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.iv)||e.call(this),this.iv=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.dv(e),void this.nv()):(this.dv(e),void this.startIfEnabledOrStop()):(this.ev===la&&(this.ev=ua,Pw.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.tv)&&i.log?this.tv.log(t,e):Pw.warn("log called before recorder was ready")}get lv(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(jn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}vv(){var t,e=this._instance.get_property(jn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Pw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!z(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=Rl}ov(t){var e,i,r;if(!this.rv&&this.sv&&this._instance.sessionManager){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Pw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ls]:!0});var n;if(this.tv||(this.tv=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.jt),this.tv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.vv()){if(this.ev===ua||this.ev===la)return;return this.ev=la,Pw.info("persisted remote config is stale, requesting fresh config before starting"),void new m_(this._instance).load()}this.ev=oa,null==(i=(r=this.tv).setDocumentWasEverVisible)||i.call(r,this.jt),this.tv.start(t)}else this.ev=ia}onRRwebEmit(t){var e;null==(e=this.tv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.tv||null==(e=this.Bo)||e.register({[zn]:!0}),null==(t=this.tv)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.tv||null==(e=this.Bo)||e.register({[Hn]:!0}),null==(t=this.tv)||t.overrideSampling()}overrideTrigger(t){var e,i;this.tv||null==(i=this.Bo)||i.register({["url"===t?Un:Wn]:!0}),null==(e=this.tv)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.tv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.tv)||!i.tryAddCustomEvent(t,e))}}},bk={autocapture:class extends Cb{constructor(t){super(new kw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.fv=this.pv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.gv();return!!(t.path||t.search||this.mv(t))}startIfEnabled(){this.isEnabled&&(Qi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.fv=this.pv(),this.startIfEnabled()}stop(){this.yv&&this.yv(),this.yv=void 0,this.bv&&this.bv(),this.bv=void 0,Qi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this._v("pushState"),this._v("replaceState"),this.wv(),this.mv()&&this.Sv())}_v(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Vv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.xv(e)}))}}pv(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}gv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:D(t)?t:{}}mv(t){return void 0===t&&(t=this.gv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Cv(t){var e=this.gv(),i=this.fv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.mv(e)&&t.hash!==i.hash))}xv(t){try{var e=this.pv();if(!e)return;this.Cv(e)&&this._instance.capture(Ys,{navigation_type:t}),this.fv=e}catch(e){Qi.error("Error capturing "+t+" pageview",e)}}wv(){if(!this.yv){var e=()=>{this.xv("popstate")};ar(t,"popstate",e),this.yv=()=>{t&&t.removeEventListener("popstate",e)}}}Sv(){if(!this.bv){var e=()=>{this.xv("hashchange")};ar(t,"hashchange",e),this.bv=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get mn(){return this.instance.config}constructor(t){var e;this.Tv=!1,this.Rs=!1,this.Mv=null,this.instance=t,this.Tv=!(null==(e=this.instance.persistence)||!e.props[Pn]),this.rageclicks=new bb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return D(this.mn.capture_heatmaps)&&this.mn.capture_heatmaps.flush_interval_milliseconds&&(t=this.mn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return z(this.mn.capture_heatmaps)?z(this.mn.enable_heatmaps)?this.Tv:this.mn.enable_heatmaps:!1!==this.mn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Aw.info("starting..."),this.Iv(),this.Vt()}else{var t;clearInterval(null!==(t=this.Mv)&&void 0!==t?t:void 0),this.Ev(),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({[Pn]:i}),this.Tv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Pt;return this.Pt=void 0,t}Rv(t){Fw(t.originalEvent)&&this.Xi(t.originalEvent,"deadclick")}Vt(){this.Mv&&clearInterval(this.Mv),this.Mv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.Po.bind(this),this.flushIntervalMilliseconds):null}Iv(){t&&r&&(this.Pv=this.Po.bind(this),ar(t,Ks,this.Pv),this.Av=e=>this.Xi(e||(null==t?void 0:t.event)),ar(r,"click",this.Av,{capture:!0}),this.Fv=e=>this.Ov(e||(null==t?void 0:t.event)),ar(r,"mousemove",this.Fv,{capture:!0}),this.Lv=new Vb(this.instance,Ub,this.Rv.bind(this)),this.Lv.startIfEnabledOrStop(),this.Dv=this.Vt.bind(this),ar(r,Js,this.Dv),this.Rs=!0)}Ev(){var e;t&&r&&(this.Pv&&t.removeEventListener(Ks,this.Pv),this.Av&&r.removeEventListener("click",this.Av,{capture:!0}),this.Fv&&r.removeEventListener("mousemove",this.Fv,{capture:!0}),this.Dv&&r.removeEventListener(Js,this.Dv),clearTimeout(this.$v),null==(e=this.Lv)||e.stop(),this.Rs=!1)}Nv(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(w(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}}Xi(t,e){var i;if(void 0===e&&(e="click"),!Sr(t.target)&&Fw(t)){var r=this.Nv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Wr(Or(t),this.instance.config.rageclick)&&this.ks(p({},r,{type:"rageclick"})),this.ks(r)}}Ov(t){!Sr(t.target)&&Fw(t)&&(clearTimeout(this.$v),this.$v=setTimeout((()=>{this.ks(this.Nv(t,"mousemove"))}),500))}ks(e){if(t){var i=this.mn.disable_capture_url_hashes?Re(t.location.href):t.location.href,r=this.mn.custom_personal_data_properties,n=this.mn.mask_personal_data_properties?[...Vo,...r||[]]:[],s=cr(i,n,Zo);this.Pt=this.Pt||{},this.Pt[s]||(this.Pt[s]=[]),this.Pt[s].push(e)}}Po(){this.Pt&&!N(this.Pt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Vb,webVitalsAutocapture:class{constructor(t){var e;this.Tv=!1,this.Rs=!1,this.Pt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.qv=()=>{clearTimeout(this.jv),this.jv=void 0,0!==this.Pt.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.Pt.url},this.Pt.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.Pt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Bv=t=>{var e;if(this.Pt=this.Pt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},z(null==t?void 0:t.name)||z(null==t?void 0:t.value))Cw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Hv(i);if(!q(r)){var n=U(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.zv||this.zv>t.value){this.Pt.navigationKey!==n&&(this.qv(),this.jv=setTimeout(this.qv,this.flushToCaptureTimeoutMs)),q(this.Pt.navigationKey)&&(this.Pt.navigationKey=n,this.Pt.url=r),this.Pt.firstMetricTimestamp=q(this.Pt.firstMetricTimestamp)?Date.now():this.Pt.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,D(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of Ew){var u="url"===l&&"string"==typeof t.attribution[l]?this.Hv(t.attribution[l]):t.attribution[l];q(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;q(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.Pt.metrics.push(a),this.Pt.metrics.length===this.allowedMetrics.length&&this.qv()}else Cw.error("Ignoring metric with value >= "+this.zv,t)}}},this.Uv=()=>{if(!this.Rs){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Wv])||("web-vitals"===this.Wv&&q(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!q(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!q(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.Bv.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Bv.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Bv.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Bv.bind(this),d),this.Rs=!0}else Cw.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Tv=!(null==(e=this._instance.persistence)||!e.props[Ln]),this.startIfEnabled()}get Vv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=D(this.Vv)?null==(t=this.Vv)?void 0:t.web_vitals_allowed_metrics:void 0;return z(i)?(null==(e=this._instance.persistence)?void 0:e.props[qn])||Mw:i}get flushToCaptureTimeoutMs(){return(D(this.Vv)?this.Vv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=D(this.Vv)?this.Vv.web_vitals_attribution:void 0;return V(t)?t?Mw:[]:O(t)?t:Iw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=D(this.Vv)?this.Vv.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get zv(){var t=D(this.Vv)&&U(this.Vv.__web_vitals_max_value)?this.Vv.__web_vitals_max_value:Tw;return t>0&&6e4>=t?Tw:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return Cw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=D(this.Vv)?this.Vv.web_vitals:V(this.Vv)?this.Vv:void 0;return V(e)?e:this.Tv}startIfEnabled(){this.isEnabled&&!this.Rs&&(Cw.info("enabled, starting..."),this.Ys(this.Uv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=D(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=D(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ln]:i}),this._instance.persistence.register({[qn]:r})),this.Tv=i,this.startIfEnabled()}}}get Wv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ys(t){var e=v.__PosthogExtensions__,i=this.Wv,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&q(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?Cw.error("failed to load script",e):t()}))}Hv(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?[...Vo,...n||[]]:[];return cr(r,s,Zo)}Cw.error("Could not determine current URL")}}},_k={exceptionObserver:class{constructor(e){var i;this.Uv=()=>{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.Gv&&this.mn.capture_unhandled_errors&&(this.Gv=i(this.captureException.bind(this))),!this.Zv&&this.mn.capture_unhandled_rejections&&(this.Zv=r(this.captureException.bind(this))),!this.Qv&&this.mn.capture_console_errors&&(this.Qv=n(this.captureException.bind(this)))}catch(t){Sw.error("failed to start",t),this.Jv()}}},this._instance=e,this.Kv=!(null==(i=this._instance.persistence)||!i.props[An]),this.pe=new st(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:Sw})),this.mn=this.Yv(),this.startIfEnabledOrStop()}Yv(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return D(t)?e=p({},e,t):(q(t)?this.Kv:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.mn.capture_console_errors||this.mn.capture_unhandled_errors||this.mn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Sw.info("enabled"),this.Jv(),this.Ys(this.Uv)):this.Jv()}Ys(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 Sw.error("failed to load script",e);t()}))}Jv(){var t,e,i;null==(t=this.Gv)||t.call(this),this.Gv=void 0,null==(e=this.Zv)||e.call(this),this.Zv=void 0,null==(i=this.Qv)||i.call(this),this.Qv=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Kv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[An]:this.Kv}),this.mn=this.Yv(),this.startIfEnabledOrStop())}}onConfigChange(){this.mn=this.Yv()}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)?Sw.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.Xv=[],this.tc=wm(),this._instance=t,this.Xv=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Fn))&&void 0!==e?e:[],this.ec=ui(this.ic()),this.rc=new hi(this.ec)}onConfigChange(){this.ec=ui(this.ic()),this.rc.setConfig(this.ec)}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.Xv=s,this._instance.persistence&&this._instance.persistence.register({[Fn]:this.Xv,[On]:a})}}}get nc(){var t,e=!!this._instance.get_property(On),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.tc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ec.enabled)try{if(!j(t)||0===t.trim().length)return void mm.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)=>oi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.sc(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&mm.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.rc.add(p({[si]:t,[ai]:(new Date).toISOString()},r))}catch(t){mm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ac(e)){if(this.oc(e))return this.lc("Exception dropped: matched a suppression rule"),void mm.info("Skipping exception capture because a suppression rule matched");if(!this.nc&&this.uc(e))return this.lc("Exception dropped: thrown by a browser extension"),void mm.info("Skipping exception capture because it was thrown by an extension");if(!this.nc&&this.hc(e))return this.lc("Exception dropped: thrown by an injected browser script"),void mm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.dc(e))return this.lc("Exception dropped: thrown by the PostHog SDK"),void mm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ec.enabled&&z(t.$exception_steps)?this.vc(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",gu:!0});return n&&this.rc.clear(),n}catch(t){return mm.error("Failed to capture exception event. Dropping this exception.",t),void this.rc.clear()}}catch(t){return void mm.error("Failed to process exception event. Ignoring this exception.",t)}var s}vc(t){try{var e=this.rc.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return mm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}lc(t){this.ec.enabled&&this.rc.add({[si]:t,[ai]:(new Date).toISOString()})}sc(t){return D(t)?p({},t):{}}ic(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}oc(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return j(i)&&i.length>0&&t.$exception_types.push(i),j(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Xv.some((t=>{var i=t.values.map((t=>{var i=Oo[t.operator],r=e[t.key];if(!i||!r)return!1;var n=O(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 mm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}uc(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&&bm.some((t=>e.startsWith(t)))}));return 0!==i.length&&(!i.every((t=>{var e=t.filename;return!!e&&e.startsWith(ym)}))||t.some((t=>{var e=t.value;return j(e)&&e.includes("isolatedAPI.contexts.topHostname")}))&&!e.some((t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(ym))})))}hc(t){return t.some((t=>{var e=t.value;return j(e)&&_m.some((t=>e.includes(t)))}))}dc(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}ac(t){return!z(t)&&O(t)}}},wk=p({productTours:class{get Bo(){return this._instance.persistence}constructor(t){this.cc=null,this.fc=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.Bo&&this.Bo.register({[$n]:!!e.productTours}),!Lw(this._instance))return!this.cc&&z(null==(i=this.Bo)?void 0:i.props[bs])||Ow.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.cc)||r.stop(),this.cc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.cc&&Lw(this._instance)&&this.Ys((()=>this.gc()))}Ys(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?Ow.error("Could not load product tours script",e):t()}))}gc(){var t;!this.cc&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.cc=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!O(this.fc)||e){var i=this.Bo;if(i){var r=i.props[bs];if(O(r)&&!e)return this.fc=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Lw(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||Ow.warn(n):Ow.error(n),void t([],{isLoaded:!1,error:n})}var s=O(e.json.product_tours)?e.json.product_tours:[];this.fc=s,i&&i.register({[bs]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.fc,{isLoaded:!0})}getActiveProductTours(t){z(this.cc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.cc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.cc)||e.showTourById(t)}previewTour(t){this.cc?this.cc.previewTour(t):this.Ys((()=>{var e;this.gc(),null==(e=this.cc)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.cc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.cc)||t.nextStep()}previousStep(){var t;null==(t=this.cc)||t.previousStep()}clearCache(){var t;this.fc=null,null==(t=this.Bo)||t.unregister(bs)}resetTour(t){var e;null==(e=this.cc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.cc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.cc)||e.cancelPendingTour(t)}}},mk),kk={siteApps:class{constructor(t){this.mc=0,this._instance=t,this.yc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}bc(t,e){if(e){var i=this.globalsForEvent(e);this.yc.push(i),this.yc.length>1e3&&(this.yc=this.yc.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.bc.bind(this));this._c=()=>{t(),this.yc=[],this._c=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,Dw),{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}}wc(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||($w.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||($w.error("prepare_external_dependency_script returned null"),null):t}kc(){var t,e,i,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.mc++,this.Sc)return this.xc();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.wc(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!H(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.Sc=()=>{d.forEach((t=>t())),this.Sc=void 0},this.xc()}xc(){var t=!1;return()=>{var e;t||(t=!0,this.mc--,0===this.mc&&(null==(e=this.Sc)||e.call(this)))}}Cc(t,e){void 0===e&&(e=!0);var i=this.kc();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.yc.length&&($w.info("Processing "+this.yc.length+" events for site app with id "+t.id),this.yc.forEach((t=>this.Cc((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this._c)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,$w.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Cc((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){$w.error(Nw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){$w.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Tc(){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)}Mc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Cc((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){$w.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Tc(),void this._instance.on("eventCaptured",(t=>this.Mc(t)))):void $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this._c)||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 $w.error(Nw+e,t)}))};for(var o of s.siteApps)a()}else $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Sk={tracingHeaders:class{constructor(t){this.Ic=void 0,this.Ec=void 0,this.Rc=void 0,this.Uv=()=>{var t,e,i=this.Pc();i?(q(this.Ic)&&(this.Ic=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),q(this.Ec)&&(this.Ec=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Jv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ys(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 xw.error("failed to load script",e);t()}))}Ac(){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}Pc(){var t=this.Ac();return O(t)?(O(this.Rc)?this.Rc.splice(0,this.Rc.length,...t):this.Rc=[...t],t.length>0?this.Rc:void 0):(O(this.Rc)&&this.Rc.splice(0),this.Rc=t||void 0,this.Rc)}Jv(){var t,e;null==(t=this.Ic)||t.call(this),null==(e=this.Ec)||e.call(this),this.Ic=void 0,this.Ec=void 0}startIfEnabledOrStop(){this.Pc()?this.Ys(this.Uv):this.Jv()}}},xk=p({surveys:class extends Hw{constructor(t){var e;super(new Zw(t),{get projectToken(){return e.config.token},kv:new Gw(e=t)}),this._instance=t}Bu(t,e){var i=e.query?k_(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})}))}}},mk),Ck={toolbar:class{constructor(t){this.instance=t}Fc(t){v.ph_toolbar_state=t}Oc(){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=Qw||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(Jw)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Lc(t){var e=v.ph_load_toolbar||v.ph_load_editor;!z(e)&&L(e)?e(t,this.instance):Kw.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(Jw,JSON.stringify(p({},s,{source:void 0}))),2===this.Oc())this.Lc(s);else if(0===this.Oc()){var a;this.Fc(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Kw.error("[Toolbar] Failed to load",t),void this.Fc(0);this.Fc(2),this.Lc(s)})),ar(t,"turbolinks:load",(()=>{this.Fc(0),this.loadToolbar(s)}))}return!0}Dc(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)}}},Tk=p({experiments:lk},mk),Mk={conversations:class{constructor(t){this.$c=void 0,this._conversationsManager=null,this.Nc=!1,this.je=null,this.qc=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.jc=t.ok,t.ok)){var e=t.config.conversations;z(e)||(V(e)?this.$c=e:(this.$c=e.enabled,this.je=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.$c=void 0,this.je=null,this.jc=void 0,this.qc=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Nc||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&&!q(this.$c)&&this.$c)if(this.je&&this.je.token){this.Nc=!0;try{var e=t.initConversations;if(e)return this.Bc(e),void(this.Nc=!1);var i=t.loadExternalDependency;if(!i)return void this.Hc(Us);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Hc("Could not load conversations script",e):this.Bc(t.initConversations),this.Nc=!1}))}catch(t){this.Hc("Error initializing conversations",t),this.Nc=!1}}else uk.error("Conversations enabled but missing token in remote config.")}}Bc(t){if(this.je)try{this._conversationsManager=t(this.je,this._instance),this.qc=!1,uk.info("Conversations loaded successfully")}catch(t){this.Hc("Error completing conversations initialization",t)}else uk.error("Cannot complete initialization: remote config is null")}Hc(t,e){uk.error(t,e),this._conversationsManager=null,this.Nc=!1,this.qc=!0}show(){this._conversationsManager?this._conversationsManager.show():uk.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.$c&&!H(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.jc?"remote_config_failed":q(this.$c)?this.jc?"disabled_in_project":"remote_config_pending":this.$c?z(this.je)||!this.je.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.Nc?"initializing":this.qc?"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):(uk.warn(hk),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(uk.warn(hk),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(uk.warn(hk),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(uk.warn(hk),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(uk.warn(hk),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(uk.warn(hk),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(uk.warn(hk),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}Cu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Tu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Ik={logs:class{constructor(e){var i,r=this;this.name=lp,this.zc=!1,this.Uc=!1,this.Wc=!1,this.A=Ji("[logs]"),this.Vc=p({},this.A,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(gk)||r.A.error(...e)}}),this.bo=[],this.Gc=[],this._d=0,this.Os=!1,this.Zc=[],this.Qc=[],this.Jc=!1,this.Kc=!1,this.Yc=()=>{var t,e;this.Os||(this._d=0,null==(t=this.Xc)||t.onReconnect(),null==(e=this.tf)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.zc=!0),t&&ar(t,"online",this.Yc)}ef(t,e,i,r){var n,s=dk(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Bi(this.if(t,e),s,this.Vc,(()=>this.rf()),(t=>t()),void 0,r),s]}nf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Xc||this.sf!==e){var i;null==(i=this.Xc)||i.reset(),this.sf=e;var r=this.ef((()=>this.bo),(t=>{this.bo=t}));this.Xc=r[0],this.af=r[1]}return this.Xc}lf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.tf||this.uf!==e){var i;null==(i=this.tf)||i.reset(),this.uf=e;var r=this.ef((()=>this.Gc),(t=>{this.Gc=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ck);this.tf=r[0],this.hf=r[1]}return this.tf}setup(t){var e;if(!this.Os){this.Ns=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.zc=!0),(this.zc||this.df()&&this.vf())&&this.cf();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.Os?r.dispose():(this.qs=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.Os||(this.Os=!0,this.ff(),null==(e=this.qs)||e.dispose(),this.qs=void 0,this.Ns=void 0,this.Wc=!1,null==t||t.removeEventListener("online",this.Yc),null==(i=this.pf)||i.call(this),this.pf=void 0,null==(r=this.Xc)||r.reset(),null==(n=this.tf)||n.reset())}onRemoteConfig(t){var e,i;if(!this.Os){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;z(r)?this.gf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[Nn]:!!r}),r?(this.zc=!0,this.Uc||this.cf(),this.loadIfEnabled()):this.gf())}}reset(){var t,e,i,r;this.ff(),null==(t=this.Xc)||t.clearQueue(),this.bo=[],null==(e=this.Xc)||e.reset(),null==(i=this.tf)||i.clearQueue(),this.Gc=[],null==(r=this.tf)||r.reset(),this._d=0}captureLog(t){this.Os||this.nf().captureLog(t)}captureConsoleLog(t){this.Os||this.lf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Os||this.lf().captureLog(t,{context:e,occurredAtMs:i})}vf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[Nn])}df(){var t,e;return null==(t=this._instance)||null==t.fo||!t.fo()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Iu(){var t;this.ff(),null==(t=this.tf)||t.clearQueue(),this.Gc=[]}gf(){this.zc||this.ff()}cf(){var t,e=this;if(!this.Jc&&null!=v&&v.console){var i=dk(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=sm(v.console[t])}catch(t){return 0}if(!r)return 0;e.Qc.push(Vv(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.mf(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of vk)r(n);this.Jc=!0,this.yf=setTimeout((()=>{this.ff()}),3e4)}}mf(t,e,i){var r;if(this.Jc&&!this.Kc&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Zc.length){this.Kc=!0;try{this.Zc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.rf()})}finally{this.Kc=!1}}}else this.ff()}ff(){if(this.Zc=[],this.Jc){for(var t of(this.Jc=!1,this.yf&&(clearTimeout(this.yf),this.yf=void 0),this.Qc))t();this.Qc=[]}}bf(){var t=this.Zc;return this.ff(),t}get logger(){return this._f||(this._f={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._f}flushLogs(t){t?this.wf(t):(this.Xc&&this.Xc.flush().catch((t=>this.kf(t))),this.tf&&this.tf.flush().catch((t=>this.kf(t))))}kf(t){gk(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Os&&this.zc&&!this.Uc&&!this.Wc){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.ff();var e=t.loadExternalDependency;if(!e)return this.A.error(Us),void this.ff();this.Wc=!0;try{e(this._instance,"logs",(e=>{if(this.Wc=!1,!this.Os&&this.zc){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.ff();else{var r,n,s=this.bf();this.pf=i.initializeLogs(null!==(r=this.Ns)&&void 0!==r?r:this._instance),this.Uc=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Ns)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.Wc=!1,t}}}if(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===C.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===C.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},hs:t=>this.hs(t),getLibraryId:()=>Gi.LIB_NAME,getLibraryVersion:()=>Gi.LIB_VERSION}}hs(t){return new Promise((e=>{if(pr(this._d,3))e({kind:"fatal",error:pk(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:pk(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Sf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.xf(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:pk(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)})}}})}}))}xf(t){(0!==t||this._instance.__loaded)&&(this._d=gr(t,this._d,3,(()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}wf(t){this.bo.length>0&&this.Cf(t,this.bo,this.af,Gi.LIB_NAME,(t=>{this.bo=t})),this.Gc.length>0&&this.Cf(t,this.Gc,this.hf,ck,(t=>{this.Gc=t}))}Cf(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=ji(s,qi(i,Gi.LIB_NAME,Gi.LIB_VERSION),r,Gi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Sf(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Sf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}rf(){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,z(n)||(e.sessionStartTimestamp=n),z(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}}},Ek={metrics:class{constructor(t){this.A=Ji("[metrics]"),this._instance=t}initialize(){}nf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Xc&&this.sf===i||(null==(e=this.Xc)||e.reset(),this.sf=i,this.Xc=new Wi(this.if(),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.Xc}count(t,e,i){void 0===e&&(e=1),this.nf().count(t,e,i)}gauge(t,e,i){this.nf().gauge(t,e,i)}histogram(t,e,i){this.nf().histogram(t,e,i)}flush(t){if(!this.Xc)return Promise.resolve();if(t){var e=this.Xc.drainWindow();return e&&this.Ms(e,t),Promise.resolve()}return this.Xc.flush().catch((t=>this.A.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Xc)||t.reset()}if(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ms:t=>e.Ms(t),getLibraryId:()=>Gi.LIB_NAME,getLibraryVersion:()=>Gi.LIB_VERSION}}Ms(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.Tf(),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)})}}}))}))}Tf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Rk=p({},mk,yk,bk,_k,wk,kk,xk,Sk,Ck,Tk,Mk,Ik,Ek);ww.__defaultExtensionClasses=p({},Rk),function(){Gi.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||O(e._i)){var i=nw[fw]=new ww;if(e){var n=[];Yi(e._i,(function(t){if(t&&O(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,pw=!1,Yi(nw,(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")}()}}()}();
1
+ !function(){"use strict";var t="u">typeof window?window:void 0,e="u">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=["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"],_=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return b.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function w(t,e){return-1!==t.indexOf(e)}var k=function(t){return t.trim()},S=function(t){return t.replace(/^\$/,"")};function x(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 C=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}({}),T=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),M="min_length",I="max_length",E=["$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"],R=["token"],P=Object.prototype,A=P.hasOwnProperty,F=P.toString,O=Array.isArray||function(t){return"[object Array]"===F.call(t)},L=t=>"function"==typeof t,D=t=>t===Object(t)&&!O(t),N=t=>{if(D(t)){for(var e in t)if(A.call(t,e))return!1;return!0}return!1},q=t=>void 0===t,j=t=>"[object String]"==F.call(t),B=t=>j(t)&&0===t.trim().length,H=t=>null===t,z=t=>q(t)||H(t),U=t=>"[object Number]"==F.call(t)&&t==t,W=t=>U(t)&&t>0,V=t=>"[object Boolean]"===F.call(t),G=t=>t instanceof FormData,Z=t=>w(E,t),Q=t=>w(R,t);function J(t){return null===t||"object"!=typeof t}function K(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Y(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 tt(t,Error)}}function X(t){return"u">typeof Event&&tt(t,Event)}function tt(t,e){try{return t instanceof e}catch(t){return!1}}var et=[!0,"true",1,"1","yes"],it=t=>w(et,t),rt=[!1,"false",0,"0","no"];function nt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),U(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),nt(null!=n?n:i,e,i,r))}class st{constructor(t){this.C={},this.I=t.I,this.R=nt(t.bucketSize,0,100,t.A),this.O=nt(t.refillRate,0,this.R,t.A),this.N=nt(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 at="Mobile",ot="iOS",lt="Android",ut="Tablet",ht=lt+" "+ut,dt="iPad",vt="Apple",ct=vt+" Watch",ft="Safari",pt="BlackBerry",gt="Samsung",mt=gt+"Browser",yt=gt+" Internet",bt="Chrome",_t=bt+" OS",wt=bt+" "+ot,kt="Internet Explorer",St=kt+" "+at,xt="Opera",Ct=xt+" Mini",Tt="Edge",Mt="Microsoft "+Tt,It="Firefox",Et=It+" "+ot,Rt="Nintendo",Pt="PlayStation",At="Xbox",Ft=lt+" "+at,Ot=at+" "+ft,Lt="Windows",Dt=Lt+" Phone",$t="Nokia",Nt="Ouya",qt="Generic",jt=qt+" "+at.toLowerCase(),Bt=qt+" "+ut.toLowerCase(),Ht="Konqueror",zt="Oculus Browser",Ut="Vivaldi",Wt="Yandex",Vt="Whale",Gt="DuckDuckGo",Zt="Pale Moon",Qt="Waterfox",Jt="Brave",Kt="Claude",Yt="Codex",Xt="ChatGPT",te="Google Search App",ee="(\\d+(\\.\\d+)?)",ie=new RegExp("Version/"+ee),re=new RegExp("("+Kt+"|"+Yt+"|"+Xt+")\\/"+ee),ne=new RegExp(At,"i"),se=new RegExp(Pt+" \\w+","i"),ae=new RegExp(Rt+" \\w+","i"),oe=new RegExp(pt+"|PlayBook|BB10","i"),le={"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"},ue=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Jt:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&w(t,"GSA/")?te:w(t," OPR/")&&w(t,"Mini")?Ct:w(t," OPR/")?xt:oe.test(t)?pt:w(t,"IE"+at)||w(t,"WPDesktop")?St:w(t,"OculusBrowser")?zt:w(t,mt)?yt:w(t,Tt)||w(t,"Edg/")?Mt:w(t,Ut+"/")?Ut:w(t,"YaBrowser/")?Wt:w(t,Vt+"/")?Vt:w(t,Gt+"/")||w(t,"Ddg/")?Gt:w(t,Kt+"/")?Kt:w(t,Yt+"/")?Yt:w(t,Xt+"/")?Xt:w(t,"FBIOS")?"Facebook "+at:w(t,"UCWEB")||w(t,"UCBrowser")?"UC Browser":w(t,"CriOS")?wt:w(t,"CrMo")||w(t,bt)?bt:w(t,lt)&&w(t,ft)?Ft:w(t,"FxiOS")?Et:w(t.toLowerCase(),Ht.toLowerCase())?Ht:w(t,Jt+"/")?Jt:((t,e)=>e&&w(e,vt)||function(t){return w(t,ft)&&!w(t,bt)&&!w(t,lt)}(t))(t,e)?w(t,at)?Ot:ft:w(t,"PaleMoon/")?Zt:w(t,Qt+"/")?Qt:w(t,It)?It:w(t,"MSIE")||w(t,"Trident/")?kt:w(t,"Gecko")?It:"")},he={[St]:[new RegExp("rv:"+ee)],[Mt]:[new RegExp(Tt+"?\\/"+ee)],[bt]:[new RegExp("("+bt+"|CrMo)\\/"+ee)],[wt]:[new RegExp("CriOS\\/"+ee)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ee)],[ft]:[ie],[Ot]:[ie],[xt]:[new RegExp("(Opera|OPR)\\/"+ee)],[It]:[new RegExp(It+"\\/"+ee)],[Et]:[new RegExp("FxiOS\\/"+ee)],[Ht]:[new RegExp("Konqueror[:/]?"+ee,"i")],[pt]:[new RegExp(pt+" "+ee),ie],[Ft]:[new RegExp("android\\s"+ee,"i")],[yt]:[new RegExp(mt+"\\/"+ee)],[zt]:[new RegExp("OculusBrowser\\/"+ee)],[Ut]:[new RegExp(Ut+"\\/"+ee)],[Wt]:[new RegExp("YaBrowser\\/"+ee)],[Vt]:[new RegExp(Vt+"\\/"+ee)],[Jt]:[new RegExp(Jt+"\\/"+ee)],[Kt]:[re],[Yt]:[re],[Xt]:[re],[Gt]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ee)],[Zt]:[new RegExp("PaleMoon\\/"+ee)],[Qt]:[new RegExp(Qt+"\\/"+ee)],[te]:[new RegExp("GSA\\/"+ee)],[kt]:[new RegExp("(rv:|MSIE )"+ee)],Mozilla:[new RegExp("rv:"+ee)]},de=function(t,e,i,r){var n=ue(t,e,i,r),s=he[n];if(q(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},ve=[[new RegExp(At+"; "+At+" (.*?)[);]","i"),t=>[At,t&&t[1]||""]],[new RegExp(Rt,"i"),[Rt,""]],[new RegExp(Pt,"i"),[Pt,""]],[oe,[pt,""]],[new RegExp(Lt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Dt,""];if(new RegExp(at).test(e)&&!/IEMobile\b/.test(e))return[Lt+" "+at,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=le[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Lt,r]}return[Lt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[ot,[t[3],t[4],t[5]||"0"].join(".")]:[ot,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=q(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+lt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+lt+")","i"),t=>t&&t[2]?[lt,[t[2],t[3],t[4]||"0"].join(".")]:[lt,""]],[/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/,[_t,""]],[/Linux|debian/i,["Linux",""]]],ce=function(t){for(var e=0;ve.length>e;e++){var i=ve[e],r=i[1],n=i[0].exec(t),s=n&&(L(r)?r(n,t):r);if(s)return s}return["",""]},fe=function(t){return ae.test(t)?Rt:se.test(t)?Pt:ne.test(t)?At:new RegExp(Nt,"i").test(t)?Nt:new RegExp("("+Dt+"|WPDesktop)","i").test(t)?Dt:/iPad/.test(t)?dt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ct:oe.test(t)?pt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp($t,"i").test(t)?$t:/(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(at).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)?lt:ht:new RegExp("(pda|"+at+")","i").test(t)?jt:new RegExp(ut,"i").test(t)&&!new RegExp(ut+" pc","i").test(t)?Bt:""},pe=function(t,e){var i,r,n,s,a=fe(t);return a===dt||a===ht||"Kobo"===a||"Kindle Fire"===a||a===Bt?ut:a===Rt||a===At||a===Pt||a===Nt?"Console":a===ct?"Wearable":a?at:"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)?at:ut:"Desktop"},ge=20,me=1e3,ye=1e4,be="[Circular]",_e="[Truncated]",we="[Unserializable]",ke="[Function]";function Se(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 xe,Ce,Te,Me=/^[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)&&Me.test(i)?t:e();var i}function Ee(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)}function Oe(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return Te&&i.length===Ce||(Ce=i.length,Te=i.reduce(((i,r)=>{xe||(xe={});var n=xe[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,xe[r]=[l,u];break}}return i}),{})),Te}}class Le{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&&O(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:Oe(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 De="?";function $e(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?De:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return q(r)||(s.lineno=r),q(n)||(s.colno=n),s}var Ne=(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]:De,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},qe=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,je=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Be=/\((\S*)(?::(\d+))(?::(\d+))\)/,He=(t,e)=>{var i=qe.exec(t);if(i)return $e(e,i[1],De,+i[2],+i[3]);var r=je.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=Be.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=Ne(r[1]||De,r[2]);return $e(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},ze=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ue=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,We=(t,e)=>{var i=ze.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=Ue.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]||De,a=Ne(s,n);return $e(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Ve=/\(error: (.*)\)/,Ge=50;class Ze{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=j(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 K(t,"DOMException")}isDOMError(t){return K(t,"DOMError")}}class Qe{match(t){return Y(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 Je{match(t){return!!K(t,"ErrorEvent")&&(null!=t.error||this.Vi(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.Zi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Vi(t){return j(t.message)&&t.message.length>0}Zi(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(j(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Ke=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ye{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(Ke);return r&&(e=r[1],i=r[2]),[e,i]}}var Xe=["fatal","error","warning","log","info","debug"];function ti(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 ei{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(X(t))return t.constructor.name;var e="name"in t?t.name:void 0;return j(e)&&!B(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: "+ti(t)}isSeverityLevel(t){return j(t)&&!B(t)&&Xe.indexOf(t)>=0}getStack(t){try{return j(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:j(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(Y(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class ii{match(t){return X(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ti(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class ri{match(t){return J(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 ni{match(t){return K(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!X(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 J(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 si="$message",ai="$timestamp",oi=new Set([si,ai]),li={enabled:!0,max_bytes:32768};function ui(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:li.enabled,max_bytes:di(t.max_bytes,li.max_bytes)}:p({},li)}class hi{constructor(t){this.Pn=[],this.Fn=0,this.mn=ui(t)}setConfig(t){this.mn=ui(t),this.$n()}add(t){var e=function(t){var e;try{e=x(t)}catch(t){return}try{var i=JSON.parse(e);if(!D(i))return;var r=i,n=r[si],s=r[ai];if(!j(n)||0===n.trim().length)return;if(!j(s)&&!U(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.mn.max_bytes||(this.Pn.push({step:e.step,bytes:i}),this.Fn+=i,this.$n())}}getAttachable(){return this.Pn.map((t=>t.step))}clear(){this.Pn=[],this.Fn=0}size(){return this.Pn.length}$n(){for(;this.Fn>this.mn.max_bytes&&this.Pn.length>0;){var t=this.Pn.shift();t&&(this.Fn-=t.bytes)}}}function di(t,e){if(!U(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var vi=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function ci(t){return"string"==typeof t||t}function fi(t){return"string"==typeof t?t:void 0}var pi,gi=["$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"],mi="NativeGzipValidationError",yi=t=>t.length>=2&&31===t[0]&&139===t[1],bi=(t,e)=>t===T.GZipJS||e===T.GZipJS||"gzip"===e,_i=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),wi=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return _i(t)||e===mi},ki=t=>{throw Ee(mi,"Native gzip produced invalid output: "+t)},Si=function(){var t=f((function*(t,e){18>t.size&&ki("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());yi(i)&&8===i[2]||ki("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(pi)return pi;pi=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;pi[t]=e>>>0}return pi})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&ki("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&ki("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function xi(t,e,i){return Ci.apply(this,arguments)}function Ci(){return Ci=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 Si(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),Ci.apply(this,arguments)}var Ti=0x8000000000000000,Mi="9223372036854775808",Ii={}.propertyIsEnumerable;function Ei(t,e){try{return Ai(t,e,{ancestors:new WeakSet,remainingNodes:ye},0)}catch(t){return[]}}function Ri(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:_e};if(i.remainingNodes--,V(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt(Mi);return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=Ti||-Ti>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:Se(t)};if("function"==typeof t)return{stringValue:ke};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:be};if(r>=ge)return{stringValue:_e};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?Se(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return Ri(o.call(t),e,i,r+1)}catch(t){}return O(t)?{arrayValue:{values:Pi(t,e,i,r+1)}}:{kvlistValue:{values:Ai(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:Se(String(t))}}function Pi(t,e,i,r){for(var n=[],s=Math.min(t.length,me),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(z(o))continue;n.push(Ri(o,e,i,r))}catch(t){n.push({stringValue:we})}return t.length>a&&n.push({stringValue:_e}),n}function Ai(t,e,i,r){var n=[];for(var s in t)if(Ii.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=me||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(H(a)||q(a))continue;n.push({key:Se(s),value:Ri(a,e,i,r)})}catch(t){n.push({key:Se(s),value:{stringValue:we}})}}return n}function Fi(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 Oi={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var Li={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}},Di=Li.info;function $i(t){try{return Se(String(t))}catch(t){return we}}function Ni(t,e,i,r){var n,s=Li[t.level||"info"]||Di,a=s.text,o=s.number,l=(void 0===(n=U(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),z(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),z(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=we}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:$i(t.body)},attributes:Ei(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),q(t.trace_flags)||(g.flags=t.trace_flags),g}function qi(t,e,i){return Fi(t,e,i)}function ji(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ei(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Bi=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.mn=e,this.A=i,this.Nn=r,this.qn=n,this.jn=s,this.Bn=a,this.Hn=null,this.zn=0,this.Un=0,this.Wn=0,this.Vn=0,this.Gn=0,this.Zn=!1,this.Qn=e.maxBufferSize,this.Jn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.Kn=e.flushIntervalMs,this.Yn=e.maxBatchRecordsPerPost,this.Xn=e.rateCapWindowMs,this.ts=e.maxLogsPerInterval}clearQueue(){this.Un++,this._instance.setPersistedProperty(C.LogsQueue,[])}reset(){this.es(),this.Vn=0,this.Gn=0,this.Zn=!1,this.Wn=0,this.Yn=this.mn.maxBatchRecordsPerPost}onReconnect(){this.Wn=0,this.rs()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.ns(t);if(null!==r)if(r.body){if(this.ss()){var n={record:Ni(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Nn(),this.A,null==e?void 0:e.occurredAtMs)};this.qn((()=>this.os(n)))}}else this.A.info("Log was rejected in beforeSend function")}}ns(t){var e=this.mn.beforeSend;if(!e)return t;var i=O(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}ss(){if(void 0===this.ts)return!0;var t=Date.now(),e=t-this.Vn;return this.Xn>e&&e>=0||(this.Vn=t,this.Gn=0,this.Zn=!1),this.ts>this.Gn?(this.Gn++,!0):(this.Zn||(this.A.warn("captureLog dropping logs: exceeded "+this.ts+" logs per "+this.Xn+"ms"),this.Zn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.Hn||(t.Hn=t.ls().finally((()=>{t.Hn=null}))),t.Hn}))()}ls(){var t=this;return f((function*(){var e;t.es();var i=null!==(e=t._instance.getPersistedProperty(C.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.Un;t.zn=0;var l=Math.min(i.length,t.Yn),u=i.slice(0,l),h=u.map((t=>t.record)),d=ji(h,t.us(),null!==(s=t.Bn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.hs(d);if(t.Un!==o)return;if("too-large"===v.kind&&u.length>1)t.Yn=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.Yn);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.mn.maxBatchRecordsPerPost>t.Yn&&(t.Yn=Math.min(t.mn.maxBatchRecordsPerPost,t.Yn+1)),yield t.ds(u.length),i=null!==(a=t._instance.getPersistedProperty(C.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}ds(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.zn),n=null!==(i=e._instance.getPersistedProperty(C.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(C.LogsQueue,n.slice(r)),yield e.jn()}))()}us(){return qi(this.mn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}os(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(C.LogsQueue))&&void 0!==e?e:[];this.Jn>i.length||(i.shift(),this.zn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(C.LogsQueue,i),this.Qn>i.length?this.vs():this.rs()}}vs(t){void 0===t&&(t=this.Kn),this.cs||(this.cs=Pe((()=>{this.cs=void 0,this.rs()}),t))}fs(){var t=Math.min(Math.max(0,this.Wn-1),6);return this.Kn*Math.pow(2,t)}ps(){var t=this._instance.getPersistedProperty(C.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.es();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((()=>{}))}))}))()}rs(){this.flush().then((()=>{this.Wn=0}),(t=>{this.Wn++,this.A.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.ps()&&this.vs(this.fs())}))}es(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};var Hi=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function zi(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 Wi=class{constructor(t,e,i){this._instance=t,this.mn=e,this.A=i,this.gs=new Map,this.Hn=null,this.ys=!1,this.bs=new Map,this._s=new Set,this.ws=0}count(t,e,i){void 0===e&&(e=1),this.ks({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.ks({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.ks({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.Hn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.Ss()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.Hn===r&&(this.Hn=null)}));return this.Hn=r,r}drainWindow(){if(0===this.gs.size)return null;var t=this.gs;return this.gs=new Map,this.ys=!1,this.bs=new Map,this._s=new Set,this.xs(t)}reset(){this.ws++,this.es(),this.gs=new Map,this.Hn=null,this.ys=!1,this.bs=new Map,this._s=new Set}ks(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.ns(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.gs.get(r);if(!n){if(!this.Cs())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.gs.set(r,n)}var s=this.bs.get(e.name);void 0===s?this.bs.set(e.name,e.type):s===e.type||this._s.has(e.name)||(this._s.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.Ts(n,e.value),this.vs()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Cs(){return this.mn.maxSeriesPerFlush>this.gs.size||(this.ys||(this.ys=!0,this.A.warn("Metric series cap reached ("+this.mn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ts(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(Hi.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,Hi)]+=1}}ns(t){var e=this.mn.beforeSend;if(!e)return t;var i=O(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}vs(){this.cs||(this.cs=Pe((()=>{this.cs=void 0,this.flush().catch((t=>{this.A.error("Metrics flush failed:",t)}))}),this.mn.flushIntervalMs))}es(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}Ss(){var t=this;return f((function*(){if(0!==t.gs.size){var e=t.gs;t.gs=new Map,t.ys=!1,t.bs=new Map,t._s=new Set;var i=t.ws,r=yield t._instance.Ms(t.xs(e));if(i===t.ws)switch(r.kind){case"ok":return;case"retry-later":return t.Is(e),void t.vs();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)}}}))()}xs(t){return e=this.Es(t),i=function(t,e,i){return Fi(t,e,i)}(this.mn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ei(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Es(t){var e=zi(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=Ei(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),l=zi(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:Hi})}return Array.from(i.values())}Is(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.gs.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.Cs()&&this.gs.set(n,s)}}};function Vi(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var Gi={DEBUG:!1,LIB_VERSION:"0.7.2",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)&&!q(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){O(t)&&t.forEach(e)}function Yi(t,e){if(!z(t))if(O(t))t.forEach(e);else if(G(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)A.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){(j(t)&&t.length>0||U(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(!j(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 x(t)}},hr=t=>{var e=null==r?void 0:r.createElement("a");return q(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){q(t)||q(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(!O(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("=");O(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(!L(r))return e;try{var n=r(e);return j(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 q(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 Ir=1e3;function Er(t){return t?k(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 Er(e)}function Ar(t){return z(t)?null:k(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:"")})),k(e)}function Or(t){var e;return q(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(q(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(V(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")?w(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||q(t))return!1;var i;if(!0===t)i=qr;else{if(!O(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++>=Ir||e.has(r))return!1;e.add(r);var n=Pr(r);if(w(n,"ph-sensitive")||w(n,"ph-no-capture"))return!1}if(w(Pr(t),"ph-include"))return!0;var s=t.type||"";if(j(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!j(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),z(t))return!1;if(j(t)){t=k(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 O(e)?e:Er(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=>{z(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(z(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return j(n)&&(n=parseInt(n)),n>i?un+" "+r+" body too large to record ("+n+" bytes)":t}function _n(t,e){if(z(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="$fbc",In="$fbc_persistence",En="__timers",Rn="$autocapture_disabled_server_side",Pn="$heatmaps_enabled_server_side",An="$exception_capture_enabled_server_side",Fn="$error_tracking_suppression_rules",On="$error_tracking_capture_extension_exceptions",Ln="$web_vitals_enabled_server_side",Dn="$dead_clicks_enabled_server_side",$n="$product_tours_enabled_server_side",Nn="$logs_capture_enabled_server_side",qn="$web_vitals_allowed_metrics",jn="$session_recording_remote_config",Bn="$replay_sample_rate",Hn="$replay_override_sampling",zn="$replay_override_linked_flag",Un="$replay_override_url_trigger",Wn="$replay_override_event_trigger",Vn="$sesid",Gn="$session_is_sampled",Zn="$session_past_minimum_duration",Qn="$session_recording_url_trigger_activated_session",Jn="$session_recording_event_trigger_activated_session",Kn="$posthog_sr_group_event_trigger_",Yn="$posthog_sr_group_url_trigger_",Xn="$posthog_sr_group_sampling_",ts="$debug_first_full_snapshot_timestamp",es="$sess_rec_flush_size",is="$enabled_feature_flags",rs="$active_feature_flags",ns="$early_access_features",ss="$feature_flag_details",as="$feature_flag_payloads",os="$feature_flag_request_id",ls="$minimal_flag_called_events",us="$override_feature_flags",hs="$override_feature_flag_payloads",ds="$stored_person_properties",vs="$stored_group_properties",cs="$groups",fs="$surveys",ps="$surveys_loaded_at",gs="$surveys_activated",ms="$surveys_activated_session",ys="$surveys_activated_timestamps",bs="ph_product_tours",_s="$flag_call_reported",ws="$flag_call_reported_session_id",ks="$feature_flag_errors",Ss="$feature_flag_evaluated_at",xs="$user_state",Cs="$client_session_props",Ts="$capture_rate_limit",Ms="$initial_campaign_params",Is="$initial_referrer_info",Es="$initial_person_info",Rs="$epp",Ps="$posthog_cookieless",As="$cookieless_mode",Fs="$sdk_debug_extensions_init_method",Os="$sdk_debug_extensions_init_time_ms",Ls="$sdk_debug_recording_script_not_loaded",Ds="$sdk_debug_replay_event_trigger_status",$s="$sdk_debug_replay_linked_flag_trigger_status",Ns="$sdk_debug_replay_matched_recording_trigger_groups",qs="$sdk_debug_replay_pending_trigger_conditions",js="$sdk_debug_replay_remote_trigger_matching_config",Bs="$sdk_debug_replay_trigger_groups_count",Hs="$sdk_debug_replay_url_trigger_status",zs="$session_recording_start_reason",Us="PostHog loadExternalDependency extension not found.",Ws="on_reject",Vs="always",Gs="anonymous",Zs="identified",Qs="identified_only",Js="visibilitychange",Ks="beforeunload",Ys="$pageview",Xs="$pageleave",ta="$identify",ea="$groupidentify",ia="disabled",ra="sampled",na="active",sa="buffering",aa="paused",oa="lazy_loading",la="awaiting_config",ua="missing_config",ha="rrweb_error",da="trigger",va=da+"_activated",ca=da+"_pending",fa=da+"_"+ia;function pa(t,e,i,r,n,s){return 0===e?fa:(null==t?void 0:t.get_property(i?r+i:n))===s?va:ca}function ga(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 ma(t){return t.includes(va)?va:t.includes(ca)?ca:fa}function ya(t){var e=new Set(t);switch(e.delete(fa),e.size){case 0:return fa;case 1:return Array.from(e)[0];default:return ca}}class ba{constructor(t){this.j=t}triggerStatus(t){return ma(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return ma(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class _a{constructor(t){this.j=t}triggerStatus(t){return ya(this.j.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return ya(this.j.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.j.forEach((t=>t.stop()))}}class wa{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return va}stop(){}}var ka=t=>"sessionRecording"in t;class Sa{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=(ka(t)?D(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(ka(t)?D(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 pa(this._instance,this.B.length,this.V,Yn,Qn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Hs]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=yr(this._instance);if(!t)return!1;try{return ga(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=ga(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=ga(n,this.H,this.U);a&&!s?t():!a&&s&&e();var o=this.G(r)===va,l=ga(n,this.B,this.$);!o&&l&&i("url",n)}}stop(){this.W=""}}class xa{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[$s]:t}),t}triggerStatusNoSideEffects(){var t=ca;return z(this.linkedFlag)&&(t=fa),this.linkedFlagSeen&&(t=va),t}onConfig(t,e){var i;if(this.linkedFlag=(ka(t)?D(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!z(this.linkedFlag)&&!this.linkedFlagSeen){var r=j(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=j(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(D(i)&&r in i){var a=i[r];s=V(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 Ca{constructor(t,e){this.Y=[],this._instance=t,this.V=e}onConfig(t){var e;this.Y=(ka(t)?D(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}K(t){return pa(this._instance,this.Y.length,this.V,Kn,Jn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Ds]:e}),e}triggerStatusNoSideEffects(t){return this.K(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Y.length){var r=this.K(i)===va,n=this.Y.includes(t);!r&&n&&e("event",t)}}stop(){}}class Ta{constructor(t,e,i){if(this._instance=t,this.group=e,this.X=new Sa(t,e.id),this.ee=new Ca(t,e.id),this.te=new xa(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 ba(s):new _a(s)}else this.re=new wa}triggerStatus(t){return this.re.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.re.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==ca?[]:[{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===ca)).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?Yn+this.group.id:Kn+this.group.id]:e})}stop(){this.X.stop(),this.ee.stop(),this.te.stop()}}function Ma(t){if(t.rrwebError)return ha;if(!t.receivedFlags)return sa;if(!t.isRecordingEnabled)return ia;if(t.urlTriggerMatching.urlBlocked)return aa;var e=!0===t.isSampled,i=new ba([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ra:i===va?na:i===ca?sa:!1===t.isSampled?ia:na}function Ia(t){if(t.rrwebError)return ha;if(!t.receivedFlags)return sa;if(!t.isRecordingEnabled)return ia;if(t.urlTriggerMatching.urlBlocked)return aa;var e=new _a([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==fa,r=V(t.isSampled);return i&&e===ca?sa:i&&e===fa||r&&!t.isSampled?ia:!0===t.isSampled?ra:na}function Ea(){var t=[];return function(e,i){if(D(i)||O(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Ra(t){var e=JSON.stringify(t,Ea());return e?new Blob([e]).size:0}function Pa(t){if(H(t))return 4;if(q(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(O(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=q(r)||H(r)?4:Pa(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];q(l)||(a||(s+=1),a=!1,s+=o.length+3+Pa(l))}return s;default:return 0}}function Aa(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[Aa({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Aa({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 Fa=Uint8Array,Oa=Uint16Array,La=Uint32Array,Da=new Fa([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]),$a=new Fa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Na=new Fa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qa=function(t,e){for(var i=new Oa(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new La(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]},ja=qa(Da,2),Ba=ja[1];ja[0][28]=258,Ba[258]=28;for(var Ha=qa($a,0)[1],za=new Oa(32768),Ua=0;32768>Ua;++Ua){var Wa=(43690&Ua)>>>1|(21845&Ua)<<1;za[Ua]=((65280&(Wa=(61680&(Wa=(52428&Wa)>>>2|(13107&Wa)<<2))>>>4|(3855&Wa)<<4))>>>8|(255&Wa)<<8)>>>1}var Va=function(t,e,i){for(var r=t.length,n=0,s=new Oa(e);r>n;++n)++s[t[n]-1];var a,o=new Oa(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new Oa(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[za[d]>>>l]=u}else for(a=new Oa(r),n=0;r>n;++n)a[n]=za[o[t[n]-1]++]>>>15-t[n];return a},Ga=new Fa(288);for(Ua=0;144>Ua;++Ua)Ga[Ua]=8;for(Ua=144;256>Ua;++Ua)Ga[Ua]=9;for(Ua=256;280>Ua;++Ua)Ga[Ua]=7;for(Ua=280;288>Ua;++Ua)Ga[Ua]=8;var Za=new Fa(32);for(Ua=0;32>Ua;++Ua)Za[Ua]=5;var Qa=Va(Ga,9,0),Ja=Va(Za,5,0),Ka=function(t){return(t/8>>0)+(7&t&&1)},Ya=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Oa?Oa:t instanceof La?La:Fa)(i-e);return r.set(t.subarray(e,i)),r},Xa=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},to=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},eo=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 Fa(0),0];if(1==n){var a=new Fa(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 Oa(v+1),f=io(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 Fa(c),f]},io=function(t,e,i){return-1==t.s?Math.max(io(t.l,e,i+1),io(t.r,e,i+1)):e[t.s]=i},ro=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Oa(++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]},no=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},so=function(t,e,i){var r=i.length,n=Ka(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)},ao=function(t,e,i,r,n,s,a,o,l,u,h){Xa(e,h++,i),++n[256];for(var d=eo(n,15),v=d[0],c=d[1],f=eo(s,15),p=f[0],g=f[1],m=ro(v),y=m[0],b=m[1],_=ro(p),w=_[0],k=_[1],S=new Oa(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=eo(S,7),T=C[0],M=C[1],I=19;I>4&&!T[Na[I-1]];--I);var E,R,P,A,F=u+5<<3,O=no(n,Ga)+no(s,Za)+a,L=no(n,v)+no(s,p)+a+14+3*I+no(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return so(e,h,t.subarray(l,l+u));if(Xa(e,h,1+(O>L)),h+=2,O>L){E=Va(v,c,0),R=v,P=Va(p,g,0),A=p;var D=Va(T,M,0);for(Xa(e,h,b-257),Xa(e,h+5,k-1),Xa(e,h+10,I-4),h+=14,x=0;I>x;++x)Xa(e,h+3*x,T[Na[x]]);h+=3*I;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Xa(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Xa(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=Qa,R=Ga,P=Ja,A=Za;for(x=0;o>x;++x)if(r[x]>255){var B;to(e,h,E[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Xa(e,h,r[x]>>>23&31),h+=Da[B]);var H=31&r[x];to(e,h,P[H]),h+=A[H],H>3&&(to(e,h,r[x]>>>5&8191),h+=$a[H])}else to(e,h,E[r[x]]),h+=R[r[x]];return to(e,h,E[256]),h+R[256]},oo=new La([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lo=function(){for(var t=new La(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),uo=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=lo[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},ho=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Fa(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=so(l,u,t.subarray(h,d)):(l[h]=true,u=so(l,u,t.subarray(h,a)))}else{for(var v=oo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Oa(32768),m=new Oa(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 La(25e3),k=new Oa(288),S=new Oa(32),x=0,C=0,T=(h=0,0),M=0,I=0;a>h;++h){var E=_(h),R=32767&h,P=m[E];if(g[R]=P,m[E]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=ao(t,l,0,w,k,S,C,T,I,h-I,u),T=x=C=0,I=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&E==_(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|Ba[O]<<18|Ha[L];var G=31&Ba[O],Z=31&Ha[L];C+=Da[G]+$a[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=ao(t,l,true,w,k,S,C,T,I,h-I,u)}return Ya(o,0,r+Ka(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)},vo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},co=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&&vo(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)}},fo=function(t){return 10+(t.filename&&t.filename.length+1||0)};function po(t,e){void 0===e&&(e={});var i=uo(),r=t.length;i.p(t);var n=ho(t,e,fo(e),8),s=n.length;return co(n,e),vo(n,s-8,i.d()),vo(n,s-4,r),n}function go(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Fa(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 Fa(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 Ya(r,0,n)}function mo(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class yo{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=Pa(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 st({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=U(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.426.3",Gi.LIB_NAME="web";class bo{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(es,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.we(es);return D(e=i)&&j(e.sessionId)&&U(e.size)&&i.sessionId===t?i.size:0}}function _o(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<nt(100*e,0,100,Qi)}function wo(t){return"$survey_response_"+t}function ko(t,e){if(!e)return null;var i=t[wo(e)];return O(i)?[...i]:i}function So(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!q(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=ko(t,e.id);q(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:ko(t,e.id)}}))},t,r)}function xo(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 Co(t){return"string"==typeof t&&t.trim()?t.trim():null}function To(t){return t.toLowerCase()}function Mo(t,e,i){if(!t||!e)return null;var r=To(e),n=Object.keys(t).find((t=>To(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=>To(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var Io=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Eo(t,e,i){var r,n=Mo(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),q(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of Io){var d=l[h];q(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return Io.some((e=>!q(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=Mo(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 q(s.question)||(a.question=s.question,o=!0),q(s.description)||(a.description=s.description,o=!0),q(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!q(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!q(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!q(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return O(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 Ro(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Po(t){var e;return Ro(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ao=(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}},Fo=t=>t.toLowerCase(),Oo={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=>Ao(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ao(e,t))))),icontains:(t,e)=>e.map(Fo).some((e=>t.map(Fo).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Fo).every((e=>t.map(Fo).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 Lo(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=Oo[i.operator];return!!n&&n(i.values,[String(r)])}))}function Do(t,e,i){return ur({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var $o=new Set(["is_not","not_icontains","not_regex"]);function No(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(q(n)||H(n))return $o.has(s);var a=Oo[s];return!!a&&!q(t.value)&&!H(t.value)&&a(O(t.value)?t.value.map(String):[String(t.value)],O(n)?n.map(String):[String(n)])}))}var qo=Ji("[SessionRecording]");function jo(t,e){return e?t:"!"+t}function Bo(t,e){return t===e||t!=="!"+e&&null}class Ho{constructor(t,e,i,r,n,s,a){this._e=null,this.Se=Ia,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=U(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Te=new ba([this.ee,this.X]),this.Se=Ma):(this.Te=new _a([this.ee,this.X]),this.Se=Ia),this._instance.register_for_session({[js]: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 U(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&&z(this.Ie))return this.Ie=t((t=>{try{this.ee.checkEventTriggerConditions(t.event,i,e)}catch(t){qo.error("Could not activate event trigger",t)}})),this.Ie}makeSamplingDecisions(t){var e,i,r,n=this._e;if(!U(n))return null==(i=this._instance.persistence)||i.unregister(Gn),void(null==(r=this._instance.persistence)||r.unregister(Bn));var s=this._instance.get_property(Gn),a=this._instance.get_property(Bn),o=Bo(s,t),l=U(a)&&a!==n,u=q(a)&&s===t,h=l||u||!V(o),d=h?_o(t,n):o;h&&(d?this.xe("sampled"):qo.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Gn]:jo(t,d),[Bn]:H(a)&&s===t?null:n})}ensureSamplingDecision(t){if(U(this._e)){var e=this._instance.get_property(Gn);V(Bo(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Jn),null==(e=this._instance.persistence)||e.unregister(Qn),null==(i=this._instance.persistence)||i.unregister(Gn),null==(r=this._instance.persistence)||r.unregister(Bn),null==(n=this._instance.persistence)||n.unregister(Zn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Te)?void 0:e.triggerStatus(t))===ca}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===ca)).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 zo{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({[js]:"v2_trigger_groups",[Bs]:t.triggerGroups.length}),this.X.onConfig(t)):qo.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ha;if(t.urlTriggerMatching.urlBlocked)return aa;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return ia;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===va){var o=s.group.id,l=i.get(o);q(l)?Qi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===ca&&(r=!0)}return n?ra:r?sa:ia}({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;U(r)&&(H(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 qo.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(ds),o=s.some((e=>!e.properties||0===e.properties.length||No(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){qo.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=Xn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(D(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=U(c)&&c!==s,l=v===t&&U(c)&&c===s&&V(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!V(l),g=p?_o(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(Gn),null==(e=this._instance.persistence)||e.unregister(Bn),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(Kn+o),null==(s=this._instance.persistence)||s.unregister(Yn+o),null==(a=this._instance.persistence)||a.unregister(Xn+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({[Ns]:e})}hasPendingTriggers(t){for(var e of this.Re)if(e.triggerStatus(t)===ca)return!0;return!1}getPendingTriggerConditions(t){return this.Re.flatMap((e=>e.triggerStatusNoSideEffects(t)!==ca?[]: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||No(i,e,this._instance.get_property(ds))}Oe(t){var e=this;this.Re.forEach((t=>t.stop())),this.Re=[],this.Ae.clear();var i=function(t){var i=new Ta(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 Uo=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}},Wo="https?://(.*)",Vo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Go=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Vo],Zo="<masked>",Qo=["li_fat_id"];function Jo(t,e,i){if(!r)return{};var n,s=e?[...Vo,...i||[]]:[],a=Ko(cr(r.URL,s,Zo),t),o=(n={},Yi(Qo,(function(t){var e=Uo(t);n[t]=e||null})),n);return Xi(o,a)}function Ko(t,e){var i=Go.concat(e||[]),r={};return Yi(i,(function(e){var i=vr(t,e);r[e]=i||null})),r}function Yo(t){var e=function(t){return t?0===t.search(Wo+"google.([^/?]*)")?"google":0===t.search(Wo+"bing.com")?"bing":0===t.search(Wo+"yahoo.com")?"yahoo":0===t.search(Wo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!H(e)){n.$search_engine=e;var s=r?vr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Xo(){return navigator.language||navigator.userLanguage}var tl="$direct";function el(){return(null==r?void 0:r.referrer)||tl}function il(t,e,i){void 0===i&&(i=!1);var r=t?[...Vo,...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:el().substring(0,1e3),u:a?cr(a,r,Zo):void 0}}function rl(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==tl?tl: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=Ko(s);Xi(a,l)}if(r){var u=Yo(r);Xi(a,u)}return a}function nl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function sl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var al=1e5,ol="https://schema.org",ll=[],ul="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(" "),hl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),dl="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(" "),vl="Accommodation AdministrativeArea Country Place State".split(" "),cl={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:hl,publisher:dl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ll},Offer:{seller:dl},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:dl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:dl,areaServed:vl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ll}},fl={},pl=[[hl,fl],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),cl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),cl.Event],[dl,cl.Organization],[vl,cl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),cl.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),fl]],gl="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 ml(t,e){return A.call(t,e)?t[e]:void 0}function yl(t){var e=typeof t;return H(t)||"string"===e||"number"===e||"boolean"===e}function bl(t){return yl(t)||O(t)&&t.every(yl)?t:void 0}function _l(t){if(A.call(cl,t))return cl[t];for(var e of pl){var i=e[1];if(e[0].includes(t))return i}return gl.includes(t)?fl:void 0}function wl(t,e){if(!D(t))return null;var i=ml(t,"@type"),r=function(t){return("string"==typeof t?[t]:O(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!_l(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=bl(ml(t,"@id"));for(var a of(q(s)||(n["@id"]=s),ul)){var o=bl(ml(t,a));q(o)||(n[a]=o)}for(var l of r){var u=_l(l),h=function(){var e=ml(t,d),i=u[d];if(!0===i){var r=bl(e);q(r)||(n[d]=r)}else if(O(e)){var s=e.map((t=>wl(t,i))).filter(D);s.length&&(n[d]=s)}else{var a=wl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function kl(t){if(!D(t))return null;var e=ml(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=wl(t);if(i)return p({"@context":ol},i);var r=ml(t,"@graph");if(!O(r))return null;var n=r.map((t=>wl(t))).filter(D);return n.length?{"@context":ol,"@graph":n}:null}function Sl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function xl(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 Cl(t){return Sl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Sl)}function Tl(t){return q(t)?void 0:Math.round(t)}function Ml(t){return D(t)?t.network_timing:t}var Il,El,Rl=36e5,Pl=943718.4,Al="[SessionRecording]",Fl=Ji(Al),Ol=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Ll=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Dl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function $l(){var t;return null==(t=Dl())?void 0:t.record}function Nl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Ea())}}function ql(t){return mo(po(go(Nl(t))))}function jl(t){return Bl.apply(this,arguments)}function Bl(){return(Bl=f((function*(t){var e=Nl(t),i=yield xi(e,Gi.DEBUG,{rethrow:!0});return mo(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var Hl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,zl=!1;function Ul(t){return O(t)&&0===t.length?Il=null!=Il?Il:ql([]):ql(t)}function Wl(t){return Vl.apply(this,arguments)}function Vl(){return(Vl=f((function*(t){return O(t)&&0===t.length?Il||(El=null!=El?El:jl([]).then((t=>(Il=t,t))).catch((t=>{throw Il=void 0,El=void 0,t}))):jl(t)}))).apply(this,arguments)}function Gl(t){return Hl&&!zl&&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:Pa(t)}}function Ql(t,e){return p({},t,{data:e,cv:"2024-10"})}function Jl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Kl(t){try{if(t.type===m.FullSnapshot)return Zl(Ql(t,ql(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Zl(Jl(t,{texts:Ul(t.data.texts),attributes:Ul(t.data.attributes),removes:Ul(t.data.removes),adds:Ul(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Zl(Jl(t,{adds:t.data.adds?ql(t.data.adds):void 0,removes:t.data.removes?ql(t.data.removes):void 0}))}catch(t){Fl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ra(t)}}function Yl(){return Yl=f((function*(t){try{if(t.type===m.FullSnapshot)return Zl(Ql(t,yield jl(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([Wl(t.data.texts),Wl(t.data.attributes),Wl(t.data.removes),Wl(t.data.adds)]);return Zl(Jl(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?jl(t.data.adds):void 0,t.data.removes?jl(t.data.removes):void 0]);return Zl(Jl(t,{adds:i[0],removes:i[1]}))}}catch(e){return wi(e)&&(zl=!0),Fl.error("could not compress event asynchronously - trying synchronous compression",e),Kl(t)}return{event:t,size:Ra(t)}})),Yl.apply(this,arguments)}function Xl(t,e){return t.type===m.Custom&&t.data.tag===e}function tu(t){return Xl(t,"sessionIdle")}function eu(t){return Xl(t,"$session_ending")}function iu(t){return Xl(t,"$session_starting")}class ru{get sessionId(){return this.Pe}get Ne(){if(!this._instance.sessionManager)throw new Error(Al+" 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 Bo(this._instance.get_property(Gn),this.sessionId)}get _e(){var t,e=null==(t=this.je)?void 0:t.sampleRate;return U(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(ts),this.ot=!1,null==(n=Dl())||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=!1,this.Ot=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Zn])===this.Pe},this.Dt=()=>{var t,e;if(0===this.Pt.data.length)return null;var i=null==(t=this.Pt.data[0])?void 0:t.timestamp,r=null==(e=this.Pt.data[this.Pt.data.length-1])?void 0:e.timestamp;return U(i)&&U(r)?r-i:null},this.Nt=()=>{var t,e,i=this.Be;if(!U(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Ft;return U(r)&&r>=0&&i>r}if(this.Ot())return!1;var n,s=this.Dt();return!!H(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Zn]:this.Pe}),!1)},this.qt=()=>{this.status!==sa?(this.Xe&&this.et&&this.jt&&!this.tt&&(this.Xe=!1),this.Bt(),this.Ht()):this.$t()},this.Ut=()=>{this.qt()},this.zt=()=>{this.Le("browser offline",{})},this.Wt=()=>{this.Le("browser online",{})},this.Vt=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.jt=!0),this.Le("window "+r.visibilityState,{}))},this._instance=t,this.jt=null==e||e;var i=this.Ne.checkAndGetSessionAndWindowId(),n=i.windowId;this.Pe=i.sessionId,this.It=n,this.te=new xa(this._instance),this.X=new Sa(this._instance),this.ee=new Ca(this._instance),this.Pt=this.$t(),this.Ne.sessionTimeoutMs>this.Fe||Fl.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 bo(this._instance)}setDocumentWasEverVisible(t){t&&(this.jt=!0)}get Zt(){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 q(d)&&q(v)&&q(c)&&q(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Gt(){var t;if(!this.ut){var e=null==(t=this.je)?void 0:t.masking;if(!z(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!q(r)&&r!==n}));0!==r.length&&(this.ut=!0,Fl.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 Qt(){var t;return nt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Ji("canvas recording resolution scale"),1)}get Jt(){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:nt(h,0,12,Ji("canvas recording fps"),4),quality:nt(d,0,1,Ji("canvas recording quality"),.4)}}get Yt(){var t,e=!(null==(t=this.je)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Kt(){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=Ml(this._instance.config.capture_performance),l=Ml(null==r?void 0:r.capturePerformance),u=!!(V(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Xt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Yt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Kt&&L(s))if(!lr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=L(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=L(t.session_recording.maskNetworkRequestFn);return h&&L(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=L(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 z(n)&&r?(wn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!q(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.Kt,a)))}else Fl.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?Re(t):t}tr(t,e){void 0===e&&(e=!1);var i=e?Re(t):this.er(t),r=this._instance.config.mask_personal_data_properties?[...Vo,...this._instance.config.custom_personal_data_properties||[]]:[];return this.rr(cr(i,r,Zo))}rr(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}ir(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}):Fl.warn("could not emit queued rrweb event.",e,t),!1}}Le(t,e){return this.ir(Ll((()=>$l().addCustomEvent(t,e))))}nr(){var t;return this.ze&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.X.urlBlocked&&!0!==this.Ge}ar(t){if(!this.nr())return!1;try{var e=$l();return!!e&&(e.addCustomEvent("$json_ld",t),this.nr())}catch(t){return!1}}sr(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.ur)?void 0:e.scan(t)}))}lr(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.tr(e.origin+e.pathname+e.search);this.hr!==i&&(this.hr=i,this.Le("$url_changed",{href:i}))}catch(t){}}cr(){if(this.Ze.length){var t=[...this.Ze];this.Ze=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ir(t)}))}}Ce(){return this.ir(Ll((()=>$l().takeFullSnapshot())))}get dr(){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 U(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}vr(){if(this.pr&&clearInterval(this.pr),!0!==this.Ge){var t=this.dr;t&&(this.pr=setInterval((()=>{this.Ce()}),t))}}Me(t){"event"===t&&this.gr(),!this.X.urlBlocked&&["sampled","active"].includes(this.status)&&this.vr()}mr(){var t;this.X.urlBlocked||(this.X.urlBlocked=!0,null==(t=this.ur)||t.scan(),clearInterval(this.pr),Fl.info("recording paused due to URL blocker"),this.Le("recording paused",{reason:"url blocker"}))}yr(){var t;this.X.urlBlocked&&(null==(t=this.ur)||t.scan(),this.X.urlBlocked=!1,this.Ce(),this.sr(),this.vr(),this.Le("recording resumed",{reason:"left blocked url"}),Fl.info("recording resumed"))}br(t,e){var i;if("event"===t&&this.gr(),!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?Qn:Jn]:this.sessionId}),null==(n=this.He)||n.updateActiveTriggers(this.sessionId),this.Me(),this.Ht(),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(jn);if(t){var e;try{e=D(t)?t:JSON.parse(t)}catch(t){return void Fl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Lt){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>Rl)return Fl.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(jn))}return e}}wr(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.kr(),this.$t());var a=this.Ne.checkAndGetSessionAndWindowId(),o=a.windowId;this.Pe=a.sessionId,this.It=o,null==(i=this._instance.persistence)||i.unregister(ts),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 zo(this._instance,this.X,this.xe.bind(this),this.Le.bind(this),this.Me.bind(this)):new Ho(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.br(t,e))),this.wr(Hn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Hn)})),this.wr(zn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(zn)})),this.wr(Wn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Wn)})),this.wr(Un,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Un)})),this.He.makeSamplingDecisions(this.sessionId),this._r(),this.it||(ar(t,"beforeunload",this.qt),ar(t,"pagehide",this.Ut),ar(t,"offline",this.zt),ar(t,"online",this.Wt),ar(r,"visibilitychange",this.Vt),!this.xt&&L(this.Ne.onSessionId)&&(this.xt=this.Ne.onSessionId(this.Tt)),!this.Ct&&L(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)}))})):L(this.Ne.on)||Fl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),z(this.St)&&(this.St=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.tr(t.properties.$current_url):"";if(!e)return;this.Le("$pageview",{href:e})}}catch(t){Fl.error("Could not add $pageview to rrweb session",t)}}))),this.status===na&&this.xe(e||"recording_initialized"))}else Fl.info("remote config must be stored in persistence before recording can start")}Sr(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.qt),null==t||t.removeEventListener("pagehide",this.Ut),null==t||t.removeEventListener("offline",this.zt),null==t||t.removeEventListener("online",this.Wt),null==r||r.removeEventListener("visibilitychange",this.Vt),clearInterval(this.pr),this.Cr(),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.Mr(),this.kr()}kr(){this.kt+=1,this.bt=[],this.wt=0,this.Tr=void 0,this._t=!1}Mr(){var t,e,i;null==(t=this.Ir)||t.stop(),this.Ze=[],null==(e=this.ur)||e.stop(),this.ur=void 0,this.ze=!1,null==(i=this.Ue)||i.call(this),this.Ue=void 0}Rr(){if(!this.Tr||0===this.wt)return!1;if(this._t)return!0;this._t=!0;var t=this.kt;return this.Cr(),this.Mr(),this.Tr.catch((()=>{})).then((()=>{t===this.kt&&(this._t=!1,this.Ht(),this.$t(),this.Sr(),Fl.info("stopped"))})).catch((()=>{this._t=!1,this.Sr(),Fl.info("stopped")})),!0}stop(){this.Mr(),this.Rr()||(this.Ht(),this.$t(),this.Sr(),Fl.info("stopped"))}Et(t){this.Lt=!0;try{var e;this.stop(),this.Ar=void 0,this.Er=void 0,this.Je=0,this.Ye=0,this.Ke=0,null==(e=Dl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Lt=!1}this.Xe=t,this.et=!1}gr(){this.isStarted||(this.rt=!0),this.Xe&&(this.Xe=!1,this.et=!1,this.tt&&(this.tt=!1,this.Ce()),this.Lr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents;void 0!==e&&e&&(this.$t(),this.Mr()),this.$t(),this.Sr(),Fl.info("discarded")}Or(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==ia?(this.Dr(t,r),this.Pr(s)):this.$t()}Nr(){try{this.Fr()}catch(t){this.st||(this.st=!0,Fl.error("could not track full snapshot cost",t))}}Fr(){var t,e=null==(t=Dl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Er&&(this.Er=e,this.Ar&&this.Ar.durationMs>=e.durationMs||(this.Ar=e),500>e.durationMs||Fl.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}))}Dr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(q(this.ft)||this.ft===e||this.yt===e||(this.yt=e,Fl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Ce())):this.ft=e}qr(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))}jr(t,e,i){t.processed||t.generation!==this.kt||(t.processed=!0,this.Or(t.event,e,i,t.targetSessionId,t.targetWindowId))}Br(t){try{var e=t.compressionEnabled?Kl(t.event):{event:t.event,size:Ra(t.event)};this.jr(t,e.event,e.size)}finally{this.qr(t)}}Bt(){[...this.bt].forEach((t=>{this.Br(t)}))}Hr(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?Gl(t)?yield function(t){return Yl.apply(this,arguments)}(t):Kl(t):{event:t,size:Ra(t)};i=a.event,r=a.size}catch(e){Fl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Ra(t)}n.jr(s,i,r)}finally{n.qr(s)}}));return function(){return i.apply(this,arguments)}}();this.Tr=this.Tr?this.Tr.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.cr(),t&&D(t))){if(t.type===m.Meta){var h=this.tr(t.data.href);if(this.hr=h,!h)return;t.data.href=h}else this.lr();if(null==(e=this.He)||e.checkUrlTriggers(this.sessionId,(()=>this.mr()),(()=>this.yr()),((t,e)=>this.br(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=Dl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.ot=!0),this.Nr(),Promise.resolve().then((()=>this.Nr())),this.vr(),null==(v=this.Ir)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[ts]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.He)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.$r();var p=this.Ir?this.Ir.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&D(e)&&6===e.type&&D(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 eu(t)?t.data.payload:null}(g),_=function(t){return iu(t)?t.data.payload:null}(g),w=function(t){return tu(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.Ur(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 tu(t)||eu(t)||iu(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.sr(!0):x||this.sr();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.wt>0||C&&Gl(g))this.Hr(g,C,k,S);else{var T=C?Kl(g):{event:g,size:Ra(g)};this.Or(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}):ia}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.gr(),this.xe("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Gn]:this.sessionId,[Bn]:null}),this.Ce(),this.gr(),this.xe("sampling_overridden")}overrideTrigger(t){this.br(t),this.gr()}zr(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.tr(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Cr(){this.Wr&&(clearTimeout(this.Wr),this.Wr=void 0)}Lr(){this.Wr||(this.Wr=setTimeout((()=>{this.Ht()}),2e3))}Vr(){return this.ft!==this.Pt.sessionId&&0!==this.Pt.data.length&&this.Pt.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!eu(t)&&!iu(t)))}Zr(){var t,e;return null!==(t=null==(e=this.He)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Gr(t){if(t!==sa)return q(this.Qr)||this._instance.register_for_session({[qs]:[]}),void(this.Qr=void 0);var e=this.Zr();if(0===e.length)return q(this.Qr)||this._instance.register_for_session({[qs]:[]}),void(this.Qr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Qr&&(this.Qr=r,this._instance.register_for_session({[qs]:e}),Fl.info("buffering: "+i))}Ht(){var t;if(this.Cr(),this.Xe)return this.Pt;if(this.Vr())return this.Pt.size>Pl?this.$t():this.Pt;var e=this.Pt;null==(t=this.He)||t.ensureSamplingDecision(this.sessionId);var i=this.Nt(),r=this.status;if(this.Gr(r),r===sa||r===aa||r===ia||i)return this.Lr(),this.Pt;if(this.Pt!==e)return this.Pt;if(e.data.length>0){var n,s=this.zr();Aa(e).forEach((t=>{var e;null==(e=this.Rt)||e.trackSize(t.sessionId,t.size),this.Jr({$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.$t()}Pr(t){var e,i=2+((null==(e=this.Pt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Pt.sessionId!==r;if(n||!0!==this.Ge&&!this.Xe&&this.Pt.size+t.$snapshot_bytes+i>Pl){var s=this.Pe;if(this.Pt=this.Ht(),this.Pe!==s)return;n&&this.Pt.data.length>0&&(this.Pt=this.$t()),this.Pt.sessionId=r,this.Pt.windowId=t.$window_id}this.Xe&&(this.tt||this.Pt.size+t.$snapshot_bytes+i>Pl)?this.tt||(this.tt=!0,this.Pt=this.$t()):(this.Pt.size+=t.$snapshot_bytes,this.Pt.data.push(t.$snapshot_data),this.Pt.sizes.push(t.$snapshot_bytes),!0===this.Ge||this.Xe||this.Lr())}Jr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.$e),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ft(){var t,e,i=null==(t=this.Pt)?void 0:t.data[(null==(e=this.Pt)?void 0:e.data.length)-1],r=this.Ne.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}$r(){if(!this.Pt||0===this.Pt.data.length)return this.$t();for(var t=-1,e=this.Pt.data.length-1;e>=0;e--)if(this.Pt.data[e].type===m.Meta){t=e;break}return 0>t?this.$t():(this.Pt.data=this.Pt.data.slice(t),this.Pt.sizes=this.Pt.sizes.slice(t),this.Pt.size=this.Pt.sizes.reduce(((t,e)=>t+e),0),this.Pt)}$t(){return this.Pt={size:0,data:[],sizes:[],sessionId:this.Pe,windowId:this.It},this.Pt}xe(t,e){this._instance.register_for_session({[zs]:t}),Fl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Le("$recording_started",p({reason:t},e))}Yr(t){var e;return 3===t.type&&-1!==Ol.indexOf(null==(e=t.data)?void 0:e.source)}Ur(t){var e=this.Yr(t);e||!0===this.Ge||t.timestamp-this.We>this.Fe&&(this.Ge=!0,clearInterval(this.pr),this.Le("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.We,threshold:this.Fe,bufferLength:this.Pt.data.length,bufferSize:this.Pt.size,sessionId:this.Pe,windowId:this.It}),this.Ht());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.gr(),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.sr(),this.vr()}}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=Dl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Pt.data.length,$sdk_debug_replay_internal_buffer_size:this.Pt.size,$sdk_debug_current_session_duration:this.Ft,$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:Tl(null==(i=this.Ar)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Tl(null==(r=this.Ar)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Ar)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Ar)?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:Tl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Tl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Tl(null==(o=Dl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Dl())||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}}_r(){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={};q(v.mousemove)||(c.mousemove=v.mousemove),q(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.Jt&&this.Jt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Jt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Jt.quality},o.canvasResolutionScale=this.Qt,o.canvasMasking={configured:()=>{var t;return L(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(L(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.ct||(this.ct=!0,Fl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Zt&&(o.maskAllInputs=null===(i=this.Zt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Zt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Zt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Zt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ht||(this.ht=!0,Fl.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.Gt();var f=$l();if(f){this.Ir=null!==(e=this.Ir)&&void 0!==e?e:new yo(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";Fl.info(i,{node:e}),this.log(Al+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Je+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.dr,onDroppedOversizedMutation:t=>{0===this.Ye&&this.log(Al+" 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.Xt();if(this.Ue=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.dt||(this.dt=!0,Fl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Ue)return this.it=!0,void Fl.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.ur&&(this.ur=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=al,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(xl(i,e.blockClass,e.blockSelector)||xl(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>al)return null;try{var e=JSON.parse(t),i=O(e)?e.map(kl):kl(e);if(H(i)||O(i)&&(!i.length||i.some(H)))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(H(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 Cl(t))a(e)};for(var i of t)if("childList"===i.type)Sl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&Sl(r)&&a(r)}else"attributes"===i.type&&Sl(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()&&Cl(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.nr()},emit:t=>this.ar(t)}),this.X.isCurrentUrlBlocked()&&this.ur.scan()),this.We=Date.now(),this.Ge=V(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 Fl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Le(t,e)}}var nu,su=["type"],au=Object.defineProperty,ou=(t,e,i)=>((t,e,i)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),lu=(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))(lu||{}),uu=(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))(uu||{}),hu=(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))(hu||{}),du=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(du||{}),vu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(vu||{}),cu=(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))(cu||{}),fu=(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))(fu||{});function pu(t,e){return-1!==t.indexOf(e)}var gu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},mu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},yu={};function bu(t){if(yu[t])return yu[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 gu?gu[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 mu?mu[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 yu[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 pu(t,"AppleWebKit")&&!pu(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),yu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var _u={};function wu(t,e,i){var r,n=t+"."+String(i);if(_u[n])return _u[n].call(e);var s=bu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(_u[n]=a,a.call(e)):e[i]}var ku={};function Su(t,e,i){var r=t+"."+String(i);if(ku[r])return ku[r].bind(e);var n=bu(t)[i];return"function"!=typeof n?e[i]:(ku[r]=n,n.bind(e))}function xu(){return bu("MutationObserver").constructor}function Cu(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 Tu={childNodes:t=>wu("Node",t,"childNodes"),parentNode:t=>wu("Node",t,"parentNode"),parentElement:t=>wu("Node",t,"parentElement"),textContent:t=>wu("Node",t,"textContent"),contains:(t,e)=>Su("Node",t,"contains")(e),getRootNode:t=>Su("Node",t,"getRootNode")(),host:t=>t&&"host"in t?wu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?wu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Su("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Su("Element",t,"querySelectorAll")(e),mutationObserver:xu,patch:Cu},Mu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Iu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Eu=0,Ru=6e4;function Pu(){Eu+=1}function Au(){return Eu}function Fu(t,e){return e!==Eu||t>Ru}var Ou=0,Lu=0,Du=0,$u=Mu(),Nu=null,qu=null,ju=[],Bu=0,Hu=0,zu={slowestBatchMs:0},Uu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Wu=t=>t&&t>0?t:null;function Vu(t){(Ou+=1)>1||($u=Mu(),ju=[],Bu=0,qu=Wu(t),Lu=Iu(),Du=Eu)}function Gu(){return 0===Ou?Nu||Mu():(Ou-=1)>0?$u:($u.durationMs=Iu()-Lu,$u.deferredStylesheetCount=Bu,Uu.deferredCount+=Bu,qu=null,Fu($u.durationMs,Du)?$u:Nu=$u)}var Zu=32;function Qu(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+=Qu(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+=Qu(l,e,i+1))}}}catch(t){}}return r}function Ju(t){if(0!==Ou){var e=Qu(t,null,0);$u.cssRuleCount+=e,Hu>0&&($u.nonDeferrableCssRuleCount+=e)}}function Ku(t){Hu+=1;try{return t()}finally{Hu-=1}}function Yu(t){Ou>0&&($u.stylesheetMs+=t)}function Xu(t){if(0===Ou||null===qu)return!1;var e=$u.cssRuleCount-$u.nonDeferrableCssRuleCount;return e>=qu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Qu(e,i,0)}catch(t){return 0}}(t)>qu}function th(){Uu.failedCount+=1}function eh(t){t>0&&(Uu.abandonedCount+=t)}function ih(t){return t.nodeType===t.ELEMENT_NODE}function rh(t){var e=t&&"host"in t&&"mode"in t&&Tu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Tu.shadowRoot(e)===t)}function nh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function sh(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 ah(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 oh=0;function lh(t){var e=0===oh,i=e?Iu():0;oh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Ju(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),sh(Array.from(r,(t=>uh(t,n))).join(""))}catch(t){return null}finally{oh-=1,e&&Yu(Iu()-i)}}function uh(t,e){var i;if(dh(t)){var r;try{r=lh(t.styleSheet)||ah(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return Mh(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return vh(t)&&t.selectorText.includes(":")&&(n=hh(n)),e?Mh(n,e):n}function hh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function dh(t){return"styleSheet"in t}function vh(t){return"selectorText"in t}var ch=/^-?[A-Za-z_][\w-]*$/,fh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ph(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||ah(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=Mh(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&&dh(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(vh(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&&!ch.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]?ch.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":fh.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?Mh(r,n):r,fixColons:"sheet"===i.kind&&vh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&vh(i)&&i.selectorText.includes(":")&&(s=hh(s)),t.parts.push(t.sheetHref?Mh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Ju(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,!dh(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;Ju(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=Iu(),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?hh(h):h}else u=sh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Yu(Iu()-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 gh{constructor(){ou(this,"idNodeMap",new Map),ou(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))),ih(t)){var i=Tu.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 mh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&yh(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function yh(t){return t.toLowerCase()}var bh=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 _h(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&&bh.has(yh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var wh="__rrweb_original__";function kh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?yh(e):null}catch(t){return null}}var Sh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xh=/^(?:[a-z+]+:)?\/\//i,Ch=/^www\..*/i,Th=/^(data:)([^,]*),(.*)/i;function Mh(t,e){return(t||"").replace(Sh,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(xh.test(l)||Ch.test(l))return"url("+u+l+u+")";if(Th.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 Ih,Eh,Rh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Ph=4096,Ah=1e5,Fh=10,Oh=new Map,Lh=1,Dh=new RegExp("[^a-z0-9-_:]"),$h=-2;function Nh(){return Lh++}var qh=/^[^ \t\n\r\u000c]+/,jh=/^[, \t\n\r\u000c]+/,Bh=new WeakMap;function Hh(t,e){return e&&""!==e.trim()?zh(t,e):e}function zh(t,e){var i=Bh.get(t);if(i||(i=t.createElement("a"),Bh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Uh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?Rh:t}(t,e.maxBase64ImageLength):t}function Wh(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=Hh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(Ah>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>Ph||t.naturalHeight>Ph)return e;var n=Oh.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(Oh.size>=Fh){var u=Oh.keys().next().value;void 0!==u&&Oh.delete(u)}return Oh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Uh(u,s)}if("image"===e)return Uh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Hh(t,r);return"image"===e&&h.startsWith("data:")?Uh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(jh),e.length>i;){var s=r(qh);if(","===s.slice(-1))s=Hh(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Hh(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?Mh(r,zh(t)):"object"===e&&"data"===i?Hh(t,r):r:Hh(t,r)}function Vh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Gh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Gh(Tu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Gh(Tu.parentNode(t),e,i)}function Zh(t,e,i,r){var n;if(ih(t)){if(!Tu.childNodes(n=t).length)return!1}else{if(null===Tu.parentElement(t))return!1;n=Tu.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Gh(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function Qh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Jh=new Map;function Kh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Yh(t){return null==t?"":t.toLowerCase()}var Xh=50,td=!1,ed=!1;function id(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,I=e.onIframeLoad,E=e.iframeLoadTimeout,R=void 0===E?5e3:E,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?Xh:H,U=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=z)return ed=!0,td||(td=!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)),Ou>0&&($u.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:fu.Document,childNodes:[],compatMode:t.compatMode}:{type:fu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:fu.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=yh(t.tagName);return Dh.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var I=t.attributes[M];Vh(S,I.name)||(C[I.name]=Wh(s,S,yh(I.name),I.value,t,f))}if("link"===S&&a&&!k){var E=t.sheet;if(!E){var R=function(t){return t.href}(t);R&&!(E=Kh(s,R))&&R.includes(".css")&&(E=Kh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;E&&(Xu(E)?Ou>0&&(ju.push(t),Bu+=1):P=lh(E)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||Tu.textContent(t)||"").trim().length){var A=Ku((()=>lh(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=mh({element:t,type:kh(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((wh in n?n[wh]: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){Ih||(Ih=s.createElement("canvas"),Eh=Ih.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",z=B.crossOrigin,U=(e,i)=>j?_h({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{Qh(B,"load",W);try{Ih.width=B.naturalWidth,Ih.height=B.naturalHeight,Eh.drawImage(B,0,0);var t=Ih.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]=_h({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:fu.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=Tu.parentNode(t),o=a&&a.tagName,l=Tu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(Xu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=lh(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=Mh(l,zh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,Tu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:fu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:fu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:fu.Comment,textContent:Tu.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===fu.Comment)return!0;if(t.type===fu.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&&(Yh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Yh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Yh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Yh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Yh(t.attributes.property).match(/^(og|twitter|fb):/)||Yh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Yh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Yh(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(Yh(t.attributes.name))||Yh(t.attributes.property).match(/^article:/)||Yh(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(Yh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===fu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?$h:Nh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===$h)return null;M&&M(t);var J=!u;if(Q.type===fu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=Tu.shadowRoot(t);K&&nh(K)&&(Q.isShadowHost=!0)}if((Q.type===fu.Document||Q.type===fu.Element)&&J){b.headWhitespace&&Q.type===fu.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:I,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z};if(Q.type===fu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Tu.childNodes(t))){var tt=id(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(ih(t)&&(et=Tu.shadowRoot(t)))for(var it of Array.from(Tu.childNodes(et))){var rt=id(it,Y);rt&&(nh(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=Tu.parentNode(t);if(nt&&rh(nt)&&nh(nt)&&(Q.isShadow=!0),Q.type===fu.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),Qh(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?Qh(t,"load",a):(o=!0,Qh(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),Qh(t,"load",a)}}return t.addEventListener("load",a),()=>{Qh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&I){var i=id(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:I,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:z});i&&I(t,i)}}),R);null==P||P(t,st)}return Q.type===fu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Jh.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=id(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:I,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:z});e&&A(t,e)}})()}finally{Jh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),Jh.set(e,v)}}}(t,0,O),Q}function rd(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 nd{constructor(){ou(this,"parentElement",null),ou(this,"parentNode",null),ou(this,"ownerDocument"),ou(this,"firstChild",null),ou(this,"lastChild",null),ou(this,"previousSibling",null),ou(this,"nextSibling",null),ou(this,"ELEMENT_NODE",1),ou(this,"TEXT_NODE",3),ou(this,"nodeType"),ou(this,"nodeName"),ou(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof nd))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 sd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>ad(i,t,e,r)}function ad(t,e,i,r){od((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function od(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var ld="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ud={map:{},getId(){return console.error(ld),-1},getNode(){return console.error(ld),null},removeNodeFromMap(){console.error(ld)},has(){return console.error(ld),!1},reset(){console.error(ld)}};function hd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,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 dd(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>dd(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ud=new Proxy(ud,{get(t,e,i){return"map"===e&&console.error(ld),Reflect.get(t,e,i)}}));var vd=Date.now;function cd(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=Tu.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=Tu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function fd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function gd(t){return t?t.nodeType===t.ELEMENT_NODE?t:Tu.parentElement(t):null}function md(t,e,i,r){if(!t)return!1;var n=gd(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(Gh(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function yd(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===$h}function bd(t,e){if(rh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Tu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||bd(r,e))}function _d(t){return Boolean(t.changedTouches)}function wd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function kd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Sd(t){return!!t&&(t instanceof nd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Tu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(vd=()=>(new Date).getTime());class xd{constructor(){ou(this,"id",1),ou(this,"styleIDMap",new WeakMap),ou(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Cd(t){var e,i=null;return"getRootNode"in t&&(null==(e=Tu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Tu.host(Tu.getRootNode(t))&&(i=Tu.host(Tu.getRootNode(t))),i}function Td(t){var e=t.ownerDocument;return!!e&&(Tu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Cd(i);)i=e;return i}(t);return Tu.contains(e,i)}(t))}function Md(t){return"__ln"in t}class Id{constructor(){ou(this,"length",0),ou(this,"head",null),ou(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Md(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Md(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Ed,Rd=(t,e)=>t+"@"+e;class Pd{constructor(){ou(this,"frozen",!1),ou(this,"locked",!1),ou(this,"texts",[]),ou(this,"attributes",[]),ou(this,"attributeMap",new WeakMap),ou(this,"generatedAttributes",new WeakMap),ou(this,"removes",[]),ou(this,"mapRemoves",[]),ou(this,"movedMap",{}),ou(this,"addedSet",new Set),ou(this,"movedSet",new Set),ou(this,"droppedSet",new Set),ou(this,"removesSubTreeCache",new Set),ou(this,"mutationCb"),ou(this,"blockClass"),ou(this,"blockSelector"),ou(this,"maskTextClass"),ou(this,"maskTextSelector"),ou(this,"inlineStylesheet"),ou(this,"maskInputOptions"),ou(this,"maskTextFn"),ou(this,"maskInputFn"),ou(this,"maskAllElementAttributes"),ou(this,"maskAttributeFn"),ou(this,"keepIframeSrcFn"),ou(this,"recordCanvas"),ou(this,"canvasMaskingConfigured"),ou(this,"inlineImages"),ou(this,"slimDOMOptions"),ou(this,"dataURLOptions"),ou(this,"doc"),ou(this,"mirror"),ou(this,"iframeManager"),ou(this,"stylesheetManager"),ou(this,"shadowDomManager"),ou(this,"canvasManager"),ou(this,"processedNodeManager"),ou(this,"unattachedDoc"),ou(this,"canvasManagerReleased",!1),ou(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),ou(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=Iu(),r=Au();try{this.processBufferedMutations()}finally{t=Iu()-i,e=r,Ou>0||Fu(t,null!=e?e:Eu)||t>zu.slowestBatchMs&&(zu.slowestBatchMs=t)}}})),ou(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new Id,r=t=>{for(var e=t,i=$h;i===$h;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=Tu.parentNode(n);if(s&&Td(n)&&"TEXTAREA"!==s.tagName){var a=rh(s)?this.mirror.getId(Cd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=id(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=>{wd(t,this.mirror)&&this.iframeManager.addIframe(t),kd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Sd(t)&&!md(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Tu.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)Fd(this.removesSubTreeCache,s)&&!this.movedSet.has(Tu.parentNode(s))||n(s);for(var a of this.addedSet)Od(this.droppedSet,a)||Fd(this.removesSubTreeCache,a)?Od(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(Tu.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(Tu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=Tu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Tu.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=Tu.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]=_h({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)})),ou(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),ou(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(Tu.childNodes(t),(t=>Tu.textContent(t)||"")).join("");e.attributes.value=mh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:kh(t),value:i,maskInputFn:this.maskInputFn})})),ou(this,"processMutation",(t=>{var e;if(!yd(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=Tu.textContent(t.target);md(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,gd(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=kh(u);l=mh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(md(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"),!Vh(n.tagName,o)){var c=Wh(this.doc,yh(n.tagName),yh(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(md(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=rh(t.target)?this.mirror.getId(Tu.host(t.target)):this.mirror.getId(t.target);md(t.target,this.blockClass,this.blockSelector,!1)||yd(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Ad(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||bd(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Rd(i,r)]?Ad(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!rh(t.target)||!nh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Tu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),ou(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(yd(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[Rd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);md(t,this.blockClass,this.blockSelector,!1)||(Tu.childNodes(t).forEach((t=>this.genAdds(t))),Sd(t)&&Tu.childNodes(Tu.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 Ad(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),Tu.childNodes(r).forEach((t=>i.push(t)))}}function Fd(t,e,i){return 0!==t.size&&function(t,e,i){var r=Tu.parentNode(e);return!!r&&t.has(r)}(t,e)}function Od(t,e){if(0===t.size)return!1;for(var i=Tu.parentNode(e);i;){if(t.has(i))return!0;i=Tu.parentNode(i)}return!1}var Ld=function(t,e){return void 0===e&&(e="rrweb"),Ed?function(){try{return t(...arguments)}catch(t){if(Ed&&!0===Ed(t,e))return;throw t}}:t},Dd=[];function $d(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Nd(t,e){var i,r=new Pd;r.init(t);try{i=new(xu())(Ld(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),Dd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function qd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=$d(t);if(a&&!md(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=cd(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=[sd("scroll",Ld(hd(Ld((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(sd("scrollend",Ld(l),i)),()=>u.forEach((t=>t()))}function jd(t,e){for(var i=Dd.length-1;i>=0;i--){var r=Dd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Dd.splice(i,1))}}}var Bd=["INPUT","TEXTAREA","SELECT"],Hd=new WeakMap;function zd(t){return function t(e,i){if(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 Ud(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var Wd=5e3;function Vd(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:Tu.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}}),Ld((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Gd(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=Ld((()=>{if(r){r.destroy(),r.reset();var e=Dd.indexOf(r);-1!==e&&Dd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Nd(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=hd(Ld((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Ld(hd(Ld((t=>{var e=$d(t),i=_d(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=vd()),l.push({x:r,y:a,id:n.getId(e),timeOffset:vd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?uu.Drag:t instanceof MouseEvent?uu.MouseMove:uu.TouchMove)})),a,{trailing:!1})),d=[sd("mousemove",h,r),sd("touchmove",h,r),sd("drag",h,r)];return Ld((()=>{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(hu).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=yh(t),o=(t=>i=>{var a=$d(i);if(!md(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=du.Mouse;break;case"touch":o=du.Touch;break;case"pen":o=du.Pen}o===du.Touch&&(hu[t]===hu.MouseDown?l="TouchStart":hu[t]===hu.MouseUp&&(l="TouchEnd"))}else _d(i)&&(o=du.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===du.Touch||l.startsWith("Mouse")&&o===du.Mouse)&&(o=null)):hu[t]===hu.Click&&(o=u,u=null);var h=_d(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Ld(e)(p({type:hu[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(hu[t]){case hu.MouseDown:case hu.MouseUp:a=a.replace("mouse","pointer");break;case hu.TouchStart:case hu.TouchEnd:return}l.push(sd(a,o,i))})),Ld((()=>{l.forEach((t=>t()))}))}(t)),c.push(qd(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return sd("resize",Ld(hd(Ld((()=>{var t=fd(),e=pd();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=$d(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=Tu.parentElement(e)),e&&c&&Bd.indexOf(c)>=0&&!md(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=kh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=mh({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=Hd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Hd.set(t,i);var s=r.getId(t);Ld(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>sd(t,Ld(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=>dd(t[0],t[1],{set(){Ld(d)({target:this,isTrusted:!1})}},!1,f)))),Ld((()=>{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=Ld((t=>hd(Ld((s=>{var a=$d(s);if(a&&!md(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=[sd("play",o(cu.Play),a),sd("pause",o(cu.Pause),a),sd("seeked",o(cu.Seeked),a),sd("volumechange",o(cu.VolumeChange),a),sd("ratechange",o(cu.RateChange),a)];return Ld((()=>{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,Wd),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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&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:Ld(((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=Ud(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=lh(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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ud(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};Qd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(Qd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),Qd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),Qd("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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ud(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),l];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:Ld(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ud(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Ld((()=>{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(Vd(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:Ld(((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=Ud(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=zd(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:Ld(((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=Ud(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=zd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Ld((()=>{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=Cu(i.fonts,"add",(function(t){return function(i){return setTimeout(Ld((()=>{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),Ld((()=>{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=Ld((()=>{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;md(s,l,u,!0)||md(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),sd("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Cu(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 Qd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Jd{constructor(t){ou(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ou(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 Kd{constructor(t){ou(this,"iframes",new WeakMap),ou(this,"crossOriginIframeMap",new WeakMap),ou(this,"crossOriginIframeMirror",new Jd(Nh)),ou(this,"crossOriginIframeStyleMirror"),ou(this,"crossOriginIframeRootIdMap",new WeakMap),ou(this,"mirror"),ou(this,"mutationCb"),ou(this,"wrappedEmit"),ou(this,"loadListener"),ou(this,"pageHideListener"),ou(this,"stylesheetManager"),ou(this,"recordCrossOriginIframes"),ou(this,"messageHandler"),ou(this,"nestedIframeListeners",new Map),ou(this,"attachedWindows",new WeakMap),ou(this,"attachedDocuments",new WeakMap),ou(this,"attachedIframes",new Map),ou(this,"loadListenerDisposers",new WeakMap),ou(this,"iframeElementsById",new Map),ou(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>od(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{ad(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);od((()=>{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)}))}od((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||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 lu.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:lu.IncrementalSnapshot,data:{source:uu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case lu.Meta:case lu.Load:case lu.DomContentLoaded:return!1;case lu.Plugin:return e;case lu.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case lu.IncrementalSnapshot:switch(e.data.source){case uu.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 uu.Drag:case uu.TouchMove:case uu.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case uu.ViewportResize:return!1;case uu.MediaInteraction:case uu.MouseInteraction:case uu.Scroll:case uu.CanvasMutation:case uu.Input:return this.replaceIds(e.data,t,["id"]),e;case uu.StyleSheetRule:case uu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case uu.Font:return e;case uu.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case uu.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===fu.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&&(ad(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(ad(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{od((()=>this.mirror.removeNodeFromMap(t)))})),od((()=>jd(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&ad(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{ad(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 Yd{constructor(t){ou(this,"shadowDoms",new WeakSet),ou(this,"mutationCb"),ou(this,"scrollCb"),ou(this,"bypassOptions"),ou(this,"mirror"),ou(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(nh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=Tu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Nd(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=Dd.indexOf(o);-1!==t&&Dd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:qd(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(Tu.host(t))),this.restoreHandlers.push({doc:n,handler:Vd({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:Cu(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=Tu.shadowRoot(this);return s&&Td(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var Xd="skip-frame";function tv(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 ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",iv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),rv=0;64>rv;rv++)iv[ev.charCodeAt(rv)]=rv;var nv=new Map,sv=(t,e,i)=>{if(t&&(lv(t,e)||"object"==typeof t)){var r=function(t,e){var i=nv.get(t);return i||nv.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function av(t,e,i,r){if(t instanceof Array)return t.map((t=>av(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+=ev[i[e]>>2],n+=ev[(3&i[e])<<4|i[e+1]>>4],n+=ev[(15&i[e+1])<<2|i[e+2]>>6],n+=ev[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:[av(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:[av(t.data,e,i,r),t.width,t.height]}:lv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:sv(t,e,i)}:t}var ov=(t,e,i,r)=>t.map((t=>av(t,e,i,r))),lv=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},uv=["webgl","webgl2"];function hv(t){return"nodeType"in t}function dv(t,e,i,r){var 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 Cu(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||hv(s)&&md(s,e,i,!0))return r.call(this,n);hv(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=Cu(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(!md(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&uv.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 vv(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=Cu(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(sv(d,s,this),this.canvas&&"tagName"in this.canvas&&!md(this.canvas,r,n,!0)){var v=ov(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=dd(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!md(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var cv,fv,pv,gv='(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',mv="undefined"!=typeof self&&self.Blob&&new Blob([gv],{type:"text/javascript;charset=utf-8"});function yv(t){var e;try{if(!(e=mv&&(self.URL||self.webkitURL).createObjectURL(mv)))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(gv),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class bv{constructor(t){ou(this,"pendingCanvasMutations",new Map),ou(this,"rafStamps",{latestId:0,invokeId:null}),ou(this,"mirror"),ou(this,"mutationCb"),ou(this,"resetObservers"),ou(this,"frozen",!1),ou(this,"locked",!1),ou(this,"rafIdTimestamp",null),ou(this,"rafIdFlush",null),ou(this,"refCount",0),ou(this,"torndown",!1),ou(this,"resetFrameDedup",null),ou(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=dv(e,i,r,!0),u=new Map;try{a=new yv}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:vu["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=>{md(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 Xd}if(void 0!==a){if(!Array.isArray(a)||!a.every(tv))return Xd;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===Xd)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=dv(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=Cu(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 md(this.canvas,i,r,!0)||setTimeout((()=>{var i=ov(l,e,this,n);t(this.canvas,{type:vu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=dd(e.CanvasRenderingContext2D.prototype,a,{set(e){md(this.canvas,i,r,!0)||t(this.canvas,{type:vu["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(...vv(e.WebGLRenderingContext.prototype,vu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...vv(e.WebGL2RenderingContext.prototype,vu.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,su)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class _v{constructor(t){var e;ou(this,"trackedLinkElements",new WeakSet),ou(this,"pendingDeferredSheets",new Set),ou(this,"mutationCb"),ou(this,"adoptedStyleSheetCb"),ou(this,"maskAllElementAttributes"),ou(this,"maskAttributeFn"),ou(this,"styleMirror",new xd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=ph(r))}catch(t){}if(!i||!r)return th(),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=Iu(),d=Au(),v=!0;try{if(s)return o=!0,th(),!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?(th(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(th(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Fu(l=Iu()-h,null!=(u=d)?u:Eu)||(Uu.totalMs+=l,l>Uu.slowestSliceMs&&(Uu.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:_h({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=Iu();try{Ku((()=>{try{var e=t.rules||t.cssRules;e&&Ju(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:uh(e,t.href),index:i})))})}))}finally{Yu(Iu()-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(),Jh.forEach((t=>t.abort())),Jh.clear()}trackStylesheetInLinkElement(t){}}class wv{constructor(){ou(this,"nodeMap",new WeakMap),ou(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 kv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Sv=document.createElement("iframe");document.body.appendChild(Sv),Array.from=(null==(nu=Sv.contentWindow)?void 0:nu.Array.from)||Array.from,document.body.removeChild(Sv)}}catch(t){console.debug("Unable to override Array.from",t)}var xv=new gh,Cv=new Set([uu.Mutation,uu.MediaInteraction,uu.StyleSheetRule,uu.CanvasMutation,uu.Font,uu.Log,uu.StyleDeclaration,uu.AdoptedStyleSheet]);function Tv(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 Mv(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,I=void 0!==M&&M,E=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;Ed=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),xv.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=rd(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};cv=(t,e)=>{var i,a=t;if(a.timestamp=vd(),!(null==(i=Dd[0])?void 0:i.isFrozen())||a.type===lu.FullSnapshot||a.type===lu.IncrementalSnapshot&&Cv.has(a.data.source)||Dd.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===lu.FullSnapshot)ut=a,ft=0;else if(a.type===lu.IncrementalSnapshot){if(a.data.source===uu.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&fv(!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=xv.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()}cv({type:lu.IncrementalSnapshot,data:p({source:uu.Mutation},t)})},yt=t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.Scroll},t)}),bt=t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.CanvasMutation},t)}),_t=new _v({mutationCb:mt,adoptedStyleSheetCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:E}),wt=new Kd({mirror:xv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:cv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:xv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new wv,xt=null==N?void 0:N.configured;pv=new bv({recordCanvas:z,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:xv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Yd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:pv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:xv});fv=function(t){if(void 0===t&&(t=!1),B){Vu(w);try{cv({type:lu.Meta,data:{href:window.location.href,width:pd(),height:fd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Dd.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new gh: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,I=i.dataURLOptions,E=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=rd(void 0!==M&&M);Vu(j);try{return id(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:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Gu()}}(document,{mirror:xv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:dt,dataURLOptions:at,recordCanvas:z,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){wd(t,xv)&&wt.addIframe(t),kd(t,xv)&&_t.trackLinkElement(t),Sd(t)&&Ct.addShadowRoot(Tu.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=ju,ju=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(cv({type:lu.FullSnapshot,data:{node:r,initialOffset:cd(window)}},t),Dd.forEach((t=>t.unlock())),pv.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&&od((()=>{a=e.beginDeferredLinkInlining(i,xv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;od((()=>{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,eh(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=Tv(h):i())}};return n=Tv(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);eh(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,xv.getId(document))}finally{Gu()}var s}};try{var Tt=[];for(var Mt of(Tt.push(sd("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(sd(Mt,Pu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{od(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)})),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=xv.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var It=t=>{var e;return Ld(Gd)({mutationCb:mt,mousemoveCb:(t,e)=>cv({type:lu.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.ViewportResize},t)}),inputCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.Input},t)}),mediaInteractionCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.MediaInteraction},t)}),styleSheetRuleCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.StyleSheetRule},t)}),styleDeclarationCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>cv({type:lu.IncrementalSnapshot,data:p({source:uu.Font},t)}),selectionCb(t){cv({type:lu.IncrementalSnapshot,data:p({source:uu.Selection},t)})},customElementCb(t){cv({type:lu.IncrementalSnapshot,data:p({source:uu.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:I,maskAttributeFn:E,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:xv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:pv,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=>cv({type:lu.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=xv.getId(t),i=It(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),wt.addPageHideListener((t=>{var e=xv.getId(t);null==vt||vt(e),jd(t)}));var Et=-1,Rt=t=>cv({type:lu.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?xv.getId(s):-1;a!==Et&&(-1!==Et&&Rt({id:Et,enter:!1}),Et=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{fv();var t=It(document);"function"==typeof t&&Tt.push(t),Tt.push(sd("fullscreenchange",Pt)),Tt.push(sd("webkitfullscreenchange",Pt)),Tt.push(sd("mozfullscreenchange",Pt)),Tt.push(sd("MSFullscreenChange",Pt)),kv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(sd("DOMContentLoaded",(()=>{cv({type:lu.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(sd("load",(()=>{cv({type:lu.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>od(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),xv.reset(),kv=!1,Ed=void 0}}catch(t){console.warn(t)}}Mv.addCustomEvent=(t,e)=>{if(!kv)throw new Error("please add custom event after start recording");cv({type:lu.Custom,data:{tag:t,payload:e}})},Mv.freezePage=()=>{Dd.forEach((t=>t.freeze()))},Mv.takeFullSnapshot=t=>{if(!kv)throw new Error("please take full snapshot after start recording");fv(t)},Mv.mirror=xv;var Iv=Object.defineProperty,Ev=(t,e,i)=>((t,e,i)=>e in t?Iv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class Rv{constructor(t){Ev(this,"fileName"),Ev(this,"functionName"),Ev(this,"lineNumber"),Ev(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 Pv=/(^|@)\S+:\d+/,Av=/^\s*at .*(\S+:\d+|\(native\))/m,Fv=/^(eval@)?(\[native code])?$/,Ov={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Av)?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(Av)}),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 Rv({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Fv)}),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 Rv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Rv({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 Rv({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 Rv({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(Pv)&&!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 Rv({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Lv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var 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 Dv(t){return Array.isArray(t)}function $v(t){return"object"==typeof t&&null!==t&&!Dv(t)}function Nv(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if($v(t[r])&&Nv(t[r],e-1))return!0;return!1}function qv(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if($v(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||$v(a)&&Nv(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]=Dv(u)?Lv(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 jv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Bv(t,e,i){var r,n=i?Object.assign({},jv,i):jv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=Ov.parse(e.error).map((t=>t.toString())),s=[qv(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=[qv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[qv("Uncaught (in promise)",n.stringifyOptions),qv(e.reason,n.stringifyOptions)]);var s=Ov.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=Ov.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>qv(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[qv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{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 Hv=t=>({name:"rrweb/console@1",observer:Bv,options:t}),zv=t=>"u">typeof Document&&t instanceof Document,Uv=()=>{},Wv=t=>{var e;if(L(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Vv(t,e,i){try{if(!(e in t))return Uv;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 L(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=Wv(i);s;){if(s.next===n)return void(s.next=r.next);s=Wv(i=s.next)}else t[e]=r.next}}catch(t){return Uv}}function Gv(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=Ji("[Recorder]"),Qv=t=>"navigation"===t.entryType,Jv=t=>"resource"===t.entryType;function Kv(t,e){return!!e&&(V(e)||e[t])}function Yv(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Xv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function tc(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Yv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Xv))return!1;if(V(i))return!0;if(O(i))return n(i);var s=i[e];return V(s)?s:n(s)}function ec(t,e,i,r,n,s){return ic.apply(this,arguments)}function ic(){return ic=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(Jv(a=t[s])&&a.initiatorType===e&&(q(r)||a.startTime>=r)&&(q(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),ec(t,e,i,r,n,s+1))})),ic.apply(this,arguments)}function rc(t){var e=t.body,i=t.options,r=t.url;if(z(e))return null;var n=Gv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(j(e))return e;if(zv(e))return e.textContent;if(G(e))return dr(e);if(D(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 nc=t=>!H(t)&&("navigation"===t.entryType||"resource"===t.entryType);function sc(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:q(a)?void 0:Math.round(a),endTime:q(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(nc(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 ac=["video/","audio/"];function oc(t){return D(t)&&L(t.getReader)&&L(t.tee)}var lc=500,uc="[SessionReplay] Timeout while trying to read body",hc="[SessionReplay] Failed to read body";function dc(t){return hc+": "+t}function vc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function cc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(uc)),lc);try{t.clone().text().then((t=>e(t)),(t=>e(dc(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(hc)}}))}(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(vc(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch((()=>{}))}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(uc)),lc);try{o=t.clone()}catch(t){return void a(hc)}var u=o.body;if(oc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(hc)}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(vc(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(dc(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(dc(t))))}catch(t){a(hc)}}))}(t,i)}function fc(){return fc=f((function*(t){var e=t.r,i=t.options,r=Gv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):cc(e,i)})),fc.apply(this,arguments)}function pc(){return pc=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=ac.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Gv(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return H(r)?cc(e,i):Promise.resolve(r)})),pc.apply(this,arguments)}var gc=null;function mc(t,e,i){if(!("performance"in e))return()=>{};if(gc)return Zv.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=>Qv(t)||Jv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>sc({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=>Qv(t)||Jv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>sc({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=Kv("request",i.recordHeaders),n=Kv("response",i.recordHeaders),s=Vv(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=>(tc({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=rc({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),tc({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=rc({body:d.response,options:i,url:o})),ec(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=sc({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=Kv("request",i.recordHeaders),n=Kv("response",i.recordHeaders),s=Vv(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),!oc(null==o?void 0:o.body)&&tc({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return fc.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=Yv(a)?yield s(l):yield s(a,o),d=e.performance.now();try{var f={};u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),tc({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return pc.apply(this,arguments)}({r:u,options:i,url:a}))}catch(t){Zv.error("Failed to record fetch response for network capture",t)}return u}finally{ec(e,"fetch",l.url,h,d).then((e=>{var i,r=sc({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)),gc=()=>{s(),a(),o(),gc=null}}var yc=t=>({name:"rrweb/network@1",observer:mc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hv,getRecordNetworkPlugin:yc},v.__PosthogExtensions__.rrweb={record:Mv,version:"v2",wasMaxDepthReached:()=>ed,resetMaxDepthState(){ed=!1,td=!1},getLastSnapshotCost:()=>Nu,getMutationCost:()=>p({},zu),resetSnapshotCostState(){Ou=0,Lu=0,Du=0,Eu=0,$u=Mu(),Nu=null,qu=null,ju=[],Bu=0,Hu=0,zu={slowestBatchMs:0},Uu={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:Mv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:Hv},v.getRecordNetworkPlugin=yc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new ru(t,e);var bc,_c,wc,kc,Sc,xc,Cc,Tc,Mc,Ic,Ec,Rc,Pc,Ac,Fc,Oc={},Lc=[],Dc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$c=Array.isArray;function Nc(t,e){for(var i in e)t[i]=e[i];return t}function qc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function jc(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?bc.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 Bc(t,a,r,n,null)}function Bc(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?++wc:n,__i:-1,__u:0};return null==n&&null!=_c.vnode&&_c.vnode(s),s}function Hc(t){return t.children}function zc(t,e){this.props=t,this.context=e}function Uc(t,e){if(null==e)return t.__?Uc(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?Uc(t):null}function Wc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Nc({},e);s.__v=e.__v+1,_c.vnode&&_c.vnode(s),ef(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Uc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,nf(r,s,n),e.__e=e.__=null,s.__e!=i&&Vc(s)}}function Vc(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})),Vc(t)}function Gc(t){(!t.__d&&(t.__d=!0)&&kc.push(t)&&!Zc.__r++||Sc!=_c.debounceRendering)&&((Sc=_c.debounceRendering)||xc)(Zc)}function Zc(){try{for(var t,e=1;kc.length;)kc.length>e&&kc.sort(Cc),t=kc.shift(),e=kc.length,Wc(t)}finally{kc.length=Zc.__r=0}}function Qc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Lc,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]=Bc(null,a,null,null,null):$c(a)?a=t.__k[s]=Bc(Hc,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Bc(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=Kc(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=Uc(o)),of(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]||Oc,c.__i=d,g=ef(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&af(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=Jc(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 Jc(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=Jc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Uc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Kc(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 Yc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Dc.test(e)?i:i+"px"}function Xc(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||Yc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Yc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ec,"$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[Ic]=r[Ic]:(i[Ic]=Rc,t.addEventListener(e,s?Ac:Pc,s)):t.removeEventListener(e,s?Ac:Pc,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 tf(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Mc])e[Mc]=Rc++;else if(i[Ic]>e[Mc])return;return i(_c.event?_c.event(e):e)}}}function ef(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=_c.__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 zc(y,_),v.constructor=C,v.render=lf),$&&$.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=Nc({},v.__s)),Nc(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)})),Lc.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=_c.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Lc.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=Nc(Nc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Hc&&null==h.key?sf(h.props.children):h,o=Qc(t,$c(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--;)qc(s[x]);rf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||rf(e);_c.__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||Oc,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&&(_c.__m&&_c.__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&&bc.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||Xc(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||Xc(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=""),Qc("template"==e.type?t.content:t,$c(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Uc(i,0),o,l),null!=s)for(u=s.length;u--;)qc(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])&&Xc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Xc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=_c.diffed)&&h(e),128&e.__u?void 0:o}function rf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(rf))}function nf(t,e,i){for(var r=0;i.length>r;r++)af(i[r],i[++r],i[++r]);_c.__c&&_c.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){_c.__e(t,e.__v)}}))}function sf(t){return"object"!=typeof t||null==t||t.__b>0?t:$c(t)?t.map(sf):void 0!==t.constructor?null:Nc({},t)}function af(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){_c.__e(t,i)}}function of(t,e,i){var r,n;if(_c.unmount&&_c.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||af(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){_c.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&of(r[n],e,i||"function"!=typeof t.type);i||qc(t.__e),t.__c=t.__=t.__e=void 0}function lf(t,e,i){return this.constructor(t,i)}function uf(t,e,i){var r,n,s;e==document&&(e=document.documentElement),_c.__&&_c.__(t,e),r=e.__k,n=[],s=[],ef(e,t=e.__k=jc(Hc,null,[t]),r||Oc,Oc,e.namespaceURI,r?null:e.firstChild?bc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),nf(n,t,s),t.props.children=null}bc=Lc.slice,_c={__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}},wc=0,zc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Nc({},this.state),"function"==typeof t&&(t=t(Nc({},i),this.props)),t&&Nc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Gc(this))},zc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Gc(this))},zc.prototype.render=Hc,kc=[],xc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cc=function(t,e){return t.__v.__b-e.__v.__b},Zc.__r=0,Tc=Math.random().toString(8),Mc="__d"+Tc,Ic="__a"+Tc,Ec=/(PointerCapture)$|Capture$/i,Rc=0,Pc=tf(!1),Ac=tf(!0),Fc=0;var hf,df,vf,cf,ff=0,pf=[],gf=_c,mf=gf.__b,yf=gf.__r,bf=gf.diffed,_f=gf.__c,wf=gf.unmount,kf=gf.__;function Sf(t,e){gf.__h&&gf.__h(df,t,ff||e),ff=0;var i=df.__H||(df.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function xf(t){return ff=1,function(t,e,i){var r=Sf(hf++,2);if(r.t=t,!r.__c&&(r.__=[Lf(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=df,!df.__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};df.__f=!0;var s=df.shouldComponentUpdate,a=df.componentWillUpdate;df.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)},df.shouldComponentUpdate=n}return r.__N||r.__}(Lf,t)}function Cf(t,e){var i=Sf(hf++,3);!gf.__s&&Of(i.__H,e)&&(i.__=t,i.u=e,df.__H.__h.push(i))}function Tf(t){return ff=5,Mf((function(){return{current:t}}),[])}function Mf(t,e){var i=Sf(hf++,7);return Of(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function If(t){var e=df.context[t.__c],i=Sf(hf++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(df)),e.props.value):t.__}function Ef(){for(var t;t=pf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Af),e.__h.some(Ff),e.__h=[]}catch(i){e.__h=[],gf.__e(i,t.__v)}}}gf.__b=function(t){df=null,mf&&mf(t)},gf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),kf&&kf(t,e)},gf.__r=function(t){yf&&yf(t),hf=0;var e=(df=t.__c).__H;e&&(vf===df?(e.__h=[],df.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Ef(),hf=0)),vf=df},gf.diffed=function(t){bf&&bf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==pf.push(e)&&cf===gf.requestAnimationFrame||((cf=gf.requestAnimationFrame)||Pf)(Ef)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),vf=df=null},gf.__c=function(t,e){e.some((function(t){try{t.__h.some(Af),t.__h=t.__h.filter((function(t){return!t.__||Ff(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],gf.__e(i,t.__v)}})),_f&&_f(t,e)},gf.unmount=function(t){wf&&wf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{Af(t)}catch(t){e=t}})),i.__H=void 0,e&&gf.__e(e,i.__v))};var Rf="function"==typeof requestAnimationFrame;function Pf(t){var e,i=function(){clearTimeout(r),Rf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Rf&&(e=requestAnimationFrame(i))}function Af(t){var e=df,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),df=e}function Ff(t){var e=df;t.__c=t.__(),df=e}function Of(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Lf(t,e){return"function"==typeof e?e(t):e}var Df="gzip-js",$f="base64",Nf="events",qf="cancelEvents",jf={Tab:"tab",Selector:"selector"},Bf={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"},Hf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},zf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Uf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Wf={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Vf="always",Gf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Zf={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"},Qf="popover";function Jf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&L(i.then)&&i.then(void 0,(()=>{}))}}}}var Kf=Ji("[Surveys]");function Yf(t){return!(!t.start_date||t.end_date)}function Xf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var tp="seenSurvey_",ep="inProgressSurvey_",ip=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),rp=t=>ip(tp,t),np=t=>{try{var e=rp(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Kf.error("Failed to persist survey seen state",t)}},sp=[zf.Popover,zf.Widget,zf.API],ap={ignoreConditions:!1,ignoreDelay:!1,displayType:Qf},op="featureFlags",lp="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return U(t)&&isFinite(t)&&Math.floor(t)===t});class up{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 up(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 up(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 hp{generate(){var t=this.generateOrAbort();if(!q(t))return t;this.Kr=0;var e=this.generateOrAbort();if(q(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Kr)this.Kr=t,this.Xr();else{if(this.Kr>=t+1e4)return;this.ei++,this.ei>4398046511103&&(this.Kr++,this.Xr())}return up.fromFieldsV7(this.Kr,Math.trunc(this.ei/Math.pow(2,30)),this.ei&Math.pow(2,30)-1,this.ti.nextUint32())}Xr(){this.ei=1024*this.ti.nextUint32()+(1023&this.ti.nextUint32())}constructor(){this.Kr=0,this.ei=0,this.ti=new cp}}var dp,vp=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!q(t.crypto)&&crypto.getRandomValues&&(vp=t=>crypto.getRandomValues(t));class cp{nextUint32(){return this.Pt.length>this.ri||(vp(this.Pt),this.ri=0),this.Pt[this.ri++]}constructor(){this.Pt=new Uint32Array(8),this.ri=1/0}}var fp=()=>pp().toString(),pp=()=>(dp||(dp=new hp)).generate(),gp="",mp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var yp=null,bp={ii(){if(!H(yp))return yp;if(yp=!1,r)try{var t="__ph_cookie_support_"+fp();bp.ni(t,"xyz"),yp='"xyz"'===Uo(t),bp.oi(t)}catch(t){yp=!1}return yp},si(t){Qi.error("cookieStore error: "+t)},ai:Uo,ui(t){var e;try{e=JSON.parse(bp.ai(t))||{}}catch(t){}return e},ni(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),gp)return gp;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_"+fp();!gp&&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",gp=a)}return gp}(t);if(!i){var n=(t=>{var e=t.match(mp);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}},oi(t,e){if(null!=r&&r.cookie)try{bp.ni(t,"",-1,e)}catch(t){return}}},_p=null,wp={ii(){if(!H(_p))return _p;var e=!0;if(q(t))e=!1;else try{var i="__mplssupport__";wp.ni(i,"xyz"),'"xyz"'!==wp.ai(i)&&(e=!1),wp.oi(i)}catch(t){e=!1}return e||Qi.error("localStorage unsupported; falling back to cookie store"),_p=e,e},si(t){Qi.error("localStorage error: "+t)},ai(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){wp.si(t)}return null},ui(t){try{return JSON.parse(wp.ai(t))||{}}catch(t){}return null},ni(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){wp.si(t)}return!1},oi(e){try{null==t||t.localStorage.removeItem(e)}catch(t){wp.si(t)}}},kp=[ds,rs,is,ss,as,os,Ss,ks,_s],Sp=[xn,Sn,Vn,Gn,Rs,Es,In,xs],xp=t=>t+"_cpm",Cp=["__proto__","constructor","prototype"],Tp=t=>{if(!D(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===Cp.indexOf(i)&&(e[i]=t[i])})),e},Mp=function(t,e){void 0===e&&(e=[]);var i={};return[...Sp,...e].forEach((e=>{var r=t[e];q(r)||H(r)||""===r||(i[e]=r)})),i},Ip=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)},Ep=(t,e)=>({p:e,f:Ip(JSON.stringify(t))}),Rp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=bp.ui(xp(t)),r=(null==i?void 0:i.f)===Ip(e)&&O(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Pp=(t,e)=>e+"|"+(bp.ai(xp(t))||""),Ap={},Fp={ii:()=>!0,si(t){Qi.error("memoryStorage error: "+t)},ai:t=>t in Ap?Ap[t]:null,ui:t=>t in Ap?Ap[t]:null,ni:(t,e)=>(Ap[t]=e,!0),oi(t){delete Ap[t]}},Op=null,Lp={ii(){if(!H(Op))return Op;if(Op=!0,q(t))Op=!1;else try{var e="__support__";Lp.ni(e,"xyz"),'"xyz"'!==Lp.ai(e)&&(Op=!1),Lp.oi(e)}catch(t){Op=!1}return Op},si(t){Qi.error("sessionStorage error: ",t)},ai(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Lp.si(t)}return null},ui(t){try{return JSON.parse(Lp.ai(t))||null}catch(t){}return null},ni(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Lp.si(t)}return!1},oi(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Lp.si(t)}}},Dp=Ji("[Stylesheet Loader]"),$p=t,Np=r,qp="#020617",jp={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:Bf.Right,widgetType:jf.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:qp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Bp=[Bf.Center,Bf.Left,Bf.Right];function Hp(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 zp(t){var e;void 0===t&&(t=jp.backgroundColor),"#"===t[0]&&(e=Hp(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=Hp(i)),!e)return qp;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?qp:"white"}return qp}var Up=(t,e,i)=>{var r=ug(t),n=Np.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Np.createElement("div");((t,e,i)=>{var r=p({},jp,i),n=t.style,s=!Bp.includes(r.position)||e===zf.Widget&&(null==i?void 0:i.widgetType)===jf.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)||zp(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",zp(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||zp(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",zp(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)||zp(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 L(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Dp.error("prepare_external_dependency_stylesheet returned null"),null)})(Np,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Np.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Wp=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?(np(i),n.capture(Gf.SENT,p({[Zf.SURVEY_NAME]:i.name,[Zf.SURVEY_ID]:i.id,[Zf.SURVEY_ITERATION]:i.current_iteration,[Zf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Zf.SURVEY_SUBMISSION_ID]:r,[Zf.SURVEY_COMPLETED]:s},o&&{[Zf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},So(e,i,l),a,{$set:{[xo(i,"responded")]:!0}})),s&&($p.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),lg(i),n.reloadFeatureFlags())):Kf.error("[survey sent] event not captured, PostHog instance not found.")},Vp=(t,e,i)=>{return p({[Zf.SURVEY_NAME]:t.name,[Zf.SURVEY_ID]:t.id,[Zf.SURVEY_ITERATION]:t.current_iteration,[Zf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Zf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!z(t))))},(null==e?void 0:e.surveyLanguage)&&{[Zf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Zf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},So(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Gp=(t,e,i,r)=>{if(e){if(!i){var n=ag(t),s=n?n.surveyLanguage:r;e.capture(Gf.DISMISSED,p({},Vp(t,n,e),s&&{[Zf.SURVEY_LANGUAGE]:s},{$set:{[xo(t,"dismissed")]:!0}})),lg(t),np(t),$p.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Kf.error("[survey dismissed] event not captured, PostHog instance not found.")},Zp=(t,e)=>{if(e){var i=(t=>ip("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ag(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Gf.ABANDONED,Vp(t,r,e),{transport:"sendBeacon"})}}else Kf.error("[survey abandoned] event not captured, PostHog instance not found.")},Qp=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Jp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,Kp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Yp=(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?Jp(t.questions,Qp(t.questions)):t.questions;var i},Xp=t=>Po(t)||og(t),tg=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,Gc(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"+Fc++,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}),eg=()=>If(tg),ig=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Nc({},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?bc.call(arguments,2):i),Bc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function rg(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 Oo[a](s,[n])}var ng=t=>ip(ep,t),sg=(t,e)=>{try{localStorage.setItem(ng(t),JSON.stringify(e))}catch(t){Kf.error("Error setting in-progress survey state in localStorage",t)}},ag=t=>{try{var e=localStorage.getItem(ng(t));if(e)return JSON.parse(e)}catch(t){Kf.error("Error getting in-progress survey state from localStorage",t)}return null},og=t=>{var e=ag(t);return!z(null==e?void 0:e.surveySubmissionId)},lg=t=>{try{localStorage.removeItem(ng(t))}catch(t){Kf.error("Error clearing in-progress survey state from localStorage",t)}};function ug(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function hg(t,e,i){if(void 0===e&&(e=Bf.Right),t===zf.ExternalSurvey)return{};switch(e){case Bf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Bf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Bf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Bf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Bf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Bf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Bf.Left:return{left:"30px"};case Bf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===zf.Widget&&i===jf.Tab?"60px":"30px"}}}var dg=0;function vg(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:--dg,__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 _c.vnode&&_c.vnode(u),u}var cg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),fg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),pg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),gg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),mg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vg("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"})}),yg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vg("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"})}),bg=vg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vg("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"})}),_g=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return vg("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:[vg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),vg("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})]})},wg=vg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[vg("g",{"clip-path":"url(#clip0_2415_6911)",children:[vg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:vg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),vg("g",{mask:"url(#mask0_2415_6911)",children:[vg("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"}),vg("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"}),vg("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"}),vg("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"}),vg("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"}),vg("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"})]})]}),vg("defs",{children:vg("clipPath",{id:"clip0_2415_6911",children:vg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function kg(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return vg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",wg]})}function Sg(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=If(tg).isPreviewMode,v=!!u&&!!h,c=!l&&vg("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 vg("div",{className:"bottom-section",children:[v?vg("div",{className:"form-buttons form-buttons-with-back",children:[vg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&vg(kg,{urlParams:{utm_source:"survey-footer"}})]})}function xg(t){var e=t.question,i=t.forceDisableHtml;return vg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[vg(e.type===Uf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&ig({component:jc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Cg(t){return vg("button",{className:"form-cancel",onClick:t.onClick,disabled:If(tg).isPreviewMode,"aria-label":"Close survey",type:"button",children:_g({fill:"black"})})}vg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vg("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 Tg=t;function Mg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=If(tg).isPopup;return Cf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return ar(Tg,"keydown",t),()=>{Tg.removeEventListener("keydown",t)}}),[a]),vg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&vg(Cg,{onClick:()=>a()}),vg("h3",{className:"thank-you-message-header",children:e}),i&&ig({component:jc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&vg(Sg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function Ig(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=If(tg),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return vg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&vg(Cg,{onClick:()=>u()}),e&&vg("h3",{className:"intro-screen-header",children:e}),i&&ig({component:jc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),vg(Sg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var Eg=t=>O(t)&&t.every((t=>j(t)));function Rg(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=eg().isPreviewMode,d=Tf(null),v=xf((()=>j(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Cf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=Mf((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case M: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 I: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=Vi(e.validation,M),b=Vi(e.validation,I),_=Mf((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return vg(Hc,{children:[vg("div",{className:"question-container",children:[vg(xg,{question:e,forceDisableHtml:i,htmlFor:g}),vg("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}),_&&vg("div",{className:"validation-hint",children:_})]}),vg(Sg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Pg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return vg(Hc,{children:[vg("div",{className:"question-container",children:vg(xg,{question:e,forceDisableHtml:t.forceDisableHtml})}),vg(Sg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function Ag(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=xf((()=>U(l)?l:O(l)&&l.length>0&&U(parseInt(l[0]))?parseInt(l[0]):j(l)&&U(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=eg().isPreviewMode,y=t=>m?o(t):a(t);return vg(Hc,{children:[vg("div",{className:"question-container",children:[vg(xg,{question:i,forceDisableHtml:r}),vg("div",{className:"rating-section",children:[vg("div",{className:"rating-options",children:["emoji"===i.display&&vg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Ng[i.scale])?void 0:e.map(((t,e)=>vg("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&&vg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:qg(i.scale).map(((t,e)=>vg(Fg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&vg("div",{className:"rating-text",children:[vg("div",{children:i.lowerBoundLabel}),vg("div",{children:i.upperBoundLabel})]})]})]}),vg(Sg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:H(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Fg(t){var e=t.num,i=t.setActiveNumber;return vg("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 Og(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=Tf(null),d=Mf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Jp(e,Qp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=xf((()=>((t,e)=>j(t)||Eg(t)?t:e===Uf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=xf((()=>((t,e)=>{if(j(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Eg(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=eg().isPreviewMode,_=e.type===Uf.SingleChoice,w=e.type===Uf.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&&O(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||!H(c)&&(!O(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?O(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return vg(Hc,{children:[vg("div",{className:"question-container",children:[vg(xg,{question:e,forceDisableHtml:i}),vg("fieldset",{className:"multiple-choice-options limit-height",children:[vg("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:O(c)&&c.includes(t);return vg("label",{className:n?"choice-option-open":"",children:[vg("div",{className:"response-choice",children:[vg("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),vg("span",{children:n?t+":":t})]}),n&&vg("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)}))]})]}),vg(Sg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var Lg=[1,2,3,4,5],Dg=[1,2,3,4,5,6,7],$g=[0,1,2,3,4,5,6,7,8,9,10],Ng={2:[yg,bg],3:[pg,fg,cg],5:[gg,pg,fg,cg,mg]};function qg(t){switch(t){case 5:default:return Lg;case 7:return Dg;case 10:return $g}}var jg=Ji("[Surveys]");function Bg(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?Wf.End:s;if(n.branching.type===Wf.End)return Wf.End;if(n.branching.type===Wf.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Wf.ResponseBased){if(n.type===Uf.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===Wf.End?Wf.End:s}}else if(n.type===Uf.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===Wf.End?Wf.End:s}}return s}return jg.warn("Falling back to next question index due to unexpected branching type"),s}var Hg=Ji("[SurveyTranslations]");function zg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Co(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?Co(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=Co(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:L(t.get_property)?t.get_property(ds):void 0,locale:Xo()},Hg)}(e);if(!i)return Hg.info("No user language detected"),{survey:t,language:null};var r=Eo(t,i,Hg);return{survey:r.survey,language:r.matchedKey}}var Ug=-1,Wg=t,Vg=r,Gg="ph:show_survey_widget",Zg="PHWidgetSurveyClickListener";function Qg(t,e){try{var i=t.getBoundingClientRect(),r=Wg.innerHeight,n=Wg.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:jp.zIndex}}catch(t){return Kf.warn("Failed to calculate trigger position:",t),null}}class Jg{constructor(t){var e=this;this.li=new Map,this.hi=new Map,this.ci=new Map,this.di=new Set,this.vi=null,this.fi=!1,this.pi=null,this.gi=null,this.mi=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(fs);if(t)for(var e of t)og(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.yi(t),v=d.survey,c=d.language;e.vi=c,e.mi=null,e.bi=i;var f=e.wi(v,i);e.ki(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Si(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.xi(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===Bf.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Vg.querySelector(f.appearance.widgetSelector);k&&(_=Qg(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||jp.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Up(f,e._posthog).shadow;e.ci.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.Ci,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(e.mi=C,0>=S)return e.fi=!0,uf(vg(em,p({},C)),x);var T=()=>{if(!e.Mi(f))return Kf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.Ci(f);(()=>{e.fi=!0;var r=e.yi(t),n=r.survey,s=r.language;e.vi=s;var a=e.wi(n,i),o=p({},C,{survey:a,surveyLanguage:s});e.mi=o,uf(vg(em,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,I=U(M)?Math.max(0,Date.now()-M):0,E=Math.max(0,1e3*S-I);if(0>=E)return T();var R=Wg.setTimeout((()=>{e.li.delete(f.id),T()}),E);e.li.set(f.id,R)}},this.Ti=t=>{var e=this.yi(t),i=e.survey,r=e.language,n=Up(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.ci.set(s,s.host),a&&uf(vg(rm,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Ii=t=>{var e=this.hi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Zg),this.hi.delete(t),Kf.info("Removed click listener for survey "+t))},this.Ri=t=>{this.Ai(t)||(this.Ei(t),this.Ii(t.id))},this.Ai=t=>{try{var e,i=Vg.querySelector(ug(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Li=(t,e)=>{var i=Vg.querySelector(e),r=this.hi.get(t.id);if(i){if(this.Ti(t),r){if(i===r.element)return;Kf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Ii(t.id)}if(!i.hasAttribute(Zg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Bf.NextToTrigger?Qg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||jp.maxWidth)):{};Wg.dispatchEvent(new CustomEvent(Gg,{detail:{surveyId:t.id,position:n}}))};ar(i,"click",n),i.setAttribute(Zg,"true"),this.hi.set(t.id,{element:i,listener:n,survey:t}),Kf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Ri(t)},this.renderPopover=t=>{var e=this.yi(t),i=e.survey,r=e.language,n=Up(i,this._posthog).shadow;this.ci.set(n,n.host),uf(vg(em,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Ci,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.yi(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.Oi(s,a,i)),uf(vg(em,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Ci,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.Mi(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===zf.Popover||t.type===zf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.li.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Di(i),a=new Set;s.forEach((t=>{if(t.type===zf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===jf.Tab)return void e.Ti(t);(null==(r=t.appearance)?void 0:r.widgetType)===jf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.Li(t,null==(s=t.appearance)?void 0:s.widgetSelector))}H(e.Pi)&&t.type===zf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.hi.forEach((t=>{var i=t.survey;a.has(i.id)||e.Ri(i)}))}),t)},this.xi=t=>{H(this.Pi)||Kf.error("Survey "+this.Pi+" already in focus. Cannot add survey "+t.id+"."),this.Pi=t.id},this.Ci=t=>{this.Pi!==t.id&&Kf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.ki(t.id),this.Pi=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0,this.Ei(t)},this._posthog=t,this.Pi=null,this.pi=()=>this.Ni(),ar(Wg,"languagechange",this.pi),this.gi=t.onFeatureFlags((()=>this.Ni()))}Ni(){if(!H(this.Pi)){var t=this._posthog.get_property(fs),e=null==t?void 0:t.find((t=>t.id===this.Pi));if(e){var i=this.yi(e),r=i.survey,n=i.language;if(n!==this.vi&&(this.vi=n,this.fi)){var s=this.wi(r,this.bi),a=Up(s,this._posthog).shadow;uf(vg(em,p({},this.mi,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Ci,surveyLanguage:n})),a)}}}}get Fi(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,op))&&void 0!==t?t:this._posthog.featureFlags}wi(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}ki(t){var e=this.li.get(t);e&&(clearTimeout(e),this.li.delete(t))}cancelSurvey(t){this.li.has(t)&&(Kf.info("Cancelled pending survey "+t),this.ki(t),this.Pi===t&&(this.Pi=null,this.vi=null,this.fi=!1,this.mi=null,this.bi=void 0))}setAutomaticDisplayDispose(t){this.qi=t}dispose(){var t;null==(t=this.qi)||t.call(this),this.qi=void 0,this.pi&&(Wg.removeEventListener("languagechange",this.pi),this.pi=null),this.gi&&(this.gi(),this.gi=null),this.li.forEach(((t,e)=>this.ki(e))),this.hi.forEach(((t,e)=>this.Ii(e))),this.ci.forEach(((t,e)=>{uf(null,e),null==t||t.remove()})),this.ci.clear(),this.Pi=null}Di(t){return t.sort(((t,e)=>{var i,r,n=og(t),s=og(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===Vf,o=e.schedule===Vf;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)}))}yi(t){return zg(t,this._posthog)}Oi(t,e,i){if(this.di.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&&!q(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}}(Wg.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Kf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.ji(t,n,e);return!!s&&(this.Bi(t,s,i,e),this.di.add(t.id),s.isSurveyCompleted)}Bi(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)&&Wp({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}Si(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=O(a)?a.map(String):[String(a)]}Kf.info("[Survey] Processing initial responses");var o=this.ji(t,n,r);return!!o&&(this.Bi(t,o,i,r),o.isSurveyCompleted)}ji(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=wo(t.id);try{switch(t.type){case Uf.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 Uf.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 Uf.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 Kf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=fp(),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=wo(l.id);q(i[u])||(n[u]=i[u])}s.push(r);var h=Bg(t,r,l.id?i[wo(l.id)]:null);if(h===Wf.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 sg(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Kp(t.questions),visitedIndices:u,surveyLanguage:i}),Kf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Kf.error("[Survey Prefill] Error handling prefill:",t),null}}Hi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Fi,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}$i(e){return!e.conditions||rg(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=pe(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 Oo[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==Np||!Np.querySelector(t.conditions.selector))}(e)}Ui(t){var e;return Xp(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.Fi)&&e.hasLoadedFlags?{satisfied:this.Hi(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(!Yf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!sp.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.Hi(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.Hi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.Ui(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,wp.ai("lastSeenSurveyDate"))?(t=>!!wp.ai(rp(t))&&!Xp(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.zi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}zi(t){var e;if(!Ro(t)&&!Xf(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))}Wi(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.Hi(e)}))}Mi(t){return this.checkSurveyEligibility(t).eligible&&this.$i(t)&&this.zi(t)&&this.Wi(t)}Ei(t){try{var e=Vg.querySelector(ug(t,!0));null!=e&&e.shadowRoot&&(uf(null,e.shadowRoot),this.ci.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Kf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.xi,removeSurveyFromFocus:this.Ci,surveyInFocus:this.Pi,surveyTimeouts:this.li,handleWidget:this.Ti,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Li,sortSurveysByAppearanceDelay:this.Di,checkFlags:this.Wi.bind(this),isSurveyFeatureFlagEnabled:this.Hi.bind(this),onLanguageChange:this.Ni.bind(this),currentLanguage:this.vi,surveyIsRendered:this.fi}}}function Kg(t,e){if(Vg&&Wg){var i,r=new Jg(t);if(t.config.disable_surveys_automatic_display)return Kf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Kf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{q(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{q(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Vg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return ar(Vg,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Vg.removeEventListener("visibilitychange",a)})),r}}function Yg(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;Cf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===zf.Widget,s=rg(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===jf.Tab&&i;if(!s)return Kf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Kf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};ar(Wg,"popstate",i),ar(Wg,"hashchange",i);var s=Wg.history.pushState,l=Wg.history.replaceState;return Wg.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()},Wg.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()},()=>{Wg.removeEventListener("popstate",i),Wg.removeEventListener("hashchange",i),Wg.history.pushState=s,Wg.history.replaceState=l}}}),[a,e,r,n,o])}var Xg=200;function tm(t){switch(void 0===t&&(t=Hf.Right),t){case Hf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Hf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Hf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function em(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,I=t.onPopupSurveyDismissed,E=void 0===I?()=>{}:I,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=Tf(null),N=Number.isInteger(b),j=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,B=function(t,e,i,r,n,s,a,o,l){var u=xf(r||0===i||t.type===zf.ExternalSurvey),h=u[0],d=u[1],v=xf(!1),c=v[0],f=v[1],g=Tf(!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 "+Xg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Xg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Cf((()=>{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(rg(t,e)){d(!0),Wg.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Gf.SHOWN,p({[Zf.SURVEY_NAME]:t.name,[Zf.SURVEY_ID]:t.id,[Zf.SURVEY_ITERATION]:t.current_iteration,[Zf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Zf.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(Wg,"PHSurveyClosed",y),ar(Wg,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return q(u)&&a(),()=>{q(u)||clearTimeout(u),q(n)||clearTimeout(n),Wg.removeEventListener("PHSurveyClosed",y),Wg.removeEventListener("PHSurveySent",s)}}}else Kf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Yg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,j,N,w,S,D,O,L),H=B.isPopupVisible,z=B.hidePopupWithAnimation,U=B.isSurveySent||b===c.questions.length||!0===F,W=xf(!1),V=W[0],G=W[1],Z=Mf((()=>!!ag(c)),[c]),Q=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),J=N?b===Ug:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Q&&!V&&!Z,K=Mf((()=>{var t=ag(c),e=(null==t?void 0:t.surveySubmissionId)||fp();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Gp(c,g,N,L):Gp(c,g,N),E()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,E,C,M,A,L]);return H?vg(tg.Provider,{value:K,children:vg("div",{className:"ph-survey",style:p({},hg(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:U?vg(Mg,{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||jp,onClose(){z(),P()}}):J?vg(Ig,{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||jp,onStart:()=>G(!0)}):vg(im,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function im(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=Mf((()=>{var t=ag(r);if(!t)return null;var e=U(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(lg(r),null)}),[r]),o=xf((()=>(null!=a&&a.responses&&Kf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=If(tg),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=xf((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=U(t)&&t>=0&&r.questions.length>t?t:0;return U(d)&&d>=0?d:e})),k=w[0],S=w[1],x=xf((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],M=xf((()=>{var t,e=ag(r);return null!==(t=null==e?void 0:e.questionSnapshots)&&void 0!==t?t:{}})),I=M[0],E=M[1],R=Mf((()=>Kp(Yp(r,a))),[r.id,a]),P=Mf((()=>{if(!R||new Set(R).size!==R.length)return Yp(r,a);var t=new Map(r.questions.map((t=>[t.id,t]))),e=R.map((e=>t.get(e))).filter((t=>!!t));return e.length===R.length?e:r.questions}),[R,r.questions,r,a]);Cf((()=>{!y||q(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?vg("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&vg(Cg,{onClick(){v()}}),vg("div",{className:"survey-box","data-question-index":k,children:nm({question:F,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||jp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var a=wo(n),o=p({},l,{[a]:e});u(o);var h=P[i],d=null!=h&&h.id?p({},I,{[h.id]:h.question}):I;E(d);var v=Bg(r,i,e),c=v===Wf.End,f=[...C,i];if(c||(T(f),S(v),sg(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:v,questionOrder:Kp(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=>wo(t)))),y=Object.fromEntries(Object.entries(o).filter((t=>g.has(t[0]))));Wp({responses:y,survey:r,surveySubmissionId:m,isSurveyCompleted:c,posthog:s,properties:b,surveyLanguage:_,questionSnapshots:d})}}else Kf.error("onNextButtonClick called without a questionId.");else Kf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:F.id}),onPreviewSubmit:f,initialValue:F.id?l[wo(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),sg(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:Kp(P),visitedIndices:e,surveyLanguage:_,questionSnapshots:I})}}})})]}):null}function rm(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=xf(!0),f=c[0],p=c[1],g=xf(!1),m=g[0],y=g[1],b=xf({}),_=b[0],w=b[1],k=Tf(void 0),S=()=>{y(!m)};if(Cf((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Kf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return ar(Wg,Gg,e),()=>{q(k.current)||(clearTimeout(k.current),k.current=void 0),Wg.removeEventListener(Gg,e)}}}else Kf.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]),Yg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Vf&&p(!1),q(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return vg(Hc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&vg("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Hf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:tm(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&vg(em,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var nm=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 Uf.Open:return jc(Rg,p({},n,{question:e,key:e.id}));case Uf.Link:return jc(Pg,p({},n,{question:e,key:e.id}));case Uf.Rating:return jc(Ag,p({},n,{question:e,key:e.id}));case Uf.SingleChoice:case Uf.MultipleChoice:return jc(Og,p({},n,{question:e,key:e.id}));default:return Kf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=Kg,v.extendPostHogWithSurveys=Kg;var sm=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},am=1e4,om=(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),lm=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return om(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 om(e,JSON.stringify(t.slice(0,n)),i)},um=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,hm=(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}},dm=(t,e,i)=>{if(!i.truncated)if(D(t)){if(i.seen.has(t))return void hm(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(dm(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else hm(e,t,i)},vm=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!um(t))return!n||om(e,"null",i);if(H(t)||(t=>{try{return U(t)||V(t)}catch(t){return!1}})(t))return om(e,JSON.stringify(t),i);if("string"==typeof t)return lm(t,e,i);if(!D(t)&&!O(t))return om(e,JSON.stringify(t),i);if(r.has(t))return lm("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(L(a))return vm(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return lm(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return om(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 vm(l,e,i,r,n,s)}if(O(t)){if(!om(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!om(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!vm(d,e,i,r,!0))return!1}return om(e,"]",i)}if(!om(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{dm(f,c,s)}catch(t){}if(um(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(!om(e,p,i))return!1;var b=e.length,_=vm(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 om(e,"}",i)},cm=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=D(t[0])?{result:{},keysRemaining:50,sizeRemaining:am,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||om(i," ",r))&&vm(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)||{}}},fm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},pm=t=>"canCapture"in t,gm=t=>pm(t)?t.canCapture?t.getExtension(lp):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(Vv(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=gm(u);if(h){n=!0,s=!0;var d=cm(o,am),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(pm(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;L(n)&&n.call(e,i)}})(u,h,{level:fm[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__=sm(s),a})))};for(var a of Object.keys(fm))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=gm(t);if(i)for(var r of e)try{var n=cm(r.args,am);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:fm[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 mm=Ji("[Error tracking]"),ym="webkit-masked-url:",bm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",ym],_m=["__firefox__","__gCrWeb"];function wm(){return new Le([new Ze,new ni,new Je,new Qe,new ii,new ei,new Ye,new ri],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=Ve.test(o)?o.replace(Ve,"$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>=Ge)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Ge).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||De});var i}))}(n)}}("web:javascript",He,We))}var km=Ji("[ExceptionAutocapture]"),Sm=wm(),xm=e=>{var i=t;i||km.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=Sm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(j(e)&&j(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),!!L(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}},Cm=function(e,i){void 0===i&&(i=!1);var r=t;r||km.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=Sm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),L(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}},Tm={wrapOnError:xm,wrapUnhandledRejection:Cm,wrapConsoleError(t){var e=console;e||km.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=Sm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),L(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=Tm,v.posthogErrorWrappingFunctions=Tm;var Mm=(t,e)=>{if(L(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!H(i)&&"object"==typeof i&&O(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){km.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){km.error("Failed to capture exception for a legacy client",t)}};xm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),Cm(n,!0)}};v.extendPostHogWithExceptionAutoCapture=Mm,v.extendPostHogWithExceptionAutocapture=Mm;var Im="X-POSTHOG-SESSION-ID",Em="X-POSTHOG-WINDOW-ID",Rm="X-POSTHOG-DISTINCT-ID",Pm=[Im,Em,Rm],Am=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Fm=(t,e)=>({}.hasOwnProperty.call(t,e)),Om=t=>"object"==typeof t&&!H(t)||L(t),Lm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Dm=e=>{try{var i;return Lm(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}},$m=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(O(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(Im,o.sessionId),n.set(Em,l),a=!0}var u=(t=>L(t)?t():t)(e);return u&&u!==Ps&&(n.set(Rm,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Nm={_patchFetch:(e,i,r)=>Vv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=Dm(n);if(l)if(Lm(n)){var u=new Request(n,s);$m(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(Om(s)?s.headers:void 0);if($m(e,i,r,l,h)){var d=((t,e)=>{if(q(t)||H(t))return{headers:e};if(Om(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)=>Fm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Fm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Am.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&Am.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var 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)=>Vv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=Dm(s);d&&$m(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return Pm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Nm,v.postHogTracingHeadersPatchFns=Nm,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});let qm=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 jm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Bm=t=>{if("loading"===document.readyState)return"loading";var e=jm();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"},Hm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},zm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Hm(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},Um=new WeakMap;function Wm(t,e){var i=Um.get(e);return i||(i=new WeakMap,Um.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Vm=-1,Gm=()=>Vm,Zm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Vm=e.timeStamp,t(e))}),!0)},Qm=(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))}},Jm=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Km=()=>{var t,e;return null!==(t=null==(e=jm())?void 0:e.activationStart)&&void 0!==t?t:0},Ym=-1,Xm=new Set,ty=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ey=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Xm)e();isFinite(Ym)||(Ym="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ey,!0))}},iy=function(t){if(void 0===t&&(t=!1),t&&(Ym=1/0),0>Ym){var e,i=Km(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Ym=null!=r?r:ty(),addEventListener("visibilitychange",ey,!0),addEventListener("prerenderingchange",ey,!0),Zm((()=>{setTimeout((()=>{Ym=ty()}))}))}return{get firstHiddenTime(){return Ym},onHidden(t){Xm.add(t)}}},ry=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=jm(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Gm()?o&&(document.prerendering||Km()>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=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){}},sy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},ay=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},oy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class ly{constructor(){this.u=void 0}}var uy,hy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},dy=[1800,3e3],vy=function(t,e){void 0===e&&(e={});var i=sy(e);hy((()=>{var r,n=Wm(e,ly),s=iy(),a=ry("FCP"),o=ny(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Km(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Qm(t,a,dy,e.reportAllChanges),Zm((i=>{a=ry("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Gm()),r=Qm(t,a,dy,e.reportAllChanges),Jm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&ny(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&ay(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=ry("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Qm(t,a,dy,e.reportAllChanges))(!0)}))}),e)}))},cy=[.1,.25],fy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],py=function(t,e){void 0===e&&(e={});var i=Wm(e=Object.assign({},e),qm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=fy(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:zm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=iy();vy(oy((()=>{var r,n=ry("CLS",0),s=Wm(e,qm),a=(i,a,o,l,u)=>{n=ry("CLS",0,i,a,o,l,u),s.o=0,r=Qm(t,n,cy,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"];sy(e)&&h.push("soft-navigation");var d=ny(h,u);d&&(r=Qm(t,n,cy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Zm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Gm()),Jm(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=fy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Bm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},gy=function(t,e){void 0===e&&(e={});var i=Wm(e=Object.assign({},e),ly);sy(e)&&(i.u=new Map),vy((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Bm(Gm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=jm(),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:Bm(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)},my=0,yy=1/0,by=0,_y=t=>{for(var e of t)e.interactionId&&(yy=Math.min(yy,e.interactionId),by=Math.max(by,e.interactionId),my=by?(by-yy)/7+1:0)},wy=()=>{var t;return uy?my:null!==(t=performance.interactionCount)&&void 0!==t?t:0};let ky=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return wy()-this.h}D(){this.h=wy(),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 Sy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=oy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},xy=[200,500],Cy=function(t,e){void 0===e&&(e={});var i=Wm(e=Object.assign({},e),ky),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(Sy(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:zm(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};ny(["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=iy();hy((()=>{var r;"interactionCount"in performance||uy||(uy=ny(["event"],_y,{durationThreshold:0}));var n,s=ry("INP"),a=Wm(e,ky),o=(i,r,o,l,u)=>{a.D(),s=ry("INP",-1,i,r,o,l,u),n=Qm(t,s,xy,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),Sy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];sy(e)&&d.push("soft-navigation");var v=ny(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Qm(t,s,xy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Zm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Gm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Bm(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:Bm(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 Ty=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],My=50,Iy=[];ny(["resource"],(t=>{for(var e of t)Iy.push(e),Iy.length>My&&Iy.shift()}));var Ey=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(My=e.resourceBufferSize);var i=Wm(e,Ty),r=new WeakMap;sy(e)&&(i.u=new Map),i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:zm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=sy(e);hy((()=>{var n,s=iy(),a=ry("LCP"),o=Wm(e,Ty),l=(r,o,l,u,h)=>{a=ry("LCP",-1,r,o,l,u,h),n=Qm(t,a,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=iy(!0))},u=t=>{o.u&&t.navigationId&&ay(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-Km(),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=ny(d,h);if(v){n=Qm(t,a,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Sy((()=>{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,Gm()),n=Qm(t,a,$,e.reportAllChanges),Jm((()=>{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&&(Iy.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=jm())?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)},Ry=-1,Py=()=>Ry,Ay=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ry=e.timeStamp,t(e))}),!0)},Fy=(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))}},Oy=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Ly=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Dy=()=>{var t,e;return null!==(t=null==(e=Ly())?void 0:e.activationStart)&&void 0!==t?t:0},$y=-1,Ny=new Set,qy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,jy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ny)e();isFinite($y)||($y="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",jy,!0))}},By=function(t){if(void 0===t&&(t=!1),t&&($y=1/0),0>$y){var e,i=Dy(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;$y=null!=r?r:qy(),addEventListener("visibilitychange",jy,!0),addEventListener("prerenderingchange",jy,!0),Ay((()=>{setTimeout((()=>{$y=qy()}))}))}return{get firstHiddenTime(){return $y},onHidden(t){Ny.add(t)}}},Hy=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Ly(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Py()?o&&(document.prerendering||Dy()>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}},zy=new WeakMap;function Uy(t,e){var i=zy.get(e);return i||(i=new WeakMap,zy.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Wy{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 Vy=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){}},Gy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Zy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Qy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};class Jy{constructor(){this.l=void 0}}var Ky,Yy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xy=[1800,3e3],tb=function(t,e){void 0===e&&(e={});var i=Gy(e);Yy((()=>{var r,n=Uy(e,Jy),s=By(),a=Hy("FCP"),o=Vy(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Dy(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Fy(t,a,Xy,e.reportAllChanges),Ay((i=>{a=Hy("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Py()),r=Fy(t,a,Xy,e.reportAllChanges),Oy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Vy(["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=Hy("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Fy(t,a,Xy,e.reportAllChanges))(!0)}))}),e)}))},eb=[.1,.25],ib=function(t,e){void 0===e&&(e={});var i=By();tb(Qy((()=>{var r,n=Hy("CLS",0),s=Uy(e,Wy),a=(i,a,o,l,u)=>{n=Hy("CLS",0,i,a,o,l,u),s.i=0,r=Fy(t,n,eb,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"];Gy(e)&&h.push("soft-navigation");var d=Vy(h,u);d&&(r=Fy(t,n,eb,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Ay((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Py()),Oy(r)})),setTimeout(r))})))},rb=0,nb=1/0,sb=0,ab=t=>{for(var e of t)e.interactionId&&(nb=Math.min(nb,e.interactionId),sb=Math.max(sb,e.interactionId),rb=sb?(sb-nb)/7+1:0)},ob=()=>{var t;return Ky?rb:null!==(t=performance.interactionCount)&&void 0!==t?t:0};class lb{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return ob()-this.u}M(){this.u=ob(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort(((t,e)=>e.P-t.P)),this.v.length>10){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 ub=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Qy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},hb=[200,500],db=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=By();Yy((()=>{var r;"interactionCount"in performance||Ky||(Ky=Vy(["event"],ab,{durationThreshold:0}));var n,s=Hy("INP"),a=Uy(e,lb),o=(i,r,o,l,u)=>{a.M(),s=Hy("INP",-1,i,r,o,l,u),n=Fy(t,s,hb,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),ub((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Gy(e)&&d.push("soft-navigation");var v=Vy(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Fy(t,s,hb,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Ay((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Py())})))}))}};class vb{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}}var cb=[2500,4e3],fb=function(t,e){void 0===e&&(e={});var i=!1,r=Gy(e);Yy((()=>{var n,s=By(),a=Hy("LCP"),o=Uy(e,vb),l=(r,o,l,u,h)=>{a=Hy("LCP",-1,r,o,l,u,h),n=Fy(t,a,cb,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=By(!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-Dy(),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=Vy(d,h);if(v){n=Fy(t,a,cb,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;ub((()=>{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});Ay((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Py()),n=Fy(t,a,cb,e.reportAllChanges),Oy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},pb={onLCP:Ey,onCLS:py,onFCP:gy,onINP:Cy,withoutAttribution:{onLCP:fb,onCLS:ib,onFCP:tb,onINP:db}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=pb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=pb,v.postHogWebVitalsCallbacks=pb;var gb={onLCP:fb,onCLS:ib,onFCP:tb,onINP:db};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=gb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=gb,v.postHogWebVitalsCallbacks=gb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>gb;var mb={onLCP:Ey,onCLS:py,onFCP:gy,onINP:Cy,withoutAttribution:{onLCP:fb,onCLS:ib,onFCP:tb,onINP:db}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=mb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=mb,v.postHogWebVitalsCallbacks=mb;var yb={onLCP:fb,onCLS:ib,onFCP:tb,onINP:db};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=yb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=yb,v.postHogWebVitalsCallbacks=yb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>yb;class bb{constructor(t){this.disabled=!1===t;var e=D(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 _b="$copy_autocapture",wb=Ji("[AutoCapture]");function kb(t,e){return e.length>t?e.slice(0,t)+"...":e}function Sb(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!xr(e));return e}function xb(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")&&Ir>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,k=!1;if(Yi(d,(t=>{var e=Zr(t);if(Cr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&nn(i))&&(h?Re(i):i)}w(Pr(t),"ph-no-capture")&&(k=!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()?kb(1024,sn(t)):kb(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)&&(!j(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=Er(o).join(" ")),a["attr__"+i.name]=kb(1024,"href"===i.name&&n?Re(o):o)}}));for(var l=1,u=1,h=t;h=Sb(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)}))})),k)return{props:{},explicitNoCapture:k};if(o||(y[0].$el_text=Cr(e,"a")||Cr(e,"button")?sn(e):Fr(e)),_){var S,x;y[0].attr__href=_;var C=null==(S=hr(_))?void 0:S.host,T=null==t||null==(x=t.location)?void 0:x.host;C&&T&&C!==T&&(g=_)}return{props:Xi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,O(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 Cb{constructor(t){this.name="autocapture",this.Rs=!1,this.Ps=null,this.As=!1,this.Fs=!1,this.mn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Os=!1,this.Ls=t,this.Ls.refresh(this.mn),this.rageclicks=new bb(this.mn.rageclick),this.Ds=null}setup(t){this.$s(),this.Ns=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Os?e.dispose():(this.qs=e,this.startIfEnabled())}dispose(){var t;this.Os||(this.Os=!0,this.Ns=void 0,null==(t=this.qs)||t.dispose(),this.qs=void 0,this.js())}Bs(){return this.Ls.refresh(this.mn),this.mn}$s(){var t,e;return this.Bs(),this.mn.url_allowlist=null==(t=this.mn.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.mn.url_ignorelist=null==(e=this.mn.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.mn}Hs(){if(this.isBrowserSupported()){if(t&&r){var e=this.zs=e=>{e=e||(null==t?void 0:t.event);try{this.Us(e)}catch(t){wb.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.Bs().capture_copied_text){var i=this.Ws=e=>{e=e||(null==t?void 0:t.event);try{this.Us(e,_b)}catch(t){wb.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 wb.info("Disabling Automatic Event Collection because this browser is not supported")}js(){this.zs&&(null==r||r.removeEventListener("submit",this.zs,!0),null==r||r.removeEventListener("change",this.zs,!0),null==r||r.removeEventListener("click",this.zs,!0),this.zs=void 0),this.Ws&&(null==r||r.removeEventListener("copy",this.Ws,!0),null==r||r.removeEventListener("cut",this.Ws,!0),null==r||r.removeEventListener("paste",this.Ws,!0),this.Ws=void 0),this.Rs=!1}startIfEnabled(){!this.Os&&this.Ns&&this.isEnabled&&!this.Rs&&(this.Hs(),this.Rs=!0)}onRemoteConfig(t){if(!this.Os)if(this.As=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Fs=e.elementsChainAsString);var i,r=e.autocapture_opt_out;V(r)&&(null==(i=this.Ns)||i.kv.set(Rn,r),this.Ps=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Ds=t}getElementSelectors(t){var e,i=[];return null==(e=this.Ds)||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.Os)return!1;var i=null==(t=this.Ns)?void 0:t.kv.get(Rn),r=this.Ps,n=this.Bs(),s=n.remoteRequestsDisabled&&!this.As;if(H(r)&&!V(i)&&!s)return!1;var a=null!==(e=this.Ps)&&void 0!==e?e:!!i;return!!n.enabled&&!a}Us(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Or(e);Tr(r)&&(r=r.parentNode||null);var n,s=this.$s();"$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.Us(e,"$rageclick");var a=i===_b,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(q(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=xb(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Fs,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===_b){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.Ns)||l.capture(i,h).catch((t=>wb.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return L(null==r?void 0:r.querySelectorAll)}}var Tb={};function Mb(e,i){var r=Tb[e];if(r)return r;var n=i[e];if((t=>L(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return Tb[e]=n.bind(i);var s=i.document;if(s&&L(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 w(t,"AppleWebKit")&&!w(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&&L(n)?Tb[e]=n.bind(i):n}function Ib(t,e){var i=Or(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Eb(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Rb(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Pb="canvas,video,audio,embed,object",Ab=1e3;function Fb(t,e){return U(t)&&t>=e}function Ob(t){return t>=0&&Ab>t?t:void 0}function Lb(t,e){return e?Ob(t-e):void 0}class Db{Gi(t){var e,i,r,n,s,a,o,l,u=this.Qi((null==t?void 0:t.__onCapture)||this.Ji.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.Yi=[],this.Ki=0,this.Qi=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.Xi=t=>{var e=Ib(t,{type:"click"});H(e)||this.en(e)||this.tn(e),this.rn()},this.nn=()=>{var t=Date.now();this.an=t,t%50==0&&this.Yi.forEach((e=>{q(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.sn=()=>{this.un=Date.now()},this.Vt=()=>{var t=Date.now();this.ln=t,this.hn("visibilityChangedDelayMs",t)},this.cn=()=>{var t=Date.now();this.dn=t,this.hn("focusChangedDelayMs",t)},this.vn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.fn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.pn=()=>{this.fn=void 0},this.gn=t=>{var e,i=this.fn;if(this.fn=void 0,!q(i)&&this.mn.max_dead_swipes_per_page_load>this.Ki){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.mn.swipe_threshold_px;if(l>=u*u&&![this.an,this.yn,this.un].some((t=>U(t)&&t>=i.timestamp))){var h;if(this.bn()&&(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(Pb))))return;var d=Ib(n,{type:"swipe",swipeDirection:Eb(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});H(d)||this.en(d)||this.tn(d),this.rn()}}}},this.instance=t,this.mn=this.Gi(e),this._onCapture=this.mn.__onCapture}start(t){this.wn(),this.kn(),this._n(),this.Sn(),this.xn(),this.Cn(t),this.mn.capture_dead_swipes&&this.Mn()}Cn(t){if(!this.Tn){var e=function(t){return Mb("MutationObserver",t)}(v);this.Tn=new e((t=>{this.In(t)})),this.Tn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Tn)||t.disconnect(),this.Tn=void 0,v.removeEventListener("click",this.Xi),v.removeEventListener("scroll",this.nn,{capture:!0}),v.removeEventListener("selectionchange",this.sn),v.removeEventListener("touchstart",this.vn,{capture:!0}),v.removeEventListener("touchend",this.gn,{capture:!0}),v.removeEventListener("touchcancel",this.pn,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.Vt),v.removeEventListener("blur",this.cn),v.removeEventListener("focus",this.cn),this.fn=void 0}In(t){this.yn=Date.now()}wn(){ar(v,"click",this.Xi)}tn(t){t.visibilityChangedDelayMs=Lb(t.timestamp,this.ln),t.focusChangedDelayMs=Lb(t.timestamp,this.dn),this.Yi.push(t)}rn(){this.Yi.length&&q(this.Rn)&&(this.Rn=v.setTimeout((()=>{this.An()}),1e3))}kn(){ar(v,"scroll",this.nn,{capture:!0})}_n(){ar(v,"selectionchange",this.sn)}Sn(){ar(r,"visibilitychange",this.Vt)}xn(){ar(v,"blur",this.cn),ar(v,"focus",this.cn)}hn(t,e){this.Yi.forEach((i=>{var r=Ob(e-i.timestamp);U(r)&&(q(i[t])||i[t]>r)&&(i[t]=r)}))}Mn(){ar(v,"touchstart",this.vn,{capture:!0,passive:!0}),ar(v,"touchend",this.gn,{capture:!0,passive:!0}),ar(v,"touchcancel",this.pn,{capture:!0,passive:!0})}bn(){var t=q(this.En)||U(this.yn)&&this.yn>this.En;return(q(this.Ln)||t)&&(this.En=Date.now(),this.Ln=!(null==r||!r.querySelector(Pb))),!!this.Ln}en(t){return!t||("swipe"===t.type?this.On(t):this.Dn(t))}On(e){if(Sr(e.node))return!0;var i=this.Yi.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=V(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.mn.css_selector_ignorelist}))}Dn(e){return!(this.mn.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.On(e)||(r=e.node,!(!t||Vr(r))&&Gr(r,!1).targetElementList.some((t=>Cr(t,"a"))));var i,r}An(){if(this.Yi.length){clearTimeout(this.Rn),this.Rn=void 0;var t=this.Yi;for(var e of(this.Yi=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.yn&&this.yn>=e.timestamp?this.yn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.un&&this.un>=e.timestamp?this.un-e.timestamp:void 0;var r=Fb(e.scrollDelayMs,this.mn.scroll_threshold_ms),n=Fb(e.selectionChangedDelayMs,this.mn.selection_change_threshold_ms),s=Fb(e.mutationDelayMs,this.mn.mutation_threshold_ms),a=Fb(e.absoluteDelayMs,1.1*this.mn.mutation_threshold_ms),o=U(e.scrollDelayMs)&&this.mn.scroll_threshold_ms>e.scrollDelayMs,l=U(e.mutationDelayMs)&&this.mn.mutation_threshold_ms>e.mutationDelayMs,u=U(e.selectionChangedDelayMs)&&this.mn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=U(e.visibilityChangedDelayMs),d=U(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=Rb(e);if("$dead_swipe"===v){if(this.Ki>=this.mn.max_dead_swipes_per_page_load)continue;this.Ki++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.yn,[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.mn.mutation_threshold_ms>e.absoluteDelayMs&&this.Yi.push(e)}this.rn()}}Ji(t,e){var i=Rb(t);this.instance.capture(i,p({},e,xb(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.mn.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 Db(t,e);var $b=Ji("[ExternalScriptsLoader]"),Nb=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]},qb=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return $b.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=Nb(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(Nb(e))return qb(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)},jb={},Bb=(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=jb[n];if("fallback"===r&&s){if(Nb(s))return void qb(t,s,i);delete jb[n]}qb(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=Bb(t,e);jb[n]=o;var l=Nb(n);null==l||null==(a=l.parentNode)||a.removeChild(l),qb(t,o,i)}else i(void 0,s)}:i)}else qb(t,Bb(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");qb(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);qb(t,r,i)};class Hb{constructor(t){this._instance=t}get mn(){return this._instance.config}get consent(){return this.Vs()?0:this.Gs}isOptedOut(){return this.mn.cookieless_mode===Vs||this.isRejected()||-1===this.consent&&this.mn.cookieless_mode===Ws}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.mn.opt_out_capturing_by_default}optInOut(t){this.Zs.ni(this.Qs,t?1:0,this.mn.cookie_expiration,this.mn.cross_subdomain_cookie,this.mn.secure_cookie)}reset(){this.Zs.oi(this.Qs,this.mn.cross_subdomain_cookie)}get Qs(){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 Gs(){var t=this.Zs.ai(this.Qs);return it(t)?1:w(rt,t)?0:-1}get Zs(){var t=this.mn.opt_out_capturing_persistence_type,e="localStorage"===t?wp:bp,i=e.ii()?e:Fp;if(!this.Js||this.Js!==i){this.Js=i;var r="localStorage"===t?bp:wp;r.ai(this.Qs)&&(this.Js.ai(this.Qs)||this.optInOut(it(r.ai(this.Qs))),r.oi(this.Qs,this.mn.cross_subdomain_cookie))}return this.Js}Vs(){return!!this.mn.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack,null==i?void 0:i.globalPrivacyControl].some((t=>it(t)))}}var zb=Ji("[Dead Clicks]"),Ub=()=>!0,Wb=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Dn)),r=t.instance.config.capture_dead_clicks;return V(r)?r:!!D(r)||i};class Vb{get lazyLoadedDeadClicksAutocapture(){return this.Ks}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({[Dn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ys((()=>{this.Xs()})):this.stop()}Ys(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?zb.error("failed to load script",e):t()}))}Xs(){var t;if(r){if(!this.Ks&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=D(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.Ks=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ks.start(r),zb.info("starting...")}}else zb.error("`document` not found. Cannot start.")}stop(){this.Ks&&(this.Ks.stop(),this.Ks=void 0,zb.info("stopping..."))}}var Gb=Ji("[SegmentIntegration]");function Zb(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||fp();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(xs,Zs)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&L(s.then)?s.then(n):n(s)}(t,(i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Gb.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Gb.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Gb.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,Ys)},identify(t){return i(t,ta)},screen(t){return i(t,"$screen")}}})(t,i)).then((()=>{e()}),(t=>{Gb.error("Failed to register the Segment integration",t),e()}))}),i)}var Qb="posthog-js";function Jb(t,e){var i=void 0===e?{}:e,r=i.organization,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 Kb{constructor(t,e,i,r,n,s){this.name=Qb,this.setupOnce=function(a){a(Jb(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Yb{constructor(t){this.ta=(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.ea=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.ia()}ia(){var t;this.ra=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.ta)}destroy(){var t;null==(t=this.ra)||t.call(this),this.ra=void 0}doPageView(e,i){var r,n=this.na(e,i);return this.ea={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.na(t,null==(e=this.ea)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ea)?void 0:t.pageViewId}}na(t,e){var i=this.ea;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(!(q(s)||q(a)||q(o)||q(l)||q(u)||q(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?nt(a/s,0,1,Qi):1,v=s>1?nt(o/s,0,1,Qi):1,c=l>1?nt(u/l,0,1,Qi):1,f=l>1?nt(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 Xb=["flags","surveys"],t_={[kn]:{exposure:"hidden"},[Tn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[En]:{exposure:"hidden"},[In]:{exposure:"hidden"},[Rn]:{exposure:"event"},[Pn]:{exposure:"hidden"},[Nn]:{exposure:"hidden"},[An]:{exposure:"event"},[Fn]:{exposure:"hidden"},[On]:{exposure:"event"},[Ln]:{exposure:"event"},[Dn]:{exposure:"event"},[$n]:{exposure:"hidden"},[qn]:{exposure:"event"},[jn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Vn]:{exposure:"hidden"},[Gn]:{exposure:"event"},[Bn]:{exposure:"event",shouldSkipFromEventProperties:t=>H(t)},[Zn]:{exposure:"event"},[Qn]:{exposure:"event"},[Jn]:{exposure:"event"},[ts]:{exposure:"event"},[es]:{exposure:"hidden"},[is]:{exposure:"hidden",storageGroup:"flags"},[rs]:{exposure:"hidden",storageGroup:"flags"},[ns]:{exposure:"hidden"},[ss]:{exposure:"hidden",storageGroup:"flags"},[as]:{exposure:"hidden",storageGroup:"flags"},[os]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ls]:{exposure:"hidden",storageGroup:"flags"},[us]:{exposure:"hidden"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden"},[vs]:{exposure:"hidden"},[fs]:{exposure:"hidden",storageGroup:"surveys"},[ps]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[gs]:{exposure:"event"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[bs]:{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"},[_s]:{exposure:"hidden"},[ws]:{exposure:"hidden"},[cs]:{exposure:"event"},[ks]:{exposure:"hidden"},[Ss]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xs]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Is]:{exposure:"hidden"},[Es]:{exposure:"hidden"},[Rs]:{exposure:"hidden"},[Hn]:{exposure:"event"},[zn]:{exposure:"event"},[Un]:{exposure:"event"},[Wn]:{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"},[Hs]:{exposure:"event"},[zs]:{exposure:"event"}},e_=[[Kn,{exposure:"hidden"}],[Yn,{exposure:"hidden"}],[Xn,{exposure:"hidden"}]],i_=t=>{var e=t_[t];if(e)return e;for(var i of e_){var r=i[1];if(0===t.indexOf(i[0]))return r}},r_={flags:Ss,surveys:ps},n_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],s_=t=>t+"_cookie_identity_change_pending",a_=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},o_="main",l_=[is,rs,ss,as,os,Ss,ls,ds],u_=t=>-1!==l_.indexOf(t),h_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},d_=t=>{if(!t)return{};var e=JSON.parse(t);return D(e)?e:{}},v_=(t,e)=>{Yi(t,((i,r)=>{var n=i_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class c_{constructor(e,i,r){if(void 0===r&&(r=!0),this.sa={},this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=new Map,this.va=!1,this.ca=!1,this.fa=!1,this.pa=!1,this.ga=new Set,this.mn=e,this.ma=r,this.props={},this.ya=void 0,this.ba=(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.Zs=this._a(e),this.la=this.wa(e),this.load(),this.ka(),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.Sa=e=>{if(this.aa&&(!e.storageArea||e.storageArea===(null==t?void 0:t.localStorage))&&e.key)if(e.key!==this.ba){if(this.la){var i=Xb.find((t=>e.key===this.xa(t)));i&&this.Ca(e.key,i)}}else this.Ca(e.key,o_)},ar(t,"storage",this.Sa)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach((t=>{var e=t[0],i=t[1],r=this.da.get(e);if(u_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach((t=>n.add(t))),n.size&&this.Ta(e,n)}else this.Ta(e,!0)}))}onCrossTabFeatureFlagChange(t){return this.ga.add(t),()=>this.ga.delete(t)}destroy(){this.Sa&&t&&(t.removeEventListener("storage",this.Sa),this.Sa=void 0),this.ga.clear()}Ca(t,e,i){if(void 0===i&&(i=!0),this.Ma)return!1;var r,n;try{if(n=wp.ai(t),H(n)){var s=this.Ia(e);return s.storageValue=null,e!==o_&&(s.persisted=!1),!1}r=d_(n)}catch(t){return!1}var a=e===o_?r:wp.ui(this.ba);if(a&&this.Ea(a))return!1;var o=this.Ra(r,e,i);return e===o_&&this.la&&!h_(this.Pa().main,r)||this.Aa(r,e,!0,n),o}Ea(t){var e=this.props[Sn],i=t[Sn];return!q(e)&&!q(i)&&e!==i}Aa(t,e,i,r){var n=this.Ia(e);n.storageValue=r,e!==o_&&(n.persisted=i);try{n.fingerprint=this.Fa(t,e)}catch(t){n.fingerprint=void 0}}Ra(t,e,i){var r=!1;return l_.forEach((i=>{var n,s=null==(n=i_(i))?void 0:n.storageGroup;if(!(e===o_&&this.la&&s||e!==o_&&s!==e)){var a=i in t,o=this.Oa(i,a?t[i]:void 0),l=this.da.has(i)?i in this.props:a;l===i in this.props&&h_(o,this.props[i])||(l?this.La(i,o,!1):this.Da(i,!1),r=!0)}})),r&&i&&this.ga.forEach((t=>t())),r}$a(){if(!this.aa)return!1;try{this.fa=!1;var t,e=wp.ai(this.ba),i=this.Ia(o_),r=!1,n=!1;if(e!==i.storageValue)if(H(e))i.storageValue=null;else{if(t=d_(e),this.fa=!this.ca&&this.Ea(t),this.fa)return!1;n=this.Ra(t,o_,!1),!this.la||h_(this.Pa().main,t)?this.Aa(t,o_,!0,e):i.storageValue=e,r=!0}return this.la&&Xb.forEach((e=>{var i=wp.ai(this.xa(e)),s=this.Ia(e),a=t||{},o=r&&l_.some((t=>{var i;return(null==(i=i_(t))?void 0:i.storageGroup)===e&&t in a}));if(i!==s.storageValue||o){if(H(i))return s.storageValue=null,s.persisted=!1,void(o&&(n=this.Ra(a,e,!1)||n));var l=d_(i);n=this.Ra(l,e,!1)||n,this.Aa(l,e,!0,i)}})),n}catch(t){return!1}}Ta(t,e){this.da.set(t,e);var i=i_(t);null!=i&&i.volatile||(this.Ia((this.la?null==i?void 0:i.storageGroup:void 0)||o_).fingerprint=void 0,this.Na(t))}qa(){l_.forEach((t=>this.da.set(t,!0)))}ka(){if(this.aa)try{var t=wp.ai(this.ba),e=d_(t);this.Ia(o_).storageValue=t,l_.forEach((t=>{var i,r=this.la?null==(i=i_(t))?void 0:i.storageGroup:void 0,n=r?wp.ai(this.xa(r)):null;if(r){var s=this.Ia(r);s.storageValue=n,s.persisted=!H(n)}var a=r&&!H(n)?d_(n):e;t in this.props?this.ja(t,a[t],this.props[t]):t in a&&this.Ta(t,!0)}))}catch(t){}}Oa(t,e){var i=this.da.get(t);if(!i)return e;if(!0===i)return this.props[t];if(t===rs){var r=new Set(O(e)?e:[]),n=new Set(O(this.props[t])?this.props[t]:[]);return i.forEach((t=>n.has(t)?r.add(t):r.delete(t))),Array.from(r)}var s=D(e)?p({},e):{},a=D(this.props[t])?this.props[t]:{};return i.forEach((t=>{t in a?s[t]=a[t]:delete s[t]})),s}ja(t,e,i){if(u_(t)){var r=this.da.get(t);if(!0!==r){var n=e;if(this.aa)try{var s,a=this.la?null==(s=i_(t))?void 0:s.storageGroup:void 0,o=a?this.xa(a):this.ba;n=d_(wp.ai(o))[t]}catch(t){}var l=new Set(r||[]);if(t===rs){if(!q(e)&&!O(e)||!q(n)&&!O(n)||!O(i))return void this.Ta(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(!D(i))return void(h_(n,i)?this.da.delete(t):this.Ta(t,!0));if(!q(e)&&!D(e)||q(e)&&N(i)&&q(n))return void this.Ta(t,!0);var v=D(e)?e:{},c=D(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach((t=>{t in v==t in i&&h_(v[t],i[t])||l.add(t)})),l.forEach((t=>{t in c==t in i&&h_(c[t],i[t])&&l.delete(t)}))}l.size?this.Ta(t,l):this.da.delete(t)}}}Ba(){var t,e=null==(t=this.mn)?void 0:t.persistence_save_debounce_ms;return U(e)&&e>0?e:0}Ha(t){if(this.mn.cookieWinsOnConflict&&"localstorage+cookie"===this.mn.persistence.toLowerCase())if(t)try{var e=Mp(t,this.mn.cookie_persisted_properties||[]),i=Ep(e,this.mn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=bp.ai(this.ba)||void 0;n&&Pp(this.ba,n)===r&&(this.za=r,this.Ua=n)}catch(t){}else try{var s=bp.ai(this.ba)||void 0;this.za=s?Pp(this.ba,s):void 0,this.Ua=s}catch(t){}}syncCookieProperties(){return this.Wa(this.mn)}Wa(t,e){if(void 0===e&&(e=!1),this.Ma&&!e||this.ha||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=bp.ai(this.ba)||void 0}catch(t){}if(!i||i===this.Ua)return!1;var r,n=Pp(this.ba,i);try{r=Tp(JSON.parse(i))}catch(t){return!1}if((bp.ai(this.ba)||void 0)!==i)return!1;this.za=n,this.Ua=i;var s=Rp(this.ba,i),a=[...Sp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(q(e)||H(e)||""===e||t===xs&&e!==Gs&&e!==Zs)&&(o[t]=!0,delete r[t])})),N(r))return!1;var l=Sn in r||r[xs]===Gs||r[xs]===Zs,u=this.props,h=u[Sn],d=u[xs],v=Xi({},u);[...Sp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==Sn&&t!==xs)){var e=v[t];!s.isValid&&-1!==Sp.indexOf(t)&&(!1===e||0===e)||delete v[t]}})),this.props=Xi(v,r),l_.forEach((t=>{var e=t in this.props;t in u===e&&h_(u[t],this.props[t])||(e?this.ja(t,u[t],this.props[t]):this.Ta(t,!0))})),!l||xs in r||xs in this.props||this.La(xs,Gs);var c=this.props[Sn],f=this.props[xs];return!l||c===h&&f===d||(this.ca=!0,this.ua=!0,Lp.ni(s_(this.ba),!0),this.Da(ds),this.Da(rs),this.Da(is),this.Da(ss),this.Da(as),this.Da(os),this.Da(Ss),this.Da(ks),this.Da(_s),f===Gs&&(d===Zs||r[xs]===Gs||!q(h)&&c!==h)&&(v_(this.props,r),this.Da(vs)),f===Zs?this.props.$user_id=c:delete this.props.$user_id,this.Da(Tn)),!0}consumeCookieIdentityChange(){var t=s_(this.ba),e=this.ua||!!Lp.ai(t);return this.ua=!1,e&&Lp.oi(t),e}Va(t){return void 0===t&&(t=!1),!(this.ha||this.Ma&&!t||!this.mn.cookieWinsOnConflict||"localstorage+cookie"!==this.mn.persistence.toLowerCase()||(this.ha=!0,0))}Ga(){this.ha&&(q(this.Za)||(clearTimeout(this.Za),this.Za=void 0),delete this.sa[o_],this.Qa(!0))}Ja(t){if(void 0===t&&(t=!0),this.ha)try{t?this.Ga():q(this.Za)||(clearTimeout(this.Za),this.Za=void 0)}finally{this.ha=!1}}isDisabled(){return!!this.Ma}_a(e){-1===n_.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=[...Sp,...e];return p({},wp,{ui(t){try{var e,n={};try{e=bp.ai(t)||void 0,n=e?Tp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(wp.ai(t)||"{}");if(i){var o=Rp(t,e),l=[...Sp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];H(e)||""===e||t===xs&&e!==Gs&&e!==Zs||(u[t]=e)}));var h=Sn in u||u[xs]===Gs||u[xs]===Zs;if(Object.keys(u).length>0){var d,v=a[Sn],c=null!==(d=a[xs])&&void 0!==d?d:Gs;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==Sn&&t!==xs)){var e=a[t];!o.isValid&&-1!==Sp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||xs in n||xs in a||(a[xs]=Gs),!h||(Sn in u?u[Sn]:a[Sn])===v&&(xs in u?u[xs]:a[xs])===c||(kp.forEach((t=>delete a[t])),u[xs]===Zs&&Sn in u?a.$user_id=u[Sn]:delete a.$user_id,u[xs]!==Zs&&(delete a[cs],delete a[vs]),delete a.__alias)}s=Xi(a,u)}else s=Xi(n,a);return wp.ni(t,s),s}catch(t){}return null},ni(t,r,n,s,a,o){var l=wp.ni(t,r,void 0,void 0,o);try{var u=Mp(r,e);if(Object.keys(u).length){if(i){var h=xp(t),d=Ep(u,e);if(bp.ni(h,d,n,s,a,o),bp.ai(h)!==JSON.stringify(d)){bp.oi(h,s);var v=Mp(r);return bp.ni(t,v,n,s,a,o),l}}bp.ni(t,u,n,s,a,o)}}catch(t){wp.si(t)}return l},oi(e,i){try{null==t||t.localStorage.removeItem(e),bp.oi(e,i),bp.oi(xp(e),i)}catch(t){wp.si(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=!1,a=e.persistence.toLowerCase();return"localstorage"===a&&wp.ii()?(i=wp,s=!0):"localstorage+cookie"===a&&r.ii()?(i=r,s=!0,n=!0):"sessionstorage"===a&&Lp.ii()?i=Lp:"memory"===a?i=Fp:"cookie"===a&&bp.ii()?(i=bp,n=!0):r.ii()?(i=r,s=!0,n=!0):bp.ii()?(i=bp,n=!0):i=Fp,this.aa=s,this.oa=n,i}xa(t){return this.ba+"__"+t}wa(t){return this.aa&&!!t.split_storage}properties(){var t={};return Yi(this.props,((e,i)=>{var r=i_(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.Ma||t){var e=this.mn.cookieWinsOnConflict&&"localstorage+cookie"===this.mn.persistence.toLowerCase(),i=e?wp.ui(this.ba):null,r={};if(e)try{Yi(r=Tp(bp.ui(this.ba)),((t,e)=>{(q(t)||H(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.Zs.ui(this.ba);if(n&&(this.props=Xi({},n)),this.la&&this.Ka(),e&&n){var s,a,o=null==i?void 0:i[Sn],l=null!==(s=null==i?void 0:i[xs])&&void 0!==s?s:Gs,u=n[Sn],h=null!==(a=n[xs])&&void 0!==a?a:Gs;if(u!==o||h!==l){this.ua=!0,Lp.ni(s_(this.ba),!0);var d=Xi({},this.props);kp.forEach((t=>delete d[t])),h===Gs&&(l===Zs||r[xs]===Gs||!q(o)&&u!==o)&&(v_(d,r),delete d[vs]),this.props=d;var v=new Set;kp.forEach((t=>{var e,i=null==(e=i_(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Yi(this.props,((i,r)=>{var n;(null==(n=i_(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),N(e)?(wp.oi(this.xa(t)),this.sa[t]={}):wp.ni(this.xa(t),e)&&(this.sa[t]={persisted:!0,fingerprint:this.Fa(e,t)})}))}}Lp.ai(s_(this.ba))&&(this.ua=!0)}}Ka(){for(var t of Xb){var e=wp.ui(this.xa(t));if(e&&!N(e)){var i=this.Ia(t);i.persisted=!0,this.Ya(t)||(i.fingerprint=this.Fa(e,t)),this.Xa(t,e)||Xi(this.props,e)}}}Ya(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=i_(e))?void 0:i.storageGroup)===t}))}Xa(t,e){var i=r_[t];if(!i)return!1;var r=e[i],n=this.props[i];return U(r)&&U(n)&&n>r}refreshKey(t){var e;if(!(this.Ma||t===In&&this.pa)){var i=this.la?null==(e=i_(t))?void 0:e.storageGroup:void 0,r=i?wp.ui(this.xa(i)):this.Zs.ui(this.ba);if(r&&t in r)this.La(t,r[t],!1);else{if(i){var n=this.Zs.ui(this.ba);if(n&&t in n)return void this.La(t,n[t],!1)}this.Da(t,!1)}}}save(){if(!this.Ma){var t=this.Ba();t>0?q(this.Za)&&(this.Za=setTimeout((()=>{this.Za=void 0,this.Qa()}),t)):this.Qa()}}flush(){q(this.Za)||(clearTimeout(this.Za),this.Za=void 0,this.Qa())}Qa(t){if(void 0===t&&(t=!1),!(this.Ma||this.ha&&!t)){t||(this.syncCookieProperties(),this.pa||this.mn.cookieWinsOnConflict&&"localstorage+cookie"===this.mn.persistence.toLowerCase()||this.refreshKey(In));var e=!t&&!this.va;e||(this.fa=!1);var i=!!e&&this.$a();if(this.fa)this.mn.debug&&Qi.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.la)return this.eo(),void(i&&this.ga.forEach((t=>t())));var r=this.io(this.Zs,this.ba,this.props,o_);"written"===r&&this.Ha(this.props),"failed"!==r&&(this.da.clear(),this.ca=!1,this.pa=!1),i&&this.ga.forEach((t=>t()))}}}eo(){var t=this,e=this.Pa(),i=e.main,r=e.groups,n=this.io(this.Zs,this.ba,i,o_);"written"===n&&this.Ha(i),"failed"!==n&&(this.ca=!1,this.pa=!1,l_.forEach((t=>{var e;null!=(e=i_(t))&&e.storageGroup||this.da.delete(t)})));var s=function(e){var i,n=r[e];if(N(n)&&(null==(i=t.sa[e])||!i.persisted))return l_.forEach((i=>{var r;(null==(r=i_(i))?void 0:r.storageGroup)===e&&t.da.delete(i)})),1;var s=t.io(wp,t.xa(e),n,e);"failed"!==s&&l_.forEach((i=>{var r=i_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.da.delete(i)}))};for(var a of Xb)s(a)}Pa(){var t={},e={flags:{},surveys:{}};return Yi(this.props,((i,r)=>{var n,s=null==(n=i_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Fa(t,e){if(e===o_)return JSON.stringify(t)+"|"+this.ro+"|"+this.no+"|"+this.so;var i={};return Yi(t,((t,e)=>{var r;i[e]=null!=(r=i_(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}io(t,e,i,r){var n,s=this.Ia(r);if(r!==o_&&!s.dirty&&!q(s.fingerprint))return"skipped";try{if((n=this.Fa(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.ni(e,i,this.ro,this.no,this.so,this.mn.debug)?(s.dirty=!1,r!==o_&&(s.persisted=!0),q(n)||(s.fingerprint=n),this.aa&&(s.storageValue=wp.ai(e)),"written"):(this.mn.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.qa(),q(this.Za)||(clearTimeout(this.Za),this.Za=void 0),this.Zs.oi(this.ba,!1),this.Zs.oi(this.ba,!0),!i&&this.ma)for(var r of Xb)wp.oi(this.xa(r));i?delete this.sa[o_]:this.sa={},this.za=void 0,this.Ua=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(D(t)){this.syncCookieProperties(),q(e)&&(e="None"),this.ro=q(i)?this.ao:i;var r=!1;if(Yi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.La(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(D(t)){this.syncCookieProperties(),this.ro=q(e)?this.ao:e;var i=!1;if(Yi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||D(e)||O(e))&&(this.La(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.Da(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.ya){var e=Jo(this.mn.custom_campaign_params,this.mn.mask_personal_data_properties,this.mn.custom_personal_data_properties),i=!N(rr(e));return i&&this.register(e),this.ya=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Yo(t):{})}update_referrer_info(){var t;this.register_once({$referrer:el(),$referring_domain:null!=r&&r.referrer&&(null==(t=hr(r.referrer))?void 0:t.host)||tl},void 0)}set_initial_person_info(){if(!this.props[Ms]&&!this.props[Is]){var t=il(this.mn.mask_personal_data_properties,this.mn.custom_personal_data_properties,this.mn.disable_capture_url_hashes);this.register_once({[Es]:this.oa?{r:a_(t.r),u:t.u?a_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Yi([Is,Ms],(e=>{var i=this.props[e];i&&Yi(i,(function(e,i){t["$initial_"+S(i)]=e}))}));var e=this.props[Es];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=rl(t,e),r={};return Yi(i,(function(t,e){r["$initial_"+S(e)]=t})),r}(e,this.mn.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.Ma&&!o;o||this.Wa(e,l),this.mn=t,!o&&(r||n||a)&&(this.za=void 0,this.Ua=void 0,this.Wa(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this._a(t):this.Zs;this.oo();var h=this.wa(t),d=s||h!==this.la,v=!o&&(d||t.cross_subdomain_cookie!==this.no||t.secure_cookie!==this.so)&&this.Va(l);this.va=d;try{if(this.ao=this.ro=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.Zs=u,this.la=h,this.props=c,this.save()}else a&&(this.Zs=u,o||(delete this.sa[o_],this.Qa()))}finally{this.va=!1,v&&this.Ja()}}oo(){var t=this.props[Es];if(this.oa&&D(t)&&"string"==typeof t.r){var e=a_(t.r),i="string"==typeof t.u?a_(t.u):t.u;e===t.r&&i===t.u||this.La(Es,p({},t,{r:e,u:i}))}}set_disabled(t){this.Ma=t,this.Ma?this.remove():this.save()}set_cross_subdomain(t){t!==this.no&&(this.no=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.so&&(this.so=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[En]||{};i[t]=e,this.La(En,i),this.save()}remove_event_timer(t){var e=this.props[En]||{},i=e[t];return q(i)||(delete e[t],this.La(En,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.La(t,e),this.save()}La(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&(t!==Sn&&t!==xs||n===e||(this.ca=!0),t!==In||h_(n,e)||(this.pa=!0),this.ja(t,n,e),null!=(r=i_(t))&&r.volatile||this.Na(t))}Da(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(u_(t)&&this.Ta(t,!0),t===In&&(this.pa=!0),this.Na(t))}Na(t){var e,i=null==(e=i_(t))?void 0:e.storageGroup;i&&(this.Ia(i).dirty=!0)}Ia(t){return this.sa[t]||(this.sa[t]={})}}var f_=Ji("[RateLimiter]");class p_{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=>{f_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void f_.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(Ts))&&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=(U(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.lo(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ts,o),{isRateLimited:l,remainingTokens:o.tokens}}uo(t){var e=this.instance.config.property_denylist;return!O(e)||!e.includes(t)}ho(){var t;if(this.uo("$current_url")&&this.uo("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}lo(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ho(),a=this.uo("$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 g_=Ji("[RemoteConfig]");class m_{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}do(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()}vo(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 g_.info("Using preloaded remote config",this.remoteConfig),void this.co(this.remoteConfig);if(this._instance.fo())return void g_.warn("Remote config is disabled. Falling back to local config.");this.do((t=>{if(!t)return g_.info("No config found after loading remote JS config. Falling back to JSON."),void this.vo((t=>{this.co(t.json,t)}));this.co(t)}))}catch(t){g_.error("Error loading remote config",t),this.co()}}co(t,e){!t&&e&&(0===e.statusCode?e.error||g_.warn("Failed to fetch remote config from PostHog."):g_.error("Failed to fetch remote config from PostHog."));try{this._instance.co(t?{ok:!0,config:t}:{ok:!1})}catch(t){g_.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){g_.error("Error loading feature flags",t)}}}var y_=!!a||!!s,b_="text/plain",__=!1,w_=(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:"")},k_=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},S_=t=>{if(t.po)return t.po;var e=t.data,i=t.compression;if(e){if(i===Df){var r=po(go(ur(e)),{mtime:0});return{contentType:b_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===$f){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}}},x_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:k_(t.url,{compression:$f}),encodedBody:S_(p({},t,{compression:$f,po:void 0}))}:{url:w_(t.url,"compression"),encodedBody:S_(p({},t,{compression:void 0,po:void 0}))};try{e=S_(t)}catch(e){if(bi(t.compression,vr(t.url,"compression")))return Qi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&bi(t.compression,vr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?yi(new Uint8Array(i)):ArrayBuffer.isView(i)&&yi(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(__=!0,r()):{url:t.url,encodedBody:e}},C_=t=>{try{return x_(t)}catch(e){return Qi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},T_=function(){var t=f((function*(t){var e=ur(t.data),i=yield xi(e,Gi.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{po:{contentType:b_,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),M_=/Failed to fetch|NetworkError|Load failed/i,I_=t=>"TypeError"===(null==t?void 0:t.name)&&M_.test((null==t?void 0:t.message)||""),E_=t=>{var e=C_(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(Ee("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||I_(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.mo&&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)}}},R_=t=>{try{var e,r=x_(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=O(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(O(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>O(t.data)?e:p({},t.data,{batch:e});return R_(p({},t,{data:v(h.slice(0,d))})),void R_(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"),E_(p({},t,{mo:!0}))}catch(t){Qi.warn("Beacon send failed",t)}},P_=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return k_(i===Df?w_(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Df?{}:{compression:i}))},A_=[];s&&A_.push({transport:"fetch",method:E_}),a&&A_.push({transport:"XHR",method(t){var e=C_(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&&A_.push({transport:"sendBeacon",method:R_});var F_=3e3;class O_{constructor(t,e){this.yo=!0,this.bo=[],this._o=nt((null==e?void 0:e.flush_interval_ms)||F_,250,5e3,Qi.createLogger("flush interval"),F_),this.wo=t}enqueue(t){this.bo.push(t),this.ko||this.So()}unload(){this.xo();var t=this.bo.length>0?this.Co():{},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.To(p({},t,{transport:"sendBeacon"}))}))}enable(){this.yo=!1,this.So()}So(){var t=this;this.yo||(this.ko=setTimeout((()=>{if(this.xo(),this.bo.length>0){var e=this.Co(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&O(i.data)&&Yi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.To(i)};for(var r in e)i()}}),this._o))}To(t){try{this.wo(t)}catch(t){Qi.error(t)}}xo(){clearTimeout(this.ko),this.ko=void 0}Co(){var t={};return Yi(this.bo,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;q(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.bo=[],t}}var L_=["retriesPerformedSoFar"];class D_{constructor(e){this.Mo=!1,this.Io=3e3,this.bo=[],this._instance=e,this.bo=[],this.Eo=!0,!q(t)&&"onLine"in t.navigator&&(this.Eo=t.navigator.onLine,this.Ro=()=>{this.Eo=!0,this.Po()},this.Ao=()=>{this.Eo=!1},ar(t,"online",this.Ro),ar(t,"offline",this.Ao))}get length(){return this.bo.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,L_);W(e)&&(i.url=k_(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.os(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)}}))}os(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.bo.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Qi.warn(n),this.Mo||(this.Mo=!0,this.Fo())}Fo(){if(this.Oo&&clearTimeout(this.Oo),0===this.bo.length)return this.Mo=!1,void(this.Oo=void 0);this.Oo=setTimeout((()=>{this.Eo&&this.bo.length>0&&this.Po(),this.Fo()}),this.Io)}Po(){var t=Date.now(),e=[],i=this.bo.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.bo=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Oo&&(clearTimeout(this.Oo),this.Oo=void 0),this.Mo=!1,q(t)||(this.Ro&&(t.removeEventListener("online",this.Ro),this.Ro=void 0),this.Ao&&(t.removeEventListener("offline",this.Ao),this.Ao=void 0)),this.bo)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Qi.error(t)}}this.bo=[]}}class $_{constructor(t){this.Lo=()=>{var t,e,i,r;this.Do||(this.Do={});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.Do.lastScrollY=Math.ceil(s),this.Do.maxScrollY=Math.max(s,null!==(t=this.Do.maxScrollY)&&void 0!==t?t:0),this.Do.maxScrollHeight=Math.max(a,null!==(e=this.Do.maxScrollHeight)&&void 0!==e?e:0),this.Do.lastContentY=o,this.Do.maxContentY=Math.max(o,null!==(i=this.Do.maxContentY)&&void 0!==i?i:0),this.Do.maxContentHeight=Math.max(l,null!==(r=this.Do.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get $o(){return this._instance.config.scroll_root_selector}getContext(){return this.Do}resetContext(){var t=this.Do;return setTimeout(this.Lo,0),t}startMeasuringScrollPosition(){ar(t,"scroll",this.Lo,{capture:!0}),ar(t,"scrollend",this.Lo,{capture:!0}),ar(t,"resize",this.Lo)}scrollElement(){var e;if(!this.$o)return null==t||null==(e=t.document)?void 0:e.documentElement;var i=O(this.$o)?this.$o:[this.$o];for(var r of i){var n,s=null==t||null==(n=t.document)?void 0:n.querySelector(r);if(s)return s}}No(e){var i,r,n="y"===e?"scrollTop":"scrollLeft";if(this.$o){var s=this.scrollElement();return s&&s[n]||0}return t?"y"===e?t.scrollY||t.pageYOffset||(null==(i=t.document)||null==(i=i.documentElement)?void 0:i.scrollTop)||0:t.scrollX||t.pageXOffset||(null==(r=t.document)||null==(r=r.documentElement)?void 0:r.scrollLeft)||0:0}scrollY(){return this.No("y")}scrollX(){return this.No("x")}}var N_=t=>il(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 q_{constructor(t,e,i,r){this.Tt=t=>{var e=this.qo();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.jo(this._instance)};this.Bo.register({[Cs]:i})}},this._instance=t,this.Ho=e,this.Bo=i,this.jo=r||N_,this.Ho.onSessionId(this.Tt)}qo(){return this.Bo.props[Cs]}getSetOnceProps(){var t,e=null==(t=this.qo())?void 0:t.props;return e?"r"in e?rl(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_"+S(i)]=e})),t}}class j_{on(t,e){return this.zo[t]||(this.zo[t]=[]),this.zo[t].push(e),()=>{this.zo[t]=this.zo[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.zo[t]||[])i(e);for(var r of this.zo["*"]||[])r(t,e)}constructor(){this.zo={}}}var B_=Ji("[SessionId]"),H_=864e5;class z_{on(t,e){return this.Uo.on(t,e)}constructor(t,e,i){var r;if(this.Wo=null,this.Vo=null,this.Go=[],this.Zo=void 0,this.Qo=!1,this.Uo=new j_,this.Jo=(t,e)=>!(!W(t)||!W(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Vs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.mn=t.config,this.Bo=t.persistence,this.It=void 0,this.Pe=void 0,this._sessionStartTimestamp=null,this.Ko=void 0,this._sessionActivityTimestamp=null,this.Yo=e||fp,this.Xo=i||fp;var n=this.mn.persistence_name||this.mn.token;if(this._sessionTimeoutMs=1e3*nt(this.mn.session_idle_timeout_seconds||1800,60,36e3,B_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.tl(),this.el="ph_"+n+"_window_id",this.il="ph_"+n+"_primary_window_exists",this.rl()){var s=Lp.ui(this.el),a=Lp.ui(this.il);s&&!a?this.It=s:Lp.oi(this.el),Lp.ni(this.il,!0)}null!=(r=this.mn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.mn.bootstrap.sessionID),this.nl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return q(this.Go)&&(this.Go=[]),this.Go.push(t),this.Pe&&t(this.Pe,this.It),()=>{this.Go=this.Go.filter((e=>e!==t))}}rl(){return"memory"!==this.mn.persistence&&!this.Bo.Ma&&Lp.ii()}sl(t){t!==this.It&&(this.It=t,this.rl()&&Lp.ni(this.el,t))}al(){return this.It?this.It:this.rl()?Lp.ui(this.el):null}ol(t){var e=this.Wo;return!H(e)&&!H(t)&&5e3>Math.abs(t-e)}ll(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.ol(e)||(this.Wo=e,this.Bo.register({[Vn]:[e,t,i]}))}ul(){var t,e=null==(t=this.mn)?void 0:t.persistence_save_debounce_ms;return W(e)&&e>0}hl(){this.ul()?this.Bo.refreshKey(Vn):(this.Bo.flush(),this.Bo.load())}dl(){var t;if(!H(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Wo){this.hl();var e=this.vl();e[1]===this.Pe&&e[2]===this._sessionStartTimestamp&&(this.Wo=this._sessionActivityTimestamp,this.Bo.register({[Vn]:[this._sessionActivityTimestamp,null!==(t=this.Pe)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Bo.flush())}}cl(){var t=this.vl()[0],e=W(t)?t:0,i=W(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}fl(t){return this.hl(),this.Jo(t,this.cl())}vl(){var t=this.Bo.props[Vn];return O(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Wo=null,this.Ko=void 0,clearTimeout(this.pl),this.pl=void 0,this.ll(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void B_.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void B_.error("Invalid sessionID in bootstrap",t)}}(t);return!q(i)&&(e?this.Ko={sessionId:t,sessionStartTimestamp:i}:this.ll(t,(new Date).getTime(),i),!0)}destroy(){this.Qo=!0,this.dl(),clearTimeout(this.pl),this.pl=void 0,this.Zo&&t&&(t.removeEventListener(Ks,this.Zo,{capture:!1}),this.Zo=void 0),this.Go=[]}nl(){this.Zo=()=>{this.dl(),this.rl()&&Lp.oi(this.il)},ar(t,Ks,this.Zo,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.mn.cookieless_mode===Vs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Pe;if(i)this.Vo=r;else if(H(this.Vo)||this.Vo>r||r-this.Vo>=1e3){var s,a;null==(s=(a=this.Bo).syncCookieProperties)||s.call(a),this.Vo=r}var o=this.vl(),l=o[1],u=o[2],h=!q(n)&&l!==n,d=this.cl(),v=this.al(),c=this.Ko,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>H_),p=c?f:W(u)&&Math.abs(r-u)>H_,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.Jo(r,d);if(_){(_=this.fl(r))||B_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.vl();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.Yo(),v=this.Xo(),B_.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.Ko=void 0,g=!0}else v||(v=this.Xo(),g=!0),(m=m||l!==b)&&(B_.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=W(d)&&t&&!p?d:r,x=W(u)?u:(new Date).getTime();this.sl(v),this.ll(l,S,x),t||this.tl();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.Go.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}tl(){this.Qo||(clearTimeout(this.pl),this.pl=setTimeout((()=>{if(!this.Qo)if(this.fl((new Date).getTime())){var t=this.Pe;this.resetSessionId(),this.Uo.emit("forcedIdleReset",{idleSessionId:t})}else this.tl()}),1.1*this.sessionTimeoutMs))}}var U_=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&_(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>_(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function W_(){return W_=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 j(r)&&r.length>0?r:void 0}catch(t){return void Qi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),W_.apply(this,arguments)}var V_="custom",G_="i.posthog.com",Z_=/^\/static\//,Q_=["/s/","/e/","/i/"];class J_{constructor(t){this.gl={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+G_,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.gl[this.apiHost]||(this.gl[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":V_),this.gl[this.apiHost]}ml(t){if(Z_.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}yl(t){var e=hr(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}bl(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&&Q_.some((t=>0===e.indexOf(t)))){var o=this.yl(r);if(o){var l,u=this.apiHost,h=this._l;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this._l=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this._l,i=this.yl(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.bl(t,e,this.uiHost+e);if("flags"===t)return this.bl(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.ml(e);if(i)return this.bl(t,e,""+i+e)}if(this.region===V_)return this.bl(t,e,this.apiHost+e);var r=G_+e;switch(t){case"assets":return this.bl(t,e,"https://"+this.region+"-assets."+r);case"api":return this.bl(t,e,"https://"+this.region+"."+r)}}}var K_=Ji("[PostHog ExternalIntegrations]"),Y_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class X_{constructor(t){this._instance=t}Ys(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return K_.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ys(Y_[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 tw{constructor(t,e){this.A=t,this.Ns=e,this.wl=new Map,this.Os=!1}add(t){var e=this;return f((function*(){if(e.Os)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.wl.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.wl.set(t.name,t);try{var i=t.setup(e.Ns);i&&(yield i)}catch(i){var r=e.wl.get(t.name)===t;r&&e.wl.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.kl(t)}}))()}getExtension(t){return this.wl.get(t)}dispose(){if(!this.Os){this.Os=!0;var t=Array.from(this.wl.values()).reverse();for(var e of(this.wl.clear(),t))this.kl(e)}}kl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&L(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 ew{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);q(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 iw="extensionsRemoteConfig";class rw{constructor(t){this.Os=!1,this.instance=t,this.A=Qi,this.Sl=t.xl,this.kv=new ew(t),this.onEvent=t=>Jf(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.Os)return Jf((()=>{}));var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.Cl.on(iw,e);return this.Sl&&e(this.Sl),Jf(i)},this.Tl=new tw(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.Tl.add(t)}getExtension(t){return this.Tl.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 Jf(this.instance.Ml(t))}handleRemoteConfig(t){this.Os||(this.Sl=t,this.instance.Cl.emit(iw,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?k_(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?T.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.Os||(this.Os=!0,this.Tl.dispose())}}var nw={},sw=0,aw=()=>{},ow='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',lw="Surveys module not available",uw="sanitize_properties is deprecated. Use before_send instead",hw="Invalid value for property_denylist config: ",dw=/^[A-Za-z0-9_-]{1,400}$/,vw=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,cw=["token","distinct_id",As],fw="posthog",pw=!y_&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),gw=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},mw=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:aw,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&&j(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:Qs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:F_},error_tracking:{},_onCapture:aw},(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:gw(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},yw=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],bw=t=>{var e={};for(var i of yw){var r=i[0],n=i[1];q(t[r])||(e[n]=t[r])}var s=Xi({},e,t),a=t.__preview_external_dependency_versioned_paths;return q(a)||(q(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),j(a)&&q(t.asset_host)&&(s.asset_host=a)),O(t.property_blacklist)&&(q(t.property_denylist)?s.property_denylist=t.property_blacklist:O(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Qi.error(hw+t.property_denylist)),s};class _w{constructor(){this.__forceAllowLocalhost=!1}get Il(){return this.__forceAllowLocalhost}set Il(t){Qi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class ww{El(t){if(t){var e=this.wl.indexOf(t);-1!==e&&this.wl.splice(e,1)}}Rl(t,e){return this.El(t),this.wl.push(e),null==e.initialize||e.initialize(),e}Pl(){return this.config.cookieless_mode===Vs||this.config.cookieless_mode===Ws&&this.consent.isRejected()}Al(){if(!this.Fl&&!this.config.segment&&!this.Pl()){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Ol||(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.Fl=!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)))}}Ll(){if(!this.Pl()&&this.get_distinct_id()===Ps){var t=this.persistence;if(t){this.Dl()||t.load(!0);var e=this.get_distinct_id();if(!e||e===Ps){var i=this.config.get_device_id(fp());this.register({distinct_id:i,$device_id:i}),t.set_property(xs,Gs)}this.$l()}}}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 _w,this.Nl=!1,this.version=Gi.LIB_VERSION,this.ql=new Set,this.jl="",this.Cl=new j_,this.wl=[],this.Bl=[],this.Ol=!1,this.Fl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=mw(),this.SentryIntegration=Kb,this.sentryIntegration=t=>function(t,e){var i=Jb(t,e);return{name:Qb,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Hl=!1,this.zl=null,this.Ul=null,this.Wl=null,this.scrollManager=new $_(this),this.pageViewManager=new Yb(this),this.rateLimiter=new p_(this),this.requestRouter=new J_(this),this.consent=new Hb(this),this.externalIntegrations=new X_(this);var e=null!==(t=ww.__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=j(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=j(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!==fw){var r,n=null!==(r=nw[i])&&void 0!==r?r:new ww;return n._init(t,e,i),nw[i]=n,nw[fw][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s,a;void 0===i&&(i={});var o,l=j(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=mw(i.defaults),i.debug=this.Vl(i.debug),this.Gl=i,this.Zl=[],i.person_profiles?this.Ul=i.person_profiles:i.process_person&&(this.Ul=i.process_person);var u=mw(i.defaults),h=bw(i),d=Xi({},u,h,{name:r,token:l});D(u.rageclick)&&D(h.rageclick)&&(d.rageclick=Xi({},u.rageclick,h.rageclick)),D(u.session_recording)&&D(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:Df;var v=this.Dl();if(this.persistence=new c_(this.config,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new c_(p({},this.config,{persistence:"sessionStorage"}),v,!1),this.jl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!v&&Lp.ii()){var c=Lp.ui(this.jl);O(c)&&c.forEach((t=>{j(t)&&this.ql.add(t)}))}else Lp.oi(this.jl);var f=p({},this.persistence.props),g=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ql=new O_((t=>this.Jl(t)),this.config.request_queue_config),this.Kl=new D_(this),this.__request_queue=[];var m=this.Pl();m||(this.sessionManager=new z_(this),this.sessionPropsManager=new q_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Yl()}))),this.Xl(),this.config.__preview_deferred_init_extensions?(Qi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.tu(m)}),0)):(Qi.info("Initializing extensions synchronously"),this.tu(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.Ol=!!y&&!B(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(xs);if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Gs)this.identify(b);else if(i.bootstrap.isIdentifiedID&&null!=_&&_!==b&&w===Zs)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(fp()),S=i.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(xs,i.bootstrap.isIdentifiedID?Zs:Gs),this.register({distinct_id:b,$device_id:S})}}if(m)this.register_once({distinct_id:Ps,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(fp());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(xs,Gs)}return ar(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?Zb(this,(()=>this.eu())):this.eu(),L(this.config._onCapture)&&this.config._onCapture!==aw&&(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 W_.apply(this,arguments)}().then((t=>{t&&this.register({[Cn]:t})})).catch(aw),this}iu(t){var e=t;return j(e.name)&&L(e.setup)}ru(t,e){this.iu(t)?e.push((()=>{this.nu().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Qi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.wl.push(t)}Xl(){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=ww.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.su)||r.call(this),this.su=void 0,this.featureFlags=new a(this)),L(this.featureFlags.onReloading)&&L(this.featureFlags.setup)?this.su||(this.su=this.featureFlags.onReloading((()=>{this.Cl.emit("featureFlagsReloading",!0)})),this.nu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}tu(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},ww.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.wl.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.wl.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.wl.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.wl.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.wl.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.ru(this.autocapture=new u.autocapture(this),h),u.surveys&&this.ru(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.ru(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.wl.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.wl.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.wl.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.wl.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.wl.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.wl.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.wl.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,Wb)),u.toolbar&&this.wl.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.wl.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.wl.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.au){var t=this.au;this.au=void 0,this.wl.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.ou(h,l)}ou(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ou(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({[Fs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Os]:r}),this.config.__preview_deferred_init_extensions&&Qi.info("PostHog extensions initialized ("+r+"ms)")}co(t){var e;if(!r||!r.body)return Qi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.co(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.au=t),this.xl=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=w(n.supportedCompression,Df)?Df:w(n.supportedCompression,$f)?$f:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Ul?this.Ul:Qs}),null==(e=this.lu)||e.handleRemoteConfig(t),this.wl.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}eu(){try{this.config.loaded(this)}catch(t){Qi.critical("`loaded` function failed",t)}if(this.uu(),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.Pl())&&this.hu()}),1),this.du=new m_(this),this.du.load()}uu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Ql)||t.enable())}_dom_loaded(){this.is_capturing()&&Ki(this.__request_queue,(t=>this.Jl(t))),this.__request_queue=[],this.uu()}_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.vu()&&this.capture(Xs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Ql)||r.unload(),null==(n=this.Kl)||n.unload()):this.vu()&&this.capture(Xs,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?pw?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=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,(q(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&&q(n.compression)&&n.data&&(n.compression=$f),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(O(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()),O(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=P_(n.url,n.method,n.compression,n.timestampMode);var v=A_.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){I_(t)?Qi.warn(t):Qi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Df&&l&&"undefined"!=typeof Promise&&!__?T_(n).then((t=>{f(t)})).catch((e=>{if(_i(e))return __=!0,void f(p({},n,{compression:void 0,url:P_(t.url,t.method,void 0,t.timestampMode)}));wi(e)&&(__=!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}))}Jl(t){this.Kl?this.Kl.retriableRequest(t):this._send_request(t)}_execute_array(t){sw++;try{var e,i=[],r=[],n=[];Ki(t,(t=>{if(t)if(O(e=t[0]))n.push(t);else if(L(t))try{t.call(this)}catch(e){Qi.error("Error executing queued PostHog call",t,e)}else O(t)&&"alias"===e?i.push(t):O(t)&&-1!==e.indexOf("capture")&&L(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ki(t,(function(t){try{if(O(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{sw--}}push(t){if(sw>0&&O(t)&&j(t[0])){var e=ww.prototype[t[0]];L(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}cu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(In);return j(e)&&vw.test(e)?{value:e,delivered:!1}:D(e)&&j(e.value)&&vw.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}fu(t,e,i,r){if(this.persistence){this.persistence.refreshKey(In);var n=this.cu();if(!r){if(i)return j(e)&&vw.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[In]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(In);if(j(t)&&dw.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[In]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(In)}}pu(t){if(this.persistence){this.persistence.refreshKey(In);var e=this.cu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[In]:{value:t,delivered:!0}})}}capture(t,e,i){var r,n,s,a,o,l,u,h,d,v;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ql){if(this.is_capturing())if(!q(t)&&j(t)){this.Ll();var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var f=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==f||!f.isRateLimited){var g;null!=e&&e.$current_url&&!j(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.gu||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&&(g=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var m=new Date,y=(null==i?void 0:i.timestamp)||m,b=Ie(null==i?void 0:i.uuid,fp),_={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},y,b)};t===Ys&&this.config.__preview_capture_bot_pageviews&&c&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),f&&(_.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var w="$feature_flag_called"===t&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(ls);(null==i?void 0:i.$set)&&!w&&(_.$set=null==i?void 0:i.$set);var k=D(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&Mn in i.$set,x=S||!!k&&Mn in k,C=S?null==i||null==(r=i.$set)?void 0:r[Mn]:null==k?void 0:k[Mn],T=O(null==e?void 0:e.$unset)?e.$unset:[],M=(null==i?void 0:i.$unset)||[],I=-1!==T.indexOf(Mn)||-1!==M.indexOf(Mn),E=this.fu(null==(n=g)?void 0:n.fbclid,C,x,I);E&&!0===_.properties.$process_person_profile&&E.pending&&!x&&!w&&(_.$set=p({[Mn]:E.value},_.$set));var R=null==i?void 0:i.$unset;R&&(_.$unset=R);var P=w?void 0:this.mu(null==i?void 0:i.$set_once,t!==ea,t===ta);if(P&&(_.$set_once=P),null!=i&&i._noTruncate||(u=this.config.properties_string_max_length,h=_,d=t=>j(t)?t.slice(0,u):t,v=new Set,_=function t(e,i){if(e!==Object(e))return d?d(e):e;if(!v.has(e)){var r;if(v.add(e),O(e))r=[],Ki(e,(e=>{r.push(t(e))}));else{var n={};Yi(e,((e,i)=>{v.has(e)||(n[i]=t(e,i))})),r=n}return r}}(h)),_.timestamp=y,q(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return gi.forEach(r),e.forEach(r),i}(_.properties,cw)),t===Gf.DISMISSED||t===Gf.SENT){var A=null==e?void 0:e[Zf.SURVEY_ID],F=null==e?void 0:e[Zf.SURVEY_ITERATION];np({id:A,current_iteration:F}),_.$set=p({},_.$set,{[xo({id:A,current_iteration:F},t===Gf.SENT?"responded":"dismissed")]:!0})}else t===Gf.SHOWN&&(_.$set=p({},_.$set,{[Zf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var L=null==e?void 0:e.$product_tour_type;L&&(_.$set=p({},_.$set,{["$product_tour_last_seen_date/"+L]:(new Date).toISOString()}))}var B=p({},_.properties.$set,_.$set);if(N(B)||this.setPersonPropertiesForFlags(B),!z(this.config.before_send)){var H=this.ns(_);if(!H)return;(_=H).uuid=Ie(_.uuid,fp)}var U=null!==(s=null==(a=_.$set)?void 0:a[Mn])&&void 0!==s?s:D(null==(o=_.properties)?void 0:o.$set)?_.properties.$set[Mn]:void 0,W=null!=E&&E.pending&&U===E.value?E.value:void 0;this.Cl.emit("eventCaptured",_);var V=null!==(l=null==i?void 0:i._url)&&void 0!==l?l:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),G=p({method:"POST",url:V,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(V)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},W?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.pu(W)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||W?this.Jl(G):this.Ql.enqueue(G),_}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.lu)?void 0:e.getExtension(t)}nu(){var t;return null!==(t=this.lu)&&void 0!==t?t:this.lu=new rw(this)}Ml(t){this.Bl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Bl.indexOf(t);-1!==i&&this.Bl.splice(i,1)}}}yu(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Wl=null,this.persistence.get_property(xs)===Gs&&(null==(r=this.sessionPersistence)||r.clear(),this.ql.clear(),this.bu()),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.yu();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.Pl()&&(h[As]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!j(h.distinct_id)&&!U(h.distinct_id)||B(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?[...Vo,...i||[]]:[],c=ce(u),f=c[0],p=c[1],g=null!=(d="u">typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};q(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;q(b)||(y.userAgentDataPlatform=b),q(_)||(y.maxTouchPoints=_),q(w)||(y.screenWidth=w),q(k)||(y.screenHeight=k),q(S)||(y.devicePixelRatio=S);var x,C=Xi(rr({$os:f,$os_version:p,$browser:ue(u,navigator.vendor,g,m),$device:fe(u),$device_type:pe(u,y),$timezone:nl(),$timezone_offset:sl()}),{$current_url:cr(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:de(u,navigator.vendor,g,m),$browser_language:Xo(),$browser_language_prefix:(x=Xo(),"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.Kl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===V_&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Ys||o?e!==Xs||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Xi(h,v),e===Ys&&r&&(h.title=r.title),!q(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(),w=h.$groups,k=b.$groups;D(w)&&!N(w)&&(h.$groups=p({},D(k)?k:{},w)),Yi(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var S={};if(this.Bl.length>0)for(var x of this.Bl.slice())try{Xi(S,x())}catch(t){Qi.error("Failed to produce browser extension event properties",t)}(h=Xi({},c,b,_,p({},S,h))).$is_identified=this._isIdentified(),O(this.config.property_denylist)?Yi(this.config.property_denylist,(function(t){delete h[t]})):Qi.error(hw+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(Qi.error(uw),h=C(h,e));var T=this._u();return h.$process_person_profile=T,T&&!o&&this.wu("_calculate_event_properties"),h}mu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this._u())return t;if(this.Nl&&!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(uw),a=o(a,"$set_once")),e&&(this.Nl=!0),N(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.yu(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.ql.add(t))),this.bu()}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.ql.delete(t),this.bu()}ku(t,e){this.register({[t]:e})}Yl(){this.ql.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.ql.clear(),this.bu()}bu(){var t;if(this.jl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Ma||!Lp.ii())Lp.oi(this.jl);else{var e=[];this.ql.forEach((t=>e.push(t))),e.length>0?Lp.ni(this.jl,e):Lp.oi(this.jl)}}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.Cl.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:lw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:lw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:lw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ap),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:lw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:lw})}Su(t){return!t||B(t)?(Qi.critical("Unique user id has not been set in posthog.identify"),!1):t===Ps?(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(U(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.Su(t)&&this.wu("posthog.identify")){this.Ll();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.yu(!1),a=this.persistence.Va(),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(xs)||Gs)===Gs,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(xs,Zs),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ga(),this.capture(ta,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Wl=Do(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(xs,Zs);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Ga(),this.capture("$set",{$set:c,$set_once:f}),this.Wl=Do(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(_s)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Ja(o)}}}setPersonProperties(t,e){if((t||e)&&this.wu("posthog.setPersonProperties")){var i=Do(this.get_distinct_id(),t,e);this.Wl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Wl=i):Qi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(O(t)?t:[t]).filter((t=>j(t)&&t.length>0));0!==i.length&&this.wu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Wl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.yu();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),(s||i)&&this._u()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(ea,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.wu("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=V(t)?t:null==t?void 0:t.resetDeviceID,i=V(t)||null==t?void 0:t.bootstrap;this.xu(e,!1,i)}xu(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.Gl)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.fo());var o=this.get_property(xn),l=this.get_property(Cn),u=this.get_property(jn),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.Va?void 0:s.Va(),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.ql.clear(),this.bu(),q(u)||null==(S=this.persistence)||S.register({[jn]: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(xs,Gs),null==(k=this.sessionManager)||k.resetSessionId(),this.Wl=null,this.config.cookieless_mode===Vs)this.register_once({distinct_id:Ps,$device_id:null},"");else{var M=this.config.get_device_id(fp());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||q(l)||this.register({[Cn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Pl()||(null==(T=this.persistence)||T.set_property(xs,i.isIdentifiedID?Zs:Gs),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(q(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var I=p({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,v=!0}finally{var E;d&&(null==(E=this.persistence)||null==E.Ja||E.Ja(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s,a,o;if(e.__loaded){e.nu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.Ql)||n.unload(),null==(s=e.Kl)||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;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Cu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Tu()}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.wu("posthog.alias")?(q(e)&&(e=this.get_distinct_id()),t!==e?(this.ku(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(D(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Xi(this.config,bw(t));var f=this.Dl();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new c_(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Vl(this.config.debug);V(m)&&(this.config.debug=m),V(this.config.debug)&&(this.config.debug?(Gi.DEBUG=!0,wp.ii()&&wp.ni("ph_debug",!0),Qi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Gi.DEBUG=!1,wp.ii()&&wp.oi("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.fo()),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.$l(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Zb(this,aw,!1)}}_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:ww.Mu}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:fw;return e!==fw&&(e=fw+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(xs))===Zs||(null==(e=this.sessionPersistence)?void 0:e.get_property(xs))===Zs}_u(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Qs&&!this._isIdentified()&&N(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Rs]))}vu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this._u()||this.wu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wu(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.Al(),this.ku(Rs,!0),!0)}Dl(){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!==Ws)}$l(){var t,e,i,r,n,s=this.Dl();return this.is_capturing()||null==(i=this.logs)||i.Iu(),(null==(t=this.persistence)?void 0:t.Ma)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Ma)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.ql.clear(),this.bu()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Vs){if(this.Pl()){var i,r,n,s,a,o;null==(i=this.sessionRecording)||i.dispose({discardBufferedEvents:!0}),this.xu(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new z_(this),this.pageViewManager=new Yb(this),this.persistence&&(this.sessionPropsManager=new q_(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=ww.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Rl(this.sessionRecording,new u(this)),this.xl&&(null==(l=this.sessionRecording)||null==l.onRemoteConfig||l.onRemoteConfig(this.xl)))}var h,d;this.consent.optInOut(!0),this.$l(),this.uu(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ws&&(null==(h=this.surveys)||h.loadIfEnabled()),(q(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.hu()}else Qi.warn(ow)}opt_out_capturing(){if(this.config.cookieless_mode!==Vs){var t,e,i=this.config.cookieless_mode===Ws?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===Ws&&this.consent.isOptedIn()&&this.xu(!0,!0),this.consent.optInOut(!1),this.$l(),this.config.cookieless_mode===Ws&&(this.register({distinct_id:Ps,$device_id:null}),this.El(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.hu(),this.uu())}else Qi.warn(ow)}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===Vs||(this.config.cookieless_mode===Ws?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$l()}_is_bot(){return i?U_(i,this.config.custom_blocked_useragents):void 0}hu(){r&&("visible"===r.visibilityState?this.Hl||(this.Hl=!0,this.capture(Ys,{title:r.title},{send_instantly:!0}),this.zl&&(r.removeEventListener(Js,this.zl),this.zl=null)):this.zl||(this.zl=this.hu.bind(this),ar(r,Js,this.zl)))}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}))}fo(){var t=this.Gl||{};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&&!z(t[e]),a=i in t&&!z(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)}ns(t){var e;if(z(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Q),r=O(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),z(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return Z(t.event)?Qi.warn(a+". This can cause unexpected behavior."):Qi.info(a),null}n.properties&&!N(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&&z(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.ea)?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)})}Vl(t){var e=V(t)&&!t,i=wp.ii()&&"true"===wp.ai("ph_debug");return!e&&(!!i||t)}}ww.__defaultExtensionClasses={},ww.Mu=(()=>{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]])}(ww,["identify"]);class kw{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=D(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.fo(),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 Sw=Ji("[ExceptionAutocapture]"),xw=Ji("[TracingHeaders]"),Cw=Ji("[Web Vitals]"),Tw=9e5,Mw=["CLS","FCP","INP","LCP"],Iw=["INP","LCP"],Ew=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Rw="[SessionRecording]",Pw=Ji(Rw),Aw=Ji("[Heatmaps]");function Fw(t){return D(t)&&"clientX"in t&&"clientY"in t&&U(t.clientX)&&U(t.clientY)}var Ow=Ji("[Product Tours]"),Lw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property($n))},Dw=["$set_once","$set"],$w=Ji("[SiteApps]"),Nw="Error while initializing PostHog app with config id ",qw=(t,e)=>null!=t&&t.then?t.then(e):e(t),jw="SDK is not enabled or survey functionality is not yet loaded",Bw="Disabled. Not loading surveys.";class Hw{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Eu=!1,this.Ru=[],this.Pu=null,this.Au=null,this.Os=!1,this.Fu=new Set,this.onRemoteConfig=t=>{if(!this.Os&&!this.mn.disableSurveys){if(!t.ok)return Kf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(z(e))return Kf.warn("Flags not loaded yet. Not loading surveys.");this.Ou=V(e)?e:e.length>0,Kf.info("flags response received, isSurveysEnabled: "+this.Ou),this.loadIfEnabled()}},this.Ls=t,this.Lu=e}setup(t){if(!this.Os)return this.Du=t,qw(t.kv.initialize(),(()=>{if(this.Du===t&&!this.Os){this.Du=void 0,this.Ns=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.Os?e.dispose():(this.qs=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.Os||(this.Os=!0,this.Du=void 0,this.Ns=void 0,null==(t=this.qs)||t.dispose(),this.qs=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ru=[],this.Pu=null,this.Fu.forEach((t=>clearTimeout(t))),this.Fu.clear())}get mn(){return this.Ls.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(tp)||null!=r&&r.startsWith(ep))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.Os&&this.Ns){var t=this.mn;if(!this._surveyManager)if(this.Eu)Kf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Kf.info(Bw);else if(t.cookielessMode&&this.Ls.isOptedOut())Kf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ls.getExtensions();if(e){if(!q(this.Ou)||t.advancedEnableSurveys){var i=this.Ou||t.advancedEnableSurveys;this.Eu=!0;try{var r=e.generateSurveys;if(r)return this.$u(r,i),void(this.Eu=!1);var n=e.loadExternalDependency;if(!n)return this.Nu(Us),void(this.Eu=!1);n((t=>{try{if(this.Os)return;var e=this.Ls.getExtensions();t||null==e||!e.generateSurveys?this.Nu("Could not load surveys script",t):this.$u(e.generateSurveys,i)}finally{this.Eu=!1}}))}catch(t){throw this.Eu=!1,this.Nu("Error initializing surveys",t),t}}}else Kf.error("PostHog Extensions not found.")}}}$u(t,e){this.Os||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ls.createEventReceiver(),Kf.info("Surveys loaded successfully"),this.qu({isLoaded:!0}))}Nu(t,e){Kf.error(t,e),this.qu({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ru.push(t),this._surveyManager&&this.qu({isLoaded:!0}),()=>{this.Ru=this.Ru.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Ns)&&void 0!==i?i:this.Lu;if(r&&!this.Os){if(this.mn.disableSurveys)return Kf.info(Bw),t([]);var n=r.kv.get(fs);if(n&&!e)return t(n,{isLoaded:!0}),void(this.ju()&&this.getSurveys((()=>{}),!0));if(this.Pu)this.Pu.then((e=>{this.Os||t(e.surveys,e.context)})).catch((t=>Kf.error("Error in survey callback",t)));else{var s=this.Bu("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.mn.requestTimeoutMs}).then((t=>{try{return this.Hu(r,t)}catch(t){return Kf.error("Error processing surveys response",t),this.Hu(r,{statusCode:0,error:t})}}),(t=>this.Hu(r,{statusCode:0,error:t})));this.Pu=s;var a=()=>{this.Pu===s&&(this.Pu=null)};s.then((e=>{a(),this.Os||t(e.surveys,e.context)}),a).catch((t=>Kf.error("Error in survey callback",t)))}}}Bu(t,e){var i=this.Ns;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(jw)})))}Hu(t,e){if(this.Os)return{surveys:[],context:{isLoaded:!1,error:jw}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Kf.error(r):e.error||Kf.warn(r),this.Au=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Au=null;var n,s=e.json.surveys||[],a=s.filter((t=>Yf(t)&&(Ro(t)||Xf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[fs]:s,[ps]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}ju(){return this.zu()&&!this.Pu&&!this.Uu()}zu(){var t,e,i=null==(t=null!==(e=this.Ns)&&void 0!==e?e:this.Lu)?void 0:t.kv.get(ps);return U(i)&&Date.now()-i>3e5}Uu(){return U(this.Au)&&3e5>Date.now()-this.Au}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};np(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}qu(t){for(var e of this.Ru)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Kf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!z(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Kf.warn("init was not called")}Wu(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}Vu(t){if(z(this._surveyManager))return{eligible:!1,reason:jw};var e="string"==typeof t?this.Wu(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Gu(t){if(z(this._surveyManager))return{eligible:!1,reason:jw};var e="string"==typeof t?this.Wu(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(z(this._surveyManager))return Kf.warn("init was not called"),{visible:!1,disabledReason:jw};var e=this.Gu(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return z(this._surveyManager)?(Kf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:jw})):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.Gu(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(z(this._surveyManager))Kf.warn("init was not called");else{var s="string"==typeof t?this.Wu(t):t;if(null!=s&&s.id)if(sp.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Kf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.Fu.delete(o),this.Os||(Kf.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),Kf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Fu.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Kf.warn("Survey element not found")}else Kf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Kf.warn("Survey not found")}}displaySurvey(t,e){var i;if(z(this._surveyManager))Kf.warn("init was not called");else{var r=this.Wu(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!==Qf&&e.initialResponses&&Kf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.Vu(r);if(!s.eligible)return void Kf.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 Kf.warn("Survey not found")}}cancelPendingSurvey(t){z(this._surveyManager)?Kf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function zw(t,e,i){if(z(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 Uw{constructor(t){this.Zu=new Set,this.Qu=new Set,this.Ju=new j_,this.Ku=(t,e)=>this.Yu(t,e)&&this.Xu(t,e)&&this.th(t,e)&&this.eh(t,e),this.Yu=(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;q(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.ih=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.ih)||t.call(this),this.ih=void 0,this.Ju=new j_}register(t){var e,i;if(!q(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Zu.add(t),null==(e=t.steps)||e.forEach((t=>{this.Qu.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Zu.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.Zu.clear(),this.Qu.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Qu.has(t)||this.Qu.has(e.event))&&this.Zu.forEach((t=>{this.rh(e,t)&&this.Ju.emit("actionCaptured",t.name)}))}nh(t){this.onAction("actionCaptured",(e=>t(e)))}rh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Ku(t,i))return!0;return!1}onAction(t,e){return this.Ju.on(t,e)}Xu(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(!zw(r,e.url,e.url_matching||"contains"))return!1}return!0}th(t,e){return!!this.sh(t,e)&&!!this.ah(t,e)&&!!this.oh(t,e)}sh(t,e){var i;if(null==e||!e.href)return!0;var r=this.lh(t);if(r.length>0)return r.some((t=>zw(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&zw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ah(t,e){var i;if(null==e||!e.text)return!0;var r=this.lh(t);if(r.length>0)return r.some((t=>zw(t.text,e.text,e.text_matching||"exact")||zw(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;!z(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=>zw(t,s,a))))}oh(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}lh(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}eh(t,e){return null==e||!e.properties||0===e.properties.length||Lo(e.properties.reduce(((t,e)=>{var i=O(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 Ww{constructor(t){var e;this.uh=[],this._instance=t,this.hh=new Map,this.dh=new Map,this.fh=new Map,this.ph=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.gh(t)))}mh(t){return!1}yh(){return null}bh(t){}_h(){}wh(t,e){return!!t&&Lo(t.propertyFilters,null==e?void 0:e.properties)}kh(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}Sh(t,e,i){var r=(i===Nf?this.hh:this.dh).get(t),n=[];return this.xh((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.wh(s,e)}))}register(t){this.Ch(t,!1)}replace(t){this.Ch(t,!0)}Ch(t,e){var i;q(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Th(t,e),this.Mh(t,e))}Mh(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.fh.clear(),0!==i.length){this.Ih||(this.Ih=new Uw(this._instance),this.Ih.init(),this.Ih.nh((t=>this.onAction(t))));var r=[];i.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach((e=>{if(r.push(e),e.name){var i,n=null!==(i=this.fh.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.fh.set(e.name,n)}}))})),e?this.Ih.replace(r):this.Ih.register(r)}else{var n;e&&(null==(n=this.Ih)||n.replace([]))}}Eh(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)}))}Th(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.kh(t,Nf),o=this.kh(t,qf);e?(this.hh=a,this.dh=o):(this.Eh(this.hh,a),this.Eh(this.dh,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.ih)&&void 0!==i||(this.ih=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Rh(),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.Ph(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Ah([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Fh(s),void this.Oh([s])}if(this.dh.has(t)){var o=this.Sh(t,e,qf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Ah(o.map((t=>t.id))),o.forEach((t=>this.Lh(t.id))))}if(this.hh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.hh.get(t)});var l=this.Sh(t,e,Nf);this.Dh(l.map((t=>t.id)))}}onAction(t){this.fh.has(t)&&this.Dh(this.fh.get(t)||[])}Dh(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.mh(n)?this.Fh(n)&&this.$h(n):r.push(n);r.length>0&&(this.uh=[...new Set([...this.uh,...r])]),this.Rh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fh(t){this.uh=this.uh.filter((e=>e!==t));var e=this.Nh();return!e.includes(t)&&(this.qh([...e,t]),this.jh(),!0)}Ah(t){var e=new Set(t);this.uh=this.uh.filter((t=>!e.has(t)));var i=this.Bh(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.qh(r),0===r.length&&this.Hh()),this.Oh(t)}zh(){var t,e=this.yh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}$h(t){if(this.yh()){var e=this.zh();this.bh(p({},e,{[t]:Date.now()}))}}Oh(t){if(this.yh()){var e=this.zh(),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&&(N(i)?this._h():this.bh(i))}}Uh(){this.yh()&&this._h()}getActivationTimestamp(t){if(this.Nh().includes(t)){var e=this.zh()[t];return U(e)?e:void 0}}Bh(){var t,e=this.Wh();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}Nh(){var t,e,i=this.Bh();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Vh()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}jh(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Gh(e)}Hh(){this.Zh()}gh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Vh()];if(i&&i!==t){var r=this.Bh(),n=this.zh();r.length>0&&(this.qh([]),r.filter((t=>U(n[t]))).forEach((t=>this.Lh(t)))),this.Hh(),this.Uh()}}getActivatedIds(){return[...new Set([...this.Nh(),...this.uh])].filter((t=>!this.Qh(t)))}dispose(){var t,e,i;null==(t=this.ph)||t.call(this),this.ph=void 0,null==(e=this.ih)||e.call(this),this.ih=void 0,null==(i=this.Ih)||i.dispose(),this.Ih=void 0}reset(){this.uh=[],this.Bh().length>0&&this.qh([]),this.Hh(),this.Uh()}getEventToItemsMap(){return this.hh}Jh(){return this.Ih}}class Vw extends Ww{constructor(t){super(t)}Wh(){return gs}Vh(){return ms}yh(){return ys}bh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ys]:t})}_h(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ys)}mh(t){var e,i;this.xh((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return U(r)&&r>0}Kh(){return Gf.SHOWN}xh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Lh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Rh(){return Kf}qh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[gs]:t})}Gh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ms]:t})}Zh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ms)}Qh(){return!1}Ph(t,e){var i;return this.xh((t=>{i=t.find((t=>t.id===e))})),!i||Po(i)?t===Gf.SHOWN?"consume":"ignore":t===Gf.SHOWN?"persist":t===Gf.DISMISSED||t===Gf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Gw{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);q(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 Zw{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 Vw(this._instance)}}var Qw=null!=t&&t.location?fr(t.location.hash,"__posthog")||fr(location.hash,"state"):null,Jw="_postHogToolbarParams",Kw=Ji("[Toolbar]"),Yw=Ji("[FeatureFlags]");class Xw{constructor(t,e){void 0===e&&(e=!1),this.Yh=!1,this.update(t,e)}update(t,e){this.Xh=((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:O(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Yh||(Yw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yh=!0),q(t.flag_keys)||O(t.flag_keys)||Yw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Xh}}var tk=Ji("[FeatureFlags]"),ek=Ji("[FeatureFlags]",{debugEnabled:!0}),ik="\" failed. Feature flags didn't load in time.",rk="connection_error",nk=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},sk=t=>{var e={};for(var i of tr(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},ak="Refusing to render web experiment since the viewer is a likely bot",ok={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Ao(e,t),not_regex:(t,e)=>!Ao(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class lk{get mn(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{lk.td("retrieved web experiments from the server"),e.ed=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.ed&&(lk.td("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.ed)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);j(r)&&t.variants[r]&&e.rd(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];lk.nd(s,e._instance)&&e.rd(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())lk.td(ak);else if(!this.mn.disable_web_experiments){if(z(this.ed))return this.ed=new Map,this.loadIfEnabled(),void this.previewWebExperiment();lk.td("applying feature flags",t),t.forEach((t=>{var e;if(this.ed&&null!=(e=this.ed)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ed)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.rd(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=lk.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&&(lk.td("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.sd(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.mn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.mn.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.mn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}sd(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(lk.td("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.rd(r[0].name,e,r[0].variants[e].transforms))}static nd(t,e){return!z(t.conditions)&&lk.ad(t,e)&&lk.od(t)}static ad(t,e){var i;if(z(t.conditions)||z(null==(i=t.conditions)?void 0:i.url))return!0;var r=lk.getWindowLocation();if(r){var n,s,a,o=mr(e,r.href);return null==(n=t.conditions)||!n.url||ok[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 od(t){var e;if(z(t.conditions)||z(null==(e=t.conditions)?void 0:e.utm))return!0;var i=Jo();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 td(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)}rd(t,e,i){this._is_bot()?lk.td(ak):"control"!==e?i.forEach((i=>{if(i.selector){var r;lk.td("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)}))}})):lk.td("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?U_(i,this.mn.custom_blocked_useragents):void 0}}var uk=Ji("[Conversations]"),hk="Conversations not available yet.";function dk(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=q(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(Oi,t)?Oi[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 vk=["debug","log","warn","error","info"],ck="console",fk="__posthogHandledLogsRequestError",pk=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[fk]=!0,i},gk=t=>!!t&&"object"==typeof t&&!0===t[fk],mk={featureFlags:class{constructor(t){this.name=op,this.ld=!1,this.featureFlagEventHandlers=[],this.A=tk,this.ud={},this.hd={},this.dd=[],this.vd=!1,this.fd=!1,this.pd=0,this.gd=!1,this.md=!1,this.yd=!1,this.bd=!1,this._d=0,this.Wt=()=>{var t=this.wd();this._d=0,t&&this.reloadFeatureFlags()},this.kd=()=>{var t,e=this.Sd;q(e)||this.mn.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.xd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Cd())},this.Vt=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.kd()},"get"in t?this.Ls=t:(this._instance=t,this.Td=new Xw(t.config,t.fo()),this.Ls=this.Td)}updateConfig(t,e){var i;null==(i=this.Td)||i.update(t,e),this.Ns&&this.Md()}setup(t){return this.Du=t,this.A=t.logger.createLogger("[FeatureFlags]"),qw(t.kv.initialize(),(()=>{this.Du===t&&(this.Du=void 0,this.Ns=t,this.Id(t))}))}Id(e){var i;if(this.Ns===e)return t&&ar(t,"online",this.Wt),this.Md(),this.Ed=e.registerDynamicEventProperties((()=>this.Rd()?this.ud:this.hd)),this.Pd=null==(i=this._instance)||null==(i=i.persistence)?void 0:i.onCrossTabFeatureFlagChange((()=>{this.Ad(),this.Fd()})),this.Ad(),this.initialize()}Md(){var t=this.mn.refreshIntervalMs,e=!this.mn.remoteRequestsDisabled&&r&&!q(t)&&t>0?t:void 0;e!==this.Sd&&(this.Od(),q(e)||(this.Sd=e,this.Cd(),null!=r&&r.addEventListener&&ar(r,Js,this.Vt)))}Cd(){q(this.Sd)||(q(this.Ld)||clearInterval(this.Ld),this.xd=Date.now(),this.Ld=setInterval(this.kd,this.Sd))}Od(){q(this.Ld)||(clearInterval(this.Ld),this.Ld=void 0,null==r||null==r.removeEventListener||r.removeEventListener(Js,this.Vt)),this.Sd=void 0,this.xd=void 0}destroy(){this.Dd()}dispose(){this.Dd()}Dd(){var e,i;this.Od(),this.pd++,this.md=!1,this.Du=void 0,this.Ns&&(this.$d(),null==(e=this.Ed)||e.dispose(),this.Ed=void 0,null==(i=this.Pd)||i.call(this),this.Pd=void 0,this.dd=[],null==t||t.removeEventListener("online",this.Wt),this.Ns=void 0)}get mn(){return this.Ls.get()}Nd(t){var e;return null==(e=this.Ns)?void 0:e.kv.get(t)}ni(t){this.qd((()=>{var e;return null==(e=this.Ns)?void 0:e.kv.set(t)}))}jd(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t[is]){var n=this.Nd(is)||{},s=t[is]||{},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&&!O(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Nd(as)||{},d=t[as]||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p={[rs]:f,[is]:f,[as]:!!c||v};for(var g of(t[ss]&&(p[ss]=f),[os,Ss,ls]))q(t[g])||(p[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(p)}}oi(t){this.qd((()=>{var e;return null==(e=this.Ns)?void 0:e.kv.remove(t)}))}qd(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Ad(){var t={};for(var e of[rs,as,os,us]){var i=this.Nd(e);q(i)||(t[e]=i)}this.ud=t;var r=p({},t),n=this.Nd(is);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.hd=r}Rd(){var t=this.mn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Nd(Ss);return"number"!=typeof e||Date.now()-e>t}Bd(){return!!this.Rd()&&(this.bd||this.fd||(this.bd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Hd(){var t=this.mn.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})):[]}zd(){var t=this.mn.flagKeys;if(!q(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.mn,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=>!q(r[t]))).reduce(((t,e)=>(t[e]=r[e],t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.Ud({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Nd(is))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Nd(as))&&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:ci(v),variant:fi(v),reason:void 0,metadata:q(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Ud({flags:u})}get hasLoadedFlags(){return this.vd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Nd(ss),e=this.Nd(us),i=this.Nd(hs);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=q(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=q(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.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.ld=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:ci(r),variant:fi(r),payload:vi(e[i])}}))}getFlagVariants(){var t=this.Nd(is),e=this.Nd(us);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.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.ld=!0),i}getFlagPayloads(){var t=this.Nd(as),e=this.Nd(hs);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.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.ld=!0),i}reloadFeatureFlags(){this.gd||this.mn.featureFlagsDisabled||this.wd()||(this.fd&&(this.md=!0),this.Wd||(this.dd.slice().forEach((t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}})),this.Wd=setTimeout((()=>{this.Vd()}),5)))}$d(){clearTimeout(this.Wd),this.Wd=void 0}onReloading(t){return this.dd.push(t),()=>{this.dd=this.dd.filter((e=>e!==t))}}ensureFlagsLoaded(){this.vd||this.fd||this.Wd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.gd=t}resetFlagCallReported(){this.oi(_s)}Vd(t){this.$d();var e=this.Ns;if(e&&!this.mn.remoteRequestsDisabled&&!this.wd())if(this.fd)this.md=!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.Nd(ds)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Nd(vs),timezone:nl()};q(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.mn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Hd();r.length&&(i.evaluation_contexts=r);var n=this.zd();q(n)||(i.flag_keys=n);var s=this.mn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.pd;this.fd=!0;var l=()=>{this.md&&(this.md=!1,this.Vd())},u=t=>{this.fd=!1,o===this.pd?(this.ni({[ks]:[rk]}),this.A.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.mn.compression,sentAt:"body",timeoutMs:this.mn.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.fd=!1,o===this.pd){if(this.Gd(t.statusCode),a||this.md||(this.$anon_distinct_id=void 0),!i.disable_flags||this.md){this.yd=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?rk:"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.ni({[ks]: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.Ud(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}wd(){return pr(this._d,3)}Gd(t){this._d=gr(t,this._d,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.yd)if(this.vd||this.getFlags()&&this.getFlags().length>0){if(!this.Bd()){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+ik)}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.yd)if(this.vd||this.getFlags()&&this.getFlags().length>0){if(!this.Bd()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Nd(os)||void 0,u=this.Nd(Ss)||void 0,h=this.Nd(_s)||{};if(this.mn.deduplicateCallsPerSession){var d,v=null==(d=this.Ns)?void 0:d.session.sessionId,c=this.Nd(ws);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.ni({[_s]:h,[ws]:i});else{var f,g,m,y,b,_,w,k,S,x,C,T;O(h[t])?h[t].push(o):h[t]=[o],this.ni(p({[_s]:h},i?{[ws]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Nd(ks))&&void 0!==f?f:[]];q(s)&&I.push("flag_missing");var E={$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.mn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(b=this.mn.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.yd};q(null==M||null==(_=M.metadata)?void 0:_.has_experiment)||(E.$feature_flag_has_experiment=M.metadata.has_experiment),q(null==M||null==(w=M.metadata)?void 0:w.version)||(E.$feature_flag_version=M.metadata.version);var R,P=null!==(k=null==M||null==(S=M.reason)?void 0:S.description)&&void 0!==k?k:null==M||null==(x=M.reason)?void 0:x.code;P&&(E.$feature_flag_reason=P),null!=M&&null!=(C=M.metadata)&&C.id&&(E.$feature_flag_id=M.metadata.id),q(null==M?void 0:M.original_variant)&&q(null==M?void 0:M.original_enabled)||(E.$feature_flag_original_response=q(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(E.$feature_flag_original_payload=null==M||null==(R=M.metadata)?void 0:R.original_payload),I.length&&(E.$feature_flag_error=I.join(",")),this.Zd(E)}else i&&this.ni({[_s]:h,[ws]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:vi(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+ik)}Zd(t){try{var e;null==(e=this.Ns)||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.Qd(t,e)}Qd(t,e){var i=this;return f((function*(){var r=i.Ns;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Hd();s.length&&(n.evaluation_contexts=s);var a,o=i.zd();q(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.mn.compression,sentAt:"body",timeoutMs:i.mn.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.yd)return e.defaultValue;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+ik),e.defaultValue;var i=this.getFeatureFlag(t,e);return q(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.Ud(t,e,i)}Ud(t,e,i){if(this.Ns){this.vd=!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=tk);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!q(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(O(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{[rs]:l,[is]:v,[ls]:!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({[rs]:Object.keys(sk(f)),[is]:f||{},[as]:g||{},[ss]:m||{},[ls]:!0===t.minimalFlagCalledEvents},h?{[os]:h}:{},d?{[Ss]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);r&&(this.jd(r,t,!(null==i||!i.partialResponse)),this.ni(r)),e||(this.bd=!1),this.Fd(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.Jd(t)}Jd(t){if(this.Ns){if(!1===t)return this.oi([us,hs]),this.Fd(),void ek.info("All overrides cleared");if(O(t))return this.ni({[us]:nk(t)}),this.Fd(),void ek.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.ld=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[us]=O(n)?nk(n):n),s&&(r[hs]=s),Object.keys(r).length&&this.ni(r),!1===n&&!1===s?this.oi([us,hs]):!1===n?this.oi(us):!1===s&&this.oi(hs),this.Fd(),!1===n?ek.info("Flag overrides cleared"):n&&ek.info("Flag overrides set",{flags:n}),void(!1===s?ek.info("Payload overrides cleared"):s&&ek.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ni({[us]:t}),this.Fd(),void ek.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.vd){var e=this.Kd(),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.Nd(ns)||[]).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({[rs]:[t],[is]:[t],[ds]:Object.keys(s)}),this.ni({[rs]:Object.keys(sk(o)),[is]:o,[ds]:p({},this.Nd(ds)||{},s)}),this.Fd();try{var l;null==(l=this.Ns)||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.Nd(ns);!r||e?this.Yd(t,i):t(r)}Yd(t,e){var i=this;return f((function*(){var r=i.Ns;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.ni({[ns]: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)}}}))()}Kd(){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)),{})}}Fd(t){this.Ad();var e=this.Kd(),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.Xd(t,e)}Xd(t,e){void 0===e&&(e=!0);var i=this.Nd(ds)||{},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.ni({[ds]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Nd(ds)||{});t.forEach((t=>{delete i[t]})),this.ni({[ds]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.oi(ds),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Nd(vs)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.ni({[vs]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Nd(vs)||{};this.ni({[vs]:p({},e,{[t]:{}})})}else this.oi(vs)}reset(){this.pd++,this.md=!1,this.ud={},this.hd={},this.vd=!1,this.gd=!1,this.yd=!1,this.$anon_distinct_id=void 0,this.$d(),this.ld=!1,this._d=0}}},yk={sessionRecording:class{get mn(){return this._instance.config}get Bo(){return this._instance.persistence}get started(){var t;return!(null==(t=this.tv)||!t.isStarted)}get status(){var t,e;return this.ev===la||this.ev===ua?this.ev:null!==(t=null==(e=this.tv)?void 0:e.status)&&void 0!==t?t:this.ev}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ev=ia,this.iv=void 0,this.rv=!1,this.jt=(()=>{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.Vt=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.jt=!0,null==(t=this.tv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Pw.error("started without valid sessionManager"),new Error(Rw+" started without valid sessionManager. This is a bug.");if(this.mn.cookieless_mode===Vs)throw new Error(Rw+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&ar(r,"visibilitychange",this.Vt)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.rv=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.Vt),i?this.nv(!0):this.stopRecording()}get sv(){var e,i=!(null==(e=this._instance.get_property(jn))||!e.enabled),r=!this.mn.disable_session_recording,n=this.mn.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.rv||this.sv&&null!=(e=this.tv)&&e.isStarted)){var i=!q(Object.assign)&&!q(Array.from);this.sv&&i?(this.av(t),Pw.info("starting")):(this.ev=ia,this.stopRecording())}}av(t){var e,i;if(this.sv)if(this.ev!==la&&this.ev!==ua&&(this.ev=oa),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording)this.ov(t);else{var r,n=this._instance.sessionManager;null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.lv,(e=>{if(!this.rv&&this.sv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ls]:!0}),Pw.error("could not load recorder",e)):void this.ov(t);this.ev=ia}))}}stopRecording(){var t,e;null==(t=this.iv)||t.call(this),this.iv=void 0,null==(e=this.tv)||e.stop()}nv(t){var e,i;void 0===t&&(t=!1),null==(e=this.iv)||e.call(this),this.iv=void 0,null==(i=this.tv)||i.discard({discardProducerEvents:t})}uv(){var t,e;null==(t=this.Bo)||t.unregister(Gn),null==(e=this.Bo)||e.unregister(Bn)}hv(t,e){if(z(t))return null;var i,r=U(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Pw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}dv(t){if(this.Bo){var e,i,r=this.Bo,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.hv(null==(e=this.mn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.hv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;z(a)&&this.uv();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[jn]: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:q(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.iv)||e.call(this),this.iv=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.dv(e),void this.nv()):(this.dv(e),void this.startIfEnabledOrStop()):(this.ev===la&&(this.ev=ua,Pw.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.tv)&&i.log?this.tv.log(t,e):Pw.warn("log called before recorder was ready")}get lv(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(jn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}vv(){var t,e=this._instance.get_property(jn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Pw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!z(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=Rl}ov(t){var e,i,r;if(!this.rv&&this.sv&&this._instance.sessionManager){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Pw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ls]:!0});var n;if(this.tv||(this.tv=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.jt),this.tv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.vv()){if(this.ev===ua||this.ev===la)return;return this.ev=la,Pw.info("persisted remote config is stale, requesting fresh config before starting"),void new m_(this._instance).load()}this.ev=oa,null==(i=(r=this.tv).setDocumentWasEverVisible)||i.call(r,this.jt),this.tv.start(t)}else this.ev=ia}onRRwebEmit(t){var e;null==(e=this.tv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.tv||null==(e=this.Bo)||e.register({[zn]:!0}),null==(t=this.tv)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.tv||null==(e=this.Bo)||e.register({[Hn]:!0}),null==(t=this.tv)||t.overrideSampling()}overrideTrigger(t){var e,i;this.tv||null==(i=this.Bo)||i.register({["url"===t?Un:Wn]:!0}),null==(e=this.tv)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.tv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.tv)||!i.tryAddCustomEvent(t,e))}}},bk={autocapture:class extends Cb{constructor(t){super(new kw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.fv=this.pv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.gv();return!!(t.path||t.search||this.mv(t))}startIfEnabled(){this.isEnabled&&(Qi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.fv=this.pv(),this.startIfEnabled()}stop(){this.yv&&this.yv(),this.yv=void 0,this.bv&&this.bv(),this.bv=void 0,Qi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this._v("pushState"),this._v("replaceState"),this.wv(),this.mv()&&this.Sv())}_v(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Vv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.xv(e)}))}}pv(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}gv(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:D(t)?t:{}}mv(t){return void 0===t&&(t=this.gv()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Cv(t){var e=this.gv(),i=this.fv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.mv(e)&&t.hash!==i.hash))}xv(t){try{var e=this.pv();if(!e)return;this.Cv(e)&&this._instance.capture(Ys,{navigation_type:t}),this.fv=e}catch(e){Qi.error("Error capturing "+t+" pageview",e)}}wv(){if(!this.yv){var e=()=>{this.xv("popstate")};ar(t,"popstate",e),this.yv=()=>{t&&t.removeEventListener("popstate",e)}}}Sv(){if(!this.bv){var e=()=>{this.xv("hashchange")};ar(t,"hashchange",e),this.bv=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get mn(){return this.instance.config}constructor(t){var e;this.Tv=!1,this.Rs=!1,this.Mv=null,this.instance=t,this.Tv=!(null==(e=this.instance.persistence)||!e.props[Pn]),this.rageclicks=new bb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return D(this.mn.capture_heatmaps)&&this.mn.capture_heatmaps.flush_interval_milliseconds&&(t=this.mn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return z(this.mn.capture_heatmaps)?z(this.mn.enable_heatmaps)?this.Tv:this.mn.enable_heatmaps:!1!==this.mn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Aw.info("starting..."),this.Iv(),this.Vt()}else{var t;clearInterval(null!==(t=this.Mv)&&void 0!==t?t:void 0),this.Ev(),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({[Pn]:i}),this.Tv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Pt;return this.Pt=void 0,t}Rv(t){Fw(t.originalEvent)&&this.Xi(t.originalEvent,"deadclick")}Vt(){this.Mv&&clearInterval(this.Mv),this.Mv=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.Po.bind(this),this.flushIntervalMilliseconds):null}Iv(){t&&r&&(this.Pv=this.Po.bind(this),ar(t,Ks,this.Pv),this.Av=e=>this.Xi(e||(null==t?void 0:t.event)),ar(r,"click",this.Av,{capture:!0}),this.Fv=e=>this.Ov(e||(null==t?void 0:t.event)),ar(r,"mousemove",this.Fv,{capture:!0}),this.Lv=new Vb(this.instance,Ub,this.Rv.bind(this)),this.Lv.startIfEnabledOrStop(),this.Dv=this.Vt.bind(this),ar(r,Js,this.Dv),this.Rs=!0)}Ev(){var e;t&&r&&(this.Pv&&t.removeEventListener(Ks,this.Pv),this.Av&&r.removeEventListener("click",this.Av,{capture:!0}),this.Fv&&r.removeEventListener("mousemove",this.Fv,{capture:!0}),this.Dv&&r.removeEventListener(Js,this.Dv),clearTimeout(this.$v),null==(e=this.Lv)||e.stop(),this.Rs=!1)}Nv(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(w(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}}Xi(t,e){var i;if(void 0===e&&(e="click"),!Sr(t.target)&&Fw(t)){var r=this.Nv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Wr(Or(t),this.instance.config.rageclick)&&this.ks(p({},r,{type:"rageclick"})),this.ks(r)}}Ov(t){!Sr(t.target)&&Fw(t)&&(clearTimeout(this.$v),this.$v=setTimeout((()=>{this.ks(this.Nv(t,"mousemove"))}),500))}ks(e){if(t){var i=this.mn.disable_capture_url_hashes?Re(t.location.href):t.location.href,r=this.mn.custom_personal_data_properties,n=this.mn.mask_personal_data_properties?[...Vo,...r||[]]:[],s=cr(i,n,Zo);this.Pt=this.Pt||{},this.Pt[s]||(this.Pt[s]=[]),this.Pt[s].push(e)}}Po(){this.Pt&&!N(this.Pt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Vb,webVitalsAutocapture:class{constructor(t){var e;this.Tv=!1,this.Rs=!1,this.Pt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.qv=()=>{clearTimeout(this.jv),this.jv=void 0,0!==this.Pt.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.Pt.url},this.Pt.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.Pt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Bv=t=>{var e;if(this.Pt=this.Pt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},z(null==t?void 0:t.name)||z(null==t?void 0:t.value))Cw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Hv(i);if(!q(r)){var n=U(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.zv||this.zv>t.value){this.Pt.navigationKey!==n&&(this.qv(),this.jv=setTimeout(this.qv,this.flushToCaptureTimeoutMs)),q(this.Pt.navigationKey)&&(this.Pt.navigationKey=n,this.Pt.url=r),this.Pt.firstMetricTimestamp=q(this.Pt.firstMetricTimestamp)?Date.now():this.Pt.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,D(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of Ew){var u="url"===l&&"string"==typeof t.attribution[l]?this.Hv(t.attribution[l]):t.attribution[l];q(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;q(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.Pt.metrics.push(a),this.Pt.metrics.length===this.allowedMetrics.length&&this.qv()}else Cw.error("Ignoring metric with value >= "+this.zv,t)}}},this.Uv=()=>{if(!this.Rs){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Wv])||("web-vitals"===this.Wv&&q(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!q(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!q(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.Bv.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Bv.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Bv.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Bv.bind(this),d),this.Rs=!0}else Cw.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Tv=!(null==(e=this._instance.persistence)||!e.props[Ln]),this.startIfEnabled()}get Vv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=D(this.Vv)?null==(t=this.Vv)?void 0:t.web_vitals_allowed_metrics:void 0;return z(i)?(null==(e=this._instance.persistence)?void 0:e.props[qn])||Mw:i}get flushToCaptureTimeoutMs(){return(D(this.Vv)?this.Vv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=D(this.Vv)?this.Vv.web_vitals_attribution:void 0;return V(t)?t?Mw:[]:O(t)?t:Iw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=D(this.Vv)?this.Vv.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get zv(){var t=D(this.Vv)&&U(this.Vv.__web_vitals_max_value)?this.Vv.__web_vitals_max_value:Tw;return t>0&&6e4>=t?Tw:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return Cw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=D(this.Vv)?this.Vv.web_vitals:V(this.Vv)?this.Vv:void 0;return V(e)?e:this.Tv}startIfEnabled(){this.isEnabled&&!this.Rs&&(Cw.info("enabled, starting..."),this.Ys(this.Uv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=D(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=D(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ln]:i}),this._instance.persistence.register({[qn]:r})),this.Tv=i,this.startIfEnabled()}}}get Wv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ys(t){var e=v.__PosthogExtensions__,i=this.Wv,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&q(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?Cw.error("failed to load script",e):t()}))}Hv(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?[...Vo,...n||[]]:[];return cr(r,s,Zo)}Cw.error("Could not determine current URL")}}},_k={exceptionObserver:class{constructor(e){var i;this.Uv=()=>{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.Gv&&this.mn.capture_unhandled_errors&&(this.Gv=i(this.captureException.bind(this))),!this.Zv&&this.mn.capture_unhandled_rejections&&(this.Zv=r(this.captureException.bind(this))),!this.Qv&&this.mn.capture_console_errors&&(this.Qv=n(this.captureException.bind(this)))}catch(t){Sw.error("failed to start",t),this.Jv()}}},this._instance=e,this.Kv=!(null==(i=this._instance.persistence)||!i.props[An]),this.pe=new st(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:Sw})),this.mn=this.Yv(),this.startIfEnabledOrStop()}Yv(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return D(t)?e=p({},e,t):(q(t)?this.Kv:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.mn.capture_console_errors||this.mn.capture_unhandled_errors||this.mn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Sw.info("enabled"),this.Jv(),this.Ys(this.Uv)):this.Jv()}Ys(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 Sw.error("failed to load script",e);t()}))}Jv(){var t,e,i;null==(t=this.Gv)||t.call(this),this.Gv=void 0,null==(e=this.Zv)||e.call(this),this.Zv=void 0,null==(i=this.Qv)||i.call(this),this.Qv=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Kv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[An]:this.Kv}),this.mn=this.Yv(),this.startIfEnabledOrStop())}}onConfigChange(){this.mn=this.Yv()}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)?Sw.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.Xv=[],this.tc=wm(),this._instance=t,this.Xv=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Fn))&&void 0!==e?e:[],this.ec=ui(this.ic()),this.rc=new hi(this.ec)}onConfigChange(){this.ec=ui(this.ic()),this.rc.setConfig(this.ec)}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.Xv=s,this._instance.persistence&&this._instance.persistence.register({[Fn]:this.Xv,[On]:a})}}}get nc(){var t,e=!!this._instance.get_property(On),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.tc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ec.enabled)try{if(!j(t)||0===t.trim().length)return void mm.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)=>oi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.sc(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&mm.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.rc.add(p({[si]:t,[ai]:(new Date).toISOString()},r))}catch(t){mm.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ac(e)){if(this.oc(e))return this.lc("Exception dropped: matched a suppression rule"),void mm.info("Skipping exception capture because a suppression rule matched");if(!this.nc&&this.uc(e))return this.lc("Exception dropped: thrown by a browser extension"),void mm.info("Skipping exception capture because it was thrown by an extension");if(!this.nc&&this.hc(e))return this.lc("Exception dropped: thrown by an injected browser script"),void mm.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.dc(e))return this.lc("Exception dropped: thrown by the PostHog SDK"),void mm.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ec.enabled&&z(t.$exception_steps)?this.vc(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",gu:!0});return n&&this.rc.clear(),n}catch(t){return mm.error("Failed to capture exception event. Dropping this exception.",t),void this.rc.clear()}}catch(t){return void mm.error("Failed to process exception event. Ignoring this exception.",t)}var s}vc(t){try{var e=this.rc.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return mm.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}lc(t){this.ec.enabled&&this.rc.add({[si]:t,[ai]:(new Date).toISOString()})}sc(t){return D(t)?p({},t):{}}ic(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}oc(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return j(i)&&i.length>0&&t.$exception_types.push(i),j(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Xv.some((t=>{var i=t.values.map((t=>{var i=Oo[t.operator],r=e[t.key];if(!i||!r)return!1;var n=O(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 mm.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}uc(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&&bm.some((t=>e.startsWith(t)))}));return 0!==i.length&&(!i.every((t=>{var e=t.filename;return!!e&&e.startsWith(ym)}))||t.some((t=>{var e=t.value;return j(e)&&e.includes("isolatedAPI.contexts.topHostname")}))&&!e.some((t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(ym))})))}hc(t){return t.some((t=>{var e=t.value;return j(e)&&_m.some((t=>e.includes(t)))}))}dc(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}ac(t){return!z(t)&&O(t)}}},wk=p({productTours:class{get Bo(){return this._instance.persistence}constructor(t){this.cc=null,this.fc=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.Bo&&this.Bo.register({[$n]:!!e.productTours}),!Lw(this._instance))return!this.cc&&z(null==(i=this.Bo)?void 0:i.props[bs])||Ow.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.cc)||r.stop(),this.cc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.cc&&Lw(this._instance)&&this.Ys((()=>this.gc()))}Ys(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?Ow.error("Could not load product tours script",e):t()}))}gc(){var t;!this.cc&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.cc=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!O(this.fc)||e){var i=this.Bo;if(i){var r=i.props[bs];if(O(r)&&!e)return this.fc=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Lw(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||Ow.warn(n):Ow.error(n),void t([],{isLoaded:!1,error:n})}var s=O(e.json.product_tours)?e.json.product_tours:[];this.fc=s,i&&i.register({[bs]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.fc,{isLoaded:!0})}getActiveProductTours(t){z(this.cc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.cc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.cc)||e.showTourById(t)}previewTour(t){this.cc?this.cc.previewTour(t):this.Ys((()=>{var e;this.gc(),null==(e=this.cc)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.cc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.cc)||t.nextStep()}previousStep(){var t;null==(t=this.cc)||t.previousStep()}clearCache(){var t;this.fc=null,null==(t=this.Bo)||t.unregister(bs)}resetTour(t){var e;null==(e=this.cc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.cc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.cc)||e.cancelPendingTour(t)}}},mk),kk={siteApps:class{constructor(t){this.mc=0,this._instance=t,this.yc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}bc(t,e){if(e){var i=this.globalsForEvent(e);this.yc.push(i),this.yc.length>1e3&&(this.yc=this.yc.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.bc.bind(this));this._c=()=>{t(),this.yc=[],this._c=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,Dw),{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}}wc(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||($w.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||($w.error("prepare_external_dependency_script returned null"),null):t}kc(){var t,e,i,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.mc++,this.Sc)return this.xc();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.wc(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!H(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.Sc=()=>{d.forEach((t=>t())),this.Sc=void 0},this.xc()}xc(){var t=!1;return()=>{var e;t||(t=!0,this.mc--,0===this.mc&&(null==(e=this.Sc)||e.call(this)))}}Cc(t,e){void 0===e&&(e=!0);var i=this.kc();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.yc.length&&($w.info("Processing "+this.yc.length+" events for site app with id "+t.id),this.yc.forEach((t=>this.Cc((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this._c)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,$w.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Cc((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){$w.error(Nw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){$w.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Tc(){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)}Mc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Cc((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){$w.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Tc(),void this._instance.on("eventCaptured",(t=>this.Mc(t)))):void $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this._c)||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 $w.error(Nw+e,t)}))};for(var o of s.siteApps)a()}else $w.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Sk={tracingHeaders:class{constructor(t){this.Ic=void 0,this.Ec=void 0,this.Rc=void 0,this.Uv=()=>{var t,e,i=this.Pc();i?(q(this.Ic)&&(this.Ic=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),q(this.Ec)&&(this.Ec=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Jv()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ys(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 xw.error("failed to load script",e);t()}))}Ac(){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}Pc(){var t=this.Ac();return O(t)?(O(this.Rc)?this.Rc.splice(0,this.Rc.length,...t):this.Rc=[...t],t.length>0?this.Rc:void 0):(O(this.Rc)&&this.Rc.splice(0),this.Rc=t||void 0,this.Rc)}Jv(){var t,e;null==(t=this.Ic)||t.call(this),null==(e=this.Ec)||e.call(this),this.Ic=void 0,this.Ec=void 0}startIfEnabledOrStop(){this.Pc()?this.Ys(this.Uv):this.Jv()}}},xk=p({surveys:class extends Hw{constructor(t){var e;super(new Zw(t),{get projectToken(){return e.config.token},kv:new Gw(e=t)}),this._instance=t}Bu(t,e){var i=e.query?k_(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})}))}}},mk),Ck={toolbar:class{constructor(t){this.instance=t}Fc(t){v.ph_toolbar_state=t}Oc(){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=Qw||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(Jw)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Lc(t){var e=v.ph_load_toolbar||v.ph_load_editor;!z(e)&&L(e)?e(t,this.instance):Kw.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(Jw,JSON.stringify(p({},s,{source:void 0}))),2===this.Oc())this.Lc(s);else if(0===this.Oc()){var a;this.Fc(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Kw.error("[Toolbar] Failed to load",t),void this.Fc(0);this.Fc(2),this.Lc(s)})),ar(t,"turbolinks:load",(()=>{this.Fc(0),this.loadToolbar(s)}))}return!0}Dc(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)}}},Tk=p({experiments:lk},mk),Mk={conversations:class{constructor(t){this.$c=void 0,this._conversationsManager=null,this.Nc=!1,this.je=null,this.qc=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.jc=t.ok,t.ok)){var e=t.config.conversations;z(e)||(V(e)?this.$c=e:(this.$c=e.enabled,this.je=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.$c=void 0,this.je=null,this.jc=void 0,this.qc=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Nc||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&&!q(this.$c)&&this.$c)if(this.je&&this.je.token){this.Nc=!0;try{var e=t.initConversations;if(e)return this.Bc(e),void(this.Nc=!1);var i=t.loadExternalDependency;if(!i)return void this.Hc(Us);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Hc("Could not load conversations script",e):this.Bc(t.initConversations),this.Nc=!1}))}catch(t){this.Hc("Error initializing conversations",t),this.Nc=!1}}else uk.error("Conversations enabled but missing token in remote config.")}}Bc(t){if(this.je)try{this._conversationsManager=t(this.je,this._instance),this.qc=!1,uk.info("Conversations loaded successfully")}catch(t){this.Hc("Error completing conversations initialization",t)}else uk.error("Cannot complete initialization: remote config is null")}Hc(t,e){uk.error(t,e),this._conversationsManager=null,this.Nc=!1,this.qc=!0}show(){this._conversationsManager?this._conversationsManager.show():uk.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.$c&&!H(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.jc?"remote_config_failed":q(this.$c)?this.jc?"disabled_in_project":"remote_config_pending":this.$c?z(this.je)||!this.je.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.Nc?"initializing":this.qc?"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):(uk.warn(hk),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(uk.warn(hk),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(uk.warn(hk),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(uk.warn(hk),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(uk.warn(hk),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(uk.warn(hk),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(uk.warn(hk),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}Cu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Tu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Ik={logs:class{constructor(e){var i,r=this;this.name=lp,this.zc=!1,this.Uc=!1,this.Wc=!1,this.A=Ji("[logs]"),this.Vc=p({},this.A,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(gk)||r.A.error(...e)}}),this.bo=[],this.Gc=[],this._d=0,this.Os=!1,this.Zc=[],this.Qc=[],this.Jc=!1,this.Kc=!1,this.Yc=()=>{var t,e;this.Os||(this._d=0,null==(t=this.Xc)||t.onReconnect(),null==(e=this.tf)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.zc=!0),t&&ar(t,"online",this.Yc)}ef(t,e,i,r){var n,s=dk(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Bi(this.if(t,e),s,this.Vc,(()=>this.rf()),(t=>t()),void 0,r),s]}nf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Xc||this.sf!==e){var i;null==(i=this.Xc)||i.reset(),this.sf=e;var r=this.ef((()=>this.bo),(t=>{this.bo=t}));this.Xc=r[0],this.af=r[1]}return this.Xc}lf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.tf||this.uf!==e){var i;null==(i=this.tf)||i.reset(),this.uf=e;var r=this.ef((()=>this.Gc),(t=>{this.Gc=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ck);this.tf=r[0],this.hf=r[1]}return this.tf}setup(t){var e;if(!this.Os){this.Ns=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.zc=!0),(this.zc||this.df()&&this.vf())&&this.cf();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.Os?r.dispose():(this.qs=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.Os||(this.Os=!0,this.ff(),null==(e=this.qs)||e.dispose(),this.qs=void 0,this.Ns=void 0,this.Wc=!1,null==t||t.removeEventListener("online",this.Yc),null==(i=this.pf)||i.call(this),this.pf=void 0,null==(r=this.Xc)||r.reset(),null==(n=this.tf)||n.reset())}onRemoteConfig(t){var e,i;if(!this.Os){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;z(r)?this.gf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[Nn]:!!r}),r?(this.zc=!0,this.Uc||this.cf(),this.loadIfEnabled()):this.gf())}}reset(){var t,e,i,r;this.ff(),null==(t=this.Xc)||t.clearQueue(),this.bo=[],null==(e=this.Xc)||e.reset(),null==(i=this.tf)||i.clearQueue(),this.Gc=[],null==(r=this.tf)||r.reset(),this._d=0}captureLog(t){this.Os||this.nf().captureLog(t)}captureConsoleLog(t){this.Os||this.lf().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.Os||this.lf().captureLog(t,{context:e,occurredAtMs:i})}vf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[Nn])}df(){var t,e;return null==(t=this._instance)||null==t.fo||!t.fo()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Iu(){var t;this.ff(),null==(t=this.tf)||t.clearQueue(),this.Gc=[]}gf(){this.zc||this.ff()}cf(){var t,e=this;if(!this.Jc&&null!=v&&v.console){var i=dk(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=sm(v.console[t])}catch(t){return 0}if(!r)return 0;e.Qc.push(Vv(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.mf(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of vk)r(n);this.Jc=!0,this.yf=setTimeout((()=>{this.ff()}),3e4)}}mf(t,e,i){var r;if(this.Jc&&!this.Kc&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Zc.length){this.Kc=!0;try{this.Zc.push({level:t,args:e,occurredAtMs:Date.now(),context:this.rf()})}finally{this.Kc=!1}}}else this.ff()}ff(){if(this.Zc=[],this.Jc){for(var t of(this.Jc=!1,this.yf&&(clearTimeout(this.yf),this.yf=void 0),this.Qc))t();this.Qc=[]}}bf(){var t=this.Zc;return this.ff(),t}get logger(){return this._f||(this._f={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._f}flushLogs(t){t?this.wf(t):(this.Xc&&this.Xc.flush().catch((t=>this.kf(t))),this.tf&&this.tf.flush().catch((t=>this.kf(t))))}kf(t){gk(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.Os&&this.zc&&!this.Uc&&!this.Wc){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.ff();var e=t.loadExternalDependency;if(!e)return this.A.error(Us),void this.ff();this.Wc=!0;try{e(this._instance,"logs",(e=>{if(this.Wc=!1,!this.Os&&this.zc){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.ff();else{var r,n,s=this.bf();this.pf=i.initializeLogs(null!==(r=this.Ns)&&void 0!==r?r:this._instance),this.Uc=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Ns)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.Wc=!1,t}}}if(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===C.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===C.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},hs:t=>this.hs(t),getLibraryId:()=>Gi.LIB_NAME,getLibraryVersion:()=>Gi.LIB_VERSION}}hs(t){return new Promise((e=>{if(pr(this._d,3))e({kind:"fatal",error:pk(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:pk(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Sf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.xf(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:pk(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)})}}})}}))}xf(t){(0!==t||this._instance.__loaded)&&(this._d=gr(t,this._d,3,(()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}wf(t){this.bo.length>0&&this.Cf(t,this.bo,this.af,Gi.LIB_NAME,(t=>{this.bo=t})),this.Gc.length>0&&this.Cf(t,this.Gc,this.hf,ck,(t=>{this.Gc=t}))}Cf(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=ji(s,qi(i,Gi.LIB_NAME,Gi.LIB_VERSION),r,Gi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Sf(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Sf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}rf(){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,z(n)||(e.sessionStartTimestamp=n),z(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}}},Ek={metrics:class{constructor(t){this.A=Ji("[metrics]"),this._instance=t}initialize(){}nf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Xc&&this.sf===i||(null==(e=this.Xc)||e.reset(),this.sf=i,this.Xc=new Wi(this.if(),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.Xc}count(t,e,i){void 0===e&&(e=1),this.nf().count(t,e,i)}gauge(t,e,i){this.nf().gauge(t,e,i)}histogram(t,e,i){this.nf().histogram(t,e,i)}flush(t){if(!this.Xc)return Promise.resolve();if(t){var e=this.Xc.drainWindow();return e&&this.Ms(e,t),Promise.resolve()}return this.Xc.flush().catch((t=>this.A.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Xc)||t.reset()}if(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ms:t=>e.Ms(t),getLibraryId:()=>Gi.LIB_NAME,getLibraryVersion:()=>Gi.LIB_VERSION}}Ms(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.Tf(),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)})}}}))}))}Tf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Rk=p({},mk,yk,bk,_k,wk,kk,xk,Sk,Ck,Tk,Mk,Ik,Ek);ww.__defaultExtensionClasses=p({},Rk),function(){Gi.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||O(e._i)){var i=nw[fw]=new ww;if(e){var n=[];Yi(e._i,(function(t){if(t&&O(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,pw=!1,Yi(nw,(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