PageSourceSearch

https://id.cardboard.inc/static/assets/vendor-analytics-Cm_7XNU9.js

js cardboard.inc collected 2026-10-07 19:14:14 UTC 331,105 bytes, 5 lines download raw bytes

1var e=typeof window<`u`?window:void 0,t=typeof globalThis<`u`?globalThis:e;typeof self>`u`&&(t.self=t),typeof File>`u`&&(t.File=function(){});var n=t?.navigator,r=t?.document,i=t?.location,a=t?.fetch,o=t!=null&&t.XMLHttpRequest&&`withCredentials`in new t.XMLHttpRequest?t.XMLHttpRequest:void 0,s=t?.AbortController,c=t?.CompressionStream,l=n?.userAgent,u=e??{},d=`1.396.6`,f={DEBUG:!1,LIB_VERSION:d,LIB_NAME:`web`,JS_SDK_VERSION:d};function p(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){p(a,r,i,o,s,`next`,e)}function s(e){p(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function g(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}};function v(e){return typeof e==`string`||e}function y(e){return typeof e==`string`?e:void 0}var b,x=function(e){return e.AnonymousId=`anonymous_id`,e.DistinctId=`distinct_id`,e.Props=`props`,e.EnablePersonProcessing=`enable_person_processing`,e.PersonMode=`person_mode`,e.FeatureFlagDetails=`feature_flag_details`,e.FeatureFlags=`feature_flags`,e.FeatureFlagPayloads=`feature_flag_payloads`,e.BootstrapFeatureFlagDetails=`bootstrap_feature_flag_details`,e.BootstrapFeatureFlags=`bootstrap_feature_flags`,e.BootstrapFeatureFlagPayloads=`bootstrap_feature_flag_payloads`,e.OverrideFeatureFlags=`override_feature_flags`,e.Queue=`queue`,e.LogsQueue=`logs_queue`,e.OptedOut=`opted_out`,e.SessionId=`session_id`,e.SessionStartTimestamp=`session_start_timestamp`,e.SessionLastTimestamp=`session_timestamp`,e.PersonProperties=`person_properties`,e.GroupProperties=`group_properties`,e.InstalledAppBuild=`installed_app_build`,e.InstalledAppVersion=`installed_app_version`,e.SessionReplay=`session_replay`,e.SessionReplayEventTriggerActivatedSession=`session_replay_event_trigger_activated_session`,e.SurveyLastSeenDate=`survey_last_seen_date`,e.SurveysSeen=`surveys_seen`,e.Surveys=`surveys`,e.RemoteConfig=`remote_config`,e.FlagsEndpointWasHit=`flags_endpoint_was_hit`,e.DeviceId=`device_id`,e}({}),S=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),C=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`],w=[`token`],ee=`NativeGzipValidationError`,T=e=>e.length>=2&&e[0]===31&&e[1]===139,te=(e,t)=>e===S.GZipJS||t===S.GZipJS||t===`gzip`,ne=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,re=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=ee,t},ie=function(){var e=m((function*(e,t){18>e.size&&re(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());T(n)&&n[2]===8||re(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(b)return b;b=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;b[e]=t>>>0}return b})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&re(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&re(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();function ae(){return ae=m((function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new CompressionStream(`gzip`),a=i.writable.getWriter(),o=a.write(r).then((()=>a.close())).catch(function(){var e=m((function*(e){try{yield a.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(i.readable).blob(),[c]=yield Promise.all([s,o]);return yield ie(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),ae.apply(this,arguments)}var oe=`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,pinterest,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`.split(`,`),E=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return oe.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function D(e,t){return e.indexOf(t)!==-1}var se=function(e){return e.trim()},ce=function(e){return e.replace(/^\$/,``)},le=Object.prototype,ue=le.hasOwnProperty,de=le.toString,O=Array.isArray||function(e){return de.call(e)===`[object Array]`},k=e=>typeof e==`function`,A=e=>e===Object(e)&&!O(e),fe=e=>{if(A(e)){for(var t in e)if(ue.call(e,t))return!1;return!0}return!1},j=e=>e===void 0,M=e=>de.call(e)==`[object String]`,pe=e=>M(e)&&e.trim().length===0,me=e=>e===null,N=e=>j(e)||me(e),P=e=>de.call(e)==`[object Number]`&&e==e,he=e=>P(e)&&e>0,ge=e=>de.call(e)===`[object Boolean]`,_e=e=>e instanceof FormData,ve=e=>D(C,e),ye=e=>D(w,e);function be(e){return typeof e!=`object`||!e}function xe(e,t){return{}.toString.call(e)===`[object `+t+`]`}function Se(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var Ce=[!0,`true`,1,`1`,`yes`],we=e=>D(Ce,e),Te=[!1,`false`,0,`0`,`no`];function Ee(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),P(e)?e>n?(r.warn(` cannot be  greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),Ee(i||n,t,n,r))}var De=class{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=Ee(e.bucketSize,0,100,e.Ae),this.$e=Ee(e.refillRate,0,this.Fe,e.Ae),this.De=Ee(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var n=Math.floor((t-e.lastAccess)/this.De);
1n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess+=n*this.De)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.Ee[r];return i?this.Ne(i,n):this.Ee[r]=i={tokens:this.Fe,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.Pe)==null||t.call(this,e)),i.tokens===0)}stop(){this.Ee={}}},Oe=`Mobile`,ke=`iOS`,Ae=`Android`,je=`Tablet`,Me=Ae+` `+je,Ne=`iPad`,Pe=`Apple`,Fe=Pe+` Watch`,Ie=`Safari`,Le=`BlackBerry`,Re=`Samsung`,ze=Re+`Browser`,Be=Re+` Internet`,Ve=`Chrome`,He=Ve+` OS`,Ue=Ve+` `+ke,We=`Internet Explorer`,Ge=We+` `+Oe,Ke=`Opera`,qe=Ke+` Mini`,Je=`Edge`,Ye=`Microsoft `+Je,Xe=`Firefox`,Ze=Xe+` `+ke,Qe=`Nintendo`,$e=`PlayStation`,et=`Xbox`,tt=Ae+` `+Oe,nt=Oe+` `+Ie,rt=`Windows`,it=rt+` Phone`,at=`Nokia`,ot=`Ouya`,st=`Generic`,ct=st+` `+Oe.toLowerCase(),lt=st+` `+je.toLowerCase(),ut=`Konqueror`,dt=`Oculus Browser`,ft=`Vivaldi`,pt=`Yandex`,mt=`Whale`,ht=`DuckDuckGo`,gt=`Pale Moon`,_t=`Waterfox`,vt=`Brave`,yt=`Google Search App`,F=`(\\d+(\\.\\d+)?)`,bt=RegExp(`Version/`+F),xt=new RegExp(et,`i`),St=RegExp($e+` \\w+`,`i`),Ct=RegExp(Qe+` \\w+`,`i`),wt=RegExp(Le+`|PlayBook|BB10`,`i`),Tt={"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`},Et=function(e,t,n,r){return t||=``,function(e){return e!=null&&e.brave?vt:null}(n)||(r!=null&&r.detectGoogleSearchApp&&D(e,`GSA/`)?yt:D(e,` OPR/`)&&D(e,`Mini`)?qe:D(e,` OPR/`)?Ke:wt.test(e)?Le:D(e,`IE`+Oe)||D(e,`WPDesktop`)?Ge:D(e,`OculusBrowser`)?dt:D(e,ze)?Be:D(e,Je)||D(e,`Edg/`)?Ye:D(e,ft+`/`)?ft:D(e,`YaBrowser/`)?pt:D(e,mt+`/`)?mt:D(e,ht+`/`)||D(e,`Ddg/`)?ht:D(e,`FBIOS`)?`Facebook `+Oe:D(e,`UCWEB`)||D(e,`UCBrowser`)?`UC Browser`:D(e,`CriOS`)?Ue:D(e,`CrMo`)||D(e,Ve)?Ve:D(e,Ae)&&D(e,Ie)?tt:D(e,`FxiOS`)?Ze:D(e.toLowerCase(),ut.toLowerCase())?ut:D(e,vt+`/`)?vt:((e,t)=>t&&D(t,Pe)||function(e){return D(e,Ie)&&!D(e,Ve)&&!D(e,Ae)}(e))(e,t)?D(e,Oe)?nt:Ie:D(e,`PaleMoon/`)?gt:D(e,_t+`/`)?_t:D(e,Xe)?Xe:D(e,`MSIE`)||D(e,`Trident/`)?We:D(e,`Gecko`)?Xe:``)},Dt={[Ge]:[RegExp(`rv:`+F)],[Ye]:[RegExp(Je+`?\\/`+F)],[Ve]:[RegExp(`(`+Ve+`|CrMo)\\/`+F)],[Ue]:[RegExp(`CriOS\\/`+F)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+F)],[Ie]:[bt],[nt]:[bt],[Ke]:[RegExp(`(Opera|OPR)\\/`+F)],[Xe]:[RegExp(Xe+`\\/`+F)],[Ze]:[RegExp(`FxiOS\\/`+F)],[ut]:[RegExp(`Konqueror[:/]?`+F,`i`)],[Le]:[RegExp(Le+` `+F),bt],[tt]:[RegExp(`android\\s`+F,`i`)],[Be]:[RegExp(ze+`\\/`+F)],[dt]:[RegExp(`OculusBrowser\\/`+F)],[ft]:[RegExp(ft+`\\/`+F)],[pt]:[RegExp(`YaBrowser\\/`+F)],[mt]:[RegExp(mt+`\\/`+F)],[vt]:[RegExp(vt+`\\/`+F)],[ht]:[RegExp(`(DuckDuckGo|Ddg)\\/`+F)],[gt]:[RegExp(`PaleMoon\\/`+F)],[_t]:[RegExp(_t+`\\/`+F)],[yt]:[RegExp(`GSA\\/`+F)],[We]:[RegExp(`(rv:|MSIE )`+F)],Mozilla:[RegExp(`rv:`+F)]},Ot=function(e,t,n,r){var i=Dt[Et(e,t,n,r)];if(j(i))return null;for(var a=0;i.length>a;a++){var o=e.match(i[a]);if(o)return parseFloat(o[o.length-2])}return null},kt=[[RegExp(et+`; `+et+` (.*?)[);]`,`i`),e=>[et,e&&e[1]||``]],[new RegExp(Qe,`i`),[Qe,``]],[new RegExp($e,`i`),[$e,``]],[wt,[Le,``]],[new RegExp(rt,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[it,``];if(new RegExp(Oe).test(t)&&!/IEMobile\b/.test(t))return[rt+` `+Oe,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Tt[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[rt,r]}return[rt,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ke,[e[3],e[4],e[5]||`0`].join(`.`)]:[ke,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=j(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+Ae+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+Ae+`)`,`i`),e=>e&&e[2]?[Ae,[e[2],e[3],e[4]||`0`].join(`.`)]:[Ae,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[He,``]],[/Linux|debian/i,[`Linux`,``]]],At=function(e){return Ct.test(e)?Qe:St.test(e)?$e:xt.test(e)?et:new RegExp(ot,`i`).test(e)?ot:RegExp(`(`+it+`|WPDesktop)`,`i`).test(e)?it:/iPad/.test(e)?Ne:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Fe:wt.test(e)?Le:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(at,`i`).test(e)?at:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(Oe).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Ae:Me:RegExp(`(pda|`+Oe+`)`,`i`).test(e)?ct:new RegExp(je,`i`).test(e)&&!RegExp(je+` pc`,`i`).test(e)?lt:``},jt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Mt(e,t){return typeof(n=e)==`string`&&jt.test(n)?e:t();var n}function Nt(e){return e&&e.split(`#`)[0]}function Pt(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&n?.unref(),n}var Ft=e=>e instanceof Error,It={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}},Lt=It.info;function Rt(e){if(ge(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(O(e))return{arrayValue:{values:e.map((e=>Rt(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function zt(e){var t=[];for(var n in e){var r=e[n];me(r)||j(r)||t.push({key:n,value:Rt(r)})}return t}function Bt(e,t){var{text:n,number:r}=It[e.level||`info`]||Lt,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a[`window.id`]=t.windowId),N(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),N(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a[`url.full`]=t.currentUrl),t.screenName&&(a[`screen.name`]=t.screenName),t.appState&&(a[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=h({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:zt(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),j(e.trace_flags)||(s.flags=e.trace_flags),s}function Vt(e,t,n){return h({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function Ht(e,t,n,r){return{resourceLogs:[{resource:{attributes:zt(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Ut=class{constructor(e,t,n,r,i,a,o){a===void 0&&(a=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=n,this.qe=r,this.Be=i,this.je=a,this.He=o,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(t.maxQueueSize??t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.it(e);
1if(t!==null){if(t.body){if(this.nt()){var n={record:Bt(t,this.qe())};this.Be((()=>this.st(n)))}}else this.Ae.info(`Log was rejected in beforeSend function`)}}}it(e){var t=this.Se.beforeSend;if(!t)return e;var n=O(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.Ae.info(`Log was rejected in beforeSend function`),null;r=a}catch(e){return this.Ae.error(`Error in beforeSend function for log:`,e),null}return r}nt(){if(this.et===void 0)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||=(this.Ae.warn(`captureLog dropping logs: exceeded `+this.et+` logs per `+this.Xe+`ms`),!0),!1)}flush(){var e=this;return m((function*(){if(!e._instance.isDisabled)return e.Ue||=e.ot().finally((()=>{e.Ue=null})),e.Ue}))()}ot(){var e=this;return m((function*(){e.tt();var t=e._instance.getPersistedProperty(x.LogsQueue)??[];if(t.length!==0)for(var n=t.length,r=0;t.length>0&&n>r;){e.ze=0;var i=Math.min(t.length,e.Ke),a=t.slice(0,i),o=Ht(a.map((e=>e.record)),e.ut(),e.He??e._instance.getLibraryId(),e._instance.getLibraryVersion()),s=yield e._instance.ht(o);if(s.kind===`too-large`&&a.length>1)e.Ke=Math.max(1,Math.floor(a.length/2)),e.Ae.warn(`Received 413 when sending logs batch of size `+a.length+`, reducing batch size to `+e.Ke);else if(s.kind===`retry-later`||(s.kind===`too-large`?e.Ae.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.`):s.kind===`ok`&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(a.length),t=e._instance.getPersistedProperty(x.LogsQueue)??[],r+=a.length,s.kind===`fatal`))throw s.error}}))()}dt(e){var t=this;return m((function*(){var n=Math.max(0,e-t.ze),r=t._instance.getPersistedProperty(x.LogsQueue)??[];t._instance.setPersistedProperty(x.LogsQueue,r.slice(n)),yield t.je()}))()}ut(){return Vt(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){if(!this._instance.optedOut){var t=this._instance.getPersistedProperty(x.LogsQueue)??[];this.Je>t.length||(t.shift(),this.ze++,this.Ae.info(`Logs queue is full, dropping oldest record.`)),t.push(e),this._instance.setPersistedProperty(x.LogsQueue,t),this.Qe>t.length?this.ct():this.rt()}}ct(e){e===void 0&&(e=this.Ye),this.vt||=Pt((()=>{this.vt=void 0,this.rt()}),e)}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*2**e}yt(){var e=this._instance.getPersistedProperty(x.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m((function*(){t.tt();var n=t.flush().catch((()=>{}));e===void 0?yield n:yield Promise.race([n,new Promise((t=>Pt(t,e)))])}))()}flushWithTimeout(e){var t=this;return m((function*(){var n=!1,r=t.flush(),i=new Promise((t=>Pt((()=>{n=!0,t()}),e)));try{yield Promise.race([r,i])}finally{n&&r.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.Ve=0}),(e=>{this.Ve++,this.Ae.error(`PostHog logs flush failed:`,e)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&=(clearTimeout(this.vt),void 0)}},Wt,Gt,Kt;function qt(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Kt&&n.length===Gt||(Gt=n.length,Kt=n.reduce(((n,r)=>{Wt||={};var i=Wt[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,Wt[r]=[s,c];break}}return n}),{})),Kt}}var Jt=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return m((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&O(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),h({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:qt(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return h({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},Yt=`?`;function Xt(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?Yt:n,in_app:!0};return j(r)||(a.lineno=r),j(i)||(a.colno=i),a}var Zt=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?Yt:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},Qt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,$t=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,en=/\((\S*)(?::(\d+))(?::(\d+))\)/,tn=(e,t)=>{var n=Qt.exec(e);if(n){var[,r,i,a]=n;return Xt(t,r,Yt,+i,+a)}var o=$t.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=en.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=Zt(o[1]||Yt,o[2]);return Xt(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,an=(e,t)=>{var n=nn.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=rn.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||Yt;return[a,i]=Zt(a,i),Xt(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},on=/\(error: (.*)\)/,sn=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=M(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?`DOMError`:`DOMException`}getValue(e){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return xe(e,`DOMException`)}isDOMError(e){return xe(e,`DOMError`)}},cn=class{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},ln=class{constructor(){}match(e){return xe(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},un=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,dn=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(un);return r&&(t=r[1],n=r[2]),[t,n]}},fn=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function pn(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var mn=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){return Se(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+pn(e)}isSeverityLevel(e){return M(e)&&!pe(e)&&fn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(Ft(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},hn=class{match(e){return Se(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+pn(e),stack:t.syntheticException?.stack,synthetic:!0}}},gn=class{match(e){return be(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},_n=class{match(e){return xe(e,`PromiseRejectionEvent`)||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Se(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return be(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},vn=`$message`,yn=`$timestamp`,bn=new Set([vn,yn]),xn={enabled:!0,max_bytes:32768};function Sn(e){return e?{enabled:e.enabled??xn.enabled,max_bytes:wn(e.max_bytes,xn.max_bytes)}:h({},xn)}var Cn=class{constructor(e){this.bt=[],this._t=0,this.Se=Sn(e)}setConfig(e){this.Se=Sn(e),this.wt()}add(e){var t=function(e){var t,n;try{n=[],t=JSON.stringify(e,(function(e,t){if(typeof t==`bigint`)return t.toString();if(typeof t!=`function`&&typeof t!=`symbol`){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&typeof t==`object`){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return`[Circular]`;n.push(t)}return t}}))??`null`}catch{return}try{var r=JSON.parse(t);if(!A(r))return;var i=r,a=i[vn],o=i[yn];return!M(a)||a.trim().length===0||!M(o)&&!P(o)?void 0:{step:i,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Se.max_bytes||(this.bt.push({step:t.step,bytes:n}),this._t+=n,this.wt())}}getAttachable(){return this.bt.map((e=>e.step))}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}};function wn(e,t){if(!P(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Tn=function(t,n){var{debugEnabled:r}=n===void 0?{}:n,i={k(n){if(e&&(f.DEBUG||u.POSTHOG_DEBUG||r)&&!j(e.console)&&e.console){for(var i=(`__rrweb_original__`in e.console[n])?e.console[n].__rrweb_original__:e.console[n],a=arguments.length,o=Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];i(t,...o)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`error`,...t)},critical(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];console.error(t,...n)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling `+e)},createLogger:(e,n)=>Tn(t+` `+e,n)};return i},I=Tn(`[PostHog.js]`),L=I.createLogger,En=L(`[ExternalScriptsLoader]`),Dn=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return En.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var i=r?.querySelectorAll(`script`);if(i){for(var a,o=function(){if(i[s].src===t){var e=i[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},s=0;i.length>s;s++)if(a=o())return a.v}var c=()=>{if(!r)return n(`document not found`);var i=r.createElement(`script`);if(i.type=`text/javascript`,i.crossOrigin=`anonymous`,i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,n(void 0,e)},i.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)r.head.appendChild(i);else{var a,o=r.querySelectorAll(`body > script`);o.length>0?(a=o[0].parentNode)==null||a.insertBefore(i,o[0]):r.body.appendChild(i)}};r!=null&&r.body?c():r?.addEventListener(`DOMContentLoaded`,c)};u.__PosthogExtensions__=u.__PosthogExtensions__||{},u.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}Dn(e,r,n)}else Dn(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},u.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Dn(e,e.requestRouter.endpointFor(`api`,t),n)};var On=`$people_distinct_id`,kn=`$device_id`,An=`$device_model`,jn=`__alias`,Mn=`__timers`,Nn=`$autocapture_disabled_server_side`,Pn=`$heatmaps_enabled_server_side`,Fn=`$exception_capture_enabled_server_side`,In=`$error_tracking_suppression_rules`,Ln=`$error_tracking_capture_extension_exceptions`,Rn=`$web_vitals_enabled_server_side`,zn=`$dead_clicks_enabled_server_side`,Bn=`$product_tours_enabled_server_side`,Vn=`$web_vitals_allowed_metrics`,Hn=`$session_recording_remote_config`,Un=`$replay_sample_rate`,Wn=`$replay_override_sampling`,Gn=`$replay_override_linked_flag`,Kn=`$replay_override_url_trigger`,qn=`$replay_override_event_trigger`,Jn=`$sesid`,Yn=`$session_is_sampled`,Xn=`$enabled_feature_flags`,Zn=`$active_feature_flags`,Qn=`$early_access_features`,$n=`$feature_flag_details`,er=`$feature_flag_payloads`,tr=`$feature_flag_request_id`,nr=`$override_feature_flags`,rr=`$override_feature_flag_payloads`,ir=`$stored_person_properties`,ar=`$stored_group_properties`,or=`$surveys`,sr=`$surveys_loaded_at`,cr=`$surveys_activated`,lr=`ph_product_tours`,ur=`$flag_call_reported`,dr=`$flag_call_reported_session_id`,fr=`$feature_flag_errors`,pr=`$feature_flag_evaluated_at`,mr=`$user_state`,hr=`$client_session_props`,gr=`$capture_rate_limit`,_r=`$initial_campaign_params`,vr=`$initial_referrer_info`,yr=`$initial_person_info`,br=`$epp`,xr=`__POSTHOG_TOOLBAR__`,Sr=`$posthog_cookieless`,Cr=`$sdk_debug_extensions_init_method`,wr=`$sdk_debug_extensions_init_time_ms`,Tr=`$sdk_debug_recording_script_not_loaded`,Er=`PostHog loadExternalDependency extension not found.`,Dr=`on_reject`,Or=`always`,kr=`anonymous`,Ar=`identified`,jr=`identified_only`,Mr=`visibilitychange`,Nr=`beforeunload`,Pr=`$pageview`,Fr=`$pageleave`,Ir=`$identify`,Lr=`$groupidentify`;function Rr(e,t){O(e)&&e.forEach(t)}function R(e,t){if(!N(e)){if(O(e))e.forEach(t);else if(_e(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)ue.call(e,n)&&t(e[n],n)}}var z=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function zr(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Br=function(e){try{return e()}catch{return}},Vr=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){I.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),I.critical(e)}}},Hr=function(e){var t={};return R(e,(function(e,n){(M(e)&&e.length>0||P(e))&&(t[n]=e)})),t},Ur=[`herokuapp.com`,`vercel.app`,`netlify.app`];function Wr(e){var t=e?.hostname;if(!M(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of Ur)if(n===r)return!1;return!0}function B(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function Gr(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return P(e)&&isFinite(e)&&Math.floor(e)===e});var Kr=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/256,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);
1if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},qr=class{constructor(){this.S=0,this.C=0,this.I=new Xr}generate(){var e=this.generateOrAbort();if(j(e)){this.S=0;var t=this.generateOrAbort();if(j(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Kr.fromFieldsV7(this.S,Math.trunc(this.C/2**30),this.C&2**30-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}},Jr,Yr=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!j(e.crypto)&&crypto.getRandomValues&&(Yr=e=>crypto.getRandomValues(e));var Xr=class{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Yr(this.R),this.O=0),this.R[this.O++]}},Zr=()=>Qr().toString(),Qr=()=>(Jr||=new qr).generate(),$r=``,ei=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ti={N:()=>!!r,D(e){I.error(`cookieStore error: `+e)},A(e){if(r){try{for(var t=e+`=`,n=r.cookie.split(`;`).filter((e=>e.length)),i=0;n.length>i;i++){for(var a=n[i];a.charAt(0)==` `;)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},F(e){var t;try{t=JSON.parse(ti.A(e))||{}}catch{}return t},q(e,t,n,i,a){if(!r)return!1;try{var o=``,s=``,c=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=r),$r)return $r;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),i=Math.min(n.length,8),a=`dmn_chk_`+Zr();!$r&&i--;){var o=n.slice(i).join(`.`),s=a+`=1;domain=.`+o+`;path=/`;t.cookie=s+`;max-age=3`,t.cookie.includes(a)&&(t.cookie=s+`;max-age=0`,$r=o)}return $r}(e);if(!n){var i=(e=>{var t=e.match(ei);return t?t[0]:``})(e);i!==n&&I.info(`Warning: cookie subdomain discovery mismatch`,i,n),n=i}return n?`; domain=.`+n:``}return``}(r.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o=`; expires=`+l.toUTCString()}a&&(s=`; secure`);var u=e+`=`+encodeURIComponent(JSON.stringify(t))+o+`; SameSite=Lax; path=/`+c+s;return u.length>3686.4&&I.warn(`cookieStore warning: large cookie, len=`+u.length),r.cookie=u,!0}catch{return!1}},P(e,t){if(r!=null&&r.cookie)try{ti.q(e,``,-1,t)}catch{return}}},ni=null,V={N(){if(!me(ni))return ni;var t=!0;if(j(e))t=!1;else try{var n=`__mplssupport__`;V.q(n,`xyz`),V.A(n)!==`"xyz"`&&(t=!1),V.P(n)}catch{t=!1}return t||I.error(`localStorage unsupported; falling back to cookie store`),ni=t,t},D(e){I.error(`localStorage error: `+e)},A(t){try{return e?.localStorage.getItem(t)}catch(e){V.D(e)}return null},F(e){try{return JSON.parse(V.A(e))||{}}catch{}return null},q(t,n){try{return e?.localStorage.setItem(t,JSON.stringify(n)),!0}catch(e){V.D(e)}return!1},P(t){try{e?.localStorage.removeItem(t)}catch(e){V.D(e)}}},ri=[kn,`distinct_id`,Jn,Yn,br,yr,mr],ii={},ai={N:()=>!0,D(e){I.error(`memoryStorage error: `+e)},A:e=>ii[e]||null,F:e=>ii[e]||null,q:(e,t)=>(ii[e]=t,!0),P(e){delete ii[e]}},oi=null,si={N(){if(!me(oi))return oi;if(oi=!0,j(e))oi=!1;else try{var t=`__support__`;si.q(t,`xyz`),si.A(t)!==`"xyz"`&&(oi=!1),si.P(t)}catch{oi=!1}return oi},D(e){I.error(`sessionStorage error: `,e)},A(t){try{return e?.sessionStorage.getItem(t)}catch(e){si.D(e)}return null},F(e){try{return JSON.parse(si.A(e))||null}catch{}return null},q(t,n){try{return e?.sessionStorage.setItem(t,JSON.stringify(n)),!0}catch(e){si.D(e)}return!1},P(t){try{e?.sessionStorage.removeItem(t)}catch(e){si.D(e)}}},ci=class{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
1isOptedOut(){return this.Se.cookieless_mode===Or||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===Dr}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,+!!e,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get St(){var e=this.Ct.A(this.It);return we(e)?1:D(Te,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t=e===`localStorage`?V:ti;if(!this.Tt||this.Tt!==t){this.Tt=t;var n=e===`localStorage`?ti:V;n.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(we(n.A(this.It))),n.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[n?.doNotTrack,n?.msDoNotTrack,u.doNotTrack].some((e=>we(e)))}};function li(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!k(r))return t;try{var i=r(t);return M(i)&&i?i:t}catch(e){return I.error(`Error in get_current_url, falling back to window.location.href`,e),t}}var ui=1,di=3,fi=11;function pi(e){return e instanceof Element&&(e.id===xr||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function mi(e){return!!e&&e.nodeType===ui}function hi(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function gi(e){return!!e&&e.nodeType===di}function _i(e){return!!e&&e.nodeType===fi&&mi(e.host)}function vi(e){return e?se(e).split(/\s+/):[]}function yi(t,n){var r=function(t){var n,r=e==null||(n=e.location)==null?void 0:n.href;return j(r)?void 0:li(t,r)}(n);return!!(r&&t&&t.some((e=>r.match(e))))}function bi(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return vi(t)}function xi(e){return N(e)?null:se(e).split(/(\s+)/).filter((e=>Wi(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function Si(e){var t=``;return Ii(e)&&!Li(e)&&e.childNodes&&e.childNodes.length&&R(e.childNodes,(function(e){gi(e)&&e.textContent&&(t+=xi(e.textContent)??``)})),se(t)}function Ci(e){return j(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var wi=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function Ti(e,t){if(j(t))return!0;var n,r=function(e){if(t.some((t=>function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}(e,t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function Ei(e){var t=e.parentNode;return!(!t||!mi(t))&&t}var Di=[`.ph-no-autocapture`,`[data-ph-no-autocapture]`],Oi=[`next`,`previous`,`prev`,`>`,`<`],ki=[...Oi,`+`,`-`,`−`,`–`],Ai=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ji=[`.ph-no-rageclick`,`.ph-no-capture`],Mi=[``,`text`,`search`,`email`,`password`,`url`,`tel`,`number`];function Ni(t,n){if(!e||Pi(t))return!1;var r,i,a,o;if(ge(n)?(r=!!n&&ji,i=void 0,a=!1):(r=n?.css_selector_ignorelist??ji,i=n?.content_ignorelist,a=(o=n?.ignore_text_selection)!=null&&o),!1===r||a&&function(e){return!(!e||!mi(e))&&(!!hi(e,`textarea`)||(hi(e,`input`)?D(Mi,(e.getAttribute(`type`)||``).toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=e.getAttribute==null?void 0:e.getAttribute(`contenteditable`);return t===`true`||t===``}(e)))}(t))return!1;var{targetElementList:s}=Fi(t,!1);return!function(e,t){if(!1===e||j(e))return!1;var n;if(!0===e)n=Oi;else{if(!O(e))return!1;if(e.length>10)return I.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>Ai(t,e)||Ai(r,e)))}))}(i,s.map((e=>({safeText:Si(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!Ti(s,r)}var Pi=e=>!e||hi(e,`html`)||!mi(e),Fi=(t,n)=>{if(!e||Pi(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],a=t;a.parentNode&&!hi(a,`body`);)if(_i(a.parentNode))i.push(a.parentNode.host),a=a.parentNode.host;else{var o=Ei(a);if(!o)break;if(n||wi.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{var s=e.getComputedStyle(o);s&&s.getPropertyValue(`cursor`)===`pointer`&&(r=!0)}catch{}i.push(o),a=o}return{parentIsUsefulElement:r,targetElementList:i}};function Ii(e){for(var t=e;t.parentNode&&!hi(t,`body`);t=t.parentNode){var n=bi(t);if(D(n,`ph-sensitive`)||D(n,`ph-no-capture`))return!1}if(D(bi(e),`ph-include`))return!0;var r=e.type||``;if(M(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}
1var i=e.name||e.id||``;return!M(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``))}function Li(e){return!!(hi(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||hi(e,`select`)||hi(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var Ri=`(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})`,zi=RegExp(`^(?:`+Ri+`)$`),Bi=new RegExp(Ri),Vi=`\\d{3}-?\\d{2}-?\\d{4}`,Hi=RegExp(`^(`+Vi+`)$`),Ui=RegExp(`(`+Vi+`)`);function Wi(e,t){return t===void 0&&(t=!0),!(N(e)||M(e)&&(e=se(e),(t?zi:Bi).test((e||``).replace(/[- ]/g,``))||(t?Hi:Ui).test(e)))}function Gi(e){var t=Si(e);return Wi(t=(t+` `+Ki(e)).trim())?t:``}function Ki(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&R(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=Si(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+Ki(e)).trim())}catch(e){I.error(`[AutoCapture]`,e)}})),t}function qi(e){return e.replace(/"|\\"/g,`\\"`)}function Ji(e){var t=e.attr__class;return t?O(t)?t:vi(t):void 0}var Yi=L(`[Dead Clicks]`),Xi=()=>!0,Zi=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(zn)),r=e.instance.config.capture_dead_clicks;return ge(r)?r:!!A(r)||n},Qi=class{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[zn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt((()=>{this.Pt()})):this.stop()}Mt(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?Yi.error(`failed to load script`,t):e()}))}Pt(){var e;if(r){if(!this.Et&&(e=u.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=A(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=u.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(r),Yi.info(`starting...`)}}else Yi.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,Yi.info(`stopping...`))}},$i=L(`[SegmentIntegration]`),ea=`posthog-js`;function ta(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>h({},e,{stacktrace:e.stacktrace?h({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>h({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var na=class{constructor(e,t,n,r,i,a){this.name=ea,this.setupOnce=function(o){o(ta(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},ra=class{constructor(e){this.Rt=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength||n.crossTabAdoption)&&(I.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){this.Ft=this._instance.sessionManager?.onSessionId(this.Rt)}destroy(){var e;(e=this.Ft)==null||e.call(this),this.Ft=void 0}doPageView(t,n){var r=this.At(t,n);return this.Ot={pathname:e?.location.pathname??``,pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(e){return this.At(e,this.Ot?.pageViewId)}doEvent(){return{$pageview_id:this.Ot?.pageViewId}}At(e,t){var n=this.Ot;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;if(!(j(a)||j(o)||j(s)||j(c)||j(l)||j(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?Ee(o/a,0,1,I):1,f=a>1?Ee(s/a,0,1,I):1,p=c>1?Ee(l/c,0,1,I):1,m=c>1?Ee(u/c,0,1,I):1;r=z(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},ia=[`flags`,`surveys`],aa={[On]:{exposure:`hidden`},[jn]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Mn]:{exposure:`hidden`},[Nn]:{exposure:`event`},[Pn]:{exposure:`hidden`},[Fn]:{exposure:`event`},[In]:{exposure:`hidden`},[Ln]:{exposure:`event`},[Rn]:{exposure:`event`},[zn]:{exposure:`event`},[Bn]:{exposure:`hidden`},[Vn]:{exposure:`event`},[Hn]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`}
1,[Jn]:{exposure:`hidden`},[Yn]:{exposure:`event`},[Un]:{exposure:`event`,shouldSkipFromEventProperties:e=>me(e)},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},$sess_rec_flush_size:{exposure:`hidden`},[Xn]:{exposure:`derived`,storageGroup:`flags`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!A(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[Zn]:{exposure:`event`,storageGroup:`flags`},[Qn]:{exposure:`hidden`},[$n]:{exposure:`hidden`,storageGroup:`flags`},[er]:{exposure:`event`,storageGroup:`flags`},[tr]:{exposure:`event`,storageGroup:`flags`,volatile:!0},[nr]:{exposure:`event`},[rr]:{exposure:`hidden`},[ir]:{exposure:`hidden`},[ar]:{exposure:`hidden`},[or]:{exposure:`hidden`,storageGroup:`surveys`},[sr]:{exposure:`hidden`,storageGroup:`surveys`,volatile:!0},[cr]:{exposure:`event`},[lr]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[ur]:{exposure:`hidden`},[dr]:{exposure:`hidden`},[fr]:{exposure:`hidden`},[pr]:{exposure:`hidden`,storageGroup:`flags`,volatile:!0},[mr]:{exposure:`hidden`},[hr]:{exposure:`hidden`},[gr]:{exposure:`hidden`},[_r]:{exposure:`hidden`},[vr]:{exposure:`hidden`},[yr]:{exposure:`hidden`},[br]:{exposure:`hidden`},[Wn]:{exposure:`event`},[Gn]:{exposure:`event`},[Kn]:{exposure:`event`},[qn]:{exposure:`event`},[Cr]:{exposure:`event`},[wr]:{exposure:`event`},[Tr]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},oa=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],sa=e=>{var t=aa[e];if(t)return t;for(var[n,r]of oa)if(e.indexOf(n)===0)return r},ca=e=>{var t=r?.createElement(`a`);return j(t)?null:(t.href=e,t)},la=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);
1if(a[0]===t){n=a;break}}if(!O(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{I.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},ua=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);O(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},da=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},fa=`https?://(.*)`,pa=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],ma=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...pa],ha=`<masked>`,ga=[`li_fat_id`];function _a(e,t,n){if(!r)return{};var i,a=t?[...pa,...n||[]]:[],o=va(ua(r.URL,a,ha),e);return z((i={},R(ga,(function(e){var t=ti.A(e);i[e]=t||null})),i),o)}function va(e,t){var n=ma.concat(t||[]),r={};return R(n,(function(t){r[t]=la(e,t)||null})),r}function ya(e){var t=function(e){return e?e.search(fa+`google.([^/?]*)`)===0?`google`:e.search(fa+`bing.com`)===0?`bing`:e.search(fa+`yahoo.com`)===0?`yahoo`:e.search(fa+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,i={};if(!me(t)){i.$search_engine=t;var a=r?la(r.referrer,n):``;a.length&&(i.ph_keyword=a)}return i}function ba(){return navigator.language||navigator.userLanguage}var xa=`$direct`;function Sa(){return r?.referrer||xa}function Ca(e,t,n){n===void 0&&(n=!1);var r=e?[...pa,...t||[]]:[],a=(n?Nt(i?.href):i?.href)?.substring(0,1e3);return{r:Sa().substring(0,1e3),u:a?ua(a,r,ha):void 0}}function wa(e,t){t===void 0&&(t=!1);var{r:n,u:r}=e,i=t?Nt(r):r,a={$referrer:n,$referring_domain:n==null?void 0:n==xa?xa:ca(n)?.host};if(i){a.$current_url=i;var o=ca(i);a.$host=o?.host,a.$pathname=o?.pathname,z(a,va(i))}return n&&z(a,ya(n)),a}function Ta(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Ea(){try{return new Date().getTimezoneOffset()}catch{return}}var Da={flags:pr,surveys:sr},Oa=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],ka=`main`,Aa=class{constructor(t,n,r){if(r===void 0&&(r=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=t,this.qt=r,this.props={},this.Bt=!1,this.jt=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(t),this.Ct=this.Ht(t),this.Nt=this.Ut(t),this.load(),t.debug&&I.info(`Persistence loaded`,t.persistence,h({},this.props)),this.update_config(t,t,n),this.save(),e){var i=()=>this.flush();B(e,`beforeunload`,i,{capture:!1}),B(e,`pagehide`,i,{capture:!1})}}zt(){var e=this.Se?.persistence_save_debounce_ms;return P(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(t){Oa.indexOf(t.persistence.toLowerCase())===-1&&(I.critical(`Unknown persistence type `+t.persistence+`; falling back to localStorage+cookie`),t.persistence=`localStorage+cookie`);var n,r=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=[...ri,...t];return h({},V,{F(e){try{var t={};try{t=ti.F(e)||{}}catch{}var r,i=JSON.parse(V.A(e)||`{}`);if(n){var a={};for(var o in t){var s=t[o];me(s)||s===``||(a[o]=s)}r=z(i,a)}else r=z(t,i);return V.q(e,r),r}catch{}return null},q(e,t,n,i,a,o){var s=V.q(e,t,void 0,void 0,o);try{var c={};r.forEach((e=>{t[e]&&(c[e]=t[e])})),Object.keys(c).length&&ti.q(e,c,n,i,a,o)}catch(e){V.D(e)}return s},P(t,n){try{e?.localStorage.removeItem(t),ti.P(t,n)}catch(e){V.D(e)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),i=!1,a=t.persistence.toLowerCase();return a===`localstorage`&&V.N()?(n=V,i=!0):a===`localstorage+cookie`&&r.N()?(n=r,i=!0):a===`sessionstorage`&&si.N()?n=si:a===`memory`?n=ai:a===`cookie`?n=ti:r.N()?(n=r,i=!0):n=ti,this.Dt=i,n}Wt(e){return this.jt+`__`+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=e??this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[pr];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return R(this.props,((t,n)=>{var r=sa(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===Xn?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&z(e,r.transformToEventProperties(t))}else if(!r||r.exposure===`event`){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,(()=>!1)))return;e[n]=t}})),e}load(){if(!this.Vt){var e=this.Ct.F(this.jt);e&&(this.props=z({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of ia){var t=V.F(this.Wt(e));if(t&&!fe(t)){var n=this.Qt(e);n.persisted=!0,this.Jt(e)||(n.fingerprint=this.Yt(t,e)),this.Kt(e,t)||z(this.props,t)}}}Jt(e){return Object.keys(this.props).some((t=>sa(t)?.storageGroup===e))}Kt(e,t){var n=Da[e];if(!n)return!1;var r=t[n],i=this.props[n];return P(r)&&P(i)&&i>r}refreshKey(e){if(!this.Vt){var t=this.Nt?sa(e)?.storageGroup:void 0,n=t?V.F(this.Wt(t)):this.Ct.F(this.jt);if(n&&e in n)this.Xt(e,n[e]);else{if(t){var r=this.Ct.F(this.jt);if(r&&e in r)return void this.Xt(e,r[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?j(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),e)):this.rr()}}flush(){j(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,ka))}ir(){var{main:e,groups:t}=this.sr();for(var n of(this.nr(this.Ct,this.jt,e,ka),ia)){var r,i=t[n];(!fe(i)||(r=this.$t[n])!=null&&r.persisted)&&this.nr(V,this.Wt(n),i,n)}}sr(){var e={},t={};for(var n of ia)t[n]={};return R(this.props,((n,r)=>{var i=sa(r)?.storageGroup;i?t[i][r]=n:e[r]=n})),{main:e,groups:t}}Yt(e,t){if(t===ka)return JSON.stringify(e)+`|`+this.ar+`|`+this.lr+`|`+this.ur;var n={};return R(e,((e,t)=>
1{var r;n[t]=(r=sa(t))!=null&&r.volatile?`__volatile__`:e})),JSON.stringify(n)}nr(e,t,n,r){var i=this.Qt(r);if(r===ka||i.dirty||j(i.fingerprint)){var a;try{if((a=this.Yt(n,r))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(t,n,this.ar,this.lr,this.ur,this.Se.debug)?(i.dirty=!1,r!==ka&&(i.persisted=!0),j(a)||(i.fingerprint=a)):this.Se.debug&&I.warn(`failed to persist storage entry "`+t+`"; will retry on next save`)}}remove(e){var{keepGroupEntries:t=!1}=e===void 0?{}:e;if(j(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!t&&this.qt)for(var n of ia)V.P(this.Wt(n));t?delete this.$t[ka]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,n){if(A(e)){j(t)&&(t=`None`),this.ar=j(n)?this.hr:n;var r=!1;if(R(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Xt(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(A(e)){this.ar=j(t)?this.hr:t;var n=!1;if(R(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Xt(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.Bt){var e=_a(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);fe(Hr(e))||this.register(e),this.Bt=!0}}update_search_keyword(){var e;this.register((e=r?.referrer)?ya(e):{})}update_referrer_info(){this.register_once({$referrer:Sa(),$referring_domain:r!=null&&r.referrer&&ca(r.referrer)?.host||xa},void 0)}set_initial_person_info(){this.props[_r]||this.props[vr]||this.register_once({[yr]:Ca(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};R([vr,_r],(t=>{var n=this.props[t];n&&R(n,(function(t,n){e[`$initial_`+ce(n)]=t}))}));var t=this.props[yr];return t&&z(e,function(e,t){t===void 0&&(t=!1);var n=wa(e,t),r={};return R(n,(function(e,t){r[`$initial_`+ce(t)]=e})),r}(t,this.Se.disable_capture_url_hashes)),e}safe_merge(e){return R(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=r?this.Ht(e):this.Ct,a=this.Ut(e);if(r||a!==this.Nt){var o=this.props;this.clear(),this.Ct=i,this.Nt=a,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var n=this.props[Mn]||{};n[e]=t,this.Xt(Mn,n),this.save()}remove_event_timer(e){var t=this.props[Mn]||{},n=t[e];return j(n)||(delete t[e],this.Xt(Mn,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var n;this.props[e]=t,(n=sa(e))!=null&&n.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t=sa(e)?.storageGroup;t&&(this.Qt(t).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}},ja={Activation:`events`,Cancellation:`cancelEvents`},Ma={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},Na={Once:`once`,Recurring:`recurring`,Always:`always`},Pa={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},Fa={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,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_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},Ia={Popover:`popover`,Inline:`inline`},La={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},Ra={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},za=L(`[RateLimiter]`),Ba=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{za.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){za.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(gr)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(gr,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},Va=L(`[RemoteConfig]`),Ha=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=u._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}cr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}vr(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return Va.info(`Using preloaded remote config`,this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void Va.warn(`Remote config is disabled. Falling back to local config.`);this.cr((e=>{if(!e)return Va.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.vr((e=>{this.pr(e),this.gr()}));this.pr(e),this.gr()}))}catch(e){Va.error(`Error loading remote config`,e)}}stop(){this.yr&&=(clearInterval(this.yr),void 0)}refresh(){!this._instance.mr()&&r&&r.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}gr(){if(!this.yr){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(e){var t;e||Va.error(`Failed to fetch remote config from PostHog.`),this._instance.pr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},Ua={GZipJS:`gzip-js`,Base64:`base64`},Wa=Uint8Array,Ga=Uint16Array,Ka=Uint32Array,qa=new Wa([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]),Ja=new Wa([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]),Ya=new Wa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xa=function(e,t){for(var n=new Ga(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new Ka(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},Za=Xa(qa,2),Qa=Za[1];Za[0][28]=258,Qa[258]=28;for(var $a=Xa(Ja,0)[1],eo=new Ga(32768),H=0;32768>H;++H){var to=(43690&H)>>>1|(21845&H)<<1;eo[H]=((65280&(to=(61680&(to=(52428&to)>>>2|(13107&to)<<2))>>>4|(3855&to)<<4))>>>8|(255&to)<<8)>>>1}var no=function(e,t,n){for(var r=e.length,i=0,a=new Ga(t);r>i;++i)++a[e[i]-1];var o,s=new Ga(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new Ga(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[eo[d]>>>c]=l}else for(o=new Ga(r),i=0;r>i;++i)o[i]=eo[s[e[i]-1]++]>>>15-e[i];return o},ro=new Wa(288);for(H=0;144>H;++H)ro[H]=8;for(H=144;256>H;++H)ro[H]=9;for(H=256;280>H;++H)ro[H]=7;for(H=280;288>H;++H)ro[H]=8;var io=new Wa(32);for(H=0;32>H;++H)io[H]=5;var ao=no(ro,9,0),oo=no(io,5,0),so=function(e){return(e/8>>0)+(7&e&&1)},co=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Ga?Ga:e instanceof Ka?Ka:Wa)(n-t);return r.set(e.subarray(t,n)),r},lo=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},uo=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},fo=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new Wa(0),0];if(i==1){var o=new Wa(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new Ga(f+1),m=po(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new Wa(p),m]},po=function(e,t,n){return e.s==-1?Math.max(po(e.l,t,n+1),po(e.r,t,n+1)):t[e.s]=n},mo=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ga(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>
vendor: 4,314 bytes, line 1
12&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},ho=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},go=function(e,t,n){var r=n.length,i=so(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},_o=function(e,t,n,r,i,a,o,s,c,l,u){lo(t,u++,n),++i[256];for(var d=fo(i,15),f=d[0],p=d[1],m=fo(a,15),h=m[0],g=m[1],_=mo(f),v=_[0],y=_[1],b=mo(h),x=b[0],S=b[1],C=new Ga(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var ee=fo(C,7),T=ee[0],te=ee[1],ne=19;ne>4&&!T[Ya[ne-1]];--ne);var re,ie,ae,oe,E=l+5<<3,D=ho(i,ro)+ho(a,io)+o,se=ho(i,f)+ho(a,h)+o+14+3*ne+ho(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(D>=E&&se>=E)return go(t,u,e.subarray(c,c+l));if(lo(t,u,1+(D>se)),u+=2,D>se){re=no(f,p,0),ie=f,ae=no(h,g,0),oe=h;var ce=no(T,te,0);for(lo(t,u,y-257),lo(t,u+5,S-1),lo(t,u+10,ne-4),u+=14,w=0;ne>w;++w)lo(t,u+3*w,T[Ya[w]]);u+=3*ne;for(var le=[v,x],ue=0;2>ue;++ue){var de=le[ue];for(w=0;de.length>w;++w)lo(t,u,ce[O=31&de[w]]),u+=T[O],O>15&&(lo(t,u,de[w]>>>5&127),u+=de[w]>>>12)}}else re=ao,ie=ro,ae=oo,oe=io;for(w=0;s>w;++w)if(r[w]>255){var O;uo(t,u,re[257+(O=r[w]>>>18&31)]),u+=ie[O+257],O>7&&(lo(t,u,r[w]>>>23&31),u+=qa[O]);var k=31&r[w];uo(t,u,ae[k]),u+=oe[k],k>3&&(uo(t,u,r[w]>>>5&8191),u+=Ja[k])}else uo(t,u,re[r[w]]),u+=ie[r[w]];return uo(t,u,re[256]),u+ie[256]},vo=new Ka([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yo=function(){for(var e=new Ka(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),bo=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function xo(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=yo[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new Wa(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=go(c,l,e.subarray(u,d)):(c[u]=!0,l=go(c,l,e.subarray(u,o)))}else{for(var f=vo[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new Ga(32768),_=new Ga(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new Ka(25e3),S=new Ga(288),C=new Ga(32),w=0,ee=0,T=(u=0,0),te=0,ne=0;o>u;++u){var re=b(u),ie=32767&u,ae=_[re];if(g[ie]=ae,_[re]=ie,u>=te){var oe=o-u;if((w>7e3||T>24576)&&oe>423){l=_o(e,c,0,x,S,C,ee,T,ne,u-ne,l),T=w=ee=0,ne=u;for(var E=0;286>E;++E)S[E]=0;for(E=0;30>E;++E)C[E]=0}var D=2,se=0,ce=m,le=ie-ae&32767;if(oe>2&&re==b(u-le))for(var ue=Math.min(p,oe)-1,de=Math.min(32767,u),O=Math.min(258,oe);de>=le&&--ce&&ie!=ae;){if(e[u+D]==e[u+D-le]){for(var k=0;O>k&&e[u+k]==e[u+k-le];++k);if(k>D){if(D=k,se=le,k>ue)break;var A=Math.min(le,k-2),fe=0;for(E=0;A>E;++E){var j=u-le+E+32768&32767,M=j-g[j]+32768&32767;M>fe&&(fe=M,ae=j)}}}le+=(ie=ae)-(ae=g[ie])+32768&32767}if(se){x[T++]=268435456|Qa[D]<<18|$a[se];var pe=31&Qa[D],me=31&$a[se];ee+=qa[pe]+Ja[me],++S[257+pe],++C[me],te=u+D,++w}else x[T++]=e[u],++S[e[u]]}}l=_o(e,c,!0,x,S,C,ee,T,ne,u-ne,l)}return co(s,0,r+so(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&bo(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),bo(l,u-8,n.d()),bo(l,u-4,r),l}var So=!!o||!!a,Co=`text/plain`,wo=!1,To=(e,t)=>{var[n,r]=e.split(`#`),[i,a]=n.split(`?`);if(!a)return e;var o=a.split(`&`).filter((e=>e.split(`=`)[0]!==t)).join(`&`);return i+(o?`?`+o:``)+(r?`#`+r:``)},Eo=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=h({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return R(e,(function(e,t){j(e)||j(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},Do=(e,t)=>JSON.stringify(e,((e,t)=>
1typeof t==`bigint`?t.toString():t),t),Oo=e=>{if(e.xt)return e.xt;var{data:t,compression:n}=e;if(t){if(n===Ua.GZipJS){var r=xo(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new Wa(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new Wa(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return co(r,0,i)}(Do(t)),{mtime:0});return{contentType:Co,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Ua.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:Do(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(Do(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=Do(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},ko=e=>{var t,n,r=()=>({url:To(e.url,`compression`),encodedBody:Oo(h({},e,{compression:void 0,xt:void 0}))});try{t=Oo(e)}catch(t){if(te(e.compression,la(e.url,`compression`)))return I.error(`Failed to gzip request body, sending uncompressed payload`,t),r();throw t}return t&&te(e.compression,la(e.url,`compression`))&&!((n=t.body)instanceof ArrayBuffer?T(new Uint8Array(n)):ArrayBuffer.isView(n)&&T(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(wo=!0,r()):{url:e.url,encodedBody:t}},Ao=e=>{try{return ko(e)}catch(t){I.error(t),e.callback==null||e.callback({statusCode:0,error:t});return}},jo=function(){var e=m((function*(e){var t=yield function(e,t,n){return ae.apply(this,arguments)}(Do(e.data),f.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return h({},e,{xt:{contentType:Co,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Mo=(e,t)=>Eo(e,{_:new Date().getTime().toString(),ver:f.JS_SDK_VERSION,compression:t}),No=[];a&&No.push({transport:`fetch`,method(e){var t=Ao(e);if(t){var{url:n,encodedBody:r}=t,{contentType:i,body:o,estimatedSize:c}=r??{},l=new Headers;R(e.headers,(function(e,t){l.append(t,e)})),i&&l.append(`Content-Type`,i);var u=null,d=!1;if(s){var f=new s;u={signal:f.signal,timeout:setTimeout((()=>{var t,n;d=!0,f.abort((t=e.timeout,(n=Error(`PostHog request timed out`+(t?` after `+t+`ms`:``))).name=`AbortError`,n))}),e.timeout)}}a(n,h({method:e?.method||`GET`,headers:l,keepalive:e.method===`POST`&&52428.8>(c||0),body:o,signal:u?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){I.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{d&&t?.name===`AbortError`?I.warn(t):I.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}}),o&&No.push({transport:`XHR`,method(e){var t=Ao(e);if(t){var n=new o,{url:r,encodedBody:i}=t;n.open(e.method||`GET`,r,!0);var{contentType:a,body:s}=i??{};R(e.headers,(function(e,t){n.setRequestHeader(t,e)})),a&&n.setRequestHeader(`Content-Type`,a),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var t={statusCode:n.status,text:n.responseText};if(n.status===200)try{t.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(t)}},n.send(s)}}}),n!=null&&n.sendBeacon&&No.push({transport:`sendBeacon`,method(e){try{var{url:t,encodedBody:r}=ko(e),{contentType:i,body:a}=r??{};if(!a)return;var o=a instanceof Blob?a:new Blob([a],{type:i});n.sendBeacon(t,o)}catch{}}});var Po=3e3,Fo=class{constructor(e,t){this.br=!0,this._r=[],this.wr=Ee(t?.flush_interval_ms||Po,250,5e3,I.createLogger(`flush interval`),Po),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=this._r.length>0?this.Tr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Er(h({},e,{transport:`sendBeacon`}))}))}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout((()=>
1{if(this.Ir(),this._r.length>0){var t=this.Tr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&O(n.data)&&R(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Er(n)};for(var r in t)n()}}),this.wr))}Er(e){try{this.kr(e)}catch(e){I.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return R(this._r,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;j(e[i])&&(e[i]=h({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this._r=[],e}},Io=[`retriesPerformedSoFar`],Lo=class{constructor(t){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=t,this._r=[],this.Rr=!0,!j(e)&&`onLine`in e.navigator&&(this.Rr=e.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},B(e,`online`,this.Or),B(e,`offline`,this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=g(e,Io);he(t)&&(n.url=Eo(n.url,{retry_count:t})),this._instance._send_request(h({},n,{callback:e=>{if(e.statusCode!==200&&(400>e.statusCode||e.statusCode>=500)){if((e.statusCode===0?3:10)>(t??0))return void this.st(h({retriesPerformedSoFar:t},n));e.statusCode===0&&I.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after `+(t??0)+` retries.`)}n.callback==null||n.callback(e)}}))}st(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this._r.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),I.warn(i),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),this._r.length===0)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var e=Date.now(),t=[],n=this._r.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this._r=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.$r&&=(clearTimeout(this.$r),void 0),this.Mr=!1,j(e)||(this.Or&&=(e.removeEventListener(`online`,this.Or),void 0),this.Fr&&=(e.removeEventListener(`offline`,this.Fr),void 0)),this._r))try{this._instance._send_request(h({},t,{transport:`sendBeacon`}))}catch(e){I.error(e)}this._r=[]}},Ro=class{constructor(e){this.Dr=()=>{this.Nr||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.Nr.lastScrollY=Math.ceil(t),this.Nr.maxScrollY=Math.max(t,this.Nr.maxScrollY??0),this.Nr.maxScrollHeight=Math.max(n,this.Nr.maxScrollHeight??0),this.Nr.lastContentY=r,this.Nr.maxContentY=Math.max(r,this.Nr.maxContentY??0),this.Nr.maxContentHeight=Math.max(i,this.Nr.maxContentHeight??0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){B(e,`scroll`,this.Dr,{capture:!0}),B(e,`scrollend`,this.Dr,{capture:!0}),B(e,`resize`,this.Dr)}scrollElement(){if(!this.qr)return e?.document.documentElement;for(var t of O(this.qr)?this.qr:[this.qr]){var n=e?.document.querySelector(t);if(n)return n}}Br(t){var n=t===`y`?`scrollTop`:`scrollLeft`;if(this.qr){var r=this.scrollElement();return r&&r[n]||0}return e?t===`y`?e.scrollY||e.pageYOffset||e.document.documentElement.scrollTop||0:e.scrollX||e.pageXOffset||e.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br(`y`)}scrollX(){return this.Br(`x`)}},zo=e=>Ca(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties,e?.config.disable_capture_url_hashes),Bo=class{constructor(e,t,n,r){this.jr=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[hr]:n})}},this._instance=e,this.Vr=t,this.zr=n,this.Ur=r||zo,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[hr]}getSetOnceProps(){var e=this.Hr()?.props;return e?`r`in e?wa(e,this._instance.config.disable_capture_url_hashes
1):{$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 e={};return R(Hr(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+ce(n)]=t})),e}},Vo=class{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.Wr[e]||[])n(t);for(var r of this.Wr[`*`]||[])r(e,t)}},Ho=L(`[SessionId]`),Uo=class{on(e,t){return this.Gr.on(e,t)}constructor(e,t,n){var r;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new Vo,this.Kr=(e,t)=>!(!he(e)||!he(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Or)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||Zr,this.ri=n||Zr;var i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Ee(this.Se.session_idle_timeout_seconds||1800,60,36e3,Ho.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni=`ph_`+i+`_window_id`,this.si=`ph_`+i+`_primary_window_exists`,this.oi()){var a=si.F(this.ni),o=si.F(this.si);a&&!o?this.Xr=a:si.P(this.ni),si.q(this.si,!0)}if((r=this.Se.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,new Date().getTime(),s)}catch(e){Ho.error(`Invalid sessionID in bootstrap`,e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return j(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((t=>t!==e))}}oi(){return this.Se.persistence!==`memory`&&!this.zr.Vt&&si.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&si.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?si.F(this.ni):null}di(e){var t=this.Zr;return!me(t)&&!me(e)&&5e3>Math.abs(e-t)}ai(e,t,n){var r=t!==this._sessionActivityTimestamp,i=e===this.ei&&n===this._sessionStartTimestamp;this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.ei=e,i&&!r||i&&this.di(t)||(this.Zr=t,this.zr.register({[Jn]:[t,e,n]}))}ci(){var e=this.Se?.persistence_save_debounce_ms;return he(e)&&e>0}vi(){this.ci()?this.zr.refreshKey(Jn):(this.zr.flush(),this.zr.load())}fi(){if(!me(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,e,t]=this.pi();e===this.ei&&t===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[Jn]:[this._sessionActivityTimestamp,this.ei??null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi(),t=he(e)?e:0,n=he(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[Jn];return O(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&e&&(e.removeEventListener(Nr,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&si.P(this.si)},B(e,Nr,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Se.cookieless_mode===Or)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[,r,i]=this.pi(),a=this.gi(),o=this.hi(),s=he(i)&&Math.abs(n-i)>864e5,c=!1,l=!1,u=!r,d=r,f=!u&&!e&&this.Kr(n,a);f&&((f=this.mi(n))||Ho.info(`cross-tab refresh kept the session alive`,{sessionId:r}),[,r,i]=this.pi()),u||f||s?(r=this.ti(),o=this.ri(),Ho.info(`new session ID generated`,{sessionId:r,windowId:o,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:s}}),i=n,c=!0):(o||(o=this.ri(),c=!0),(l=r!==d)&&(Ho.info(`adopted cross-tab session id`,{sessionId:r,windowId:o}),c=!0));var p=he(a)&&e&&!s?a:n,m=he(i)?i:new Date().getTime();this.ui(o),this.ai(r,p,m),e||this.ii();var h={noSessionId:u,activityTimeout:f,sessionPastMaximumLength:s,crossTabAdoption:l};return c&&this.Qr.forEach((e=>e(r,o,h))),{sessionId:r,windowId:o,sessionStartTimestamp:m,changeReason:c?h:void 0,lastActivityTimestamp:a}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>
1{if(!this.Yr){if(this.mi(new Date().getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit(`forcedIdleReset`,{idleSessionId:e})}else this.ii()}}),1.1*this.sessionTimeoutMs))}},Wo=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&E(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>E(e?.brand,t))))return!0}catch{}return!!e.webdriver};function Go(){return(Go=m((function*(){var e=n?.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=(yield e.getHighEntropyValues([`model`]))?.model;return M(t)&&t.length>0?t:void 0}catch(e){I.info(`Unable to resolve $device_model from userAgentData.getHighEntropyValues`,e);return}}))).apply(this,arguments)}var Ko=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function qo(e,t,n){return Do({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var Jo={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Ko(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Ko(t,e))))),icontains:(e,t)=>t.map(Yo).some((t=>e.map(Yo).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Yo).every((t=>e.map(Yo).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},Yo=e=>e.toLowerCase();function Xo(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(j(i)||me(i))return!1;var a=[String(i)],o=Jo[r.operator];return!!o&&o(r.values,a)}))}var Zo=`custom`,Qo=`i.posthog.com`,$o=/^\/static\//,es=class{constructor(e){this.bi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+Qo,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.bi[this.apiHost]||(this.bi[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`:Zo),this.bi[this.apiHost]}wi(e){if($o.test(e)){var t=this.instance.config.asset_host;if(typeof t==`string`)return t.trim().replace(/\/$/,``)||void 0}}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.wi(t);if(n)return``+n+t}if(this.region===Zo)return this.apiHost+t;var r=Qo+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}},U=L(`[Surveys]`),ts=`seenSurvey_`,ns=e=>{try{var t=(e=>((e,t)=>{var n=``+ts+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+ts+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){U.error(`Failed to persist survey seen state`,e)}},rs=[Ma.Popover,Ma.Widget,Ma.API],is={ignoreConditions:!1,ignoreDelay:!1,displayType:Ia.Popover},as=L(`[PostHog ExternalIntegrations]`),os={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},ss=class{constructor(e){this._instance=e}Mt(e,t){var n;(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return as.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=u.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.Mt(os[t],(()=>{var n;(n=u.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=u.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=u.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},cs,ls={},us=0,ds=()=>{}
1,fs=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,ps=`Surveys module not available`,ms=`sanitize_properties is deprecated. Use before_send instead`,hs=`Invalid value for property_denylist config: `,gs=`posthog`,_s=!So&&l?.indexOf(`MSIE`)===-1&&l?.indexOf(`Mozilla`)===-1,vs=t=>{var n;return h({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,asset_host:null,token:``,autocapture:!0,cross_subdomain_cookie:Wr(r?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:ds,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:t??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:i&&M(i?.search)&&i.search.indexOf(`__posthog_debug=true`)!==-1||!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:!1,enable_recording_console_log:void 0,secure_cookie:(e==null||(n=e.location)==null?void 0:n.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){I.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:jr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Po},error_tracking:{},_onCapture:ds},(e=>({rageclick:e&&e>=`2026-05-30`?{content_ignorelist:ki,ignore_text_selection:!0}
1:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2026-06-25`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>=`2026-05-30`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>=`2026-05-30`?250:0,split_storage:!(!e||`2026-05-30`>e),detect_google_search_app:!(!e||`2026-05-30`>e),disable_capture_url_hashes:!(!e||`2026-06-25`>e)}))(t))},ys=[[`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`]],bs=e=>{var t={};for(var[n,r]of ys)j(e[n])||(t[r]=e[n]);var i=z({},t,e),a=e.__preview_external_dependency_versioned_paths;return j(a)||(j(e.strict_script_versioning)&&(i.strict_script_versioning=!!a),M(a)&&j(e.asset_host)&&(i.asset_host=a)),O(e.property_blacklist)&&(j(e.property_denylist)?i.property_denylist=e.property_blacklist:O(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:I.error(hs+e.property_denylist)),i},xs=class{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){I.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ss=class t{ki(e,t){if(e){var n=this.Si.indexOf(e);n!==-1&&this.Si.splice(n,1)}return this.Si.push(t),t.initialize==null||t.initialize(),t}Ci(){return this.config.cookieless_mode===Or||this.config.cookieless_mode===Dr&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new xs,this.Ii=!1,this.version=f.LIB_VERSION,this.Ti=new Vo,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=vs(),this.SentryIntegration=na,this.sentryIntegration=e=>function(e,t){var n=ta(e,t);return{name:ea,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new Ro(this),this.pageViewManager=new ra(this),this.rateLimiter=new Ba(this),this.requestRouter=new es(this),this.consent=new ci(this),this.externalIntegrations=new ss(this);var e=t.__defaultExtensionClasses??{};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.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(e,t,n)=>{var r=M(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=M(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>I.info(`send "`+e?.event+`"`,e)))}init(e,n,r){if(r&&r!==gs){var i=ls[r]??new t;return i._init(e,n,r),ls[r]=i,ls[gs][r]=i,i}return this._init(e,n,r)}_init(t,n,r){var i;n===void 0&&(n={});var a=M(t)?t.trim():``;if(!a)return I.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 console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},n.debug=this.Oi(n.debug),this.Li=n,this.Fi=[],n.person_profiles?this.Pi=n.person_profiles:n.process_person&&(this.Pi=n.process_person);var o=vs(n.defaults),s=bs(n),c=z({},o,s,{name:r,token:a});A(o.rageclick)&&A(s.rageclick)&&(c.rageclick=z({},o.rageclick,s.rageclick)),A(o.session_recording)&&A(s.session_recording)&&(c.session_recording=z({},o.session_recording,s.session_recording)),this.set_config(c),this.config.on_xhr_error&&I.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=n.disable_compression?void 0:Ua.GZipJS;var l=this.Ai();this.persistence=new Aa(this.config,l),this.sessionPersistence=this.config.persistence===`
1sessionStorage`||this.config.persistence===`memory`?this.persistence:new Aa(h({},this.config,{persistence:`sessionStorage`}),l,!1);var u=h({},this.persistence.props),d=h({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new Fo((e=>this.Di(e)),this.config.request_queue_config),this.Ni=new Lo(this),this.__request_queue=[];var p=this.Ci();if(p||(this.sessionManager=new Uo(this),this.sessionPropsManager=new Bo(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(I.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.qi(p)}),0)):(I.info(`Initializing extensions synchronously`),this.qi(p)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&I.info(`Starting in debug mode`,{this:this,config:n,thisC:h({},this.config),p:u,s:d}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=h({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),n.bootstrap?.distinctID!==void 0){var m=n.bootstrap.distinctID,g=this.get_distinct_id(),_=this.persistence.get_property(mr);if(n.bootstrap.isIdentifiedID&&g!=null&&g!==m&&_===kr)this.identify(m);else if(n.bootstrap.isIdentifiedID&&g!=null&&g!==m&&_===Ar)I.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 v=this.config.get_device_id(Zr()),y=n.bootstrap.isIdentifiedID?v:m;this.persistence.set_property(mr,n.bootstrap.isIdentifiedID?Ar:kr),this.register({distinct_id:m,$device_id:y})}}if(p)this.register_once({distinct_id:Sr,$device_id:null},``);else if(!this.get_distinct_id()){var b=this.config.get_device_id(Zr());this.register_once({distinct_id:b,$device_id:b},``),this.persistence.set_property(mr,kr)}return B(e,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),n.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||Zr();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(mr,Ar)),t()},i=n.user();`then`in i&&k(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{typeof Promise<`u`&&Promise.resolve||$i.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||($i.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&($i.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Pr),identify:e=>t(e,Ir),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.Bi())):this.Bi(),k(this.config._onCapture)&&this.config._onCapture!==ds&&(I.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&I.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 Go.apply(this,arguments)}().then((e=>{e&&this.register({[An]:e})})).catch(ds),this}qi(e){var n=performance.now(),r=h({},t.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Si.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Si.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Si.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Si.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.Si.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Si.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Si.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Si.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Si.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Si.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Si.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Si.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Zi)),r.toolbar&&this.Si.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Si.push(this.experiments=this.experiments??new r.experiments(this)),this.Si.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>
1{if(this.ji){var e=this.ji;this.ji=void 0,this.pr(e)}})),this.Hi(i,n)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Hi(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){I.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Cr]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[wr]:r}),this.config.__preview_deferred_init_extensions&&I.info(`PostHog extensions initialized (`+r+`ms)`)}pr(e){var t;if(!r||!r.body)return I.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.pr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.ji=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=D(e.supportedCompression,Ua.GZipJS)?Ua.GZipJS:D(e.supportedCompression,Ua.Base64)?Ua.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:jr}),this.Si.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}Bi(){try{this.config.loaded(this)}catch(e){I.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&i!=null&&i.hostname){var e=i.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new Ha(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.$i)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Rr(this.__request_queue,(e=>this.Di(e))),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(Fr),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.$i)==null||n.unload(),(r=this.Ni)==null||r.unload()):this.Gi()&&this.capture(Fr,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded?_s?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=h({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,(j(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=h({},e);t.timeout=t.timeout||6e4,t.url=Mo(t.url,t.compression);var n=t.transport??`fetch`,r=No.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===Ua.GZipJS&&c&&typeof Promise<`u`&&!wo?jo(t).then((e=>{i(e)})).catch((n=>{if(ne(n))return wo=!0,void i(h({},t,{compression:void 0,url:Mo(e.url,void 0)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return ne(e)||t===ee})(n)&&(wo=!0),i(t)})):i(t)})(h({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){us++;try{var t,n=[],r=[],i=[];Rr(e,(e=>{if(e){if(O(t=e[0]))i.push(e);else if(k(e))try{e.call(this)}catch(t){I.error(`Error executing queued PostHog call`,e,t)}else O(e)&&t===`alias`?n.push(e):O(e)&&t.indexOf(`capture`)!==-1&&k(this[t])?i.push(e):r.push(e)}}));var a=function(e,t){Rr(e,(function(e){try{if(O(e[0])){var n=t;R(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){I.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{us--}}push(e){if(us>0&&O(e)&&M(e[0])){var n=t.prototype[e[0]];k(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing()){if(!j(e)&&M(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!M(t?.$current_url)&&(I.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.Zi||I.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=Mt(n?.uuid,Zr),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Pr&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p=n?.$unset;p&&(f.$unset=p);var m,g,_,v=this.Qi(n?.$set_once,e!==Lr,e===Ir);if(v&&(f.$set_once=v),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>M(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),O(t)?(r=[],Rr(t,(t=>{r.push(e(t))}))):(r={},R(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,j(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===Pa.DISMISSED||e===Pa.SENT){var y=t?.[Fa.SURVEY_ID],b=t?.[Fa.SURVEY_ITERATION];ns({id:y,current_iteration:b}),f.$set=h({},f.$set,{[(m={id:y,current_iteration:b},g=e===Pa.SENT?`responded`:`dismissed`,_=`$survey_`+g+`/`+m.id,m.current_iteration&&m.current_iteration>0&&(_=`$survey_`+g+`/`+m.id+`/`+m.current_iteration),_)]:!0})}else e===Pa.SHOWN&&(f.$set=h({},f.$set,{[Fa.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===La.SHOWN){var x=t?.[Ra.TOUR_TYPE];x&&(f.$set=h({},f.$set,{[Ra.TOUR_LAST_SEEN_DATE+`/`+x]:new Date().toISOString()}))}var S=h({},f.properties.$set,f.$set);if(fe(S)||this.setPersonPropertiesForFlags(S),!N(this.config.before_send)){var C=this.it(f);if(!C)return;(f=C).uuid=Mt(f.uuid,Zr)}this.Ti.emit(`eventCaptured`,f);var w={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey,transport:n?.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Di(w):this.$i.enqueue(w),f}I.critical(`This capture call is ignored due to client rate limiting.`)}}else I.error(`No event name provided to posthog.capture`)}}else I.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}
1calculateEventProperties(t,n,a,o,s){if(a||=new Date,!this.persistence||!this.sessionPersistence)return n;var c=s?void 0:this.persistence.remove_event_timer(t),u=h({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Ci()&&(u.$cookieless_mode=!0),t===`$snapshot`){var d=h({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!M(u.distinct_id)&&!P(u.distinct_id)||pe(u.distinct_id))&&I.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),u}var p,m=function(t,n,r,a){var o,s,c;if(a===void 0&&(a=!1),!l)return{};var u,d,p,m,h,g=t?[...pa,...n||[]]:[],[_,v]=function(e){for(var t=0;kt.length>t;t++){var[n,r]=kt[t],i=n.exec(e),a=i&&(k(r)?r(i,e):r);if(a)return a}return[``,``]}(l),y=(u=typeof navigator<`u`?navigator:void 0)!=null&&u.brave?{brave:!0}:{},b={detectGoogleSearchApp:r},x=z(Hr({$os:_,$os_version:v,$browser:Et(l,navigator.vendor,y,b),$device:At(l),$device_type:(p=l,m={userAgentDataPlatform:(o=navigator)==null||(o=o.userAgentData)==null?void 0:o.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:e==null||(s=e.screen)==null?void 0:s.width,screenHeight:e==null||(c=e.screen)==null?void 0:c.height,devicePixelRatio:e?.devicePixelRatio},h=At(p),h===Ne||h===Me||h===`Kobo`||h===`Kindle Fire`||h===lt?je:h===Qe||h===et||h===$e||h===ot?`Console`:h===Fe?`Wearable`:h?Oe:m?.userAgentDataPlatform===`Android`&&(m?.maxTouchPoints??0)>0?600>Math.min(m?.screenWidth??0,m?.screenHeight??0)/(m?.devicePixelRatio??1)?Oe:je:`Desktop`),$timezone:Ta(),$timezone_offset:Ea()}),{$current_url:ua(a?Nt(i?.href):i?.href,g,ha),$host:i?.host,$pathname:i?.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+`...`:l,$browser_version:Ot(l,navigator.vendor,y,b),$browser_language:ba(),$browser_language_prefix:(d=ba(),typeof d==`string`?d.split(`-`)[0]:void 0),$screen_height:e?.screen.height,$screen_width:e?.screen.width,$viewport_height:e?.innerHeight,$viewport_width:e?.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=f.SDK_DIST_CHANNEL),x}(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{sessionId:g,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(s,a.getTime());u.$session_id=g,u.$window_id=_}this.sessionPropsManager&&z(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&z(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=this.Ni?.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Zo&&(u.$lib_custom_api_host=this.config.api_host),p=t!==Pr||s?t!==Fr||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(a):this.pageViewManager.doPageView(a,o),u=z(u,p),t===Pr&&r&&(u.title=r.title),!j(c)){var v=a.getTime()-c;u.$duration=parseFloat((v/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?`bot`:`browser`),(u=z({},m,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),O(this.config.property_denylist)?R(this.config.property_denylist,(function(e){delete u[e]})):I.error(hs+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(I.error(ms),u=y(u,t));var b=this.Ji();return u.$process_person_profile=b,b&&!s&&this.Yi(`_calculate_event_properties`),u}Qi(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.Ji()||this.Ii&&!n)return e;var r=z({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(I.error(ms),r=i(r,`$set_once`)),t&&(this.Ii=!0),fe(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}getAllFeatureFlags(){return this.featureFlags?.getAllFeatureFlags()??[]}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}
1updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Ti.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:ps}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:ps})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:ps})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=is),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:ps}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:ps})}Xi(e){return!e||pe(e)?(I.critical(`Unique user id has not been set in posthog.identify`),!1):e===Sr?(I.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(I.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return I.uninitializedWarning(`posthog.identify`);if(P(e)&&(e=e.toString(),I.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.Xi(e)&&this.Yi(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(kn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(jn)&&(this.unregister(jn),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(mr)||kr)===kr;e!==r&&a?(this.persistence.set_property(mr,Ar),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(Ir,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ri=qo(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(ur))}}setPersonProperties(e,t){if((e||t)&&this.Yi(`posthog.setPersonProperties`)){var n=qo(this.get_distinct_id(),e,t);this.Ri===n?I.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Ri=n)}}unsetPersonProperties(e){var t,n=(O(e)?e:[e]).filter((e=>M(e)&&e.length>0));n.length!==0&&this.Yi(`posthog.unsetPersonProperties`)&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(n,!0),this.capture(`$set`,{$unset:n}),this.Ri=null)}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:h({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(Lr,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else I.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.Yi(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c,l;if(I.info(`reset`),!this.__loaded)return I.uninitializedWarning(`posthog.reset`);var u,d=this.get_property(kn),f=this.get_property(An),p=this.get_property(Hn);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),j(p)||(u=this.persistence)==null||u.register({[Hn]:p}),(r=this.surveys)==null||r.reset(),(i=this.Wi)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.logs)==null||s.reset(),(c=this.persistence)==null||c.set_property(mr,kr),(l=this.sessionManager)==null||l.resetSessionId(),this.Ri=null,this.config.cookieless_mode===Or)this.register_once({distinct_id:Sr,$device_id:null},``);else{var m=this.config.get_device_id(Zr());this.register_once({distinct_id:m,$device_id:e?m:d},``),e||j(f)||this.register({[An]:f})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return m((function*(){var e,n,r;t.__loaded?((e=t.logs)==null||e.flushLogs(`sendBeacon`),(n=t.$i)==null||n.unload(),(r=t.Ni)==null||r.unload()):I.uninitializedWarning(`posthog.shutdown`)}))()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.tn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(On)?(I.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.Yi(`posthog.alias`)?(j(t)&&(t=this.get_distinct_id()),e===t?(I.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.Ki(jn,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=h({},this.config);if(A(e)){var n,r,i,a,o,s,c,l,u,d,p;z(this.config,bs(e));var m=this.Ai();(n=this.persistence)==null||n.update_config(this.config,t,m),this.sessionPersistence=this.config.persistence===`
1sessionStorage`||this.config.persistence===`memory`?this.persistence:new Aa(h({},this.config,{persistence:`sessionStorage`}),m,!1);var g=this.Oi(this.config.debug);ge(g)&&(this.config.debug=g),ge(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,V.N()&&V.q(`ph_debug`,!0),I.info(`set_config`,{config:e,oldConfig:t,newConfig:h({},this.config)})):(f.DEBUG=!1,V.N()&&V.P(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.rn(),(p=this.externalIntegrations)==null||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(h({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??t.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??gs;return e!==gs&&(e=gs+`.`+e),e}_isIdentified(){return this.persistence?.get_property(mr)===Ar||this.sessionPersistence?.get_property(mr)===Ar}Ji(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===jr&&!this._isIdentified()&&fe(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[jn])&&((t=this.persistence)==null||(t=t.props)==null||!t[br]))}Gi(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.Ji()||this.Yi(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return this.config.person_profiles===`never`?(I.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.Ki(br,!0),!0)}Ai(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Dr)}rn(){var e,t,n=this.Ai();return this.persistence?.Vt!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.Vt!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Or){if(this.Ci()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new 
1Uo(this),this.pageViewManager=new ra(this),this.persistence&&(this.sessionPropsManager=new Bo(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??t.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.ki(this.sessionRecording,new o(this)),this.Ui&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.Ui)))}var s;this.consent.optInOut(!0),this.rn(),this.zi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Dr&&((s=this.surveys)==null||s.loadIfEnabled()),(j(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture(e?.captureEventName??`$opt_in`,e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else I.warn(fs)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Or?I.warn(fs):(this.config.cookieless_mode===Dr&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===Dr&&(this.register({distinct_id:Sr,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Or||(this.config.cookieless_mode===Dr?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return n?Wo(n,this.config.custom_blocked_useragents):void 0}Vi(){r&&(r.visibilityState===`visible`?this.Ei||(this.Ei=!0,this.capture(Pr,{title:r.title},{send_instantly:!0}),this.Mi&&=(r.removeEventListener(Mr,this.Mi),null)):this.Mi||(this.Mi=this.Vi.bind(this),B(r,Mr,this.Mi)))}debug(t){!1===t?(e?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(e?.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}))}mr(){var e,t,n,r,i,a,o=this.Li||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(I.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):(n=`advanced_disable_decide`,r=I,i=(t=`advanced_disable_flags`)in(e=o)&&!N(e[t]),a=n in e&&!N(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}it(e){if(N(this.config.before_send))return e;var t=Object.keys(e.properties??{}).filter(ye),n=O(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),N(r)){var a=`Event '`+e.event+`' was rejected in beforeSend function`;return ve(e.event)?I.warn(a+`. This can cause unexpected behavior.`):I.info(a),null}r.properties&&!fe(r.properties)||I.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}for(var o of t)if(r.properties&&N(r.properties[o]))return I.warn(`Event '`+e.event+`' had its '`+o+`' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){return this.pageViewManager.Ot?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Oi(e){var t=ge(e)&&!e,n=V.N()&&V.A(`ph_debug`)===`true`;return!t&&(!!n||e)}};Ss.__defaultExtensionClasses={},Ss.nn={trace:cs=()=>{},debug:cs,info:cs,warn:cs,error:cs,fatal:cs},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Vr(e.prototype[t[n]])}(Ss,[`identify`]);var Cs=class{constructor(e){this.disabled=!1===e;var t=A(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},ws=`$copy_autocapture`,Ts=L(`[AutoCapture]`);function Es(e,t){return t.length>e?t.slice(0,e)+`...`:t}function Ds(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!mi(t));return t}function Os(t,n){var r,{e:i,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:s,elementsC
1hainAsString:c,disableCaptureUrlHashes:l}=n;if(!mi(t))return{props:{}};for(var u=[t],d=t;d.parentNode&&!hi(d,`body`);)if(_i(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!mi(d.parentNode))break;u.push(d.parentNode),d=d.parentNode}var f,p,m=[],g={},_=!1,v=!1;if(R(u,(e=>{var t=Ii(e);if(hi(e,`a`)){var n=e.getAttribute(`href`);_=!!(t&&n&&Wi(n))&&(l?Nt(n):n)}D(bi(e),`ph-no-capture`)&&(v=!0),m.push(function(e,t,n,r,i){i===void 0&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};wi.indexOf(a)>-1&&!n&&(o.$el_text=a.toLowerCase()===`a`||a.toLowerCase()===`button`?Es(1024,Gi(e)):Es(1024,Si(e)));var s=bi(e);s.length>0&&(o.classes=s.filter((function(e){return e!==``}))),R(e.attributes,(function(n){var a;if((!Li(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&Wi(n.value)&&(!M(a=n.name)||a.substring(0,10)!==`_ngcontent`&&a.substring(0,7)!==`_nghost`)){var s=n.value;n.name===`class`&&(s=vi(s).join(` `)),o[`attr__`+n.name]=Es(1024,n.name===`href`&&i?Nt(s):s)}}));for(var c=1,l=1,u=e;u=Ds(u);)c++,u.tagName===e.tagName&&l++;return o.nth_child=c,o.nth_of_type=l,o}(e,a,o,s,l)),z(g,function(e){if(!Ii(e))return{};var t={};return R(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&Wi(r)&&(t[n]=r)}})),t}(e))})),v)return{props:{},explicitNoCapture:v};if(o||(m[0].$el_text=hi(t,`a`)||hi(t,`button`)?Gi(t):Si(t)),_){var y;m[0].attr__href=_;var b=ca(_)?.host,x=e==null||(y=e.location)==null?void 0:y.host;b&&x&&b!==x&&(f=_)}return{props:z({$event_type:i.type,$ce_version:1},c?{}:{$elements:m},{$elements_chain:(p=m,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=h({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return zr(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[qi(t.toString())]=qi(n.toString())})),(t+=`:`)+zr(i).map((e=>{var[t,n]=e;return t+`="`+n+`"`})).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:Ji(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return zr(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(p)))},(r=m[0])!=null&&r.$el_text?{$el_text:m[0]?.$el_text}:{},f&&i.type===`click`?{$external_click_url:f}:{},g)}}var ks=L(`[ExceptionAutocapture]`),As=L(`[TracingHeaders]`),js=L(`[Web Vitals]`),Ms=9e5,Ns=`disabled`,Ps=`lazy_loading`,Fs=`awaiting_config`,Is=`missing_config`;L(`[SessionRecording]`),L(`[SessionRecording]`);var Ls=`[SessionRecording]`,Rs=L(Ls),zs=L(`[Heatmaps]`);function Bs(e){return A(e)&&`clientX`in e&&`clientY`in e&&P(e.clientX)&&P(e.clientY)}var Vs=L(`[Product Tours]`),Hs=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(Bn))},Us=[`$set_once`,`$set`],Ws=L(`[SiteApps]`),Gs=`Error while initializing PostHog app with config id `;function Ks(e,t,n){if(N(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var qs=class{constructor(e){this.sn=new Vo,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e;j(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!j(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.vn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.cn)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))}
1)),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.cn.has(e)||this.cn.has(t?.event))&&this.vn&&this.vn?.size>0&&this.vn.forEach((e=>{this.fn(t,e)&&this.sn.emit(`actionCaptured`,e.name)}))}pn(e){this.onAction(`actionCaptured`,(t=>e(t)))}fn(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.an(e,n))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!Ks(r,t.url,t.url_matching||`contains`))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){var n;if(t==null||!t.href)return!0;var r=this.bn(e);if(r.length>0)return r.some((e=>Ks(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&Ks((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}mn(e,t){var n;if(t==null||!t.text)return!0;var r=this.bn(e);if(r.length>0)return r.some((e=>Ks(e.text,t.text,t.text_matching||`exact`)||Ks(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!N(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>Ks(e,a,o))))}yn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}bn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}dn(e,t){return t==null||!t.properties||t.properties.length===0||Xo(t.properties.reduce(((e,t)=>{var n=O(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},Js=class{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&Xo(e.propertyFilters,t?.properties)}Cn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}In(e,t,n){var r=(n===ja.Activation?this.wn:this.xn).get(e),i=[];return this.Tn((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Sn(a,t)}))}register(e){j(this._instance?._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Pn??(this.Pn=new qs(this._instance),this.Pn.init(),this.Pn.pn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Pn)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.kn.get(t.name);n&&n.push(e.id),this.kn.set(t.name,n||[e.id])}})))})))}En(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.wn=this.Cn(e,ja.Activation),this.xn=this.Cn(e,ja.Cancellation))}onEvent(e,t){var n,r,i=this.Rn(),a=(t==null||(n=t.properties)==null?void 0:n.$survey_id)||(t==null||(r=t.properties)==null?void 0:r.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.On(e,a);if(o===`consume`)return i.info(`event consumed activated item, remov
1ing it`,{event:e,itemId:a}),void this.Ln([a]);if(o===`persist`)return i.info(`shown item promoted to persisted activation`,{event:e,itemId:a}),void this.Fn(a)}if(this.xn.has(e)){var s=this.In(e,t,ja.Cancellation);s.length>0&&(i.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:s.map((e=>e.id))}),this.Ln(s.map((e=>e.id))),s.forEach((e=>this.An(e.id))))}if(this.wn.has(e)){i.info(`event name matched`,{event:e,eventPayload:t,items:this.wn.get(e)});var c=this.In(e,t,ja.Activation);this.$n(c.map((e=>e.id)))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){e.length!==0&&(this._n=[...new Set([...this._n,...e])],this.Rn().info(`updating activated items`,{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter((t=>t!==e));var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter((e=>!t.has(e)));var n=this.Dn(),r=n.filter((e=>!t.has(e)));r.length!==n.length&&this.Nn(r)}Dn(){var e,t=this.qn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter((e=>!this.Bn(e)))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}jn(){return this.Pn}},Ys=class extends Js{constructor(e){super(e)}qn(){return cr}Hn(){return Pa.SHOWN}Tn(e){var t;(t=this._instance)==null||t.getSurveys(e)}An(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}Rn(){return U}Nn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[cr]:e})}Bn(){return!1}On(e,t){var n;return this.Tn((e=>{n=e.find((e=>e.id===t))})),!n||function(e){var t,n,r=(((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)??0)>0;return e.schedule===Na.Always||!((n=e.conditions)==null||(n=n.events)==null||!n.repeatedActivation||!r)}(n)?e===Pa.SHOWN?`consume`:`ignore`:e===Pa.SHOWN?`persist`:e===Pa.DISMISSED||e===Pa.SENT?`consume`:`ignore`}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Xs=`SDK is not enabled or survey functionality is not yet loaded`,Zs=`Disabled. Not loading surveys.`,Qs=e!=null&&e.location?da(e.location.hash,`__posthog`)||da(location.hash,`state`):null,$s=`_postHogToolbarParams`,ec=L(`[Toolbar]`),W=L(`[FeatureFlags]`),tc=L(`[FeatureFlags]`,{debugEnabled:!0}),nc=`" failed. Feature flags didn't load in time.`,rc=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},ic=e=>{var t={};for(var[n,r]of zr(e||{}))r&&(t[n]=r);return t},ac=L(`[Error tracking]`),oc=`Refusing to render web experiment since the viewer is a likely bot`,sc={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>Ko(t,e),not_regex:(e,t)=>!Ko(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},cc=class t{get Se(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){e===void 0&&(e=!1),n.getWebExperiments((e=>{t.Un(`retrieved web experiments from the server`),n.zn=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;n.zn&&(t.Un(`setting flag key `,e.feature_flag_key,` to web experiment `,e),(r=n.zn)==null||r.set(e.feature_flag_key,e));var i=n._instance.getFeatureFlag(e.feature_flag_key);M(i)&&e.variants[i]&&n.Vn(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var a in e.variants){var o=e.variants[a];t.Wn(o,n._instance)&&n.Vn(e.name,a,o.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())t.Un(oc);else if(!this.Se.disable_web_experiments){if(N(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Un(`applying feature flags`,e),e.forEach((e=>{var t;if(this.zn&&(t=this.zn)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.zn?.get(e);n&&r!=null&&r.variants[n]&&this.Vn(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=la(e?.search,`__experiment_id`),r=la(e?.search,`__experiment_variant`);n&&r&&(t.Un(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Gn(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}
1getWebExperiments(e,t,n){if(this.Se.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.Se.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Gn(e,n,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(t.Un(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Vn(i[0].name,n,i[0].variants[n].transforms))}static Wn(e,n){return!N(e.conditions)&&t.Zn(e,n)&&t.Qn(e)}static Zn(e,n){if(N(e.conditions)||N(e.conditions?.url))return!0;var r=t.getWindowLocation();if(r){var i,a=li(n,r.href);return(i=e.conditions)==null||!i.url||sc[e.conditions?.urlMatchType??`icontains`](e.conditions.url,a)}return!1}static getWindowLocation(){return e?.location}static Qn(e){if(N(e.conditions)||N(e.conditions?.utm))return!0;var t=_a();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Un(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];I.info(`[WebExperiments] `+e,n)}Vn(e,n,r){this._is_bot()?t.Un(oc):n===`control`?t.Un(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(t.Un(`applying transform of variant `+n+` for experiment `+e+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return n&&this._instance?Wo(n,this.Se.custom_blocked_useragents):void 0}},lc=L(`[Conversations]`),uc=`Conversations not available yet.`,dc=`console`,fc={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Se(){return this._instance.config}get zr(){return this._instance.persistence}ss(e){return this._instance.get_property(e)}os(){var e;return(e=this.zr?.Gt(this.Se.feature_flag_cache_ttl_ms))!=null&&e}ls(){return!!this.os()&&(this.ns||this.Kn||(this.ns=!0,W.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}us(){var e=this.Se.evaluation_contexts??this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(W.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.rs=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||W.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}hs(){return this.us().length>0}ds(){var e=this.Se.flag_keys;if(!j(e)){if(O(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||W.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}));W.error(`Invalid flag_keys found:`,e,`Expected array of non-empty strings`)}}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r,i,a=n!=null&&n.merge&&(r=this.ss(Xn))!=null?r:{},o=n!=null&&n.merge&&(i=this.ss(er))!=null?i:{},s=h({},a,e),c=h({},o,t),l={};for(var[u,d]of Object.entries(s))l[u]={key:u,enabled:v(d),variant:y(d),reason:void 0,metadata:j(c?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:c[u]}};this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ss($n),t=this.ss(nr),n=this.ss(rr);if(!n&&!t)return e||{};var r=z({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=j(c)?(a=s?.enabled)!=null&&a:!!c,u=j(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=h({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=h({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Jn||=(W.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((n=>{var r=e[n];return{key:n,enabled:v(r),variant:y(r),payload:_(t[n])}}))}getFlagVariants(){var e=this.ss(Xn),t=this.ss(nr);if(!t)return e||{};for(var n=z({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(W.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.ss(er),t=this.ss(rr);if(!t)return e||{};for(var n=z({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(W.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.cs||(this._instance.Ti.emit(`featureFlagsReloading`,!0),this.cs=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.cs),this.cs=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.cs||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}vs(e){if(this.fs(),!this._instance.mr()){if(this.Kn)this.es=!0;else{var t=this.Se.token,n=this.ss(kn),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:h({},this.zr?.get_initial_props()||{},this.ss(ir)||{}),group_properties:this.ss(ar),timezone:Ta()};me(n)||j(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.hs()&&(r.evaluation_contexts=this.us());var i=this.ds();j(i)||(r.flag_keys=i);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Se.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Kn=!0,this._instance._send_request({method:`POST`,url:o,data:r,compression:this.Se.disable_compression?void 0:Ua.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,o=!0;if(e.statusCode===200&&(this.es||(this.$anon_distinct_id=void 0),o=!1),this.Kn=!1,!r.disable_flags||this.es){this.ts=!o;var s=[];e.error?e.error instanceof Error?s.push(e.error.name===`AbortError`?`timeout`:`connection_error`):s.push(`unknown_error`):e.statusCode!==200&&s.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&s.push(`errors_while_computing_flags`);var c=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));c&&s.push(`quota_limited`),(i=this.zr)==null||i.register({[fr]:s}),c?W.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.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},o,{partialResponse:a}
1),this.es&&(this.es=!1,this.vs()))}}})}}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else W.warn(`getFeatureFlag for key "`+e+nc)}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.ss(tr)||void 0,c=this.ss(pr)||void 0,l=this.ss(ur)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.ss(dr);d&&d!==f&&(l={},(u=this.zr)==null||u.register({[ur]:l,[dr]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,v,y,b,x;O(l[e])?l[e].push(o):l[e]=[o],(p=this.zr)==null||p.register({[ur]:l});var S=this.getFeatureFlagDetails(e),C=[...this.ss(fr)??[]];j(i)&&C.push(`flag_missing`);var w={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Se.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Se.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.ts};j(S==null||(g=S.metadata)==null?void 0:g.version)||(w.$feature_flag_version=S.metadata.version);var ee,T=(S==null||(v=S.reason)==null?void 0:v.description)??(S==null||(y=S.reason)==null?void 0:y.code);T&&(w.$feature_flag_reason=T),S!=null&&(b=S.metadata)!=null&&b.id&&(w.$feature_flag_id=S.metadata.id),j(S?.original_variant)&&j(S?.original_enabled)||(w.$feature_flag_original_response=j(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(x=S.metadata)!=null&&x.original_payload&&(w.$feature_flag_original_payload=S==null||(ee=S.metadata)==null?void 0:ee.original_payload),C.length&&(w.$feature_flag_error=C.join(`,`)),this._instance.capture(`$feature_flag_called`,w)}if(r)return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:_(a)}}}else W.warn(`getFeatureFlagResult for key "`+e+nc)}}getRemoteConfigPayload(e,t){var n=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.hs()&&(r.evaluation_contexts=this.us());var i=this.ds();j(i)||(r.flag_keys=i),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Se.disable_compression?void 0:Ua.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return j(n)?void 0:!!n}W.warn(`isFeatureEnabled for key "`+e+nc)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.zr){this.Yn=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):e.featureFlags&&W.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(O(c)){W.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[Zn]:c,[Xn]:f})}else{var m=c,g=l,_=s;if(a!=null&&a.partialResponse)m=h({},n,m),g=h({},r,g),_=h({},i,_);else if(e.errorsWhileComputingFlags){if(s){var v=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=h({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return v.has(t)})))),g=h({},r,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return v.has(t)})))),_=h({},i,Object.fromEntries(Object.entries(_||{}).filter((e=>{var[t]=e;return v.has(t)}))))}else m=h({},n,m),g=h({},r,g),_=h({},i,_)}t&&t.register(h({[Zn]:Object.keys(ic(m)),[Xn]:m||{},[er]:g||{},[$n]:_||{}},u?{[tr]:u}:{},d?{[pr]:d}:{}))}}})(e,this.zr,r,i,a,n),t||(this.ns=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),W.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return W.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.zr.unregister(nr),this.zr.unregister(rr),this.ps(),tc.info(`All overrides cleared`);if(O(e)){var t=rc(e);return this.zr.register({[nr]:t}),this.ps(),tc.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.zr.unregister(nr),tc.info(`Flag overrides cleared`);else if(r.flags){if(O(r.flags)){var i=rc(r.flags);this.zr.register({[nr]:i})}else this.zr.register({[nr]:r.flags});tc.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.zr.unregister(rr),tc.info(`Payload overrides cleared`)):r.payloads&&(this.zr.register({[rr]:r.payloads}),tc.info(`Payload overrides set`,{payloads:r.payloads}))),this.ps();return}if(e&&typeof e==`object`)return this.zr.register({[nr]:e}),this.ps(),tc.info(`Flag overrides set`,{flags:e});W.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:n}=this.gs();try{e(t,n)}catch(e){W.error(`Error while running feature flags callback`,e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.ss(Qn)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=h({},this.getFlagVariants(),{[e]:t});(r=this.zr)==null||r.register({[Zn]:Object.keys(ic(s)),[Xn]:s}),this.ps()}
1getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.ss(Qn),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Se.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.zr)==null||n.unregister(Qn),(r=this.zr)==null||r.register({[Qn]:i}),e(i)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>{try{r(t,n,{errorsLoading:e})}catch(e){W.error(`Error while running feature flags callback`,e)}}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.ss(ir)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[ir]:h({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=h({},this.ss(ir)||{});e.forEach((e=>{delete n[e]})),this._instance.register({[ir]:n}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this._instance.unregister(ir),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.ss(ar)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=h({},n[t],e[t]),delete e[t]})),this._instance.register({[ar]:h({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ss(ar)||{};this._instance.register({[ar]:h({},t,{[e]:{}})})}else this._instance.unregister(ar)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},pc={sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){return this.bs===Fs||this.bs===Is?this.bs:this.ys?.status??this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=Ns,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Rs.error(`started without valid sessionManager`),Error(Ls+` started without valid sessionManager. This is a bug.`);if(this.Se.cookieless_mode===Or)throw Error(Ls+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get ws(){var t,n=!((t=this._instance.get_property(Hn))==null||!t.enabled),r=!this.Se.disable_session_recording,i=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return e&&n&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var n=!j(Object.assign)&&!j(Array.from);this.ws&&n?(this.xs(e),Rs.info(`starting`)):(this.bs=Ns,this.stopRecording())}}xs(e){var t,n,r;this.ws&&(this.bs!==Fs&&this.bs!==Is&&(this.bs=Ps),u!=null&&(t=u.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=u.__PosthogExtensions__)!=null&&n.initSessionRecording?this.ks(e):(r=u.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return Rs.error(`could not load recorder`,t);this.ks(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}Cs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}Is(){var e,t;(e=this.zr)==null||e.unregister(Yn),(t=this.zr)==null||t.unregister(Un)}Ts(e,t){if(N(e))return null;var n,r=P(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Rs.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}Es(e){if(this.zr){var t,n=this.zr,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ts(this.Se.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ts(t?.sampleRate,`remote config sampleRate`),a=r??i;N(a)&&this.Is();var o=t?.minimumDurationMilliseconds;n.register({[Hn]:h({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:h({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:j(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this._s)==null||t.call(this),this._s=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.Es(e),this.Cs()):(this.Es(e),this.startIfEnabledOrStop()):(this.bs===Fs&&(this.bs=Is,Rs.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Rs.warn(`log called before recorder was ready`)}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Hn);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Ms(){var e,t=this._instance.get_property(Hn);if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return Rs.warn(`persisted remote config for session recording is invali
1d and will be ignored`,e),!1}var n=e.cache_timestamp??Date.now();return 36e5>=Date.now()-n}ks(e){var t;if((t=u.__PosthogExtensions__)==null||!t.initSessionRecording)return Rs.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Tr]:!0});if(this.ys||(this.ys=u.__PosthogExtensions__?.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===Is||this.bs===Fs)return;this.bs=Fs,Rs.info(`persisted remote config is stale, requesting fresh config before starting`),new Ha(this._instance).load();return}this.bs=Ps,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.zr)==null||t.register({[Gn]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.zr)==null||t.register({[Wn]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.zr)==null||n.register({[e===`url`?Kn:qn]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.ys?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},mc={autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new Cs(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get Se(){var e=A(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}Fs(){if(this.isBrowserSupported()){if(e&&r){var t=t=>{t||=e?.event;try{this.As(t)}catch(e){Ts.error(`Failed to capture event`,e)}};if(B(r,`submit`,t,{capture:!0}),B(r,`change`,t,{capture:!0}),B(r,`click`,t,{capture:!0}),this.Se.capture_copied_text){var n=t=>{t||=e?.event;try{this.As(t,ws)}catch(e){Ts.error(`Failed to capture copy/cut event`,e)}};B(r,`copy`,n,{capture:!0}),B(r,`cut`,n,{capture:!0})}}}else Ts.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Os=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Nn]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,n=[];return(t=this.Ls)==null||t.forEach((t=>{(r?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Nn];if(me(this.Rs)&&!ge(e)&&!this.instance.mr())return!1;var t=this.Rs??!!e;return!!this.instance.config.autocapture&&!t}As(t,n){if(n===void 0&&(n=`$autocapture`),this.isEnabled){var r,i=Ci(t);gi(i)&&(i=i.parentNode||null),n===`$autocapture`&&t.type===`click`&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&Ni(i,this.instance.config.rageclick)&&this.As(t,`$rageclick`);var a=n===ws;if(i&&function(t,n,r,i,a,o){var s,c,l;if(r===void 0&&(r=void 0),!e||Pi(t)||(s=r)!=null&&s.url_allowlist&&!yi(r.url_allowlist,o)||(c=r)!=null&&c.url_ignorelist&&yi(r.url_ignorelist,o))return!1;if((l=r)!=null&&l.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>n.type===e)))return!1}var{parentIsUsefulElement:d,targetElementList:f}=Fi(t,i);if(!function(e,t){var n=t?.element_allowlist;if(j(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(f,r)||!Ti(f,r?.css_selector_allowlist)||Ti(f,r?.css_selector_ignorelist??Di))return!1;try{var p=e.getComputedStyle(t);if(p&&p.getPropertyValue(`cursor`)===`pointer`&&n.type===`click`)return!0}catch{}var m=t.tagName.toLowerCase();switch(m){case`html`:return!1;case`form`:return(a||[`submit`]).indexOf(n.type)>=0;
1case`input`:case`select`:case`textarea`:return(a||[`change`,`click`]).indexOf(n.type)>=0;default:return d?(a||[`click`]).indexOf(n.type)>=0:(a||[`click`]).indexOf(n.type)>=0&&(wi.indexOf(m)>-1||t.getAttribute(`contenteditable`)===`true`)}}(i,t,this.Se,a,a?[`copy`,`cut`]:void 0,this.instance)){var{props:o,explicitNoCapture:s}=Os(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Os,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(s)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(o.$element_selectors=c),n===ws){var l,u=xi(e==null||(l=e.getSelection())==null?void 0:l.toString()),d=t.type||`clipboard`;if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return k(r?.querySelectorAll)}},historyAutocapture:class{constructor(t){var n;this._instance=t,this.$s=(e==null||(n=e.location)==null?void 0:n.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(I.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,I.info(`History API monitoring stopped`)}monitorHistoryChanges(){e&&e.history&&(this.Ns(`pushState`),this.Ns(`replaceState`),this.qs())}Ns(t){var n;if(e&&((n=e.history[t])==null||!n.__posthog_wrapped__)){var r=this;(function(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return k(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]===i&&(e[t]=r)}}catch{return()=>{}}})(e.history,t,(e=>function(n,i,a){e.call(this,n,i,a),r.Bs(t)}))}}Bs(t){try{var n,r=e==null||(n=e.location)==null?void 0:n.pathname;if(!r)return;r!==this.$s&&this.isEnabled&&this._instance.capture(Pr,{navigation_type:t}),this.$s=r}catch(e){I.error(`Error capturing `+t+` pageview`,e)}}qs(){if(!this.Ds){var t=()=>{this.Bs(`popstate`)};B(e,`popstate`,t),this.Ds=()=>{e&&e.removeEventListener(`popstate`,t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.js=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.js=!((t=this.instance.persistence)==null||!t.props[Pn]),this.rageclicks=new Cs(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return A(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return N(this.Se.capture_heatmaps)?N(this.Se.enable_heatmaps)?this.js:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;zs.info(`starting...`),this.Us(),this.ke()}else clearInterval(this.Hs??void 0),this.zs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Pn]:t}),this.js=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Vs(e){this.fe(e.originalEvent,`deadclick`)}ke(){this.Hs&&clearInterval(this.Hs),this.Hs=r?.visibilityState===`visible`?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Us(){e&&r&&(this.Ws=this.Lr.bind(this),B(e,Nr,this.Ws),this.Gs=t=>this.fe(t||e?.event),B(r,`click`,this.Gs,{capture:!0}),this.Zs=t=>this.Qs(t||e?.event),B(r,`mousemove`,this.Zs,{capture:!0}),this.Js=new Qi(this.instance,Xi,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ys=this.ke.bind(this),B(r,Mr,this.Ys),this.Ps=!0)}zs(){var t;e&&r&&(this.Ws&&e.removeEventListener(Nr,this.Ws),this.Gs&&r.removeEventListener(`click`,this.Gs,{capture:!0}),this.Zs&&r.removeEventListener(`mousemove`,this.Zs,{capture:!0}),this.Ys&&r.removeEventListener(Mr,this.Ys),clearTimeout(this.Ks),(t=this.Js)==null||t.stop(),this.Ps=!1)}Xs(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=function(t,n,r){for(var i=t;i&&mi(i)&&!hi(i,`body`);){if(i===r)return!1;var a=void 0;try{a=(i.ownerDocument?.defaultView??e)?.getComputedStyle(i).position}catch{return!1}if(D(n,a))return!0;
1i=Ei(i)}return!1}(Ci(t),[`fixed`,`sticky`],a);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:n}}fe(e,t){var n;if(t===void 0&&(t=`click`),!pi(e.target)&&Bs(e)){var r=this.Xs(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&Ni(Ci(e),this.instance.config.rageclick)&&this.eo(h({},r,{type:`rageclick`})),this.eo(r)}}Qs(e){!pi(e.target)&&Bs(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.eo(this.Xs(e,`mousemove`))}),500))}eo(t){if(e){var n=this.Se.disable_capture_url_hashes?Nt(e.location.href):e.location.href,r=this.Se.custom_personal_data_properties,i=ua(n,this.Se.mask_personal_data_properties?[...pa,...r||[]]:[],ha);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(t)}}Lr(){this.R&&!fe(this.R)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Qi,webVitalsAutocapture:class{constructor(e){var t;this.js=!1,this.Ps=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),this.R.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.R.metrics.reduce(((e,t)=>h({},e,{[`$web_vitals_`+t.name+`_event`]:h({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.no=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t=this.so();if(!j(t)){if(N(e?.name)||N(e?.value))js.error(`Invalid metric received`,e);else if(!this.oo||this.oo>e.value){this.R.url!==t&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),j(this.R.url)&&(this.R.url=t),this.R.firstMetricTimestamp=j(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),r=h({},e,{$current_url:t,timestamp:Date.now()});j(n)||(r.$session_id=n.sessionId,r.$window_id=n.windowId),this.R.metrics.push(r),this.R.metrics.length===this.allowedMetrics.length&&this.ro()}else js.error(`Ignoring metric with value >= `+this.oo,e)}},this.ao=()=>{if(!this.Ps){var e,t,n,r,i=u.__PosthogExtensions__;j(i)||j(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.no.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.no.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.no.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.no.bind(this)),this.Ps=!0):js.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.js=!((t=this._instance.persistence)==null||!t.props[Rn]),this.startIfEnabled()}get lo(){return this._instance.config.capture_performance}get allowedMetrics(){var e=A(this.lo)?this.lo?.web_vitals_allowed_metrics:void 0;return N(e)?this._instance.persistence?.props[Vn]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(A(this.lo)?this.lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=A(this.lo)?this.lo.web_vitals_attribution:void 0;return e!=null&&e}get oo(){var e=A(this.lo)&&P(this.lo.__web_vitals_max_value)?this.lo.__web_vitals_max_value:Ms;return e>0&&6e4>=e?Ms:e}get isEnabled(){var e=i?.protocol;if(e!==`http:`&&e!==`https:`)return js.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=A(this.lo)?this.lo.web_vitals:ge(this.lo)?this.lo:void 0;return ge(t)?t:this.js}startIfEnabled(){this.isEnabled&&!this.Ps&&(js.info(`enabled, starting...`),this.Mt(this.ao))}onRemoteConfig(e){if(`capturePerformance`in e){var t=A(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=A(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Rn]:t}),this._instance.persistence.register({[Vn]:n})),this.js=t,this.startIfEnabled()}}Mt(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?js.error(`failed to load script`,t):e()}))}
1so(){var t=e?this._instance.config.disable_capture_url_hashes?Nt(e.location.href):e.location.href:void 0;if(t){var n=this._instance.config.custom_personal_data_properties;return ua(t,this._instance.config.mask_personal_data_properties?[...pa,...n||[]]:[],ha)}js.error(`Could not determine current URL`)}}},hc={exceptionObserver:class{constructor(t){var n;this.ao=()=>{var t;if(e&&this.isEnabled&&(t=u.__PosthogExtensions__)!=null&&t.errorWrappingFunctions){var n=u.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=u.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=u.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.Se.capture_unhandled_errors&&(this.uo=n(this.captureException.bind(this))),!this.ho&&this.Se.capture_unhandled_rejections&&(this.ho=r(this.captureException.bind(this))),!this.do&&this.Se.capture_console_errors&&(this.do=i(this.captureException.bind(this)))}catch(e){ks.error(`failed to start`,e),this.co()}}},this._instance=t,this.vo=!((n=this._instance.persistence)==null||!n.props[Fn]),this.fo=new De({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Ae:ks}),this.Se=this.po(),this.startIfEnabledOrStop()}po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return A(e)?t=h({},t,e):(j(e)?this.vo:e)&&(t=h({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ks.info(`enabled`),this.co(),this.Mt(this.ao)):this.co()}Mt(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return ks.error(`failed to load script`,t);e()}))}co(){var e,t,n;(e=this.uo)==null||e.call(this),this.uo=void 0,(t=this.ho)==null||t.call(this),this.ho=void 0,(n=this.do)==null||n.call(this),this.do=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.vo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Fn]:this.vo}),this.Se=this.po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.po()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.fo.consumeRateLimit(r)?ks.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.mo=[],this.yo=new Jt([new sn,new _n,new ln,new cn,new hn,new mn,new dn,new gn],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
2`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=on.test(s)?s.replace(on,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Yt});var n}))}(i)}}(`web:javascript`,tn,an)),this._instance=e,this.mo=this._instance.persistence?.get_property(In)??[],this.bo=Sn(this._o()),this.wo=new Cn(this.bo)}onConfigChange(){this.bo=Sn(this._o()),this.wo.setConfig(this.bo)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.mo=t,this._instance.persistence&&this._instance.persistence.register({[In]:this.mo,[Ln]:n})}}get xo(){var e,t=!!this._instance.get_property(Ln);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.yo.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.bo.enabled)try{if(!M(e)||e.trim().length===0)return void ac.warn(`Ignoring exception step because message must be a non-empty string`);var{sanitizedProperties:n,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>bn.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.ko(t));r.length>0&&ac.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.wo.add(h({[vn]:e,[yn]:new Date().toISOString()},n))}catch(e){ac.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.So(t)){if(this.Co(t))return this.Io(`Exception dropped: matched a suppression rule`),void ac.info(`Skipping exception capture because a suppression rule matched`);if(!this.xo&&this.To(t))return this.Io(`Exception dropped: thrown by a browser extension`),void ac.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Eo(t))return this.Io(`Exception dropped: thrown by the PostHog SDK`),void ac.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.bo.enabled&&N(e.$exception_steps)?this.Mo(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,Zi:!0});return r&&this.wo.clear(),r}catch(e){ac.error(`Failed to capture exception event. Dropping this exception.`,e),this.wo.clear();return}}catch(e){ac.error(`Failed to process exception event. Ignoring this exception.`,e);return}}Mo(e){try{var t=this.wo.getAttachable();return t.length===0?e:h({},e,{$exception_steps:t})}catch(t){return ac.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}Io(e){this.bo.enabled&&this.wo.add({[vn]:e,[yn]:new Date().toISOString()})}ko(e){return A(e)?h({},e):{}}_o(){return this._instance.config.error_tracking?.exception_steps??{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return M(n)&&n.length>0&&e.$exception_types.push(n),M(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.mo.some((e=>{var n=e.values.map((e=>{var n=Jo[e.operator],r=O(e.value)?e.value:[e.value],i=t[e.key]??[];return r.length>0&&n(r,i)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}To(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}Eo(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}So(e){return!N(e)&&O(e)}}},gc=h({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Po=null,this.Ro=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(`productTours`in e){var t;if(this.zr&&this.zr.register({[Bn]:!!e.productTours}),!Hs(this._instance))return!this.Po&&N(this.zr?.props[lr])||Vs.info(`product tours disabled; stopping and clearing cached tours`),(t=this.Po)==null||t.stop(),this.Po=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Po&&Hs(this._instance)&&this.Mt((()=>this.Oo()))}Mt(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?Vs.error(`Could not load product tours script`,t):e()}))}Oo(){var e;!this.Po&&(e=u.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Po=u.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!O(this.Ro)||t){var n=this.zr;if(n){var r=n.props[lr];if(O(r)&&!t)return this.Ro=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,callback:t=>{if(Hs(this._instance)){var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;Vs.error(i),e([],{isLoaded:!1,error:i});return}var a=O(t.json.product_tours)?t.json.product_tours:[];this.Ro=a,n&&n.register({[lr]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ro,{isLoaded:!0})}getActiveProductTours(e){N(this.Po)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Po.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Po)==null||t.showTourById(e)}previewTour(e){this.Po?this.Po.previewTour(e):this.Mt((()=>{var t;this.Oo(),(t=this.Po)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Po)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Po)==null||e.nextStep()}previousStep(){var e;(e=this.Po)==null||e.previousStep()}clearCache(){var e;this.Ro=null,(e=this.zr)==null||e.unregister(lr)}resetTour(e){var t;(t=this.Po)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Po)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Po)==null||t.cancelPendingTour(e)}}},fc),_c={siteApps:class{constructor(e){this.Lo=0,this._instance=e,this.Fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ao(e,t){if(t){var n=this.globalsForEvent(t);this.Fo.push(n),this.Fo.length>1e3&&(this.Fo=this.Fo.slice(10))}}get siteAppLoaders(){var e;return(e=u._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Ao.bind(this));this.$o=()=>{e(),this.Fo=[],this.$o=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var[i,a]of Object.entries(r))t[i]={id:n[i],type:i,properties:a};var{$set_once:o,$set:s}=e;return{event:h({},g(e,Us),{properties:h({},e.properties,s?{$set:h({},e.properties?.$set??{},s)}:{},o?{$set_once:h({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}Do(e){var t=e.tagName?.toLowerCase();
2return t===`style`&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Ws.error(`prepare_external_dependency_stylesheet returned null`),null):t===`script`&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Ws.error(`prepare_external_dependency_script returned null`),null):e}No(){var e;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var t=r?.defaultView,n=t==null||(e=t.Node)==null?void 0:e.prototype;if(!t||!n)return()=>{};if(this.Lo++,this.qo)return this.Bo();var i=[],a=this,o=new WeakSet,s=(e,t,n)=>{if(e!=null&&e[t]){var r=e[t];e[t]=n(r),i.push((()=>{e[t]=r}))}},c=e=>{if(o.has(e))return e;var t=a.Do(e);return t&&o.add(t),t},l=e=>e.map((e=>typeof e==`string`?e:c(e))).filter((e=>!me(e)));return s(n,`appendChild`,(e=>function(t){var n=c(t);return n?e.call(this,n):t})),s(n,`insertBefore`,(e=>function(t,n){var r=c(t);return r?e.call(this,r,n):t})),s(n,`replaceChild`,(e=>function(t,n){var r=c(t);return r?e.call(this,r,n):n})),[t.Element?.prototype,t.Document?.prototype,t.DocumentFragment?.prototype].forEach((e=>{s(e,`append`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))})),s(e,`prepend`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))}))})),[t.Element?.prototype,t.CharacterData?.prototype,t.DocumentType?.prototype].forEach((e=>{s(e,`before`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))})),s(e,`after`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))})),s(e,`replaceWith`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=l(n);return n.length&&!i.length?void 0:e.apply(this,i)}))})),s(t.Element?.prototype,`insertAdjacentElement`,(e=>function(t,n){var r=c(n);return r?e.call(this,t,r):null})),this.qo=()=>{i.forEach((e=>e())),this.qo=void 0},this.Bo()}Bo(){var e=!1;return()=>{var t;e||(e=!0,this.Lo--,this.Lo===0&&((t=this.qo)==null||t.call(this)))}}jo(e,t){t===void 0&&(t=!0);var n=this.No();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.Fo.length&&(Ws.info(`Processing `+this.Fo.length+` events for site app with id `+e.id),this.Fo.forEach((e=>this.jo((()=>t.processEvent==null?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.$o)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Ws.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=this.jo((t=>e.init({posthog:this._instance,callback(e){t(),i(e)}})),!1);a&&(t.processEvent=a),r=!0}catch(t){Ws.error(Gs+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Ws.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}Ho(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Uo(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(r){try{t.jo((()=>r.processEvent==null?void 0:r.processEvent(n)))}catch(t){Ws.error(`Error while processing event `+e.event+` for site app `+r.id,t)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Ho(),void this._instance.on(`eventCaptured`,(e=>this.Uo(e)))):void Ws.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.$o)==null||n.call(this),(r=e.siteApps)!=null&&r.length){if(this.isEnabled){var a=function(e){var t;u[`__$$ph_site_app_`+e]=i._instance,(t=u.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return Ws.error(Gs+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else Ws.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}}},vc={tracingHeaders:class{constructor(e){this.zo=void 0,this.Vo=void 0,this.Wo=void 0,this.ao=()=>{var e,t,n=this.Go();n?(j(this.zo)&&(this.zo=(e=u.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),j(this.Vo)&&(this.Vo=(t=u.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.co()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return As.error(`failed to load script`,t);
2e()}))}Zo(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}Go(){var e=this.Zo();return O(e)?(O(this.Wo)?this.Wo.splice(0,this.Wo.length,...e):this.Wo=[...e],e.length>0?this.Wo:void 0):(O(this.Wo)&&this.Wo.splice(0),this.Wo=e||void 0,this.Wo)}co(){var e,t;(e=this.zo)==null||e.call(this),(t=this.Vo)==null||t.call(this),this.zo=void 0,this.Vo=void 0}startIfEnabledOrStop(){this.Go()?this.Mt(this.ao):this.co()}}},yc=h({surveys:class{get Se(){return this._instance.config}constructor(e){this.Qo=void 0,this._surveyManager=null,this.Jo=!1,this.Yo=[],this.Ko=null,this.Xo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(N(t))return U.warn(`Flags not loaded yet. Not loading surveys.`);var n=O(t);this.Qo=n?t.length>0:t,U.info(`flags response received, isSurveysEnabled: `+this.Qo),this.loadIfEnabled()}}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem(`lastSeenSurveyDate`);for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(ts)||r!=null&&r.startsWith(`inProgressSurvey_`))&&t.push(r)}t.forEach((e=>localStorage.removeItem(e)))}catch{}}loadIfEnabled(){if(!this._surveyManager){if(this.Jo)U.info(`Already initializing surveys, skipping...`);else if(this.Se.disable_surveys)U.info(Zs);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())U.info(`Not loading surveys in cookieless mode without consent.`);else{var e=u?.__PosthogExtensions__;if(e){if(!j(this.Qo)||this.Se.advanced_enable_surveys){var t=this.Qo||this.Se.advanced_enable_surveys;this.Jo=!0;try{var n=e.generateSurveys;if(n)return void this.ea(n,t);var r=e.loadExternalDependency;if(!r)return void this.ta(Er);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.ta(`Could not load surveys script`,n):this.ea(e.generateSurveys,t)}))}catch(e){throw this.ta(`Error initializing surveys`,e),e}finally{this.Jo=!1}}}else U.error(`PostHog Extensions not found.`)}}}ea(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Ys(this._instance),U.info(`Surveys loaded successfully`),this.ra({isLoaded:!0})}ta(e,t){U.error(e,t),this.ra({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yo.push(e),this._surveyManager&&this.ra({isLoaded:!0}),()=>{this.Yo=this.Yo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Se.disable_surveys)return U.info(Zs),e([]);var n,r=this._instance.get_property(or);if(r&&!t)return e(r,{isLoaded:!0}),void(this.ia()&&this.getSurveys((()=>{}),!0));typeof Promise<`u`&&this.Ko?this.Ko.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.Ko=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.Se.token),method:`GET`,timeout:this.Se.surveys_request_timeout_ms,callback:t=>{var r;this.Ko=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;U.error(a),this.Xo=Date.now();var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}this.Xo=null;var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[or]:c,[sr]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}ia(){return this.na()&&!this.Ko&&!this.sa()}na(){var e=this._instance.get_property(sr);return P(e)&&Date.now()-e>3e5}sa(){return P(this.Xo)&&3e5>Date.now()-this.Xo}markSurveyAsSeen(e,t){ns({id:e,current_iteration:t?.iteration??null});try{localStorage.setItem(`lastSeenSurveyDate`,new Date().toISOString())}catch{}}ra(e){for(var t of this.Yo)try{if(!e.isLoaded)return t([],e);
2this.getSurveys(t)}catch(e){U.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!N(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);U.warn(`init was not called`)}oa(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}aa(e){if(N(this._surveyManager))return{eligible:!1,reason:Xs};var t=typeof e==`string`?this.oa(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(N(this._surveyManager))return U.warn(`init was not called`),{visible:!1,disabledReason:Xs};var t=this.aa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return N(this._surveyManager)?(U.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:Xs})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.aa(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var i;if(N(this._surveyManager))U.warn(`init was not called`);else{var a=typeof e==`string`?this.oa(e):e;if(a!=null&&a.id){if(rs.includes(a.type)){var o=r?.querySelector(t);if(o)return(i=a.appearance)!=null&&i.surveyPopupDelaySeconds?(U.info(`Rendering survey `+a.id+` with delay of `+a.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;U.info(`Rendering survey `+a.id+` with delay of `+a.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(a,o,n),U.info(`Survey `+a.id+` rendered`)}),1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,o,n);U.warn(`Survey element not found`)}else U.warn(`Surveys of type `+a.type+` cannot be rendered in the app`)}else U.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(N(this._surveyManager))U.warn(`init was not called`);else{var r=this.oa(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=h({},r,{appearance:h({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Ia.Popover&&t.initialResponses&&U.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.canRenderSurvey(r);if(!a.visible)return void U.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===Ia.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else U.warn(`Survey not found`)}}cancelPendingSurvey(e){N(this._surveyManager)?U.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},fc),bc={toolbar:class{constructor(e){this.instance=e}la(e){u.ph_toolbar_state=e}ua(){return u.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,n,i){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),Gr(this.instance.config)||!e||!r)return!1;t??=e.location,i??=e.history;try{if(!n){try{e.localStorage.setItem(`test`,`test`),e.localStorage.removeItem(`test`)}catch{return!1}n=e?.localStorage}var a,o=Qs||da(t.hash,`__posthog`)||da(t.hash,`state`),s=o?Br((()=>JSON.parse(atob(decodeURIComponent(o)))))||Br((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action===`ph_authorize`?((a=s).source=`url`,a&&Object.keys(a).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,``,t.pathname+t.search):t.hash=``)):((a=JSON.parse(n.getItem($s)||`{}`)).source=`localstorage`,delete a.userIntent),!(!a.token||this.instance.config.token!==a.token||(this.loadToolbar(a),0))}catch{return!1}}ha(e){var t=u.ph_load_toolbar||u.ph_load_editor;!N(t)&&k(t)?t(e,this.instance):ec.warn(`No toolbar load function found`)}loadToolbar(t){var n=!(r==null||!r.getElementById(xr));if(!e||n)return!1;var i=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,a=h({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},i?{instrument:!1}:{});if(e.localStorage.setItem($s,JSON.stringify(h({},a,{source:void 0}))),this.ua()===2)this.ha(a);else if(this.ua()===0){var o;this.la(1),(o=u.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return ec.error(`[Toolbar] Failed to load`,e),void this.la(0);this.la(2),this.ha(a)})),B(e,`turbolinks:load`,(()=>{this.la(0),this.loadToolbar(a)}
2))}return!0}da(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},xc=h({experiments:cc},fc),Sc=h({},fc,pc,mc,hc,gc,_c,yc,vc,bc,xc,{conversations:class{constructor(e){this.ca=void 0,this._conversationsManager=null,this.va=!1,this.fa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;N(t)||(ge(t)?this.ca=t:(this.ca=t.enabled,this.fa=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.ca=void 0,this.fa=null}loadIfEnabled(){if(!(this._conversationsManager||this.va||this._instance.config.disable_conversations||Gr(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=u?.__PosthogExtensions__;if(e&&!j(this.ca)&&this.ca){if(this.fa&&this.fa.token){this.va=!0;try{var t=e.initConversations;if(t)return this.pa(t),void(this.va=!1);var n=e.loadExternalDependency;if(!n)return void this.ga(Er);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.ga(`Could not load conversations script`,t):this.pa(e.initConversations),this.va=!1}))}catch(e){this.ga(`Error initializing conversations`,e),this.va=!1}}else lc.error(`Conversations enabled but missing token in remote config.`)}}}pa(e){if(this.fa)try{this._conversationsManager=e(this.fa,this._instance),lc.info(`Conversations loaded successfully`)}catch(e){this.ga(`Error completing conversations initialization`,e)}else lc.error(`Cannot complete initialization: remote config is null`)}ga(e,t){lc.error(e,t),this._conversationsManager=null,this.va=!1}show(){this._conversationsManager?this._conversationsManager.show():lc.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ca&&!me(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return m((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(lc.warn(uc),null)}))()}getMessages(e,t){var n=this;return m((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(lc.warn(uc),null)}))()}markAsRead(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(lc.warn(uc),null)}))()}getTickets(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(lc.warn(uc),null)}))()}requestRestoreLink(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(lc.warn(uc),null)}))()}restoreFromToken(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(lc.warn(uc),null)}))()}restoreFromUrlToken(){var e=this;return m((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(lc.warn(uc),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}en(){var e;(e=this._conversationsManager)==null||e.setIdentity()}tn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(t){var n;this.ma=!1,this.ya=!1,this.Ae=L(`[logs]`),this._r=[],this.ba=[],this._a=()=>{var e,t;(e=this.wa)==null||e.onReconnect(),(t=this.xa)==null||t.onReconnect()},this._instance=t,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.ma=!0),e&&B(e,`online`,this._a)}ka(e,t,n,r){var i,a=function(e,t){var n=e?.flushIntervalMs??3e3,r=e?.maxBufferSize??100,i=t!=null&&t.consoleCapture?void 0:e?.maxLogsPerInterval??1e3,a=j(i)?Math.max(r,2048):Math.max(r,i),o=e?.resourceAttributes;return{serviceName:o?.[`service.name`]??e?.serviceName??t?.serviceNameDefault,serviceVersion:o?.[`service.version`]??e?.serviceVersion,environment:o?.[`deployment.environment`]??e?.environment,resourceAttributes:o,beforeSend:e?.beforeSend,flushIntervalMs:n,maxBufferSize:r,maxQueueSize:a,maxBatchRecordsPerPost:100,rateCapWindowMs:n,maxLogsPerInterval:i,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new Ut(this.Sa(e,t),a,this.Ae,(()=>this.Ca()),(e=>e()),void 0,r),a]}Ia(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;return this.wa&&this.Ta===n||((t=this.wa)==null||t.reset(),this.Ta=n,[this.wa,this.Ea]=this.ka((()=>this._r),(e=>{this._r=e}))),this.wa}Ma(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;return this.xa&&this.Pa===n||((t=this.xa)==null||t.reset(),this.Pa=n,[this.xa,this.Ra]=this.ka((()=>this.ba),(e=>{this.ba=e}),{serviceNameDefault:`posthog-browser-logs`,consoleCapture:!0},dc)),this.xa}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!N(t)&&t&&(this.ma=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],(e=this.wa)==null||e.reset(),this.ba=[],(t=this.xa)==null||t.reset()}captureLog(e){this.Ia().captureLog(e)}le(e){this.Ma().captureLog(e)}get logger(){return this.Oa||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>
2this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.Oa}flushLogs(e){e?this.La(e):(this.wa&&this.wa.flush().catch((e=>this.Ae.error(`PostHog logs flush failed:`,e))),this.xa&&this.xa.flush().catch((e=>this.Ae.error(`PostHog logs flush failed:`,e))))}loadIfEnabled(){if(this.ma&&!this.ya){var e=u?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Ae.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.ya=!0)})):this.Ae.error(Er)}else this.Ae.error(`PostHog Extensions not found.`)}}Sa(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:t=>t===x.LogsQueue?e():void 0,setPersistedProperty(e,n){e===x.LogsQueue&&t(n??[])},ht:e=>this.ht(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}ht(e){return new Promise((t=>{var n=!1,r=e=>{n||(n=!0,clearTimeout(i),t(e))},i=setTimeout((()=>r({kind:`retry-later`,error:Error(`logs request timed out`)})),9e4);this._instance._send_request({method:`POST`,url:this.Fa(),data:e,compression:`best-available`,batchKey:`logs`,fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;r(t>=200&&300>t?{kind:`ok`}:t===413?{kind:`too-large`}:t!==0&&t!==429&&500>t?{kind:`fatal`,error:Error(`logs request failed with status `+t)}:{kind:`retry-later`,error:e.error??Error(`logs request failed with status `+t)})}})}))}La(e){this._r.length>0&&this.Aa(e,this._r,this.Ea,f.LIB_NAME,(e=>{this._r=e})),this.ba.length>0&&this.Aa(e,this.ba,this.Ra,dc,(e=>{this.ba=e}))}Aa(e,t,n,r,i){if(t.length!==0){var a=t.map((e=>e.record));i([]);var o=Ht(a,Vt(n,f.LIB_NAME,f.LIB_VERSION),r,f.LIB_VERSION);this._instance._send_request({method:`POST`,url:this.Fa(),data:o,compression:`best-available`,batchKey:`logs`,transport:e})}}Fa(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token)}Ca(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n,windowId:r,sessionStartTimestamp:i,lastActivityTimestamp:a}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n,t.windowId=r,N(i)||(t.sessionStartTimestamp=i),N(a)||(t.lastActivityTimestamp=a)}if(u!=null&&(e=u.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?
2Nt(u.location.href):u.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}});Ss.__defaultExtensionClasses=h({},Sc);var Cc=function(){f.SDK_DIST_CHANNEL=`npm`;var t=ls[gs]=new Ss;return function(){function t(){t.done||(t.done=!0,_s=!1,R(ls,(function(e){e._dom_loaded()})))}r!=null&&r.addEventListener?r.readyState===`complete`?t():B(r,`DOMContentLoaded`,t,{capture:!1}):e&&I.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),G=globalThis,wc=`10.45.0`;function Tc(){return Ec(G),G}function Ec(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.45.0`,t[wc]=t[`10.45.0`]||{}}function Dc(e,t,n=G){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[wc]=r[`10.45.0`]||{};return i[e]||(i[e]=t())}var Oc=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],kc={};function Ac(e){if(!(`console`in G))return e();let t=G.console,n={},r=Object.keys(kc);r.forEach(e=>{let r=kc[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function jc(){Lc().enabled=!0}function Mc(){Lc().enabled=!1}function Nc(){return Lc().enabled}function Pc(...e){[...e]}function Fc(...e){[...e]}function Ic(...e){[...e]}function Lc(){return{enabled:!1}}var Rc={enable:jc,disable:Mc,isEnabled:Nc,log:Pc,warn:Fc,error:Ic},zc=50,Bc=/\(error: (.*)\)/,Vc=/captureMessage|captureException/;function Hc(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
3`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=Bc.test(n)?n.replace(Bc,`$1`):n;if(!o.match(/\S*Error: /)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=zc+r)break}}return Wc(i.slice(r))}}function Uc(e){return Array.isArray(e)?Hc(...e):e}function Wc(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Gc(t).function||``)&&t.pop(),t.reverse(),Vc.test(Gc(t).function||``)&&(t.pop(),Vc.test(Gc(t).function||``)&&t.pop()),t.slice(0,zc).map(e=>({...e,filename:e.filename||Gc(t).filename,function:e.function||`?`}))}function Gc(e){return e[e.length-1]||{}}var Kc=`<anonymous>`;function qc(e){try{return!e||typeof e!=`function`?Kc:e.name||Kc}catch{return Kc}}function Jc(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function Yc(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var Xc={},Zc={};function Qc(e,t){Xc[e]=Xc[e]||[],Xc[e].push(t)}function $c(e,t){if(!Zc[e]){Zc[e]=!0;try{t()}catch{}}}function el(e,t){let n=e&&Xc[e];if(n)for(let e of n)try{e(t)}catch{}}var tl=null;function nl(e){let t=`error`;Qc(t,e),$c(t,rl)}function rl(){tl=G.onerror,G.onerror=function(e,t,n,r,i){return el(`error`,{column:r,error:i,line:n,msg:e,url:t}),tl?tl.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}var il=null;function al(e){let t=`unhandledrejection`;Qc(t,e),$c(t,ol)}function ol(){il=G.onunhandledrejection,G.onunhandledrejection=function(e){return el(`unhandledrejection`,e),!il||il.apply(this,arguments)},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var sl=Object.prototype.toString;function cl(e){switch(sl.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Sl(e,Error)}}function ll(e,t){return sl.call(e)===`[object ${t}]`}function ul(e){return ll(e,`ErrorEvent`)}function dl(e){return ll(e,`DOMError`)}function fl(e){return ll(e,`DOMException`)}function pl(e){return ll(e,`String`)}function ml(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function hl(e){return e===null||ml(e)||typeof e!=`object`&&typeof e!=`function`}function gl(e){return ll(e,`Object`)}function _l(e){return typeof Event<`u`&&Sl(e,Event)}function vl(e){return typeof Element<`u`&&Sl(e,Element)}function yl(e){return ll(e,`RegExp`)}function bl(e){return!!(e?.then&&typeof e.then==`function`)}function xl(e){return gl(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function Sl(e,t){try{return e instanceof t}catch{return!1}}function Cl(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function wl(e){return typeof Request<`u`&&Sl(e,Request)}var Tl=G,El=80;function Dl(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||El;for(;n&&i++<5&&(o=Ol(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function Ol(e,t){let n=e,r=[];if(!n?.tagName)return``;if(Tl.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;
3if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&pl(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function kl(){try{return Tl.document.location.href}catch{return``}}function Al(e){if(!Tl.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function jl(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Nl(i,r);try{e[t]=i}catch{}}function Ml(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{}}function Nl(e,t){try{e.prototype=t.prototype=t.prototype||{},Ml(e,`__sentry_original__`,t)}catch{}}function Pl(e){return e.__sentry_original__}function Fl(e){if(cl(e))return{message:e.message,name:e.name,stack:e.stack,...Ll(e)};if(_l(e)){let t={type:e.type,target:Il(e.target),currentTarget:Il(e.currentTarget),...Ll(e)};return typeof CustomEvent<`u`&&Sl(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Il(e){try{return vl(e)?Dl(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Ll(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function Rl(e){let t=Object.keys(Fl(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var zl;function Bl(e){if(zl!==void 0)return zl?zl(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=G;return t in n&&typeof n[t]==`function`?(zl=n[t],zl(e)):(zl=null,e())}function Vl(){return Bl(()=>Math.random())}function Hl(){return Bl(()=>Date.now())}function Ul(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Wl(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Cl(r)?n.push(Yc(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function Gl(e,t,n=!1){return pl(e)?yl(t)?t.test(e):pl(t)?n?e===t:e.includes(t):!1:!1}function Kl(e,t=[],n=!1){return t.some(t=>Gl(e,t,n))}function ql(){let e=G;return e.crypto||e.msCrypto}var Jl;function Yl(){return Vl()*16}function Xl(e=ql()){try{if(e?.randomUUID)return Bl(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Jl||=`10000000100040008000100000000000`,Jl.replace(/[018]/g,e=>(e^(Yl()&15)>>e/4).toString(16))}function Zl(e){return e.exception?.values?.[0]}function Ql(e){let{message:t,event_id:n}=e;if(t)return t;let r=Zl(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function $l(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function eu(e,t){let n=Zl(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function tu(e){if(nu(e))return!0;try{Ml(e,`__sentry_captured__`,!0)}catch{}return!1}function nu(e){try{return e.__sentry_captured__}catch{}}var ru=1e3;function iu(){return Hl()/ru}function au(){let{performance:e}=G;if(!e?.now||!e.timeOrigin)return iu;let t=e.timeOrigin;return()=>(t+Bl(()=>e.now()))/ru}var ou;function K(){return(ou??=au())()}var su=null;function cu(){let{performance:e}=G;if(!e?.now)return;let t=3e5,n=Bl(()=>e.now()),r=Hl(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function lu(){return su===null&&(su=cu()),su}function uu(e){let t=K(),n={sid:Xl(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>pu(n)};return e&&du(n,e),n}function du(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||K(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Xl()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),t
3ypeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function fu(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),du(e,n)}function pu(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function mu(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=mu(r[e],t[e],n-1));return r}function hu(){return Xl()}function gu(){return Xl().substring(16)}var _u=`_sentrySpan`;function vu(e,t){t?Ml(e,_u,t):delete e[_u]}function yu(e){return e[_u]}var bu=100,xu=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:hu(),sampleRand:Vl()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,vu(t,yu(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&du(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():gl(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,vu(this,void 0),this._attachments=[],this.setPropagationContext({traceId:hu(),sampleRand:Vl()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:bu;if(n<=0)return this;let r={timestamp:iu(),...e,message:e.message?Ul(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:yu(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=mu(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||Xl();if(!this._client)return n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||Xl();if(!this._client)return r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||Xl();return this._client&&this._client.captureEvent(e,{...t,event_id:n},this),n}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEac
3h(e=>{e(this)}),!1)}};function Su(){return Dc(`defaultCurrentScope`,()=>new xu)}function Cu(){return Dc(`defaultIsolationScope`,()=>new xu)}var wu=class{constructor(e,t){let n;n=e||new xu;let r;r=t||new xu,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return bl(n)?n.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Tu(){let e=Ec(Tc());return e.stack=e.stack||new wu(Su(),Cu())}function Eu(e){return Tu().withScope(e)}function Du(e,t){let n=Tu();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Ou(e){return Tu().withScope(()=>e(Tu().getIsolationScope()))}function ku(){return{withIsolationScope:Ou,withScope:Eu,withSetScope:Du,withSetIsolationScope:(e,t)=>Ou(t),getCurrentScope:()=>Tu().getScope(),getIsolationScope:()=>Tu().getIsolationScope()}}function Au(e){let t=Ec(e);return t.acs?t.acs:ku()}function q(){return Au(Tc()).getCurrentScope()}function ju(){return Au(Tc()).getIsolationScope()}function Mu(){return Dc(`globalScope`,()=>new xu)}function Nu(...e){let t=Au(Tc());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function J(){return q().getClient()}function Pu(e){let{traceId:t,parentSpanId:n,propagationSpanId:r}=e.getPropagationContext(),i={trace_id:t,span_id:r||gu()};return n&&(i.parent_span_id=n),i}var Fu=`sentry.source`,Iu=`sentry.sample_rate`,Lu=`sentry.previous_trace_sample_rate`,Ru=`sentry.op`,Y=`sentry.origin`,zu=`sentry.idle_span_finish_reason`,Bu=`sentry.measurement_unit`,Vu=`sentry.measurement_value`,Hu=`sentry.custom_span_name`,Uu=`sentry.profile_id`,Wu=`sentry.exclusive_time`,Gu=`sentry.link.type`,Ku=`gen_ai.conversation.id`;function qu(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function Ju(e,t){e.setAttribute(`http.response.status_code`,t);let n=qu(t);n.message!==`unknown_error`&&e.setStatus(n)}var Yu=`_sentryScope`,Xu=`_sentryIsolationScope`;function Zu(e){try{let t=G.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function Qu(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}function $u(e,t,n){e&&(Ml(e,Xu,Zu(n)),Ml(e,Yu,t))}function ed(e){let t=e;return{scope:t[Yu],isolationScope:Qu(t[Xu])}}var td=`sentry-`;function nd(e){let t=id(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function rd(e){if(e)return od(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${td}${t}`]=n),e),{}))}function id(e){if(e&&(pl(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=ad(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):ad(e)}function ad(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function od(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>
3{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?e:a},``)}var sd=/^o(\d+)\./,cd=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ld(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function ud(e){let t=cd.exec(e);if(!t){Ac(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return dd({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function dd(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function fd(e){return!0}function pd(e){return e.match(sd)?.[1]}function md(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=pd(n)),r}function hd(e){let t=typeof e==`string`?ud(e):dd(e);if(t&&fd(t))return t}function gd(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var _d=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function vd(e){if(!e)return;let t=e.match(_d);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function yd(e,t){let n=vd(e),r=nd(t);if(!n?.traceId)return{traceId:hu(),sampleRand:Vl()};let i=Sd(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function bd(e=hu(),t=gu(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function xd(e=hu(),t=gu(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Sd(e,t){let n=gd(t?.sample_rand);if(n!==void 0)return n;let r=gd(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Vl()*r:r+Vl()*(1-r):Vl()}var Cd=!1;function wd(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=X(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function Td(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:X(e).parent_span_id,a=ed(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||gu():t,trace_id:n}}function Ed(e){let{traceId:t,spanId:n}=e.spanContext();return bd(t,n,Nd(e))}function Dd(e){let{traceId:t,spanId:n}=e.spanContext();return xd(t,n,Nd(e))}function Od(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function kd(e){return typeof e==`number`?Ad(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ad(e.getTime()):K()}function Ad(e){return e>9999999999?e/1e3:e}function X(e){if(Md(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(jd(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0,start_timestamp:kd(i),timestamp:kd(o)||void 0,status:Pd(s),op:r[Ru],origin:r[Y],links:Od(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function jd(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Md(e){return typeof e.getSpanJSON==`function`}function Nd(e){let{traceFlags:t}=e.spanContext();return t===1}function Pd(e){if(e&&e.code!==0)return e.code===1?`ok`:e.message||`internal_error`}var Fd=`_sentryChildSpans`,Id=`_sentryRootSpan`;function Ld(e,t){Ml(t,Id,e[Id]||e),e[Fd]?e[Fd].add(t):Ml(e,Fd,new Set([t]))}function Rd(e,t){e[Fd]&&e[Fd].delete(t)}function zd(e){let t=new Set;function n(e){if(!t.has(e)&&Nd(e)){t.add(e);let r=e[Fd]?Array.from(e[Fd]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}function Bd(e){return e[Id]||e}function Vd(){let e=Au(Tc());return e.getActiveSpan?e.getActiveSpan():yu(q())}function Hd(){Cd||=(Ac(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}var Ud=!1;function Wd(){if(Ud)return;function e(){let e=Vd(),t=e&&Bd(e);t&&t.setStatus({code:2,message:`internal_error`})}e.tag=`sentry_tracingErrorCallback`,Ud=!0,nl(e),al(e)}function Gd(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||J()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Kd(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(Jd(n)){if(Gl(e.description,n))return!0;continue}if(!n.name&&!n.op)continue;let t=!n.name||Gl(e.description,n.name),r=!n.op||e.op&&Gl(e.op,n.op);if(t&&r)return!0}return!1}function qd(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function Jd(e){return typeof e==`string`||e instanceof RegExp}var Yd=`production`,Xd=`_frozenDsc`;function Zd(e,t){Ml(e,Xd,t)}function Qd(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:md(t)};return t.emit(`createDsc`,i),i}function $d(e,t){let n=t.getPropagationContext();return n.dsc||Qd(n.traceId,e)}function ef(e){let t=J();if(!t)return{};let n=Bd(e),r=X(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[Xd];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&nd(l);if(u)return s(u);let d=Qd(e.spanContext().traceId,t),f=i[Fu],p=r.description;return f!==`url`&&p&&(d.transaction=p),Gd()&&(d.sampled=String(Nd(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??ed(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var tf=class{constructor(e={}){this._traceId=e.traceId||hu(),this._spanId=e.spanId||gu()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}
3addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function nf(e,t=100,n=1/0){try{return af(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function rf(e,t=3,n=102400){let r=nf(e,t);return lf(r)>n?rf(e,t-1,n):r}function af(e,t,n=1/0,r=1/0,i=uf()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=of(e,t);if(!s.startsWith(`[object `))return s;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(c===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let l=t;if(l&&typeof l.toJSON==`function`)try{return af(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=Fl(t);for(let e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(d>=r){u[e]=`[MaxProperties ~]`;break}let t=f[e];u[e]=af(e,t,c-1,r,i),d++}return o(t),u}function of(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Cl(t))return Yc(t);if(xl(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${qc(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=sf(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function sf(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function cf(e){return~-encodeURI(e).split(/%..|./).length}function lf(e){return cf(JSON.stringify(e))}function uf(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function df(e,t=[]){return[e,t]}function ff(e,t){let[n,r]=e;return[n,[...r,t]]}function pf(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function mf(e,t){return pf(e,(e,n)=>t.includes(n))}function hf(e){let t=Ec(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function gf(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[hf(r),e]:r.push(typeof e==`string`?hf(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(nf(n))}i(e)}}return typeof r==`string`?r:_f(r)}function _f(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function vf(e){return[{type:`span`},e]}function yf(e){let t=typeof e.data==`string`?hf(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var bf={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function xf(e){return e in bf}function Sf(e){return xf(e)?bf[e]:e}function Cf(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function wf(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ld(r)},...i&&{trace:i}}}function Tf(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Ef(e,t,n,r){let i=Cf(n);return df({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:ld(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Df(e,t,n,r){let i=Cf(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Tf(e,n?.sdk);let o=wf(e,i,r,t);return delete e.sdkProcessingMetadata,df(o,[[{type:a},e]])}function Of(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=ef(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:ld(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>!Kd(X(e),c)):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=X(e);return s(t)||(Hd(),t)}:X,f=[];for(let e of l){let t=d(e);t&&f.push(vf(t))}return df(o,f)}function kf(e,t,n,r=Vd()){let i=r&&Bd(r);i&&i.addEvent(e,{[Vu]:t,[Bu]:n})}function Af(e){if(!e||e.length===0)return;let t={};
3return e.forEach(e=>{let n=e.attributes||{},r=n[Bu],i=n[Vu];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}var jf=1e3,Mf=class{constructor(e={}){this._traceId=e.traceId||hu(),this._spanId=e.spanId||gu(),this._startTime=e.startTimestamp||K(),this._links=e.links,this._attributes={},this.setAttributes({[Y]:`manual`,[Ru]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=kd(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Fu,`custom`),this}end(e){this._endTime||(this._endTime=kd(e),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ru],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Pd(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Y],profile_id:this._attributes[Uu],exclusive_time:this._attributes[Wu],measurements:Af(this._events),is_segment:this._isStandaloneSpan&&Bd(this)===this||void 0,segment_id:this._isStandaloneSpan?Bd(this).spanContext().spanId:void 0,links:Od(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){let r=Nf(t)?t:n||K(),i=Nf(t)?{}:t||{},a={name:e,time:kd(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=J();if(e&&e.emit(`spanEnd`,this),!(this._isStandaloneSpan||this===Bd(this)))return;if(this._isStandaloneSpan){this._sampled?If(Of([this],e)):e&&e.recordDroppedEvent(`sample_rate`,`span`);return}let t=this._convertSpanToTransaction();t&&(ed(this).scope||q()).captureEvent(t)}_convertSpanToTransaction(){if(!Pf(X(this)))return;this._name||=`<unlabeled transaction>`;let{scope:e,isolationScope:t}=ed(this),n=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let r=zd(this).filter(e=>e!==this&&!Ff(e)).map(e=>X(e)).filter(Pf),i=this._attributes[Fu];delete this._attributes[Hu],r.forEach(e=>{delete e.data[Hu]});let a={contexts:{trace:wd(this)},spans:r.length>jf?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,jf):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:ef(this)},request:n,...i&&{transaction_info:{source:i}}},o=Af(this._events);return o&&Object.keys(o).length&&(a.measurements=o),a}};function Nf(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function Pf(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Ff(e){return e instanceof Mf&&e.isStandaloneSpan()}function If(e){let t=J();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function Lf(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return Rf(i,t,n,r)}function Rf(e,t,n,r){return bl(e)?e.then(e=>(n(),r(e),e),e=>{throw t(e),n(),e}):(n(),r(e),e)}function zf(e,t,n){if(!Gd(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=gd(i);return a===void 0?[!1]:a?[n<a,a,r]:[!1,a,r]}var Bf=`__SENTRY_SUPPRESS_TRACING__`;function Vf(e,t){let n=Kf();if(n.startSpan)return n.startSpan(e,t);let r=Gf(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return Nu(s,()=>Xf(a)(()=>
3{let n=q(),o=Yf(n,a),s=e.onlyIfParent&&!o?new tf:Wf({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return vu(n,s),Lf(()=>t(s),()=>{let{status:e}=X(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})},()=>{s.end()})}))}function Hf(e){let t=Kf();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Gf(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>Nu(e.scope,t):i===void 0?e=>e():e=>Uf(i,e))(()=>{let t=q(),a=Yf(t,i);return e.onlyIfParent&&!a?new tf:Wf({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function Uf(e,t){let n=Kf();return n.withActiveSpan?n.withActiveSpan(e,t):Nu(n=>(vu(n,e||void 0),t(n)))}function Wf({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Gd()){let r=new tf;return(n||!e)&&Zd(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...ef(r)}),r}let i=ju(),a;if(e&&!n)a=Jf(e,r,t),Ld(e,a);else if(e){let n=ef(e),{traceId:i,spanId:o}=e.spanContext(),s=Nd(e);a=qf({traceId:i,parentSpanId:o,...t},r,s),Zd(a,n)}else{let{traceId:e,dsc:n,parentSpanId:o,sampled:s}={...i.getPropagationContext(),...r.getPropagationContext()};a=qf({traceId:e,parentSpanId:o,...t},r,s),n&&Zd(a,n)}return $u(a,r,i),a}function Gf(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=kd(e.startTime),delete n.startTime,n}return t}function Kf(){return Au(Tc())}function qf(e,t,n){let r=J(),i=r?.getOptions()||{},{name:a=``}=e,o={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};r?.emit(`beforeSampling`,o,{decision:!1});let s=o.parentSampled??n,c=o.spanAttributes,l=t.getPropagationContext(),[u,d,f]=t.getScopeData().sdkProcessingMetadata[Bf]?[!1]:zf(i,{name:a,parentSampled:s,attributes:c,parentSampleRate:gd(l.dsc?.sample_rate)},l.sampleRand),p=new Mf({...e,attributes:{[Fu]:`custom`,[Iu]:d!==void 0&&f?d:void 0,...c},sampled:u});return!u&&r&&r.recordDroppedEvent(`sample_rate`,`transaction`),r&&r.emit(`spanStart`,p),p}function Jf(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=!t.getScopeData().sdkProcessingMetadata[Bf]&&Nd(e),o=a?new Mf({...n,parentSpanId:r,traceId:i,sampled:a}):new tf({traceId:i});Ld(e,o);let s=J();return s&&(s.emit(`spanStart`,o),n.endTimestamp&&s.emit(`spanEnd`,o)),o}function Yf(e,t){if(t)return t;if(t===null)return;let n=yu(e);if(!n)return;let r=J();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Bd(n):n}function Xf(e){return e===void 0?e=>e():t=>Uf(e,t)}var Zf={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Qf=`heartbeatFailed`,$f=`idleTimeout`,ep=`finalTimeout`,tp=`externalFinish`;function np(e,t={}){let n=new Map,r=!1,i,a=tp,o=!t.disableAutoFinish,s=[],{idleTimeout:c=Zf.idleTimeout,finalTimeout:l=Zf.finalTimeout,childSpanTimeout:u=Zf.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=J();if(!p||!Gd()){let e=new tf;return Zd(e,{sample_rate:`0`,sampled:`false`,...ef(e)}),e}let m=q(),h=Vd(),g=rp(e);g.end=new Proxy(g.end,{apply(e,t,n){if(d&&d(g),t instanceof tf)return;let[r,...i]=n,a=kd(r||K()),o=zd(g).filter(e=>e!==g),s=X(g);if(!o.length||!f)return S(a),Reflect.apply(e,t,[a,...i]);let c=p.getOptions().ignoreSpans,u=o?.reduce((e,t)=>{let n=X(t);return!n.timestamp||c&&Kd(n,c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),m=s.start_timestamp,h=Math.min(m?m+l/1e3:1/0,Math.max(m||-1/0,Math.min(a,u||1/0)));return S(h),Reflect.apply(e,t,[h,...i])}});function _(){i&&=(clearTimeout(i),void 0)}function v(e){_(),i=setTimeout(()=>{!r&&n.size===0&&o&&(a=$f,g.end(e))},c)}function y(e){i=setTimeout(()=>{!r&&o&&(a=Qf,g.end(e))},u)}function b(e){_(),n.set(e,!0),y(K()+u/1e3)}function x(e){n.has(e)&&n.delete(e),n.size===0&&v(K()+c/1e3)}function S(e){r=!0,n.clear(),s.forEach(e=>e()),vu(m,h);let t=X(g),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||g.setAttribute(zu,a);let o=t.status;(!o||o===`unknown`)&&g.setStatus({code:1}),Rc.log(`[Tracing] Idle span "${t.op}" finished`);let u=zd(g).filter(e=>e!==g),d=0;u.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e));let{timestamp:n=0,start_timestamp:r=0}=X(t),i=r<=e,a=(l+c)/1e3;(!(n-r<=a)||!i)&&(Rd(g,t),d++)}),d>0&&g.setAttribute(`sentry.idle_span_discarded_spans`,d)}return s.push(p.on(`spanStart`,e=>{r||e===g||X(e).timestamp||e instanceof Mf&&e.isStandaloneSpan()||zd(g).includes(e)&&b(e.spanContext().spanId)})),s.push(p.on(`spanEnd`,e=>{r||x(e.spanContext().spanId)})),s.push(p.on(`idleSpanEnableAutoFinish`,e=>{e===g&&(o=!0,v(),n.size&&y())})),t.disableAutoFinish||v(),setTimeout(()=>{r||(g.setStatus({code:2,message:`deadline_exceeded`}),a=ep,g.end())},l),g}function rp(e){let t=Hf(e);return vu(q(),t),t}var ip=0,ap=1,op=2;function sp(e){return new lp(t=>{t(e)})}function cp(e){return new lp((t,n)=>{n(e)})}var lp=class e{constructor(e){this._state=ip,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>
3{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===ip)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===ap&&e[1](this._value),this._state===op&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===ip){if(bl(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(ap,e)},r=e=>{t(op,e)};try{e(n,r)}catch(e){r(e)}}};function up(e,t,n,r=0){try{let i=dp(t,n,e,r);return bl(i)?i:sp(i)}catch(e){return cp(e)}}function dp(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return bl(a)?a.then(e=>dp(e,t,n,r+1)):dp(a,t,n,r+1)}var fp,pp,mp,hp;function gp(e){let t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(hp&&r.length===pp&&i.length===mp)return hp;pp=r.length,mp=i.length,hp={},fp||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=fp?.[r];if(i&&hp&&t)hp[i[0]]=t,fp&&(fp[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&hp&&fp){hp[i]=t,fp[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),hp}function _p(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;xp(e,t),r&&wp(e,r),Tp(e,n),Sp(e,i),Cp(e,a)}function vp(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;yp(e,`extra`,n),yp(e,`tags`,r),yp(e,`attributes`,i),yp(e,`user`,a),yp(e,`contexts`,o),e.sdkProcessingMetadata=mu(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function yp(e,t,n){e[t]=mu(e[t],n,1)}function bp(e,t){let n=Mu().getScopeData();return e&&vp(n,e.getScopeData()),t&&vp(n,t.getScopeData()),n}function xp(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Sp(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Cp(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function wp(e,t){e.contexts={trace:Td(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ef(t),...e.sdkProcessingMetadata};let n=X(Bd(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function Tp(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Ep(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Xl(),timestamp:t.timestamp||iu()},l=n.integrations||e.integrations.map(e=>e.name);Dp(c,e),Ap(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Op(c,e.stackParser);let u=Mp(r,n.captureContext);n.mechanism&&eu(c,n.mechanism);let d=i?i.getEventProcessors():[],f=bp(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),_p(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?sp(c):up(m,c,n)).then(e=>(e&&kp(e),typeof o==`number`&&o>0?jp(e,o,s):e))}function Dp(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=Ul(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=Ul(e.value,a)})}function Op(e,t){let n=gp(t);
3e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function kp(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Ap(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function jp(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:nf(e.data,t,n)}}))},...e.user&&{user:nf(e.user,t,n)},...e.contexts&&{contexts:nf(e.contexts,t,n)},...e.extra&&{extra:nf(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=nf(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:nf(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=nf(e.contexts.flags,3,n)),r}function Mp(e,t){if(!t)return e;let n=e?e.clone():new xu;return n.update(t),n}function Np(e){if(e)return Pp(e)||Ip(e)?{captureContext:e}:e}function Pp(e){return e instanceof xu||typeof e==`function`}var Fp=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Ip(e){return Object.keys(e).some(e=>Fp.includes(e))}function Lp(e,t){return q().captureException(e,Np(t))}function Rp(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return q().captureMessage(e,n,r)}function zp(e,t){return q().captureEvent(e,t)}function Bp(e,t){ju().setTag(e,t)}function Vp(e){ju().setUser(e)}function Hp(){let e=J();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Up(e){let t=ju(),{user:n}=bp(t,q()),{userAgent:r}=G.navigator||{},i=uu({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&du(a,{status:`exited`}),Wp(),t.setSession(i),i}function Wp(){let e=ju(),t=q().getSession()||e.getSession();t&&fu(t),Gp(),e.setSession()}function Gp(){let e=ju(),t=J(),n=e.getSession();n&&t&&t.captureSession(n)}function Kp(e=!1){if(e){Wp();return}Gp()}var qp=`7`;function Jp(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Yp(e){return`${Jp(e)}${e.projectId}/envelope/`}function Xp(e,t){let n={sentry_version:qp};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Zp(e,t,n){return t||`${Yp(e)}?${Xp(e,n)}`}var Qp=[];function $p(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function em(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return $p(r)}function tm(e,t){let n={};return t.forEach(t=>{t&&rm(e,t,n)}),n}function nm(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function rm(e,t,n){if(!n[t.name]){if(n[t.name]=t,!Qp.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),Qp.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}}}function im(e){return e}function am(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function om(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=ld(r)),df(i,[am(e)])}function sm(e,t){let n=t??cm(e)??[];if(n.length===0)return;let r=e.getOptions(),i=om(n,r._metadata,r.tunnel,e.getDsn());lm().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function cm(e){return lm().get(e)}function lm(){return Dc(`clientToLogBufferMap`,()=>new WeakMap)}function um(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function dm(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=ld(r)),df(i,[um(e)])}function fm(e,t){let n=t??pm(e)??[];if(n.length===0)return;let r=e.getOptions(),i=dm(n,r._metadata,r.tunnel,e.getDsn());mm().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function pm(e){return mm().get(e)}function mm(){return Dc(`clientToMetricBufferMap`,()=>new WeakMap)}function hm(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}var gm=Symbol.for(`SentryBufferFullError`);function _m(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return cp(gm);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return sp(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>hm(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var vm=6e4;function ym(e,t=Hl()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?vm:r-t}function bm(e,t){return e[t]||e.all||0}function xm(e,t,n=Hl()){return bm(e,t)>n}function Sm(e,{statusCode:t,headers:n},r=Hl()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+ym(o,r):t===429&&(i.all=r+6e4);return i}function Cm(e,t,n=_m(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(pf(i,(t,n)=>{let i=Sf(n);xm(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=df(i[0],a),s=t=>{mf(o,[`client_report`])||pf(o,(n,r)=>{e.recordDroppedEvent(t,Sf(r))})};return n.add(()=>t({body:gf(o)}).then(e=>e.statusCode===413?(s(`send_error`),e):(r=Sm(r,e),e),e=>{throw s(`network_error`),e})).then(e=>e,e=>
3{if(e===gm)return s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function wm(e,t,n){let r=[{type:`client_report`},{timestamp:n||iu(),discarded_events:e}];return df(t?{dsn:t}:{},[r])}function Tm(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Em(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[Uu],exclusive_time:o?.[Wu],measurements:e.measurements,is_segment:!0}}function Dm(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var Om=Symbol.for(`SentryInternalError`),km=Symbol.for(`SentryDoNotSendEventError`),Am=5e3;function jm(e){return{message:e,[Om]:!0}}function Mm(e){return{message:e,[km]:!0}}function Nm(e){return!!e&&typeof e==`object`&&Om in e}function Pm(e){return!!e&&typeof e==`object`&&km in e}function Fm(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=hm(setTimeout(()=>{i(e)},Am)))}),e.on(`flush`,()=>{i(e)})}var Im=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=_m(e.transportOptions?.bufferSize??64),e.dsn&&(this._dsn=hd(e.dsn)),this._dsn){let t=Zp(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Fm(this,`afterCaptureLog`,`flushLogs`,Um,sm),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Fm(this,`afterCaptureMetric`,`flushMetrics`,Hm,fm)}captureException(e,t,n){let r=Xl();if(tu(e))return r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:Xl(),...n},a=ml(e)?e:String(e),o=hl(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=Xl();if(t?.originalException&&tu(t.originalException))return r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=Lm(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),du(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(!t)return!0;this.emit(`flush`);let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){sm(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];rm(this,e,this._integrations),t||nm(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Df(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=ff(n,yf(e));this.sendEnvelope(n).then(t=>
3this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=Yd}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t)return;r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return;e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=Ef(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch{return{}}return{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=tm(this,e),nm(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(du(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Ep(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...Pu(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:$d(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=q(),r=ju()){return this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=Vm(e),s=Bm(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:gd(a);if(s&&typeof l==`number`&&Vl()>
3l)return this.recordDroppedEvent(`sample_rate`,`error`),cp(Mm(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=Lm(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),Mm("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:Rm(zm(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw Mm(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw Pm(e)||Nm(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),jm(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===gm&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0||!this._dsn)return;let t=wm(e,this._options.tunnel&&ld(this._dsn));this.sendEnvelope(t)}};function Lm(e){return e===`replay_event`?`replay`:e||`error`}function Rm(e,t){let n=`${t} must return \`null\` or a valid event.`;if(bl(e))return e.then(e=>{if(!gl(e)&&e!==null)throw jm(n);return e},e=>{throw jm(`${t} rejected with ${e}`)});if(!gl(e)&&e!==null)throw jm(n);return e}function zm(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t,c=n;if(Bm(c)&&i)return i(c,r);if(Vm(c)){if(o||s){let t=Em(c);if(s?.length&&Kd(t,s))return null;if(o){let e=o(t);e?c=mu(n,Dm(e)):Hd()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(s?.length&&Kd(e,s)){qd(n,e);continue}if(o){let n=o(e);n?t.push(n):(Hd(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function Bm(e){return e.type===void 0}function Vm(e){return e.type===`transaction`}function Hm(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Wm(e.attributes)}function Um(e){let t=0;return e.message&&(t+=e.message.length*2),t+Wm(e.attributes)}function Wm(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Gm(e[0]):hl(e)?t+=Gm(e):t+=100}),t}function Gm(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function Km(e){return cl(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function qm(e){return Km(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Jm(e,t){t.debug===!0&&Ac(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")}),q().update(t.initialScope);let n=new e(t);return Ym(n),n.init(),n}function Ym(e){q().setClient(e)}var Xm=`thismessage:/`;function Zm(e){return`isRelative`in e}function Qm(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?Xm:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function $m(e){if(Zm(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function eh(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function th(e){return e.split(/[?#]/,1)[0]}function nh(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function rh(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function ih(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:wc})),i.version=wc)}function ah(e={}){let t=e.client||J();if(!Hp()||!t)return{};let n=Au(Tc());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||q(),i=e.span||Vd(),a=i?Ed(i):oh(r),o=rd(i?ef(i):$d(t,r));if(!_d.test(a))return Rc.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?Dd(i):sh(r)),s}function oh(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return bd(t,r,n)}function sh(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return xd(t,r,n)}var ch=100;function lh(e,t){let n=J(),r=ju();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=ch}=n.getOptions();if(a<=0)return;let o={timestamp:iu(),...e},s=i?Ac(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var uh,dh=`FunctionToString`,fh=new WeakMap,ph=im((()=>({name:dh,setupOnce(){uh=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Pl(this),n=fh.has(J())&&t!==void 0?t:this;return uh.apply(n,e)}}catch{}},setup(e){fh.set(e,!0)}}))),mh=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],hh=`EventFilters`,gh=im((e={})=>{let t;return{name:hh,setup(n){t=vh(e,n.getOptions())},processEvent(n,r,i){return t||=vh(e,i.getOptions()),yh(n,t)?null:n}}}),_h=im(((e={})=>({...gh(e),name:`InboundFilters`})));function vh(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:mh],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function yh(e,t){if(!e.type){if(bh(e,t.ignoreErrors)||Eh(e)||Sh(e,t.denyUrls)||!Ch(e,t.allowUrls))return!0}else if(e.type===`transaction`&&xh(e,t.ignoreTransactions))return!0;return!1}function bh(e,t){return t?.length?Tm(e).some(e=>Kl(e,t)):!1}function xh(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Kl(n,t):!1}function Sh(e,t){if(!t?.length)return!1;let n=Th(e);return n?Kl(n,t):!1}function Ch(e,t){if(!t?.length)return!0;let n=Th(e);return!n||Kl(n,t)}function wh(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function Th(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?wh(t):null}catch{return null}}function Eh(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function Dh(e,t,n,r,i,a){if(!i.exception?.values||!a||!Sl(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=Oh(e,t,r,a.originalException,n,i.exception.values,o,0))}
3function Oh(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Sl(r[i],Error)){Ah(o,s,r);let a=e(t,r[i]),l=c.length;jh(a,i,l,s),c=Oh(e,t,n,r[i],i,[a,...c],a,l)}return kh(r)&&r.errors.forEach((a,l)=>{if(Sl(a,Error)){Ah(o,s,r);let u=e(t,a),d=c.length;jh(u,`errors[${l}]`,d,s),c=Oh(e,t,n,a,i,[u,...c],u,d)}}),c}function kh(e){return Array.isArray(e.errors)}function Ah(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...kh(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function jh(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Mh(e){let t=`console`;Qc(t,e),$c(t,Nh)}function Nh(){`console`in G&&Oc.forEach(function(e){e in G.console&&jl(G.console,e,function(t){return kc[e]=t,function(...t){el(`console`,{args:t,level:e}),kc[e]?.apply(G.console,t)}})})}function Ph(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var Fh=`Dedupe`,Ih=im((()=>{let e;return{name:Fh,processEvent(t){if(t.type)return t;try{if(Lh(t,e))return null}catch{}return e=t}}}));function Lh(e,t){return t?!!(Rh(e,t)||zh(e,t)):!1}function Rh(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Vh(e,t)||!Bh(e,t))}function zh(e,t){let n=Hh(t),r=Hh(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Vh(e,t)||!Bh(e,t))}function Bh(e,t){let n=Jc(e),r=Jc(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Vh(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Hh(e){return e.exception?.values?.[0]}var Uh=`ConversationId`,Wh=im((()=>({name:Uh,setup(e){e.on(`spanStart`,e=>{let t=q().getScopeData(),n=ju().getScopeData(),r=t.conversationId||n.conversationId;r&&e.setAttribute(Ku,r)})}})));function Gh(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=Gd()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(Jh(n,e),Kh(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=!!Vd(),d=s&&u?Hf(Zh(o,a,c)):new tf;if(e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=qh(t,n,Gd()&&u?d:void 0,l);r&&(e.args[1]=n,n.headers=r)}let f=J();if(f){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit(`beforeOutgoingRequestSpan`,d,t)}return d}function Kh(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function qh(e,t,n,r){let i=ah({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(wl(e)?e.headers:void 0);if(!c)return{...i};if(Xh(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?Yh(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}if(Array.isArray(c)){let e=[...c];c.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!c.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&Yh(e[1]));return o&&!t&&e.push([`baggage`,o]),e}{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>Yh(e)):Yh(n));o&&!l&&i.push(o);let u={...c,"sentry-trace":e??a,baggage:i.length>0?i.join(`,`):void 0};return r&&s&&!t&&(u.traceparent=s),u}}function Jh(e,t){if(t.response){Ju(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function Yh(e){return e.split(`,`).some(e=>e.trim().startsWith(td))}function Xh(e){return typeof Headers<`u`&&Sl(e,Headers)}function Zh(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${nh(e)}`,attributes:Qh(e,void 0,t,n)};let r=Qm(e);return{name:`${t} ${r?$m(r):e}`,attributes:Qh(e,r,t,n)}}function Qh(e,t,n,r){let i={url:nh(e),type:`fetch`,"http.method":n,[Y]:r,[Ru]:`http.client`};return t&&(Zm(t)||(i[`http.url`]=nh(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function $h(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var eg=G;function tg(){return`history`in eg&&!!eg.history}function ng(){if(!(`fetch`in eg))return!1;
3try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function rg(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ig(){if(typeof EdgeRuntime==`string`)return!0;if(!ng())return!1;if(rg(eg.fetch))return!0;let e=!1,t=eg.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=rg(n.contentWindow.fetch)),t.head.removeChild(n)}catch{}return e}function ag(e,t){let n=`fetch`;Qc(n,e),$c(n,()=>sg(void 0,t))}function og(e){let t=`fetch-body-resolved`;Qc(t,e),$c(t,()=>sg(lg))}function sg(e,t=!1){(!t||ig())&&jl(G,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=fg(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:K()*1e3,virtualError:r,headers:pg(n)};return e||el(`fetch`,{...o}),t.apply(G,n).then(async t=>(e?e(t):el(`fetch`,{...o,endTimestamp:K()*1e3,response:t}),t),e=>{el(`fetch`,{...o,endTimestamp:K()*1e3,error:e}),cl(e)&&e.stack===void 0&&(e.stack=r.stack,Ml(e,`framesToPop`,1));let t=J()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:Ml(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function cg(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function lg(e){let t;try{t=e.clone()}catch{return}cg(t,()=>{el(`fetch-body-resolved`,{endTimestamp:K()*1e3,response:e})})}function ug(e,t){return!!e&&typeof e==`object`&&!!e[t]}function dg(e){return typeof e==`string`?e:e?ug(e,`url`)?e.url:e.toString?e.toString():``:``}function fg(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:dg(t),method:ug(n,`method`)?String(n.method).toUpperCase():wl(t)&&ug(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:dg(t),method:ug(t,`method`)?String(t.method).toUpperCase():`GET`}}function pg(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(wl(t))return new Headers(t.headers)}catch{}}function mg(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function hg(){return`npm`}function gg(){return!mg()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function _g(){return typeof window<`u`&&(!gg()||vg())}function vg(){return G.process?.type===`renderer`}var Z=G,yg=0;function bg(){return yg>0}function xg(){yg++,setTimeout(()=>{yg--})}function Sg(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(Pl(e))return e}catch{return e}let r=function(...n){try{let r=n.map(e=>Sg(e,t));return e.apply(this,r)}catch(e){throw xg(),Nu(r=>{r.addEventProcessor(e=>(t.mechanism&&($l(e,void 0,void 0),eu(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),Lp(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Nl(r,e),Ml(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Cg(){let e=kl(),{referrer:t}=Z.document||{},{userAgent:n}=Z.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function wg(e,t){let n=Dg(e,t),r={type:Mg(t),value:Ng(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function Tg(e,t,n,r){let i=J()?.getOptions().normalizeDepth,a=Bg(t),o={__serialized__:rf(t,i)};if(a)return{exception:{values:[wg(e,a)]},extra:o};let s={exception:{values:[{type:_l(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:Rg(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=Dg(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function Eg(e,t){return{exception:{values:[wg(e,t)]}}}function Dg(e,t){let n=t.stacktrace||t.stack||``,r=kg(t),i=Ag(t);try{return e(n,r,i)}catch{}return[]}var Og=/Minified React error #\d+;/i;function kg(e){return e&&Og.test(e.message)?1:0}function Ag(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function jg(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function Mg(e){let t=e?.name;return!t&&jg(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function Ng(e){let t=e?.message;return jg(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?qm(t.error):qm(e):`No error message`}function Pg(e,t,n,r){let i=Ig(e,t,n?.syntheticException||void 0,r);
3return eu(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),sp(i)}function Fg(e,t,n=`info`,r,i){let a=Lg(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),sp(a)}function Ig(e,t,n,r,i){let a;if(ul(t)&&t.error)return Eg(e,t.error);if(dl(t)||fl(t)){let i=t;if(`stack`in t)a=Eg(e,t);else{let t=i.name||(dl(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=Lg(e,o,n,r),$l(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return cl(t)?Eg(e,t):gl(t)||_l(t)?(a=Tg(e,t,n,i),eu(a,{synthetic:!0}),a):(a=Lg(e,t,n,r),$l(a,`${t}`,void 0),eu(a,{synthetic:!0}),a)}function Lg(e,t,n,r){let i={};if(r&&n){let r=Dg(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),eu(i,{synthetic:!0})}if(ml(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Rg(e,{isUnhandledRejection:t}){let n=Rl(e),r=t?`promise rejection`:`exception`;return ul(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:_l(e)?`Event \`${zg(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function zg(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Bg(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}var Vg=class extends Im{constructor(e){let t=Hg(e);ih(t,`browser`,[`browser`],Z.SENTRY_SDK_SOURCE||hg()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?`auto`:`never`,...t._metadata.sdk.settings}),super(t);let{sendDefaultPii:n,sendClientReports:r,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;Z.document&&(r||i||s)&&Z.document.addEventListener(`visibilitychange`,()=>{Z.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),i&&sm(this),s&&fm(this))}),n&&this.on(`beforeSendSession`,rh)}eventFromException(e,t){return Pg(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return Fg(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function Hg(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:Z.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Q=G,Ug=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,Wg=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Ug(t.value,n),e(t)))}},Gg=(e=!0)=>{let t=Q.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Kg=()=>Gg()?.activationStart??0;function qg(e,t,n){Q.document&&Q.addEventListener(e,t,n)}function Jg(e,t,n){Q.document&&Q.removeEventListener(e,t,n)}var Yg=-1,Xg=new Set,Zg=()=>Q.document?.visibilityState===`hidden`&&!Q.document?.prerendering?0:1/0,Qg=e=>{if(e_(e)&&Yg>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of Xg)e();isFinite(Yg)||(Yg=e.type===`visibilitychange`?e.timeStamp:0,Jg(`prerenderingchange`,Qg,!0))}},$g=()=>{if(Q.document&&Yg<0){let e=Kg();Yg=(Q.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??Zg(),qg(`visibilitychange`,Qg,!0),qg(`pagehide`,Qg,!0),qg(`prerenderingchange`,Qg,!0)}return{get firstHiddenTime(){return Yg},onHidden(e){Xg.add(e)}}};function e_(e){return e.type===`pagehide`||Q.document?.visibilityState===`hidden`}var t_=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+0xe8d4a51000}`,n_=(e,t=-1)=>{let n=Gg(),r=`navigate`;return n&&(Q.document?.prerendering||Kg()>0?r=`prerender`:Q.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:t_(),navigationType:r}},r_=new WeakMap;function i_(e,t){try{return r_.get(e)||r_.set(e,new t),r_.get(e)}catch{return new t}}var a_=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},o_=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},s_=e=>{let t=!1;return()=>{t||=(e(),!0)}},c_=e=>{Q.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},l_=[1800,3e3],u_=(e,t={})=>{c_(()=>{let n=$g(),r=n_(`FCP`),i,a=o_(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Kg(),0),r.entries.push(t),i(!0)))});a&&(i=Wg(e,r,l_,t.reportAllChanges))})},d_=[.1,.25],f_=(e,t={})=>{u_(s_(()=>{let n=n_(`CLS`,0),r,i=$g(),a=i_(t,a_),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>
3n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=o_(`layout-shift`,o);s&&(r=Wg(e,n,d_,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),Q?.setTimeout?.(r))}))},p_=0,m_=1/0,h_=0,g_=e=>{e.forEach(e=>{e.interactionId&&(m_=Math.min(m_,e.interactionId),h_=Math.max(h_,e.interactionId),p_=h_?(h_-m_)/7+1:0)})},__,v_=()=>__?p_:performance.interactionCount||0,y_=()=>{`interactionCount`in performance||__||(__=o_(`event`,g_,{type:`event`,buffered:!0,durationThreshold:0}))},b_=10,x_=0,S_=()=>v_()-x_,C_=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){x_=v_(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(S_()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<b_||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>b_){let e=this._longestInteractionList.splice(b_);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},w_=e=>{let t=Q.requestIdleCallback||Q.setTimeout;Q.document?.visibilityState===`hidden`?e():(e=s_(e),qg(`visibilitychange`,e,{once:!0,capture:!0}),qg(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),Jg(`visibilitychange`,e,{capture:!0}),Jg(`pagehide`,e,{capture:!0})}))},T_=[200,500],E_=40,D_=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=$g();c_(()=>{y_();let r=n_(`INP`),i,a=i_(t,C_),o=e=>{w_(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=o_(`event`,o,{durationThreshold:t.durationThreshold??E_});i=Wg(e,r,T_,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},O_=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},k_=[2500,4e3],A_=(e,t={})=>{c_(()=>{let n=$g(),r=n_(`LCP`),i,a=i_(t,O_),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Kg(),0),r.entries=[t],i())},s=o_(`largest-contentful-paint`,o);if(s){i=Wg(e,r,k_,t.reportAllChanges);let n=s_(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(w_(n),Jg(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])qg(e,a,{capture:!0})}})},j_=[800,1800],M_=e=>{Q.document?.prerendering?c_(()=>M_(e)):Q.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>M_(e),!0)},N_=(e,t={})=>{let n=n_(`TTFB`),r=Wg(e,n,j_,t.reportAllChanges);M_(()=>{let e=Gg();e&&(n.value=Math.max(e.responseStart-Kg(),0),n.entries=[e],r(!0))})},P_={},F_={},I_,L_,R_,z_;function B_(e,t=!1){return X_(`cls`,e,K_,I_,t)}function V_(e,t=!1){return X_(`lcp`,e,q_,L_,t)}function H_(e){return X_(`ttfb`,e,J_,R_)}function U_(e){return X_(`inp`,e,Y_,z_)}function W_(e,t){return Q_(e,t),F_[e]||(Z_(e),F_[e]=!0),$_(e,t)}function G_(e,t){let n=P_[e];if(n?.length)for(let e of n)try{e(t)}catch{}}function K_(){return f_(e=>{G_(`cls`,{metric:e}),I_=e},{reportAllChanges:!0})}function q_(){return A_(e=>{G_(`lcp`,{metric:e}),L_=e},{reportAllChanges:!0})}function J_(){return N_(e=>{G_(`ttfb`,{metric:e}),R_=e})}function Y_(){return D_(e=>{G_(`inp`,{metric:e}),z_=e})}function X_(e,t,n,r,i=!1){Q_(e,t);let a;return F_[e]||(a=n(),F_[e]=!0),r&&t({metric:r}),$_(e,t,i?a:void 0)}function Z_(e){let t={};e===`event`&&(t.durationThreshold=0),o_(e,t=>{G_(e,{entries:t})},t)}function Q_(e,t){P_[e]=P_[e]||[],P_[e].push(t)}function $_(e,t,n){return()=>{n&&n();let r=P_[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function ev(e){return`duration`in e}var tv=e=>{let t=t=>{(t.type===`pagehide`||Q.document?.visibilityState===`hidden`)&&e(t)};qg(`visibilitychange`,t,{capture:!0,once:!0}),qg(`pagehide`,t,{capture:!0,once:!0})};function nv(e){return typeof e==`number`&&isFinite(e)}function rv(e,t,n,{...r}){let i=X(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),Uf(e,()=>{let e=Hf({startTime:t,...r});return e&&e.end(n),e})}function iv(e){let t=J();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s,sendDefaultPii:c}=t.getOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=q(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return Hf({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":Q.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function av(){return Q.addEventListener&&Q.performance}function $(e){return e/1e3}function ov(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}
3return r===e&&(t=r),{name:t,version:n}}function sv(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function cv(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n),r=!0}tv(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e.spanContext().spanId,o()})}function lv(e){let t=0,n;if(!sv(`layout-shift`))return;let r=B_(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);cv(e,(e,i)=>{uv(t,n,i,e),r()})}function uv(e,t,n,r){let i=t?$((lu()||0)+t.startTime):K(),a=q().getScopeData().transactionName,o=t?Dl(t.sources[0]?.node):`Layout shift`,s={[Y]:`auto.http.browser.cls`,[Ru]:`ui.webvital.cls`,[Wu]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=Dl(e.node)});let c=iv({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[Bu]:``,[Vu]:e}),c.end(i))}function dv(e){let t=0,n;if(!sv(`largest-contentful-paint`))return;let r=V_(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);cv(e,(e,i)=>{fv(t,n,i,e),r()})}function fv(e,t,n,r){let i=$((lu()||0)+(t?.startTime||0)),a=q().getScopeData().transactionName,o=t?Dl(t.element):`Largest contentful paint`,s={[Y]:`auto.http.browser.lcp`,[Ru]:`ui.webvital.lcp`,[Wu]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=Dl(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=iv({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[Bu]:`millisecond`,[Vu]:e}),c.end(i))}function pv(e){return e&&((lu()||performance.timeOrigin)+e)/1e3}function mv(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=ov(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return lu()||av()?.timeOrigin?hv({...t,"http.request.redirect_start":pv(e.redirectStart),"http.request.redirect_end":pv(e.redirectEnd),"http.request.worker_start":pv(e.workerStart),"http.request.fetch_start":pv(e.fetchStart),"http.request.domain_lookup_start":pv(e.domainLookupStart),"http.request.domain_lookup_end":pv(e.domainLookupEnd),"http.request.connect_start":pv(e.connectStart),"http.request.secure_connection_start":pv(e.secureConnectionStart),"http.request.connection_end":pv(e.connectEnd),"http.request.request_start":pv(e.requestStart),"http.request.response_start":pv(e.responseStart),"http.request.response_end":pv(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function hv(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var gv=2147483647,_v=0,vv={},yv,bv;function xv({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=av();if(r&&lu()){r.mark&&Q.performance.mark(`sentry-tracing-init`);let i=t?dv(n):Ev(),a=Dv(),o=e?lv(n):Tv();return()=>{i?.(),a(),o?.()}}return()=>void 0}function Sv(){W_(`longtask`,({entries:e})=>{let t=Vd();if(!t)return;let{op:n,start_timestamp:r}=X(t);for(let i of e){let e=$(lu()+i.startTime),a=$(i.duration);n===`navigation`&&r&&e<r||rv(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[Y]:`auto.ui.browser.metrics`}})}})}function Cv(){new PerformanceObserver(e=>{let t=Vd();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=$(lu()+n.startTime),{start_timestamp:r,op:i}=X(t);if(i===`navigation`&&r&&e<r)continue;let a=$(n.duration),o={[Y]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),rv(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function wv(){W_(`event`,({entries:e})=>{let t=Vd();if(t){for(let n of e)if(n.name===`click`){let e=$(lu()+n.startTime),r=$(n.duration),i={name:Dl(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[Y]:`auto.ui.browser.metrics`}},a=Al(n.target);a&&(i.attributes[`ui.component_name`]=a),rv(t,e,e+r,i)}}})}function Tv(){return B_(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(vv.cls={value:e.value,unit:``},bv=t)},!0)}function Ev(){return V_(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(vv.lcp={value:e.value,unit:`millisecond`},yv=t)},!0)}function Dv(){return H_(({metric:e})=>{e.entries[e.entries.length-1]&&(vv.ttfb={value:e.value,unit:`millisecond`})})}
3function Ov(e,t){let n=av(),r=lu();if(!n?.getEntries||!r)return;let i=$(r),a=n.getEntries(),{op:o,start_timestamp:s}=X(e);a.slice(_v).forEach(n=>{let r=$(n.startTime),a=$(Math.max(0,n.duration));if(!(o===`navigation`&&s&&i+r<s))switch(n.entryType){case`navigation`:Mv(e,n,i);break;case`mark`:case`paint`:case`measure`:{Av(e,n,r,a,i,t.ignorePerformanceApiSpans);let o=$g(),s=n.startTime<o.firstHiddenTime;n.name===`first-paint`&&s&&(vv.fp={value:n.startTime,unit:`millisecond`}),n.name===`first-contentful-paint`&&s&&(vv.fcp={value:n.startTime,unit:`millisecond`});break}case`resource`:Iv(e,n,n.name,r,a,i,t.ignoreResourceSpans)}}),_v=Math.max(a.length-1,0),Lv(e),o===`pageload`&&(Bv(vv),t.recordClsOnPageloadSpan||delete vv.cls,t.recordLcpOnPageloadSpan||delete vv.lcp,Object.entries(vv).forEach(([e,t])=>{kf(e,t.value,t.unit)}),e.setAttribute(`performance.timeOrigin`,i),e.setAttribute(`performance.activationStart`,Kg()),Rv(e,t)),yv=void 0,bv=void 0,vv={}}function kv(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function Av(e,t,n,r,i,a){if(kv(t)||[`mark`,`measure`].includes(t.entryType)&&Kl(t.name,a))return;let o=Gg(!1),s=$(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[Y]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),jv(d,t),c<=u&&rv(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function jv(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&hl(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(hl(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function Mv(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{Nv(e,t,r,n)}),Nv(e,t,`secureConnection`,n,`TLS/SSL`),Nv(e,t,`fetch`,n,`cache`),Nv(e,t,`domainLookup`,n,`DNS`),Fv(e,t,n)}function Nv(e,t,n,r,i=n){let a=t[Pv(n)],o=t[`${n}Start`];o&&a&&rv(e,r+$(o),r+$(a),{op:`browser.${i}`,name:t.name,attributes:{[Y]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Pv(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function Fv(e,t,n){let r=n+$(t.requestStart),i=n+$(t.responseEnd),a=n+$(t.responseStart);t.responseEnd&&(rv(e,r,i,{op:`browser.request`,name:t.name,attributes:{[Y]:`auto.ui.browser.metrics`}}),rv(e,a,i,{op:`browser.response`,name:t.name,attributes:{[Y]:`auto.ui.browser.metrics`}}))}function Iv(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[Y]:`auto.resource.browser.metrics`},l=eh(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(Q.location.origin),zv(t,c,[[`responseStatus`,`http.response.status_code`],[`transferSize`,`http.response_transfer_size`],[`encodedBodySize`,`http.response_content_length`],[`decodedBodySize`,`http.decoded_response_content_length`],[`renderBlockingStatus`,`resource.render_blocking_status`],[`deliveryType`,`http.response_delivery_type`]]);let u={...c,...mv(t)},d=a+r;rv(e,d,d+i,{name:n.replace(Q.location.origin,``),op:s,attributes:u})}function Lv(e){let t=Q.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setAttribute(`effectiveConnectionType`,n.effectiveType),n.type&&e.setAttribute(`connectionType`,n.type),nv(n.rtt)&&(vv[`connection.rtt`]={value:n.rtt,unit:`millisecond`})),nv(t.deviceMemory)&&e.setAttribute(`deviceMemory`,`${t.deviceMemory} GB`),nv(t.hardwareConcurrency)&&e.setAttribute(`hardwareConcurrency`,String(t.hardwareConcurrency))}function Rv(e,t){yv&&t.recordLcpOnPageloadSpan&&(yv.element&&e.setAttribute(`lcp.element`,Dl(yv.element)),yv.id&&e.setAttribute(`lcp.id`,yv.id),yv.url&&e.setAttribute(`lcp.url`,yv.url.trim().slice(0,200)),yv.loadTime!=null&&e.setAttribute(`lcp.loadTime`,yv.loadTime),yv.renderTime!=null&&e.setAttribute(`lcp.renderTime`,yv.renderTime),e.setAttribute(`lcp.size`,yv.size)),bv?.sources&&t.recordClsOnPageloadSpan&&bv.sources.forEac
3h((t,n)=>e.setAttribute(`cls.source.${n+1}`,Dl(t.node)))}function zv(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<gv||typeof i==`string`)&&(t[r]=i)})}function Bv(e){let t=Gg(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}function Vv(){return av()&&lu()?W_(`element`,Hv):()=>void 0}var Hv=({entries:e})=>{let t=Vd(),n=t?Bd(t):void 0,r=n?X(n).description:q().getScopeData().transactionName;e.forEach(e=>{let t=e;if(!t.identifier)return;let n=t.name,i=t.renderTime,a=t.loadTime,[o,s]=a?[$(a),`load-time`]:i?[$(i),`render-time`]:[K(),`entry-emission`],c=n===`image-paint`?$(Math.max(0,(i??0)-(a??0))):0,l={[Y]:`auto.ui.browser.elementtiming`,[Ru]:`ui.elementtiming`,[Fu]:`component`,"sentry.span_start_time_source":s,"sentry.transaction_name":r,"element.id":t.id,"element.type":t.element?.tagName?.toLowerCase()||`unknown`,"element.size":t.naturalWidth&&t.naturalHeight?`${t.naturalWidth}x${t.naturalHeight}`:void 0,"element.render_time":i,"element.load_time":a,"element.url":t.url||void 0,"element.identifier":t.identifier,"element.paint_type":n};Vf({name:`element[${t.identifier}]`,attributes:l,startTime:o,onlyIfParent:!0},e=>{e.end(o+c)})})},Uv=1e3,Wv,Gv,Kv;function qv(e){Qc(`dom`,e),$c(`dom`,Jv)}function Jv(){if(!Q.document)return;let e=el.bind(null,`dom`),t=Zv(e,!0);Q.document.addEventListener(`click`,t,!1),Q.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Q[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(jl(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=Zv(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),jl(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Yv(e){if(e.type!==Gv)return!1;try{if(!e.target||e.target._sentryId!==Kv)return!1}catch{}return!0}function Xv(e,t){return e===`keypress`?!t?.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function Zv(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Qv(n);if(Xv(n.type,r))return;Ml(n,`_sentryCaptured`,!0),r&&!r._sentryId&&Ml(r,`_sentryId`,Xl());let i=n.type===`keypress`?`input`:n.type;Yv(n)||(e({event:n,name:i,global:t}),Gv=n.type,Kv=r?r._sentryId:void 0),clearTimeout(Wv),Wv=Q.setTimeout(()=>{Kv=void 0,Gv=void 0},Uv)}}function Qv(e){try{return e.target}catch{return null}}var $v;function ey(e){let t=`history`;Qc(t,e),$c(t,ty)}function ty(){if(Q.addEventListener(`popstate`,()=>{let e=Q.location.href,t=$v;$v=e,t!==e&&el(`history`,{from:t,to:e})}),!tg())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=$v,i=ny(String(n));if($v=i,r===i)return e.apply(this,t);el(`history`,{from:r,to:i})}return e.apply(this,t)}}jl(Q.history,`pushState`,e),jl(Q.history,`replaceState`,e)}function ny(e){try{return new URL(e,Q.location.origin).toString()}catch{return e}}var ry={};function iy(e){let t=ry[e];if(t)return t;let n=Q[e];if(rg(n))return ry[e]=n.bind(Q);let r=Q.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch{}return n&&(ry[e]=n.bind(Q))}function ay(e){ry[e]=void 0}var oy=`__sentry_xhr_v3__`;function sy(e){Qc(`xhr`,e),$c(`xhr`,cy)}function cy(){if(!Q.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=K()*1e3,a=pl(n[0])?n[0].toUpperCase():void 0,o=ly(n[1]);if(!a||!o)return e.apply(t,n);t[oy]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[oy];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}el(`xhr`,{endTimestamp:K()*1e3,startTimestamp:i,xhr:t,virtualError:r})}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[oy];return a&&pl(r)&&pl(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[oy];return r?(n[0]!==void 0&&(r.body=n[0]),el(`xhr`,{startTimestamp:K()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function ly(e){if(pl(e))return e;try{return e.toString()}catch{}}function uy(e){let t;try{t=e.getAllResponseHeaders()}catch{return{}}return t?t.split(`\r
4`).reduce((e,t)=>
4{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}var dy=[],fy=new Map,py=new Map,my=60;function hy(){if(av()&&lu()){let e=_y();return()=>{e()}}return()=>void 0}var gy={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function _y(){return U_(vy)}var vy=({metric:e})=>{if(e.value==null)return;let t=$(e.value);if(t>my)return;let n=e.entries.find(t=>t.duration===e.value&&gy[t.name]);if(!n)return;let{interactionId:r}=n,i=gy[n.name],a=$(lu()+n.startTime),o=Vd(),s=o?Bd(o):void 0,c=r==null?void 0:fy.get(r),l=c?.span||s,u=l?X(l).description:q().getScopeData().transactionName,d=iv({name:c?.elementName||Dl(n.target),transaction:u,attributes:{[Y]:`auto.http.browser.inp`,[Ru]:`ui.interaction.${i}`,[Wu]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[Bu]:`millisecond`,[Vu]:e.value}),d.end(a+t))};function yy(){let e=Object.keys(gy);_g()&&e.forEach(e=>{Q.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=Dl(t),r=Math.round(e.timeStamp);if(py.set(r,n),py.size>50){let e=py.keys().next().value;e!==void 0&&py.delete(e)}}function n(e){let t=Math.round(e.startTime),n=py.get(t);if(!n)for(let e=-5;e<=5;e++){let r=py.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=Vd(),r=t&&Bd(t);e.forEach(e=>{if(!ev(e))return;let t=e.interactionId;if(t==null||fy.has(t))return;let i=e.target?Dl(e.target):n(e);if(dy.length>10){let e=dy.shift();fy.delete(e)}dy.push(t),fy.set(t,{span:r,elementName:i})})};W_(`event`,r),W_(`first-input`,r)}var by=40;function xy(e,t=iy(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw ay(`fetch`),e}finally{n-=a,r--}}return Cm(e,i,_m(e.bufferSize||by))}var Sy=30,Cy=50;function wy(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var Ty=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ey=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Dy=/\((\S*)(?::(\d+))(?::(\d+))\)/,Oy=/at (.+?) ?\(data:(.+?),/,ky=[Sy,e=>{let t=e.match(Oy);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=Ty.exec(e);if(n){let[,e,t,r]=n;return wy(e,`?`,+t,+r)}let r=Ey.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=Dy.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Ny(r[1]||`?`,r[2]);return wy(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Ay=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jy=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,My=Hc(ky,[Cy,e=>{let t=Ay.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=jy.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=Ny(n,e),wy(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Ny=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Py=1024,Fy=`Breadcrumbs`,Iy=im(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Fy,setup(e){t.console&&Mh(zy(e)),t.dom&&qv(Ry(e,t.dom)),t.xhr&&sy(By(e)),t.fetch&&ag(Vy(e)),t.history&&ey(Hy(e)),t.sentry&&e.on(`beforeSendEvent`,Ly(e))}}}));function Ly(e){return function(t){J()===e&&lh({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:Ql(t)},{event:t})}}function Ry(e,t){return function(n){if(J()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>Py&&(o=Py),typeof a==`string`&&(a=[a]);try{let e=n.event,t=Uy(e)?e.target:e;r=Dl(t,{keyAttrs:a,maxStringLength:o}),i=Al(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};
4i&&(s.data={"ui.component_name":i}),lh(s,{event:n.event,name:n.name,global:n.global})}}function zy(e){return function(t){if(J()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:Ph(t.level),message:Wl(t.args,` `)};if(t.level===`assert`){if(t.args[0]===!1)n.message=`Assertion failed: ${Wl(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return}lh(n,{input:t.args,level:t.level})}}function By(e){return function(t){if(J()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[oy];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:$h(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),lh(d,u)}}function Vy(e){return function(t){if(J()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`)){if(t.fetchData.method,t.fetchData.url,t.error){let i=t.fetchData,a={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},o={category:`fetch`,data:i,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,o,a),lh(o,a)}else{let i=t.response,a={...t.fetchData,status_code:i?.status};t.fetchData.request_body_size,t.fetchData.response_body_size,i?.status;let o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:$h(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),lh(s,o)}}}}function Hy(e){return function(t){if(J()!==e)return;let n=t.from,r=t.to,i=eh(Z.location.href),a=n?eh(n):void 0,o=eh(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),lh({category:`navigation`,data:{from:n,to:r}})}}function Uy(e){return!!e&&!!e.target}var Wy=`EventTarget.Window.Node.ApplicationCache.AudioTrackList.BroadcastChannel.ChannelMergerNode.CryptoOperation.EventSource.FileReader.HTMLUnknownElement.IDBDatabase.IDBRequest.IDBTransaction.KeyOperation.MediaController.MessagePort.ModalWindow.Notification.SVGElementInstance.Screen.SharedWorker.TextTrack.TextTrackCue.TextTrackList.WebSocket.WebSocketWorker.Worker.XMLHttpRequest.XMLHttpRequestEventTarget.XMLHttpRequestUpload`.split(`.`),Gy=`BrowserApiErrors`,Ky=im(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Gy,setupOnce(){t.setTimeout&&jl(Z,`setTimeout`,qy),t.setInterval&&jl(Z,`setInterval`,qy),t.requestAnimationFrame&&jl(Z,`requestAnimationFrame`,Jy),t.XMLHttpRequest&&`XMLHttpRequest`in Z&&jl(XMLHttpRequest.prototype,`send`,Yy);let e=t.eventTarget;e&&(Array.isArray(e)?e:Wy).forEach(e=>Xy(e,t))}}}));function qy(e){return function(...t){let n=t[0];return t[0]=Sg(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${qc(e)}`}}),e.apply(this,t)}}function Jy(e){return function(t){return e.apply(this,[Sg(t,{mechanism:{data:{handler:qc(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function Yy(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&jl(n,e,function(t){let n={mechanism:{data:{handler:qc(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Pl(t);return r&&(n.mechanism.data.handler=qc(r)),Sg(t,n)})}),e.apply(this,t)}}function Xy(e,t){let n=Z[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(jl(n,`addEventListener`,function(n){return function(r,i,a){try{Zy(i)&&(i.handleEvent=Sg(i.handleEvent,{mechanism:{data:{handler:qc(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&Qy(this,r,i),n.apply(this,[r,Sg(i,{mechanism:{data:{handler:qc(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),jl(n,`removeEventListener`,function(e){return function(t,n,r){try{let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch{}return e.call(this,t,n,r)}}))}function Zy(e){return typeof e.handleEvent==`function`}function Qy(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var $y=im((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(Z.document===void 0)return;Up({ignoreDuration:!0}),Kp();let e=ju(),n=e.getUser();e.addScopeListener(e=>{let t=e.getUser();
4(n?.id!==t?.id||n?.ip_address!==t?.ip_address)&&(Kp(),n=t)}),t===`route`&&ey(({from:e,to:t})=>{e!==t&&(Up({ignoreDuration:!0}),Kp())})}}}),eb=`CultureContext`,tb=im((()=>({name:eb,preprocessEvent(e){let t=nb();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})));function nb(){try{let e=Z.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var rb=`GlobalHandlers`,ib=im(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:rb,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&ab(e),t.onunhandledrejection&&ob(e)}}}));function ab(e){nl(t=>{let{stackParser:n,attachStacktrace:r}=ub();if(J()!==e||bg())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=lb(Ig(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,zp(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function ob(e){al(t=>{let{stackParser:n,attachStacktrace:r}=ub();if(J()!==e||bg())return;let i=sb(t),a=hl(i)?cb(i):Ig(n,i,void 0,r,!0);a.level=`error`,zp(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function sb(e){if(hl(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function cb(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function lb(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[],l=r,u=n,d=db(t)??kl();return c.length===0&&c.push({colno:l,filename:d,function:`?`,in_app:!0,lineno:u}),e}function ub(){return J()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function db(e){if(pl(e)&&e.length!==0)return e.startsWith(`data:`)?`<${nh(e,!1)}>`:e}var fb=im(()=>({name:`HttpContext`,preprocessEvent(e){if(!Z.navigator&&!Z.location&&!Z.document)return;let t=Cg(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}})),pb=`cause`,mb=5,hb=`LinkedErrors`,gb=im(((e={})=>{let t=e.limit||mb,n=e.key||pb;return{name:hb,preprocessEvent(e,r,i){Dh(wg,i.getOptions().stackParser,n,t,e,r)}}}));function _b(){return!!vb()}function vb(){if(Z.window===void 0)return!1;let e=Z;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=kl();return!(Z===Z.top&&[`chrome-extension`,`moz-extension`,`ms-browser-extension`,`safari-web-extension`].some(e=>
4t.startsWith(`${e}://`)))}function yb(e){return[_h(),ph(),Wh(),Ky(),Iy(),ib(),gb(),Ih(),fb(),tb(),$y()]}function bb(e={}){let t=!e.skipBrowserExtensionCheck&&_b(),n=e.defaultIntegrations==null?yb():e.defaultIntegrations;return Jm(Vg,{...e,enabled:!t&&e.enabled,stackParser:Uc(e.stackParser||My),integrations:em({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||xy})}function xb(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function Sb(e){try{return new URL(e,Z.location.origin).href}catch{return}}function Cb(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function wb(e){try{return new Headers(e)}catch{return}}var Tb=new WeakMap,Eb=new Map,Db={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Ob(e,t){let{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:o,tracePropagationTargets:s,onRequestSpanStart:c,onRequestSpanEnd:l}={...Db,...t},u=typeof a==`function`?a:e=>!0,d=e=>Ab(e,s),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(e=>(e.type===`transaction`&&e.spans&&e.spans.forEach(e=>{if(e.op===`http.client`){let t=Eb.get(e.span_id);t&&(e.timestamp=t/1e3,Eb.delete(e.span_id))}}),e)),i&&og(e=>{if(e.response){let t=Tb.get(e.response);t&&e.endTimestamp&&Eb.set(t,e.endTimestamp)}}),ag(e=>{let t=Gh(e,u,d,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(e.response&&e.fetchData.__span&&Tb.set(e.response,e.fetchData.__span),t){let n=Sb(e.fetchData.url),r=n?eh(n).host:void 0;t.setAttributes({"http.url":n?nh(n):void 0,"server.address":r}),o&&kb(t),c?.(t,{headers:e.headers})}})),r&&sy(e=>{let t=jb(e,u,d,f,p,l);t&&(o&&kb(t),c?.(t,{headers:wb(e.xhr.__sentry_xhr_v3__?.request_headers)}))})}function kb(e){let{url:t}=X(e).data;if(!t||typeof t!=`string`)return;let n=W_(`resource`,({entries:r})=>{r.forEach(r=>{Cb(r)&&r.name.endsWith(t)&&(e.setAttributes(mv(r)),setTimeout(n))})})}function Ab(e,t){let n=kl();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?Kl(r.toString(),t)||a&&Kl(r.pathname,t):a}{let n=!!e.match(/^\/(?!\/)/);return t?Kl(e,t):n}}function jb(e,t,n,r,i,a){let o=e.xhr,s=o?.[oy];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=Gd()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(Ju(n,s.status_code),n.end(),a?.(n,{headers:wb(uy(o)),error:e.error})),delete r[t]);return}let d=Sb(c),f=eh(d||c),p=nh(th(c)),m=!!Vd(),h=u&&m?Hf({name:`${l} ${p}`,attributes:{url:nh(c),type:`xhr`,"http.method":l,"http.url":d?nh(d):void 0,"server.address":f?.host,[Y]:`auto.http.browser`,[Ru]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new tf;o.__sentry_xhr_span_id__=h.spanContext().spanId,r[o.__sentry_xhr_span_id__]=h,n(c)&&Mb(o,Gd()&&m?h:void 0,i);let g=J();return g&&g.emit(`beforeOutgoingRequestSpan`,h,e),h}function Mb(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=ah({span:t,propagateTraceparent:n});r&&Nb(e,r,i,a)}function Nb(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!i?.[`sentry-trace`]&&e.setRequestHeader)try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!xb(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}function Pb(){Z.document&&Z.document.addEventListener(`visibilitychange`,()=>{let e=Vd();if(!e)return;let t=Bd(e);if(Z.document.hidden&&t){let{op:e,status:n}=X(t);n||t.setStatus({code:2,message:`cancelled`}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}})}var Fb=`sentry_previous_trace`,Ib=`sentry.previous_trace`;function Lb(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?Bb():void 0;e.on(`spanStart`,e=>{if(Bd(e)!==e)return;let t=q().getPropagationContext();i=Rb(i,e,t),r&&zb(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=q(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(Vb(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=Vb(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[Lu]:i.sampleRate}})}function Rb(e,t,n){let r=X(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[`sentry.sample_rate`])}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(t.addLink({context:o,attributes:{[Gu]:`previous_trace`}}),t.setAttribute(Ib,`${o.traceId}-${o.spanId}-${+!!Vb(o)}`)),a)}function zb(e){try{Z.sessionStorage.setItem(Fb,JSON.stringify(e))}catch{}}function Bb(){try{let e=Z.sessionStorage?.getItem(Fb);return JSON.parse(e)}catch{return}}function Vb(e){return e.traceFlags===1}var Hb=`BrowserTracing`,Ub=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Wb(){let e=Z.navigator;return e?.userAgent?Ub.test(e.userAgent):!1}var Gb={...Zf,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroun
4dSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Db},Kb=((e={})=>{let t={name:void 0,source:void 0},n=Z.document,{enableInp:r,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:o,_experiments:{enableInteractions:s,enableStandaloneClsSpans:c,enableStandaloneLcpSpans:l},beforeStartSpan:u,idleTimeout:d,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:m,traceFetch:h,traceXHR:g,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:v,enableHTTPTimings:y,ignoreResourceSpans:b,ignorePerformanceApiSpans:x,instrumentPageLoad:S,instrumentNavigation:C,detectRedirects:w,linkPreviousTrace:ee,consistentTraceSampling:T,enableReportPageLoaded:te,onRequestSpanStart:ne,onRequestSpanEnd:re}={...Gb,...e},ie=Wb(),ae,oe,E;function D(e,r,i=!0){let a=r.op===`pageload`,o=r.name,s=u?u(r):r,m=s.attributes||{};if(o!==s.name&&(m[Fu]=`custom`,s.attributes=m),!i){let e=iu();Hf({...s,startTime:e}).end(e);return}t.name=s.name,t.source=m[Fu];let h=np(s,{idleTimeout:d,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:a,beforeSpanEnd:t=>{ae?.(),Ov(t,{recordClsOnPageloadSpan:!c,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:b,ignorePerformanceApiSpans:x}),ex(e,void 0);let n=q(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:h.spanContext().traceId,sampled:Nd(h),dsc:ef(t)}),a&&(E=void 0)},trimIdleSpanEndTimestamp:!te});a&&te&&(E=h),ex(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&e.emit(`idleSpanEnableAutoFinish`,h)}a&&!te&&n&&(n.addEventListener(`readystatechange`,()=>{g()}),g())}return{name:Hb,setup(e){if(ie)return;if(Wd(),ae=xv({recordClsStandaloneSpans:c||!1,recordLcpStandaloneSpans:l||!1,client:e}),r&&hy(),i&&Vv(),o&&G.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?Cv():a&&Sv(),s&&wv(),w&&n){let e=()=>{oe=K()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function t(){let t=$b(e);t&&!X(t).timestamp&&(t.setAttribute(zu,`cancelled`),t.end())}e.on(`startNavigationSpan`,(n,r)=>{if(J()!==e)return;if(r?.isRedirect){D(e,{op:`navigation.redirect`,...n},!1);return}oe=void 0,t(),ju().setPropagationContext({traceId:hu(),sampleRand:Math.random(),propagationSpanId:Gd()?void 0:gu()});let i=q();i.setPropagationContext({traceId:hu(),sampleRand:Math.random(),propagationSpanId:Gd()?void 0:gu()}),i.setSDKProcessingMetadata({normalizedRequest:void 0}),D(e,{op:`navigation`,...n,parentSpan:null,forceTransaction:!0})}),e.on(`startPageLoadSpan`,(n,r={})=>{if(J()!==e)return;t();let i=yd(r.sentryTrace||Yb(`sentry-trace`)||Xb(`sentry-trace`),r.baggage||Yb(`baggage`)||Xb(`baggage`)),a=q();a.setPropagationContext(i),Gd()||(a.getPropagationContext().propagationSpanId=gu()),a.setSDKProcessingMetadata({normalizedRequest:Cg()}),D(e,{op:`pageload`,...n})}),e.on(`endPageloadSpan`,()=>{te&&E&&(E.setAttribute(zu,`reportPageLoaded`),E.end())})},afterAllSetup(e){if(ie)return;let n=kl();if(ee!==`off`&&Lb(e,{linkPreviousTrace:ee,consistentTraceSampling:T}),Z.location){if(S){let t=lu();qb(e,{name:Z.location.pathname,startTime:t?t/1e3:void 0,attributes:{[Fu]:`url`,[Y]:`auto.pageload.browser`}})}C&&ey(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=Qm(t),a=$b(e),o=a&&w&&nx(a,oe);Jb(e,{name:i?.pathname||Z.location.pathname,attributes:{[Fu]:`url`,[Y]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}m&&Pb(),s&&Zb(e,d,f,p,t),r&&yy(),Ob(e,{traceFetch:h,traceXHR:g,trackFetchStreamPerformance:_,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:v,enableHTTPTimings:y,onRequestSpanStart:ne,onRequestSpanEnd:re})}}});function qb(e,t,n){e.emit(`startPageLoadSpan`,t,n),q().setTransactionName(t.name);let r=$b(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function Jb(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i}),e.emit(`startNavigationSpan`,t,{isRedirect:i});let a=q();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...Cg(),url:r}}),$b(e)}function Yb(e){return(Z.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function Xb(e){return(Z.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function Zb(e,t,n,r,i){let a=Z.document,o;a&&addEventListener(`click`,()=>{let a=$b(e);if(a){let e=X(a).op;if([`navigation`,`pageload`].includes(e))return}o&&=(o.setAttribute(zu,`interactionInterrupted`),o.end(),void 0),i.name&&(o=np({name:i.name,op:`ui.action.click`,attributes:{[Fu]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r}))},{capture:!0})}var Qb=`_sentry_idleSpan`;function $b(e){return e[Qb]}function ex(e,t){Ml(e,Qb,t)}var tx=1.5;function nx(e,t){let n=X(e),r=iu();return!(r-n.start_timestamp>tx||t&&r-t<=tx)}export{Bp as a,Rp as i,bb as n,Vp as o,Lp as r,Cc as s,Kb as t};
5//# sourceMappingURL=vendor-analytics-Cm_7XNU9.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.