signalpilot-ai-internal 0.10.0__py3-none-any.whl → 0.11.24__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. signalpilot_ai_internal/__init__.py +1 -0
  2. signalpilot_ai_internal/_version.py +1 -1
  3. signalpilot_ai_internal/cache_service.py +22 -21
  4. signalpilot_ai_internal/composio_handlers.py +224 -0
  5. signalpilot_ai_internal/composio_service.py +511 -0
  6. signalpilot_ai_internal/database_config_handlers.py +182 -0
  7. signalpilot_ai_internal/database_config_service.py +166 -0
  8. signalpilot_ai_internal/databricks_schema_service.py +907 -0
  9. signalpilot_ai_internal/file_scanner_service.py +5 -146
  10. signalpilot_ai_internal/handlers.py +388 -9
  11. signalpilot_ai_internal/integrations_config.py +256 -0
  12. signalpilot_ai_internal/log_utils.py +31 -0
  13. signalpilot_ai_internal/mcp_handlers.py +532 -0
  14. signalpilot_ai_internal/mcp_server_manager.py +298 -0
  15. signalpilot_ai_internal/mcp_service.py +1255 -0
  16. signalpilot_ai_internal/oauth_token_store.py +141 -0
  17. signalpilot_ai_internal/schema_search_config.yml +17 -11
  18. signalpilot_ai_internal/schema_search_service.py +85 -4
  19. signalpilot_ai_internal/signalpilot_home.py +961 -0
  20. signalpilot_ai_internal/snowflake_schema_service.py +2 -0
  21. signalpilot_ai_internal/test_dbt_mcp_server.py +180 -0
  22. signalpilot_ai_internal/unified_database_schema_service.py +2 -0
  23. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/schemas/signalpilot-ai-internal/package.json.orig → signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/package.json +15 -48
  24. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/package.json → signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/schemas/signalpilot-ai-internal/package.json.orig +9 -52
  25. {signalpilot_ai_internal-0.10.0.data → signalpilot_ai_internal-0.11.24.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/schemas/signalpilot-ai-internal/plugin.json +7 -1
  26. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/122.bab318d6caadb055e29c.js +1 -0
  27. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/129.868ca665e6fc225c20a0.js +1 -0
  28. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/179.fd45a2e75d471d0aa3b9.js +7 -0
  29. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/220.81105a94aa873fc51a94.js +1 -0
  30. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/262.a002dd4630d3b6404a90.js +1 -0
  31. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/353.cc6f6ecacd703bcdb468.js +1 -0
  32. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/364.817a883549d55a0e0576.js +1 -0
  33. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/384.a4daecd44f1e9364e44a.js +1 -0
  34. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/439.667225aab294fb5ed161.js +1 -0
  35. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/447.8138af2522716e5a926f.js +1 -0
  36. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/476.925c73e32f3c07448da0.js +1 -0
  37. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/477.aaa4cc9e87801fb45f5b.js +1 -0
  38. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/481.370056149a59022b700c.js +1 -0
  39. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/510.868ca665e6fc225c20a0.js +1 -0
  40. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/512.835f97f7ccfc70ff5c93.js +1 -0
  41. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/57.6c13335f73de089d6b1e.js +1 -0
  42. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/574.ad2709e91ebcac5bbe68.js +1 -0
  43. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/635.bddbab8e464fe31f0393.js +1 -0
  44. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/713.fda1bcdb10497b0a6ade.js +1 -0
  45. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/741.d046701f475fcbf6697d.js +1 -0
  46. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/785.c306dffd4cfe8a613d13.js +1 -0
  47. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/801.e39898b6f336539f228c.js +1 -0
  48. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/880.77cc0ca10a1860df1b52.js +1 -0
  49. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/936.4e2850b2af985ed0d378.js +1 -0
  50. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/956.eeffe67d7781fd63ef4b.js +2 -0
  51. signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/remoteEntry.055f50d20a31f3068c72.js +1 -0
  52. {signalpilot_ai_internal-0.10.0.data → signalpilot_ai_internal-0.11.24.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/third-party-licenses.json +47 -29
  53. {signalpilot_ai_internal-0.10.0.dist-info → signalpilot_ai_internal-0.11.24.dist-info}/METADATA +14 -31
  54. signalpilot_ai_internal-0.11.24.dist-info/RECORD +66 -0
  55. signalpilot_ai_internal-0.11.24.dist-info/licenses/LICENSE +7 -0
  56. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/122.e2dadf63dc64d7b5f1ee.js +0 -1
  57. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/220.328403b5545f268b95c6.js +0 -1
  58. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/262.726e1da31a50868cb297.js +0 -1
  59. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/330.af2e9cb5def5ae2b84d5.js +0 -1
  60. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/353.972abe1d2d66f083f9cc.js +0 -1
  61. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/364.dbec4c2dc12e7b050dcc.js +0 -1
  62. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/384.fa432bdb7fb6b1c95ad6.js +0 -1
  63. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/439.37e271d7a80336daabe2.js +0 -1
  64. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/476.ad22ccddd74ee306fb56.js +0 -1
  65. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/481.73c7a9290b7d35a8b9c1.js +0 -1
  66. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/512.b58fc0093d080b8ee61c.js +0 -1
  67. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/553.b4042a795c91d9ff71ef.js +0 -2
  68. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/57.e9acd2e1f9739037f1ab.js +0 -1
  69. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/635.9720593ee20b768da3ca.js +0 -1
  70. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/713.8e6edc9a965bdd578ca7.js +0 -1
  71. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/741.dc49867fafb03ea2ba4d.js +0 -1
  72. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/742.91e7b516c8699eea3373.js +0 -1
  73. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/785.2d75de1a8d2c3131a8db.js +0 -1
  74. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/786.770dc7bcab77e14cc135.js +0 -7
  75. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/801.ca9e114a30896b669a3c.js +0 -1
  76. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/880.25ddd15aca09421d3765.js +0 -1
  77. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/888.34054db17bcf6e87ec95.js +0 -1
  78. signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/remoteEntry.b05b2f0c9617ba28370d.js +0 -1
  79. signalpilot_ai_internal-0.10.0.dist-info/RECORD +0 -50
  80. signalpilot_ai_internal-0.10.0.dist-info/licenses/LICENSE +0 -29
  81. {signalpilot_ai_internal-0.10.0.data → signalpilot_ai_internal-0.11.24.data}/data/etc/jupyter/jupyter_server_config.d/signalpilot_ai.json +0 -0
  82. {signalpilot_ai_internal-0.10.0.data → signalpilot_ai_internal-0.11.24.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/install.json +0 -0
  83. /signalpilot_ai_internal-0.10.0.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/553.b4042a795c91d9ff71ef.js.LICENSE.txt → /signalpilot_ai_internal-0.11.24.data/data/share/jupyter/labextensions/signalpilot-ai-internal/static/956.eeffe67d7781fd63ef4b.js.LICENSE.txt +0 -0
  84. {signalpilot_ai_internal-0.10.0.data → signalpilot_ai_internal-0.11.24.data}/data/share/jupyter/labextensions/signalpilot-ai-internal/static/style.js +0 -0
  85. {signalpilot_ai_internal-0.10.0.dist-info → signalpilot_ai_internal-0.11.24.dist-info}/WHEEL +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunksignalpilot_ai_internal=self.webpackChunksignalpilot_ai_internal||[]).push([[476],{55476:(e,t,i)=>{i.r(t),i.d(t,{COPY_AUTOCAPTURE_EVENT:()=>Qt,Compression:()=>ei,DisplaySurveyType:()=>xn,PostHog:()=>_o,SurveyEventName:()=>wn,SurveyEventProperties:()=>En,SurveyPosition:()=>_n,SurveyQuestionBranchingType:()=>yn,SurveyQuestionType:()=>mn,SurveySchedule:()=>bn,SurveyType:()=>fn,SurveyWidgetType:()=>vn,default:()=>mo,posthog:()=>mo,severityLevels:()=>ti});var r="undefined"!=typeof window?window:void 0,s="undefined"!=typeof globalThis?globalThis:r,n=Array.prototype,o=n.forEach,a=n.indexOf,l=null==s?void 0:s.navigator,c=null==s?void 0:s.document,u=null==s?void 0:s.location,h=null==s?void 0:s.fetch,d=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,p=null==s?void 0:s.AbortController,g=null==l?void 0:l.userAgent,v=null!=r?r:{},_={DEBUG:!1,LIB_VERSION:"1.291.0"};function f(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,s)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){f(n,r,s,o,a,"next",e)}function a(e){f(n,r,s,o,a,"throw",e)}o(void 0)})}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},y.apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var w=["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"],E=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return w.concat(t).some(e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)})},x=["$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"];function k(e,t){return-1!==e.indexOf(t)}var S=function(e){return e.trim()},P=function(e){return e.replace(/^\$/,"")},$=Array.isArray,I=Object.prototype,F=I.hasOwnProperty,C=I.toString,O=$||function(e){return"[object Array]"===C.call(e)},T=e=>"function"==typeof e,R=e=>e===Object(e)&&!O(e),M=e=>{if(R(e)){for(var t in e)if(F.call(e,t))return!1;return!0}return!1},A=e=>void 0===e,D=e=>"[object String]"==C.call(e),L=e=>D(e)&&0===e.trim().length,N=e=>null===e,j=e=>A(e)||N(e),H=e=>"[object Number]"==C.call(e),U=e=>"[object Boolean]"===C.call(e),q=e=>k(x,e);function B(e){return null===e||"object"!=typeof e}function V(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function W(e){return!A(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var G=[!0,"true",1,"1","yes"],z=e=>k(G,e),Y=[!1,"false",0,"0","no"];function X(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),H(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(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: "+i+", fallback: "+s),X(s||i,t,i,r))}class J{constructor(e){this.t={},this.i=e.i,this.o=X(e.bucketSize,0,100,e.h),this.m=X(e.refillRate,0,this.o,e.h),this.$=X(e.refillInterval,0,864e5,e.h)}S(e,t){var i=t-e.lastAccess,r=Math.floor(i/this.$);if(r>0){var s=r*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+r*this.$}}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.t[r];return s?this.S(s,i):(s={tokens:this.o,lastAccess:i},this.t[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.i)||t.call(this,e)),0===s.tokens)}stop(){this.t={}}}var Z,K,Q,ee=e=>e instanceof Error;function te(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return Q&&i.length===K||(K=i.length,Q=i.reduce((i,r)=>{Z||(Z={});var s=Z[r];if(s)i[s[0]]=s[1];else for(var n=e(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[r];if(l&&c){i[l]=c,Z[r]=[l,c];break}}return i},{})),Q}}var ie="?";function re(e,t,i,r){var s={platform:"web:javascript",filename:e,function:"<anonymous>"===t?ie:t,in_app:!0};return A(i)||(s.lineno=i),A(r)||(s.colno=r),s}var se=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:ie,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ne=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,oe=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ae=/\((\S*)(?::(\d+))(?::(\d+))\)/,le=e=>{var t=ne.exec(e);if(t){var[,i,r,s]=t;return re(i,ie,+r,+s)}var n=oe.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=ae.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=se(n[1]||ie,n[2]);return re(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},ce=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ue=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,he=e=>{var t=ce.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=ue.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var r=t[3],s=t[1]||ie;return[s,r]=se(s,r),re(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},de=/\(error: (.*)\)/;class pe{constructor(e,t,i){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===i&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e,i){void 0===i&&(i=0);for(var r=[],s=e.split("\n"),n=i;n<s.length;n++){var o=s[n];if(!(o.length>1024)){var a=de.test(o)?o.replace(de,"$1"):o;if(!a.match(/\S*Error: /)){for(var l of t){var c=l(a);if(c){r.push(c);break}}if(r.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 y({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||ie});var i})}(r)}}(...t)}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&O(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),y({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(r=t.handled)||void 0===r||r,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:te(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(r<=4){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}class ge{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=D(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?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 V(e,"DOMException")}isDOMError(e){return V(e,"DOMError")}}class ve{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 i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class _e{constructor(){}match(e){return V(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var fe=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class me{match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(fe);return r&&(t=r[1],i=r[2]),[t,i]}}var ye=["fatal","error","warning","log","info","debug"];function be(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");if(!(s.length>t))return r===i.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class we{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return W(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+be(e)}isSeverityLevel(e){return D(e)&&!L(e)&&ye.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(ee(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Ee{match(e){return W(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+be(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class xe{match(e){return B(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class ke{match(e){return V(e,"PromiseRejectionEvent")}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return B(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){if(B(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Se=e=>{var t={k:function(t){if(r&&(_.DEBUG||v.POSTHOG_DEBUG)&&!A(r.console)&&r.console){for(var i=("__rrweb_original__"in r.console[t]?r.console[t].__rrweb_original__:r.console[t]),s=arguments.length,n=new Array(s>1?s-1:0),o=1;o<s;o++)n[o-1]=arguments[o];i(e,...n)}},info:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];t.k("log",...i)},warn:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];t.k("warn",...i)},error:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];t.k("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>Se(e+" "+t)};return t},Pe=Se("[PostHog.js]"),$e=Pe.createLogger,Ie=$e("[ExternalScriptsLoader]"),Fe=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return Ie.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==c?void 0:c.querySelectorAll("script");if(r)for(var s,n=function(){if(r[o].src===t){var e=r[o];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}},o=0;o<r.length;o++)if(s=n())return s.v;var a=()=>{if(!c)return i("document not found");var r=c.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");var s,n=c.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):c.body.appendChild(r)};null!=c&&c.body?a():null==c||c.addEventListener("DOMContentLoaded",a)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var r="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var n=e.requestRouter.endpointFor("assets",r);Fe(e,n,i)},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);Fe(e,r,i)};var Ce={};function Oe(e,t,i){if(O(e))if(o&&e.forEach===o)e.forEach(t,i);else if("length"in e&&e.length===+e.length)for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(i,e[r],r)===Ce)return}function Te(e,t,i){if(!j(e)){if(O(e))return Oe(e,t,i);if((e=>e instanceof FormData)(e)){for(var r of e.entries())if(t.call(i,r[1],r[0])===Ce)return}else for(var s in e)if(F.call(e,s)&&t.call(i,e[s],s)===Ce)return}}var Re=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Oe(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},Me=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Oe(i,function(t){Oe(t,function(t){e.push(t)})}),e};function Ae(e){for(var t=Object.keys(e),i=t.length,r=new Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var De=function(e){try{return e()}catch(e){return}},Le=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){Pe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Pe.critical(e)}}},Ne=function(e){var t={};return Te(e,function(e,i){(D(e)&&e.length>0||H(e))&&(t[i]=e)}),t},je=["herokuapp.com","vercel.app","netlify.app"];function He(e){var t=null==e?void 0:e.hostname;if(!D(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of je)if(i===r)return!1;return!0}function Ue(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function qe(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}var Be="$people_distinct_id",Ve="__alias",We="__timers",Ge="$autocapture_disabled_server_side",ze="$heatmaps_enabled_server_side",Ye="$exception_capture_enabled_server_side",Xe="$error_tracking_suppression_rules",Je="$error_tracking_capture_extension_exceptions",Ze="$web_vitals_enabled_server_side",Ke="$dead_clicks_enabled_server_side",Qe="$web_vitals_allowed_metrics",et="$session_recording_remote_config",tt="$sesid",it="$session_is_sampled",rt="$enabled_feature_flags",st="$early_access_features",nt="$feature_flag_details",ot="$stored_person_properties",at="$stored_group_properties",lt="$surveys",ct="$surveys_activated",ut="$flag_call_reported",ht="$user_state",dt="$client_session_props",pt="$capture_rate_limit",gt="$initial_campaign_params",vt="$initial_referrer_info",_t="$initial_person_info",ft="$epp",mt="__POSTHOG_TOOLBAR__",yt="$posthog_cookieless",bt=[Be,Ve,"__cmpns",We,"$session_recording_enabled_server_side",ze,tt,rt,Xe,ht,st,nt,at,ot,lt,ut,dt,pt,gt,vt,ft,_t];function wt(e){return e instanceof Element&&(e.id===mt||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Et(e){return!!e&&1===e.nodeType}function xt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function kt(e){return!!e&&3===e.nodeType}function St(e){return!!e&&11===e.nodeType}function Pt(e){return e?S(e).split(/\s+/):[]}function $t(e){var t=null==r?void 0:r.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function It(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 Pt(t)}function Ft(e){return j(e)?null:S(e).split(/(\s+)/).filter(e=>Gt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ct(e){var t="";return Nt(e)&&!jt(e)&&e.childNodes&&e.childNodes.length&&Te(e.childNodes,function(e){var i;kt(e)&&e.textContent&&(t+=null!==(i=Ft(e.textContent))&&void 0!==i?i:"")}),S(t)}function Ot(e){return A(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Tt=["a","button","form","input","select","textarea","label"];function Rt(e,t){if(A(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function Mt(e){var t=e.parentNode;return!(!t||!Et(t))&&t}var At=[".ph-no-rageclick",".ph-no-capture"],Dt=e=>!e||xt(e,"html")||!Et(e),Lt=(e,t)=>{if(!r||Dt(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!xt(n,"body");)if(St(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=Mt(n);if(!o)break;if(t||Tt.indexOf(o.tagName.toLowerCase())>-1)i=!0;else{var a=r.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}s.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:s}};function Nt(e){for(var t=e;t.parentNode&&!xt(t,"body");t=t.parentNode){var i=It(t);if(k(i,"ph-sensitive")||k(i,"ph-no-capture"))return!1}if(k(It(e),"ph-include"))return!0;var r=e.type||"";if(D(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!D(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function jt(e){return!!(xt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||xt(e,"select")||xt(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Ht="(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})",Ut=new RegExp("^(?:"+Ht+")$"),qt=new RegExp(Ht),Bt="\\d{3}-?\\d{2}-?\\d{4}",Vt=new RegExp("^("+Bt+")$"),Wt=new RegExp("("+Bt+")");function Gt(e,t){if(void 0===t&&(t=!0),j(e))return!1;if(D(e)){if(e=S(e),(t?Ut:qt).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Vt:Wt).test(e))return!1}return!0}function zt(e){var t=Ct(e);return Gt(t=(t+" "+Yt(e)).trim())?t:""}function Yt(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Te(e.childNodes,function(e){var i;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{var r=Ct(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Yt(e)).trim())}catch(e){Pe.error("[AutoCapture]",e)}}),t}function Xt(e){return function(e){var t=e.map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return Ae(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return o[Jt(t.toString())]=Jt(i.toString())}),(r+=":")+Ae(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")});return t.join(";")}(function(e){return e.map(e=>{var t,i,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:Zt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Ae(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r})}(e))}function Jt(e){return e.replace(/"|\\"/g,'\\"')}function Zt(e){var t=e.attr__class;return t?O(t)?t:Pt(t):void 0}class Kt{constructor(){this.clicks=[]}isRageClick(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var Qt="$copy_autocapture",ei=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ti=["fatal","error","warning","log","info","debug"],ii=e=>{var t=null==c?void 0:c.createElement("a");return A(t)?null:(t.href=e,t)},ri=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!O(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){Pe.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},si=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");O(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},ni=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},oi=$e("[AutoCapture]");function ai(e,t){return t.length>e?t.slice(0,e)+"...":t}function li(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Et(t));return t}class ci{constructor(e){this.P=!1,this.T=null,this.rageclicks=new Kt,this.I=!1,this.instance=e,this.R=null}get C(){var e,t,i=R(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}O(){if(this.isBrowserSupported()){if(r&&c){var e=e=>{e=e||(null==r?void 0:r.event);try{this.F(e)}catch(e){oi.error("Failed to capture event",e)}};if(qe(c,"submit",e,{capture:!0}),qe(c,"change",e,{capture:!0}),qe(c,"click",e,{capture:!0}),this.C.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event),this.F(e,Qt)};qe(c,"copy",t,{capture:!0}),qe(c,"cut",t,{capture:!0})}}}else oi.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.O(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ge]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.R=e}getElementSelectors(e){var t,i=[];return null==(t=this.R)||t.forEach(t=>{var r=null==c?void 0:c.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[Ge],r=this.T;if(N(r)&&!U(i)&&!this.instance.M())return!1;var s=null!==(t=this.T)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!s}F(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=Ot(e);kt(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&function(e,t){if(!r||Dt(e))return!1;var i,s;if(!1===(i=U(t)?!!t&&At:null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:At))return!1;var{targetElementList:n}=Lt(e,!1);return!Rt(n,i)}(s,this.instance.config.rageclick)&&this.F(e,"$rageclick");var n=t===Qt;if(s&&function(e,t,i,s,n){var o,a,l,c;if(void 0===i&&(i=void 0),!r||Dt(e))return!1;if(null!=(o=i)&&o.url_allowlist&&!$t(i.url_allowlist))return!1;if(null!=(a=i)&&a.url_ignorelist&&$t(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var u=i.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=Lt(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(A(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(d,i))return!1;if(!Rt(d,null==(c=i)?void 0:c.css_selector_allowlist))return!1;var p=r.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Tt.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.C,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var i,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!xt(h,"body");)St(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},v=!1,_=!1;if(Te(u,e=>{var t=Nt(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&Gt(v)&&v),k(It(e),"ph-no-capture")&&(_=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};Tt.indexOf(s)>-1&&!i&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=ai(1024,zt(e)):n.$el_text=ai(1024,Ct(e)));var o=It(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),Te(e.attributes,function(i){var s;if((!jt(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&Gt(i.value)&&(s=i.name,!D(s)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=Pt(o).join(" ")),n["attr__"+i.name]=ai(1024,o)}});for(var a=1,l=1,c=e;c=li(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l));var i=function(e){if(!Nt(e))return{};var t={};return Te(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&Gt(r)&&(t[i]=r)}}),t}(e);Re(g,i)}),_)return{props:{},explicitNoCapture:_};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=zt(e):p[0].$el_text=Ct(e)),v){var f,m;p[0].attr__href=v;var y=null==(f=ii(v))?void 0:f.host,b=null==r||null==(m=r.location)?void 0:m.host;y&&b&&y!==b&&(d=v)}return{props:Re({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:Xt(p)},null!=(i=p[0])&&i.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.C.element_attribute_ignorelist,elementsChainAsString:this.I});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===Qt){var c,u=Ft(null==r||null==(c=r.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return T(null==c?void 0:c.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return H(e)&&isFinite(e)&&Math.floor(e)===e});var ui="0123456789abcdef";class hi{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new hi(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+ui.charAt(this.bytes[t]>>>4)+ui.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new hi(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class di{constructor(){this.A=0,this.D=0,this.j=new vi}generate(){var e=this.generateOrAbort();if(A(e)){this.A=0;var t=this.generateOrAbort();if(A(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return hi.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var pi,gi=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};r&&!A(r.crypto)&&crypto.getRandomValues&&(gi=e=>crypto.getRandomValues(e));class vi{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(gi(this.N),this.U=0),this.N[this.U++]}}var _i=()=>fi().toString(),fi=()=>(pi||(pi=new di)).generate(),mi="",yi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,bi={H:()=>!!c,B:function(e){Pe.error("cookieStore error: "+e)},q:function(e){if(c){try{for(var t=e+"=",i=c.cookie.split(";").filter(e=>e.length),r=0;r<i.length;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},W:function(e){var t;try{t=JSON.parse(bi.q(e))||{}}catch(e){}return t},G:function(e,t,i,r,s){if(c)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=c),mi)return mi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+_i();!mi&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",mi=n)}return mi}(e);if(!i){var r=(e=>{var t=e.match(yi);return t?t[0]:""})(e);r!==i&&Pe.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(c.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+24*i*60*60*1e3),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Pe.warn("cookieStore warning: large cookie, len="+u.length),c.cookie=u,u}catch(e){return}},V:function(e,t){if(null!=c&&c.cookie)try{bi.G(e,"",-1,t)}catch(e){return}}},wi=null,Ei={H:function(){if(!N(wi))return wi;var e=!0;if(A(r))e=!1;else try{var t="__mplssupport__";Ei.G(t,"xyz"),'"xyz"'!==Ei.q(t)&&(e=!1),Ei.V(t)}catch(t){e=!1}return e||Pe.error("localStorage unsupported; falling back to cookie store"),wi=e,e},B:function(e){Pe.error("localStorage error: "+e)},q:function(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){Ei.B(e)}return null},W:function(e){try{return JSON.parse(Ei.q(e))||{}}catch(e){}return null},G:function(e,t){try{null==r||r.localStorage.setItem(e,JSON.stringify(t))}catch(e){Ei.B(e)}},V:function(e){try{null==r||r.localStorage.removeItem(e)}catch(e){Ei.B(e)}}},xi=["distinct_id",tt,it,ft,_t],ki=y({},Ei,{W:function(e){try{var t={};try{t=bi.W(e)||{}}catch(e){}var i=Re(t,JSON.parse(Ei.q(e)||"{}"));return Ei.G(e,i),i}catch(e){}return null},G:function(e,t,i,r,s,n){try{Ei.G(e,t,void 0,void 0,n);var o={};xi.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&bi.G(e,o,i,r,s,n)}catch(e){Ei.B(e)}},V:function(e,t){try{null==r||r.localStorage.removeItem(e),bi.V(e,t)}catch(e){Ei.B(e)}}}),Si={},Pi={H:function(){return!0},B:function(e){Pe.error("memoryStorage error: "+e)},q:function(e){return Si[e]||null},W:function(e){return Si[e]||null},G:function(e,t){Si[e]=t},V:function(e){delete Si[e]}},$i=null,Ii={H:function(){if(!N($i))return $i;if($i=!0,A(r))$i=!1;else try{var e="__support__";Ii.G(e,"xyz"),'"xyz"'!==Ii.q(e)&&($i=!1),Ii.V(e)}catch(e){$i=!1}return $i},B:function(e){Pe.error("sessionStorage error: ",e)},q:function(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){Ii.B(e)}return null},W:function(e){try{return JSON.parse(Ii.q(e))||null}catch(e){}return null},G:function(e,t){try{null==r||r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ii.B(e)}},V:function(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){Ii.B(e)}}},Fi=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Ci{constructor(e){this._instance=e}get C(){return this._instance.config}get consent(){return this.J()?Fi.DENIED:this.K}isOptedOut(){return"always"===this.C.cookieless_mode||this.consent===Fi.DENIED||this.consent===Fi.PENDING&&(this.C.opt_out_capturing_by_default||"on_reject"===this.C.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Fi.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.C.cookie_expiration,this.C.cross_subdomain_cookie,this.C.secure_cookie)}reset(){this.Y.V(this.X,this.C.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return z(e)?Fi.GRANTED:k(Y,e)?Fi.DENIED:Fi.PENDING}get Y(){if(!this.Z){var e=this.C.opt_out_capturing_persistence_type;this.Z="localStorage"===e?Ei:bi;var t="localStorage"===e?bi:Ei;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(z(t.q(this.X))),t.V(this.X,this.C.cross_subdomain_cookie))}return this.Z}J(){return!!this.C.respect_dnt&&!!Ue([null==l?void 0:l.doNotTrack,null==l?void 0:l.msDoNotTrack,v.doNotTrack],e=>z(e))}}var Oi=$e("[Dead Clicks]"),Ti=()=>!0,Ri=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(Ke)),r=e.instance.config.capture_dead_clicks;return U(r)?r:i};class Mi{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Ke]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?Oi.error("failed to load script",t):e()})}et(){var e;if(c){if(!this.tt&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=R(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(c),Oi.info("starting...")}}else Oi.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Oi.info("stopping..."))}}var Ai=$e("[ExceptionAutocapture]");class Di{constructor(e){var t,i,s;this.rt=()=>{var e;if(r&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.C.capture_unhandled_errors&&(this.st=t(this.captureException.bind(this))),!this.nt&&this.C.capture_unhandled_rejections&&(this.nt=i(this.captureException.bind(this))),!this.ot&&this.C.capture_console_errors&&(this.ot=s(this.captureException.bind(this)))}catch(e){Ai.error("failed to start",e),this.lt()}}},this._instance=e,this.ut=!(null==(t=this._instance.persistence)||!t.props[Ye]),this.C=this.ht(),this.dt=new J({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==s?s:10,refillInterval:1e4,h:Ai}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return R(e)?t=y({},t,e):(A(e)?this.ut:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.C.capture_console_errors||this.C.capture_unhandled_errors||this.C.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Ai.info("enabled"),this.it(this.rt))}it(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return Ai.error("failed to load script",t);e()})}lt(){var e,t,i;null==(e=this.st)||e.call(this),this.st=void 0,null==(t=this.nt)||t.call(this),this.nt=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ut=!!t||!1,this.C=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Ye]:this.ut}),this.startIfEnabled()}captureException(e){var t,i,r=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.dt.consumeRateLimit(r)?Ai.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}function Li(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);return T(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}class Ni{constructor(e){var t;this._instance=e,this.vt=(null==r||null==(t=r.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Pe.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,Pe.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(r&&r.history){var i=this;null!=(e=r.history.pushState)&&e.__posthog_wrapped__||Li(r.history,"pushState",e=>function(t,r,s){e.call(this,t,r,s),i.ft("pushState")}),null!=(t=r.history.replaceState)&&t.__posthog_wrapped__||Li(r.history,"replaceState",e=>function(t,r,s){e.call(this,t,r,s),i.ft("replaceState")}),this.gt()}}ft(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=i}catch(t){Pe.error("Error capturing "+e+" pageview",t)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};qe(r,"popstate",e),this.ct=()=>{r&&r.removeEventListener("popstate",e)}}}}var ji=$e("[SegmentIntegration]"),Hi="posthog-js";function Ui(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{var a,l,c,u,h;if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=t.exception)?void 0:a.values)||[],g=p.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(v.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(v),t}}class qi{constructor(e,t,i,r,s,n){this.name=Hi,this.setupOnce=function(o){o(Ui(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}var Bi=null!=r&&r.location?ni(r.location.hash,"__posthog")||ni(location.hash,"state"):null,Vi="_postHogToolbarParams",Wi=$e("[Toolbar]"),Gi=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Gi||{});class zi{constructor(e){this.instance=e}_t(e){v.ph_toolbar_state=e}yt(){var e;return null!==(e=v.ph_toolbar_state)&&void 0!==e?e:Gi.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!r||!c)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=Bi||ni(e.hash,"__posthog")||ni(e.hash,"state"),o=n?De(()=>JSON.parse(atob(decodeURIComponent(n))))||De(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(Vi)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}bt(e){var t=v.ph_load_toolbar||v.ph_load_editor;!j(t)&&T(t)?t(e,this.instance):Wi.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==c||!c.getElementById(mt));if(!r||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(r.localStorage.setItem(Vi,JSON.stringify(y({},s,{source:void 0}))),this.yt()===Gi.LOADED)this.bt(s);else if(this.yt()===Gi.UNINITIALIZED){var n;this._t(Gi.LOADING),null==(n=v.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return Wi.error("[Toolbar] Failed to load",e),void this._t(Gi.UNINITIALIZED);this._t(Gi.LOADED),this.bt(s)}),qe(r,"turbolinks:load",()=>{this._t(Gi.UNINITIALIZED),this.loadToolbar(s)})}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var Yi=$e("[TracingHeaders]");class Xi{constructor(e){this.xt=void 0,this.$t=void 0,this.rt=()=>{var e,t;A(this.xt)&&(null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),A(this.$t)&&(null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return Yi.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(e=this.xt)||e.call(this),null==(t=this.$t)||t.call(this),this.xt=void 0,this.$t=void 0)}}var Ji="Mobile",Zi="iOS",Ki="Android",Qi="Tablet",er=Ki+" "+Qi,tr="iPad",ir="Apple",rr=ir+" Watch",sr="Safari",nr="BlackBerry",or="Samsung",ar=or+"Browser",lr=or+" Internet",cr="Chrome",ur=cr+" OS",hr=cr+" "+Zi,dr="Internet Explorer",pr=dr+" "+Ji,gr="Opera",vr=gr+" Mini",_r="Edge",fr="Microsoft "+_r,mr="Firefox",yr=mr+" "+Zi,br="Nintendo",wr="PlayStation",Er="Xbox",xr=Ki+" "+Ji,kr=Ji+" "+sr,Sr="Windows",Pr=Sr+" Phone",$r="Nokia",Ir="Ouya",Fr="Generic",Cr=Fr+" "+Ji.toLowerCase(),Or=Fr+" "+Qi.toLowerCase(),Tr="Konqueror",Rr="(\\d+(\\.\\d+)?)",Mr=new RegExp("Version/"+Rr),Ar=new RegExp(Er,"i"),Dr=new RegExp(wr+" \\w+","i"),Lr=new RegExp(br+" \\w+","i"),Nr=new RegExp(nr+"|PlayBook|BB10","i"),jr={"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"},Hr=function(e,t){return t=t||"",k(e," OPR/")&&k(e,"Mini")?vr:k(e," OPR/")?gr:Nr.test(e)?nr:k(e,"IE"+Ji)||k(e,"WPDesktop")?pr:k(e,ar)?lr:k(e,_r)||k(e,"Edg/")?fr:k(e,"FBIOS")?"Facebook "+Ji:k(e,"UCWEB")||k(e,"UCBrowser")?"UC Browser":k(e,"CriOS")?hr:k(e,"CrMo")||k(e,cr)?cr:k(e,Ki)&&k(e,sr)?xr:k(e,"FxiOS")?yr:k(e.toLowerCase(),Tr.toLowerCase())?Tr:((e,t)=>t&&k(t,ir)||function(e){return k(e,sr)&&!k(e,cr)&&!k(e,Ki)}(e))(e,t)?k(e,Ji)?kr:sr:k(e,mr)?mr:k(e,"MSIE")||k(e,"Trident/")?dr:k(e,"Gecko")?mr:""},Ur={[pr]:[new RegExp("rv:"+Rr)],[fr]:[new RegExp(_r+"?\\/"+Rr)],[cr]:[new RegExp("("+cr+"|CrMo)\\/"+Rr)],[hr]:[new RegExp("CriOS\\/"+Rr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Rr)],[sr]:[Mr],[kr]:[Mr],[gr]:[new RegExp("(Opera|OPR)\\/"+Rr)],[mr]:[new RegExp(mr+"\\/"+Rr)],[yr]:[new RegExp("FxiOS\\/"+Rr)],[Tr]:[new RegExp("Konqueror[:/]?"+Rr,"i")],[nr]:[new RegExp(nr+" "+Rr),Mr],[xr]:[new RegExp("android\\s"+Rr,"i")],[lr]:[new RegExp(ar+"\\/"+Rr)],[dr]:[new RegExp("(rv:|MSIE )"+Rr)],Mozilla:[new RegExp("rv:"+Rr)]},qr=function(e,t){var i=Hr(e,t),r=Ur[i];if(A(r))return null;for(var s=0;s<r.length;s++){var n=r[s],o=e.match(n);if(o)return parseFloat(o[o.length-2])}return null},Br=[[new RegExp(Er+"; "+Er+" (.*?)[);]","i"),e=>[Er,e&&e[1]||""]],[new RegExp(br,"i"),[br,""]],[new RegExp(wr,"i"),[wr,""]],[Nr,[nr,""]],[new RegExp(Sr,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Pr,""];if(new RegExp(Ji).test(t)&&!/IEMobile\b/.test(t))return[Sr+" "+Ji,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],s=jr[r]||"";return/arm/i.test(t)&&(s="RT"),[Sr,s]}return[Sr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Zi,t.join(".")]}return[Zi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=A(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Ki+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ki+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Ki,t.join(".")]}return[Ki,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ur,""]],[/Linux|debian/i,["Linux",""]]],Vr=function(e){return Lr.test(e)?br:Dr.test(e)?wr:Ar.test(e)?Er:new RegExp(Ir,"i").test(e)?Ir:new RegExp("("+Pr+"|WPDesktop)","i").test(e)?Pr:/iPad/.test(e)?tr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rr:Nr.test(e)?nr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp($r,"i").test(e)?$r:/(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(Ji).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)?Ki:er:Ki:new RegExp("(pda|"+Ji+")","i").test(e)?Cr:new RegExp(Qi,"i").test(e)&&!new RegExp(Qi+" pc","i").test(e)?Or:""},Wr="https?://(.*)",Gr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],zr=Me(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Gr),Yr="<masked>",Xr=["li_fat_id"];function Jr(e,t,i){if(!c)return{};var r,s=t?Me([],Gr,i||[]):[],n=Zr(si(c.URL,s,Yr),e),o=(r={},Te(Xr,function(e){var t=bi.q(e);r[e]=t||null}),r);return Re(o,n)}function Zr(e,t){var i=zr.concat(t||[]),r={};return Te(i,function(t){var i=ri(e,t);r[t]=i||null}),r}function Kr(e){var t=function(e){return e?0===e.search(Wr+"google.([^/?]*)")?"google":0===e.search(Wr+"bing.com")?"bing":0===e.search(Wr+"yahoo.com")?"yahoo":0===e.search(Wr+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",r={};if(!N(t)){r.$search_engine=t;var s=c?ri(c.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function Qr(){return navigator.language||navigator.userLanguage}function es(){return(null==c?void 0:c.referrer)||"$direct"}function ts(e,t){var i=e?Me([],Gr,t||[]):[],r=null==u?void 0:u.href.substring(0,1e3);return{r:es().substring(0,1e3),u:r?si(r,i,Yr):void 0}}function is(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ii(i))?void 0:t.host};if(r){s.$current_url=r;var n=ii(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=Zr(r);Re(s,o)}if(i){var a=Kr(i);Re(s,a)}return s}function rs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function ss(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function ns(e,t){if(!g)return{};var i,s,n,o=e?Me([],Gr,t||[]):[],[a,l]=function(e){for(var t=0;t<Br.length;t++){var[i,r]=Br[t],s=i.exec(e),n=s&&(T(r)?r(s,e):r);if(n)return n}return["",""]}(g);return Re(Ne({$os:a,$os_version:l,$browser:Hr(g,navigator.vendor),$device:Vr(g),$device_type:(s=g,n=Vr(s),n===tr||n===er||"Kobo"===n||"Kindle Fire"===n||n===Or?Qi:n===br||n===Er||n===wr||n===Ir?"Console":n===rr?"Wearable":n?Ji:"Desktop"),$timezone:rs(),$timezone_offset:ss()}),{$current_url:si(null==u?void 0:u.href,o,Yr),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:qr(g,navigator.vendor),$browser_language:Qr(),$browser_language_prefix:(i=Qr(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:"web",$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var os=$e("[Web Vitals]"),as=9e5;class ls{constructor(e){var t;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Et=()=>{clearTimeout(this.kt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(A(i))os.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Tt();A(r)||(j(null==e?void 0:e.name)||j(null==e?void 0:e.value)?os.error("Invalid metric received",e):this.It&&e.value>=this.It?os.error("Ignoring metric with value >= "+this.It,e):(this.N.url!==r&&(this.Et(),this.kt=setTimeout(this.Et,this.flushToCaptureTimeoutMs)),A(this.N.url)&&(this.N.url=r),this.N.firstMetricTimestamp=A(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.N.metrics.push(y({},e,{$current_url:r,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Et()))}},this.rt=()=>{var e,t,i,r,s=v.__PosthogExtensions__;A(s)||A(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.Pt.bind(this)),this.P=!0):os.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.St=!(null==(t=this._instance.persistence)||!t.props[Ze]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=R(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return A(i)?(null==(t=this._instance.persistence)?void 0:t.props[Qe])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(R(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get It(){var e=R(this._instance.config.capture_performance)&&H(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:as;return 0<e&&e<=6e4?as:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return os.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=R(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:U(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return U(t)?t:this.St}startIfEnabled(){this.isEnabled&&!this.P&&(os.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=R(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=R(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ze]:t}),this._instance.persistence.register({[Qe]:i})),this.St=t,this.startIfEnabled()}it(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?os.error("failed to load script",t):e()})}Tt(){var e=r?r.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,s=t?Me([],Gr,i||[]):[];return si(e,s,Yr)}os.error("Could not determine current URL")}}var cs=$e("[Heatmaps]");function us(e){return R(e)&&"clientX"in e&&"clientY"in e&&H(e.clientX)&&H(e.clientY)}class hs{constructor(e){var t;this.rageclicks=new Kt,this.St=!1,this.P=!1,this.Rt=null,this.instance=e,this.St=!(null==(t=this.instance.persistence)||!t.props[ze])}get flushIntervalMilliseconds(){var e=5e3;return R(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return A(this.instance.config.capture_heatmaps)?A(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.P)return;cs.info("starting..."),this.Ct(),this.Ot()}else{var e;clearInterval(null!==(e=this.Rt)&&void 0!==e?e:void 0),this.Ft(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ze]:t}),this.St=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Mt(e){this.At(e.originalEvent,"deadclick")}Ot(){this.Rt&&clearInterval(this.Rt),this.Rt=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(c)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ct(){r&&c&&(this.jt=this.Dt.bind(this),qe(r,"beforeunload",this.jt),this.Lt=e=>this.At(e||(null==r?void 0:r.event)),qe(c,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||(null==r?void 0:r.event)),qe(c,"mousemove",this.Nt,{capture:!0}),this.zt=new Mi(this.instance,Ti,this.Mt.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ot.bind(this),qe(c,"visibilitychange",this.Ht),this.P=!0)}Ft(){var e;r&&c&&(this.jt&&r.removeEventListener("beforeunload",this.jt),this.Lt&&c.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&c.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&c.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),null==(e=this.zt)||e.stop(),this.P=!1)}qt(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var s=e;s&&Et(s)&&!xt(s,"body");){if(s===i)return!1;if(k(t,null==r?void 0:r.getComputedStyle(s).position))return!0;s=Mt(s)}return!1}(Ot(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:i),target_fixed:o,type:t}}At(e,t){var i;if(void 0===t&&(t="click"),!wt(e.target)&&us(e)){var r=this.qt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Wt(y({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!wt(e.target)&&us(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout(()=>{this.Wt(this.qt(e,"mousemove"))},500))}Wt(e){if(r){var t=r.location.href,i=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=i?Me([],Gr,s||[]):[],o=si(t,n,Yr);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(e)}}Dt(){this.N&&!M(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class ds{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.Gt(e,t);return this.Vt={pathname:null!==(i=null==r?void 0:r.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Gt(e,null==(t=this.Vt)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Vt)?void 0:e.pageViewId}}Gt(e,t){var i=this.Vt;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=s;if(!(A(n)||A(o)||A(a)||A(l)||A(c)||A(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:X(o/n,0,1,Pe),d=n<=1?1:X(a/n,0,1,Pe),p=l<=1?1:X(c/l,0,1,Pe),g=l<=1?1:X(u/l,0,1,Pe);r=Re(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var ps=Uint8Array,gs=Uint16Array,vs=Uint32Array,_s=new ps([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]),fs=new ps([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]),ms=new ps([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ys=function(e,t){for(var i=new gs(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var s=new vs(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return[i,s]},bs=ys(_s,2),ws=bs[0],Es=bs[1];ws[28]=258,Es[258]=28;for(var xs=ys(fs,0)[1],ks=new gs(32768),Ss=0;Ss<32768;++Ss){var Ps=(43690&Ss)>>>1|(21845&Ss)<<1;Ps=(61680&(Ps=(52428&Ps)>>>2|(13107&Ps)<<2))>>>4|(3855&Ps)<<4,ks[Ss]=((65280&Ps)>>>8|(255&Ps)<<8)>>>1}var $s=function(e,t,i){for(var r=e.length,s=0,n=new gs(t);s<r;++s)++n[e[s]-1];var o,a=new gs(t);for(s=0;s<t;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new gs(1<<t);var l=15-t;for(s=0;s<r;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[ks[h]>>>l]=c}else for(o=new gs(r),s=0;s<r;++s)o[s]=ks[a[e[s]-1]++]>>>15-e[s];return o},Is=new ps(288);for(Ss=0;Ss<144;++Ss)Is[Ss]=8;for(Ss=144;Ss<256;++Ss)Is[Ss]=9;for(Ss=256;Ss<280;++Ss)Is[Ss]=7;for(Ss=280;Ss<288;++Ss)Is[Ss]=8;var Fs=new ps(32);for(Ss=0;Ss<32;++Ss)Fs[Ss]=5;var Cs=$s(Is,9,0),Os=$s(Fs,5,0),Ts=function(e){return(e/8|0)+(7&e&&1)},Rs=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof gs?gs:e instanceof vs?vs:ps)(i-t);return r.set(e.subarray(t,i)),r},Ms=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8},As=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8,e[r+2]|=i>>>16},Ds=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new ps(0),0];if(1==s){var o=new ps(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(r=1;r<s;++r)n[r].s>d&&(d=n[r].s);var p=new gs(d+1),g=Ls(i[u-1],p,0);if(g>t){r=0;var v=0,_=g-t,f=1<<_;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<s;++r){var m=n[r].s;if(!(p[m]>t))break;v+=f-(1<<g-p[m]),p[m]=t}for(v>>>=_;v>0;){var y=n[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=n[r].s;p[b]==t&&(--p[b],++v)}g=t}return[new ps(p),g]},Ls=function(e,t,i){return-1==e.s?Math.max(Ls(e.l,t,i+1),Ls(e.r,t,i+1)):t[e.s]=i},Ns=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new gs(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[i.subarray(0,r),t]},js=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},Hs=function(e,t,i){var r=i.length,s=Ts(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;n<r;++n)e[s+n+4]=i[n];return 8*(s+4+r)},Us=function(e,t,i,r,s,n,o,a,l,c,u){Ms(t,u++,i),++s[256];for(var h=Ds(s,15),d=h[0],p=h[1],g=Ds(n,15),v=g[0],_=g[1],f=Ns(d),m=f[0],y=f[1],b=Ns(v),w=b[0],E=b[1],x=new gs(19),k=0;k<m.length;++k)x[31&m[k]]++;for(k=0;k<w.length;++k)x[31&w[k]]++;for(var S=Ds(x,7),P=S[0],$=S[1],I=19;I>4&&!P[ms[I-1]];--I);var F,C,O,T,R=c+5<<3,M=js(s,Is)+js(n,Fs)+o,A=js(s,d)+js(n,v)+o+14+3*I+js(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(R<=M&&R<=A)return Hs(t,u,e.subarray(l,l+c));if(Ms(t,u,1+(A<M)),u+=2,A<M){F=$s(d,p,0),C=d,O=$s(v,_,0),T=v;var D=$s(P,$,0);for(Ms(t,u,y-257),Ms(t,u+5,E-1),Ms(t,u+10,I-4),u+=14,k=0;k<I;++k)Ms(t,u+3*k,P[ms[k]]);u+=3*I;for(var L=[m,w],N=0;N<2;++N){var j=L[N];for(k=0;k<j.length;++k){var H=31&j[k];Ms(t,u,D[H]),u+=P[H],H>15&&(Ms(t,u,j[k]>>>5&127),u+=j[k]>>>12)}}}else F=Cs,C=Is,O=Os,T=Fs;for(k=0;k<a;++k)if(r[k]>255){H=r[k]>>>18&31,As(t,u,F[H+257]),u+=C[H+257],H>7&&(Ms(t,u,r[k]>>>23&31),u+=_s[H]);var U=31&r[k];As(t,u,O[U]),u+=T[U],U>3&&(As(t,u,r[k]>>>5&8191),u+=fs[U])}else As(t,u,F[r[k]]),u+=C[r[k]];return As(t,u,F[256]),u+C[256]},qs=new vs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bs=function(){for(var e=new vs(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),Vs=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};var Ws=!!d||!!h,Gs="text/plain",zs=function(e,t,i){var r;void 0===i&&(i=!0);var[s,n]=e.split("?"),o=y({},t),a=null!==(r=null==n?void 0:n.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!==(t=o[r])&&void 0!==t?t:s;return delete o[r],r+"="+n}))&&void 0!==r?r:[],l=function(e,t){var i,r;void 0===t&&(t="&");var s=[];return Te(e,function(e,t){A(e)||A(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),s[s.length]=r+"="+i)}),s.join(t)}(o);return l&&a.push(l),s+"?"+a.join("&")},Ys=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),Xs=e=>{var{data:t,compression:i}=e;if(t){if(i===ei.GZipJS){var r=function(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p:function(t){for(var i=e,r=0;r<t.length;++r)i=Bs[255&i^t[r]]^i>>>8;e=i},d:function(){return 4294967295^e}}}(),r=e.length;i.p(e);var s,n=function(e,t,i){return function(e,t,i,r,s,n){var o=e.length,a=new ps(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=Hs(l,c,e.subarray(u,h)):(l[u]=n,c=Hs(l,c,e.subarray(u,o)))}else{for(var d=qs[t-1],p=d>>>13,g=8191&d,v=(1<<i)-1,_=new gs(32768),f=new gs(v+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&v},w=new vs(25e3),E=new gs(288),x=new gs(32),k=0,S=0,P=(u=0,0),$=0,I=0;u<o;++u){var F=b(u),C=32767&u,O=f[F];if(_[C]=O,f[F]=C,$<=u){var T=o-u;if((k>7e3||P>24576)&&T>423){c=Us(e,l,0,w,E,x,S,P,I,u-I,c),P=k=S=0,I=u;for(var R=0;R<286;++R)E[R]=0;for(R=0;R<30;++R)x[R]=0}var M=2,A=0,D=g,L=C-O&32767;if(T>2&&F==b(u-L))for(var N=Math.min(p,T)-1,j=Math.min(32767,u),H=Math.min(258,T);L<=j&&--D&&C!=O;){if(e[u+M]==e[u+M-L]){for(var U=0;U<H&&e[u+U]==e[u+U-L];++U);if(U>M){if(M=U,A=L,U>N)break;var q=Math.min(L,U-2),B=0;for(R=0;R<q;++R){var V=u-L+R+32768&32767,W=V-_[V]+32768&32767;W>B&&(B=W,O=V)}}}L+=(C=O)-(O=_[C])+32768&32767}if(A){w[P++]=268435456|Es[M]<<18|xs[A];var G=31&Es[M],z=31&xs[A];S+=_s[G]+fs[z],++E[257+G],++x[z],$=u+M,++k}else w[P++]=e[u],++E[e[u]]}}c=Us(e,l,n,w,E,x,S,P,I,u-I,c)}return Rs(a,0,r+Ts(c)+8)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,i,0,!0)}(e,t,10+((s=t).filename&&s.filename.length+1||0)),o=n.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Vs(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(n,t),Vs(n,o-8,i.d()),Vs(n,o-4,r),n}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new ps(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},n=0;n<t;++n){if(r+5>i.length){var o=new ps(r+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);a<128?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return Rs(i,0,r)}(Ys(t)),{mtime:0}),s=new Blob([r],{type:Gs});return{contentType:Gs,body:s,estimatedSize:s.size}}if(i===ei.Base64){var n=function(e){var t,i,r,s,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=function(e){var t,i,r,s,n="";for(t=i=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){var o=e.charCodeAt(s),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),N(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=s+1)}return i>t&&(n+=e.substring(t,e.length)),n}(e);do{t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,r=n>>6&63,s=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(r)+o.charAt(s)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Ys(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ys(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Ys(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Js=[];h&&Js.push({transport:"fetch",method:e=>{var t,i,{contentType:r,body:s,estimatedSize:n}=null!==(t=Xs(e))&&void 0!==t?t:{},o=new Headers;Te(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(p){var c=new p;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}h(a,y({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(n||0)<52428.8,body:s,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){Pe.error(e)}null==e.callback||e.callback(r)})).catch(t=>{Pe.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),d&&Js.push({transport:"XHR",method:e=>{var t,i=new d;i.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=null!==(t=Xs(e))&&void 0!==t?t:{};Te(e.headers,function(e,t){i.setRequestHeader(t,e)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(s)}}),null!=l&&l.sendBeacon&&Js.push({transport:"sendBeacon",method:e=>{var t=zs(e.url,{beacon:"1"});try{var i,{contentType:r,body:s}=null!==(i=Xs(e))&&void 0!==i?i:{},n="string"==typeof s?new Blob([s],{type:r}):s;l.sendBeacon(t,n)}catch(e){}}});var Zs=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Ks(e,t,i){return Ys({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var Qs={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=>Zs(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Zs(t,e))),icontains:(e,t)=>t.map(en).some(t=>e.map(en).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(en).every(t=>e.map(en).every(e=>!t.includes(e)))},en=e=>e.toLowerCase(),tn=$e("[Error tracking]");class rn{constructor(e){var t,i;this.Jt=[],this.Kt=new pe([new ge,new ke,new _e,new ve,new Ee,new we,new me,new xe],[le,he]),this._instance=e,this.Jt=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(Xe))&&void 0!==t?t:[]}onRemoteConfig(e){var t,i,r,s=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.Jt=s,this._instance.persistence&&this._instance.persistence.register({[Xe]:this.Jt,[Je]:n})}get Yt(){var e,t=!!this._instance.get_property(Je),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.Kt.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Xt(t)){if(this.Qt(t))return void tn.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(t))return void tn.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(t))return void tn.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:r}=t;return D(i)&&i.length>0&&e.$exception_types.push(i),D(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Jt.some(e=>{var i=e.values.map(e=>{var i,r=Qs[e.operator],s=O(e.value)?e.value:[e.value],n=null!==(i=t[e.key])&&void 0!==i?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Zt(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ti(e){if(e.length>0){var t,i,r,s,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],o=n[n.length-1];return null!==(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Xt(e){return!j(e)&&O(e)}}var sn=$e("[FeatureFlags]"),nn="$active_feature_flags",on="$override_feature_flags",an="$feature_flag_payloads",ln="$override_feature_flag_payloads",cn="$feature_flag_request_id",un=e=>{var t={};for(var[i,r]of Ae(e||{}))r&&(t[i]=r);return t},hn=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class dn{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||sn.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t}):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(nt),t=this._instance.get_property(on),i=this._instance.get_property(ln);if(!i&&!t)return e||{};var r=Re({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var n of s){var o,a,l=r[n],c=null==t?void 0:t[n],u=A(c)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!c,h=A(c)?l.variant:"string"==typeof c?c:void 0,d=null==i?void 0:i[n],p=y({},l,{enabled:u,variant:u?null!=h?h:null==l?void 0:l.variant:void 0});u!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),h!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),d&&(p.metadata=y({},null==l?void 0:l.metadata,{payload:d,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[n]=p}return this.ii||(sn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(rt),t=this._instance.get_property(on);if(!t)return e||{};for(var i=Re({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ii||(sn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(an),t=this._instance.get_property(ln);if(!t)return e||{};for(var i=Re({},e||{}),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ii||(sn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout(()=>{this.di()},5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var t;if(this.vi(),!this._instance.M())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(ot)||{}),group_properties:this._instance.get_property(at)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,s=r?"/flags/?v=2":"/flags/?v=2&config=true",n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",s+n);r&&(i.timezone=rs()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:ei.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,s=!0;if(200===e.statusCode&&(this.ni||(this.$anon_distinct_id=void 0),s=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi(null!==(r=e.json)&&void 0!==r?r:{})),!i.disable_flags||this.ni)if(this.ai=!s,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(hn.FeatureFlags))sn.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.");else{var n;i.disable_flags||this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},s),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,s=this._instance.get_property(cn)||void 0,n=this._instance.get_property(ut)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(r))){var o,a,l,c,u,h,d,p,g;O(n[e])?n[e].push(r):n[e]=[r],null==(o=this._instance.persistence)||o.register({[ut]:n});var v=this.getFeatureFlagDetails(e),_={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:s,$feature_flag_bootstrapped_response:(null==(a=this._instance.config.bootstrap)||null==(a=a.featureFlags)?void 0:a[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this.ai};A(null==v||null==(c=v.metadata)?void 0:c.version)||(_.$feature_flag_version=v.metadata.version);var f,m=null!==(u=null==v||null==(h=v.reason)?void 0:h.description)&&void 0!==u?u:null==v||null==(d=v.reason)?void 0:d.code;m&&(_.$feature_flag_reason=m),null!=v&&null!=(p=v.metadata)&&p.id&&(_.$feature_flag_id=v.metadata.id),A(null==v?void 0:v.original_variant)&&A(null==v?void 0:v.original_enabled)||(_.$feature_flag_original_response=A(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(g=v.metadata)&&g.original_payload&&(_.$feature_flag_original_payload=null==v||null==(f=v.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",_)}return i}sn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:ei.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return A(i)?void 0:!!i}sn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,r,s){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var n=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload}).map(e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]}))):sn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),o=n.flags,a=n.featureFlags,l=n.featureFlagPayloads;if(a){var c=e.requestId;if(O(a)){sn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var u={};if(a)for(var h=0;h<a.length;h++)u[a[h]]=!0;t&&t.register({[nn]:a,[rt]:u})}else{var d=a,p=l,g=o;e.errorsWhileComputingFlags&&(d=y({},i,d),p=y({},r,p),g=y({},s,g)),t&&t.register(y({[nn]:Object.keys(un(d)),[rt]:d||{},[an]:p||{},[nt]:g||{}},c?{[cn]:c}:{}))}}}(e,this._instance.persistence,i,r,s),this.pi(t)}}override(e,t){void 0===t&&(t=!1),sn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return sn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(on),this._instance.persistence.unregister(ln),void this.pi();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,i=e;if(this.ii=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(on);else if(i.flags)if(O(i.flags)){for(var r={},s=0;s<i.flags.length;s++)r[i.flags[s]]=!0;this._instance.persistence.register({[on]:r})}else this._instance.persistence.register({[on]:i.flags});return"payloads"in i&&(!1===i.payloads?this._instance.persistence.unregister(ln):i.payloads&&this._instance.persistence.register({[ln]:i.payloads})),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:t,flagVariants:i}=this.gi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this._instance.get_property(st)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(o.$early_access_feature_name=s.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=y({},this.getFlagVariants(),{[e]:t});null==(r=this._instance.persistence)||r.register({[nn]:Object.keys(un(a)),[rt]:a}),this.pi()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this._instance.get_property(st),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(st),null==(r=this._instance.persistence)||r.register({[st]:s}),e(s)}}})}gi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}pi(e){var{flags:t,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(ot)||{};this._instance.register({[ot]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ot)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(at)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[at]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(at)||{};this._instance.register({[at]:y({},t,{[e]:{}})})}else this._instance.unregister(at)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var pn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class gn{constructor(e,t){this.C=e,this.props={},this.mi=!1,this.yi=(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"})(e),this.Y=this.bi(e),this.load(),e.debug&&Pe.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wi}bi(e){-1===pn.indexOf(e.persistence.toLowerCase())&&(Pe.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Ei.H()?Ei:"localstorage+cookie"===t&&ki.H()?ki:"sessionstorage"===t&&Ii.H()?Ii:"memory"===t?Pi:"cookie"===t?bi:ki.H()?ki:bi}properties(){var e={};return Te(this.props,function(t,i){if(i===rt&&R(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/"+r[s]]=t[r[s]];else o=i,l=!1,(N(n=bt)?l:a&&n.indexOf===a?-1!=n.indexOf(o):(Te(n,function(e){if(l||(l=e===o))return Ce}),l))||(e[i]=t);var n,o,l}),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Re({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.$i,this.Si,this.C.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(R(e)){A(t)&&(t="None"),this.xi=A(i)?this.Ei:i;var r=!1;if(Te(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(R(e)){this.xi=A(t)?this.Ei:t;var i=!1;if(Te(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=Jr(this.C.custom_campaign_params,this.C.mask_personal_data_properties,this.C.custom_personal_data_properties);M(Ne(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=null==c?void 0:c.referrer)?Kr(e):{})}update_referrer_info(){var e;this.register_once({$referrer:es(),$referring_domain:null!=c&&c.referrer&&(null==(e=ii(c.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[gt]||this.props[vt]||this.register_once({[_t]:ts(this.C.mask_personal_data_properties,this.C.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Te([vt,gt],t=>{var i=this.props[t];i&&Te(i,function(t,i){e["$initial_"+P(i)]=t})});var t,i,r=this.props[_t];if(r){var s=(t=is(r),i={},Te(t,function(e,t){i["$initial_"+P(t)]=e}),i);Re(e,s)}return e}safe_merge(e){return Te(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ei=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.bi(e),s=this.props;this.clear(),this.Y=r,this.props=s,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.$i&&(this.$i=e,this.remove(),this.save())}set_secure(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[We]||{};i[e]=t,this.props[We]=i,this.save()}remove_event_timer(e){var t=(this.props[We]||{})[e];return A(t)||(delete this.props[We][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var vn=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),_n=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),fn=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),mn=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),yn=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),bn=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),wn=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),En=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),xn=function(e){return e.Popover="popover",e.Inline="inline",e}({});class kn{constructor(){this.ki={},this.ki={}}on(e,t){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(t),()=>{this.ki[e]=this.ki[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.ki[e]||[])i(t);for(var r of this.ki["*"]||[])r(e,t)}}class Sn{constructor(e){this.Pi=new kn,this.Ti=(e,t)=>this.Ii(e,t)&&this.Ri(e,t)&&this.Ci(e,t),this.Ii=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Oi=new Set,this.Fi=new Set}init(){var e,t;A(null==(e=this._instance)?void 0:e.Mi)||null==(t=this._instance)||t.Mi((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!A(null==(t=this._instance)?void 0:t.Mi)&&(e.forEach(e=>{var t,i;null==(t=this.Fi)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Oi)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Oi.has(e)||this.Oi.has(null==t?void 0:t.event))&&this.Fi&&(null==(i=this.Fi)?void 0:i.size)>0&&this.Fi.forEach(e=>{this.Ai(t,e)&&this.Pi.emit("actionCaptured",e.name)})}Di(e){this.onAction("actionCaptured",t=>e(t))}Ai(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,t){return this.Pi.on(e,t)}Ri(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Sn.ji(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static ji(e,t,i){switch(i){case"regex":return!!r&&Zs(e,t);case"exact":return t===e;case"contains":var s=Sn.Li(t).replace(/_/g,".").replace(/%/g,".*");return Zs(e,s);default:return!1}}static Li(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ci(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Ni(e).some(e=>!(null!=t&&t.href&&!Sn.ji(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact")||null!=t&&t.tag_name&&e.tag_name!==(null==t?void 0:t.tag_name)||null!=t&&t.text&&!Sn.ji(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!Sn.ji(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var i,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!r)return!1;if(!r.includes(null==t?void 0:t.selector))return!1}return!0}Ni(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}var Pn=$e("[Surveys]"),$n="seenSurvey_",In=(e,t)=>{var i="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(i="$survey_"+t+"/"+e.id+"/"+e.current_iteration),i},Fn=e=>{var t=""+$n+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+$n+e.id+"_"+e.current_iteration),t},Cn=[fn.Popover,fn.Widget,fn.API],On={ignoreConditions:!1,ignoreDelay:!1,displayType:xn.Popover};class Tn{constructor(e){this._instance=e,this.Ui=new Map,this.zi=new Map}register(e){var t;A(null==(t=this._instance)?void 0:t.Mi)||(this.Hi(e),this.Bi(e))}Bi(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.qi&&(this.qi=new Sn(this._instance),this.qi.init(),this.qi.Di(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.qi)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.zi.get(t.name);i&&i.push(e.id),this.zi.set(t.name,i||[e.id])}}))}))}Hi(e){var t;0!==e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}).length&&(null==(t=this._instance)||t.Mi((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach(t=>{if(t&&t.name){var i=this.Ui.get(t.name);i&&i.push(e.id),this.Ui.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,r,s=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[ct])||[];if(wn.SHOWN===e&&t&&s.length>0){var n;Pn.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var o=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(o){var a=s.indexOf(o);a>=0&&(s.splice(a,1),this.Wi(s))}}else if(this.Ui.has(e)){Pn.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Ui.get(e)});var l=[];null==(r=this._instance)||r.getSurveys(t=>{l=t.filter(t=>{var i;return null==(i=this.Ui.get(e))?void 0:i.includes(t.id)})});var c=l.filter(i=>{var r,s=null==(r=i.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.find(t=>t.name===e);return!!s&&(!s.propertyFilters||Object.entries(s.propertyFilters).every(e=>{var i,[r,s]=e,n=null==t||null==(i=t.properties)?void 0:i[r];if(A(n)||N(n))return!1;var o=[String(n)],a=Qs[s.operator];return a?a(s.values,o):(Pn.warn("Unknown property comparison operator: "+s.operator),!1)}))});this.Wi(s.concat(c.map(e=>e.id)||[]))}}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[ct])||[];this.zi.has(e)&&this.Wi(i.concat(this.zi.get(e)||[]))}Wi(e){var t;Pn.info("updating activated surveys",{activatedSurveys:e}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[ct]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[ct])||[]}getEventToSurveys(){return this.Ui}Gi(){return this.qi}}class Rn{constructor(e){this.Vi=void 0,this._surveyManager=null,this.Ji=!1,this.Ki=!1,this.Yi=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(j(t))return Pn.warn("Flags not loaded yet. Not loading surveys.");var i=O(t);this.Vi=i?t.length>0:t,Pn.info("flags response received, isSurveysEnabled: "+this.Vi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith($n)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.Ki)Pn.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Pn.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Pn.info("Not loading surveys in cookieless mode without consent.");else{var e=null==v?void 0:v.__PosthogExtensions__;if(e){if(!A(this.Vi)||this._instance.config.advanced_enable_surveys){var t=this.Vi||this._instance.config.advanced_enable_surveys;this.Ki=!0;try{var i=e.generateSurveys;if(i)return void this.Xi(i,t);var r=e.loadExternalDependency;if(!r)return void this.Qi("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.Qi("Could not load surveys script",i):this.Xi(e.generateSurveys,t)})}catch(e){throw this.Qi("Error initializing surveys",e),e}finally{this.Ki=!1}}}else Pn.error("PostHog Extensions not found.")}}Xi(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Tn(this._instance),Pn.info("Surveys loaded successfully"),this.Zi({isLoaded:!0})}Qi(e,t){Pn.error(e,t),this.Zi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yi.push(e),this._surveyManager&&this.Zi({isLoaded:!0}),()=>{this.Yi=this.Yi.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Pn.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(lt);if(i&&!t)return e(i,{isLoaded:!0});if(this.Ji)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ji=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this.Ji=!1;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;return Pn.error(s),e([],{isLoaded:!1,error:s})}var n,o=t.json.surveys||[],a=o.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(i=this._instance.persistence)||i.register({[lt]:o}),e(o,{isLoaded:!0})}})}catch(e){throw this.Ji=!1,e}}Zi(e){for(var t of this.Yi)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Pn.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Pn.warn("init was not called")}te(e){var t=null;return this.getSurveys(i=>{var r;t=null!==(r=i.find(t=>t.id===e))&&void 0!==r?r:null}),t}ie(e){if(j(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.te(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(j(this._surveyManager))return Pn.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ie(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return j(this._surveyManager)?(Pn.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!==(r=t.find(t=>t.id===e))&&void 0!==r?r:null;if(s){var n=this.ie(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){var i;if(j(this._surveyManager))Pn.warn("init was not called");else{var r="string"==typeof e?this.te(e):e;if(null!=r&&r.id)if(Cn.includes(r.type)){var s=null==c?void 0:c.querySelector(t);if(s)return null!=(i=r.appearance)&&i.surveyPopupDelaySeconds?(Pn.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;Pn.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,s),Pn.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,s);Pn.warn("Survey element not found")}else Pn.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Pn.warn("Survey not found")}}displaySurvey(e,t){var i;if(j(this._surveyManager))Pn.warn("init was not called");else{var r=this.te(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=y({},r,{appearance:y({},r.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void Pn.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==xn.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,t.selector)}else Pn.warn("Survey not found")}}}var Mn=$e("[RateLimiter]");class An{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{Mn.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Mn.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,r;void 0===e&&(e=!1);var s=(new Date).getTime(),n=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(pt))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:s};n.tokens+=(s-n.last)/1e3*this.captureEventsPerSecond,n.last=s,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||e||(n.tokens=Math.max(0,n.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 "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(r=this.instance.persistence)||r.set_property(pt,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Dn=$e("[RemoteConfig]");class Ln{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}ee(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(Dn.error("PostHog Extensions not found. Cannot load remote config."),e())}re(e){this._instance.ci({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 Dn.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.M())return void Dn.warn("Remote config is disabled. Falling back to local config.");this.ee(e=>{if(!e)return Dn.info("No config found after loading remote JS config. Falling back to JSON."),void this.re(e=>{this.fi(e)});this.fi(e)})}catch(e){Dn.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Dn.info("__preview_remote_config is disabled. Logging config instead",e):Dn.error("Failed to fetch remote config from PostHog.")}}var Nn=3e3;class jn{constructor(e,t){this.se=!0,this.ne=[],this.oe=X((null==t?void 0:t.flush_interval_ms)||Nn,250,5e3,Pe.createLogger("flush interval"),Nn),this.ae=e}enqueue(e){this.ne.push(e),this.le||this.ue()}unload(){this.he();var e=this.ne.length>0?this.de():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ae(y({},e,{transport:"sendBeacon"}))})}enable(){this.se=!1,this.ue()}ue(){var e=this;this.se||(this.le=setTimeout(()=>{if(this.he(),this.ne.length>0){var t=this.de(),i=function(){var i=t[r],s=(new Date).getTime();i.data&&O(i.data)&&Te(i.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.ae(i)};for(var r in t)i()}},this.oe))}he(){clearTimeout(this.le),this.le=void 0}de(){var e={};return Te(this.ne,t=>{var i,r=t,s=(r?r.batchKey:null)||r.url;A(e[s])&&(e[s]=y({},r,{data:[]})),null==(i=e[s].data)||i.push(r.data)}),this.ne=[],e}}var Hn=["retriesPerformedSoFar"];class Un{constructor(e){this.ve=!1,this.ce=3e3,this.ne=[],this._instance=e,this.ne=[],this.fe=!0,!A(r)&&"onLine"in r.navigator&&(this.fe=r.navigator.onLine,this.pe=()=>{this.fe=!0,this.Dt()},this.ge=()=>{this.fe=!1},qe(r,"online",this.pe),qe(r,"offline",this.ge))}get length(){return this.ne.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,Hn);H(t)&&t>0&&(i.url=zs(i.url,{retry_count:t})),this._instance.ci(y({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this._e(y({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}_e(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),s=(Math.random()-.5)*(r-i);return Math.ceil(r+s)}(t),r=Date.now()+i;this.ne.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),Pe.warn(s),this.ve||(this.ve=!0,this.me())}me(){if(this.ye&&clearTimeout(this.ye),0===this.ne.length)return this.ve=!1,void(this.ye=void 0);this.ye=setTimeout(()=>{this.fe&&this.ne.length>0&&this.Dt(),this.me()},this.ce)}Dt(){var e=Date.now(),t=[],i=this.ne.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.ne=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ve=!1,A(r)||(this.pe&&(r.removeEventListener("online",this.pe),this.pe=void 0),this.ge&&(r.removeEventListener("offline",this.ge),this.ge=void 0)),this.ne))try{this._instance.ci(y({},e,{transport:"sendBeacon"}))}catch(e){Pe.error(e)}this.ne=[]}}class qn{constructor(e){this.be=()=>{var e,t,i,r;this.we||(this.we={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.we.lastScrollY=Math.ceil(n),this.we.maxScrollY=Math.max(n,null!==(e=this.we.maxScrollY)&&void 0!==e?e:0),this.we.maxScrollHeight=Math.max(o,null!==(t=this.we.maxScrollHeight)&&void 0!==t?t:0),this.we.lastContentY=a,this.we.maxContentY=Math.max(a,null!==(i=this.we.maxContentY)&&void 0!==i?i:0),this.we.maxContentHeight=Math.max(l,null!==(r=this.we.maxContentHeight)&&void 0!==r?r:0)},this._instance=e}getContext(){return this.we}resetContext(){var e=this.we;return setTimeout(this.be,0),e}startMeasuringScrollPosition(){qe(r,"scroll",this.be,{capture:!0}),qe(r,"scrollend",this.be,{capture:!0}),qe(r,"resize",this.be)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==r?void 0:r.document.documentElement;var e=O(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=null==r?void 0:r.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return r&&(r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return r&&(r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft)||0}}var Bn=e=>ts(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Vn{constructor(e,t,i,r){this.xe=e=>{var t=this.$e();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Se(this._instance)};this.Ee.register({[dt]:i})}},this._instance=e,this.ke=t,this.Ee=i,this.Se=r||Bn,this.ke.onSessionId(this.xe)}$e(){return this.Ee.props[dt]}getSetOnceProps(){var e,t=null==(e=this.$e())?void 0:e.props;return t?"r"in t?is(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Te(Ne(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+P(i)]=t}),e}}var Wn=$e("[SessionId]");class Gn{on(e,t){return this.Pe.on(e,t)}constructor(e,t,i){var r;if(this.Te=[],this.Ie=void 0,this.Pe=new kn,this.Re=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.C=e.config,this.Ee=e.persistence,this.Ce=void 0,this.Oe=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fe=t||_i,this.Me=i||_i;var s=this.C.persistence_name||this.C.token,n=this.C.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*X(n,60,36e3,Wn.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ae(),this.De="ph_"+s+"_window_id",this.je="ph_"+s+"_primary_window_exists",this.Le()){var o=Ii.W(this.De),a=Ii.W(this.je);o&&!a?this.Ce=o:Ii.V(this.De),Ii.G(this.je,!0)}if(null!=(r=this.C.bootstrap)&&r.sessionID)try{var l=(()=>{var e=this.C.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.Ne(this.C.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){Wn.error("Invalid sessionID in bootstrap",e)}this.Ue()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return A(this.Te)&&(this.Te=[]),this.Te.push(e),this.Oe&&e(this.Oe,this.Ce),()=>{this.Te=this.Te.filter(t=>t!==e)}}Le(){return"memory"!==this.C.persistence&&!this.Ee.wi&&Ii.H()}ze(e){e!==this.Ce&&(this.Ce=e,this.Le()&&Ii.G(this.De,e))}He(){return this.Ce?this.Ce:this.Le()?Ii.W(this.De):null}Ne(e,t,i){e===this.Oe&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Oe=e,this.Ee.register({[tt]:[t,e,i]}))}Be(){if(this.Oe&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Oe,this._sessionStartTimestamp];var e=this.Ee.props[tt];return O(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ne(null,null,null)}destroy(){clearTimeout(this.qe),this.qe=void 0,this.Ie&&r&&(r.removeEventListener("beforeunload",this.Ie,{capture:!1}),this.Ie=void 0),this.Te=[]}Ue(){this.Ie=()=>{this.Le()&&Ii.V(this.je)},qe(r,"beforeunload",this.Ie,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.C.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[r,s,n]=this.Be(),o=this.He(),a=H(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!s,u=!c&&!e&&this.Re(i,r);c||u||a?(s=this.Fe(),o=this.Me(),Wn.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.Me(),l=!0);var h=0===r||!e||a?i:r,d=0===n?(new Date).getTime():n;return this.ze(o),this.Ne(s,h,d),e||this.Ae(),l&&this.Te.forEach(e=>e(s,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:s,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}Ae(){clearTimeout(this.qe),this.qe=setTimeout(()=>{var[e]=this.Be();if(this.Re((new Date).getTime(),e)){var t=this.Oe;this.resetSessionId(),this.Pe.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var zn=["$set_once","$set"],Yn=$e("[SiteApps]");class Xn{constructor(e){this._instance=e,this.We=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ge(e,t){if(t){var i=this.globalsForEvent(t);this.We.push(i),this.We.length>1e3&&(this.We=this.We.slice(10))}}get siteAppLoaders(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Mi(this.Ge.bind(this));this.Ve=()=>{e(),this.We=[],this.Ve=void 0}}}globalsForEvent(e){var t,i,r,s,n,o,a;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[h,d]of Object.entries(u))l[h]={id:c[h],type:h,properties:d};var{$set_once:p,$set:g}=e;return{event:y({},b(e,zn),{properties:y({},e.properties,g?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:y({},null!==(r=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==r?r:{},p)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.We.length&&(Yn.info("Processing "+this.We.length+" events for site app with id "+e.id),this.We.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Ve)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,Yn.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{s(e)}});n&&(t.processEvent=n),r=!0}catch(t){Yn.error("Error while initializing PostHog app with config id "+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){Yn.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Je(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Ke(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){Yn.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Je(),void this._instance.on("eventCaptured",e=>this.Ke(e))):void Yn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Ve)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var n=function(e){var t;v["__$$ph_site_app_"+e]=s._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,a,t=>{if(t)return Yn.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else Yn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Jn=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&E(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>E(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},Zn=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Kn="i.posthog.com";class Qn{constructor(e){this.Ye={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"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,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Kn,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ye[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=Zn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=Zn.EU:this.Ye[this.apiHost]=Zn.CUSTOM),this.Ye[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===Zn.CUSTOM)return this.apiHost+t;var i=Kn+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var eo={icontains:(e,t)=>!!r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!r&&Zs(t.href,e),not_regex:(e,t)=>!!r&&!Zs(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class to{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{to.Xe("retrieved web experiments from the server"),t.Qe=new Map,e.forEach(e=>{if(e.feature_flag_key){var i;t.Qe&&(to.Xe("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Qe)||i.set(e.feature_flag_key,e));var r=t._instance.getFeatureFlag(e.feature_flag_key);D(r)&&e.variants[r]&&t.Ze(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];to.tr(n)&&t.Ze(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())to.Xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(j(this.Qe))return this.Qe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();to.Xe("applying feature flags",e),e.forEach(e=>{var t;if(this.Qe&&null!=(t=this.Qe)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.Qe)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Ze(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=to.getWindowLocation();if(null!=e&&e.search){var t=ri(null==e?void 0:e.search,"__experiment_id"),i=ri(null==e?void 0:e.search,"__experiment_variant");t&&i&&(to.Xe("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ir(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var i=t.json.experiments||[];return e(i)}})}ir(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(to.Xe("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Ze(r[0].name,t,r[0].variants[t].transforms))}static tr(e){return!j(e.conditions)&&to.er(e)&&to.rr(e)}static er(e){var t;if(j(e.conditions)||j(null==(t=e.conditions)?void 0:t.url))return!0;var i,r,s,n=to.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||eo[null!==(r=null==(s=e.conditions)?void 0:s.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,n))}static getWindowLocation(){return null==r?void 0:r.location}static rr(e){var t;if(j(e.conditions)||j(null==(t=e.conditions)?void 0:t.utm))return!0;var i=Jr();if(i.utm_source){var r,s,n,o,a,l,c,u,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==i.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==i.utm_term;return h&&p&&g&&d}return!1}static Xe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];Pe.info("[WebExperiments] "+e,i)}Ze(e,t,i){this._is_bot()?to.Xe("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){var r;to.Xe("applying transform of variant "+t+" for experiment "+e+" ",i);var s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)})}}):to.Xe("Control variants leave the page unmodified.")}_is_bot(){return l&&this._instance?Jn(l,this._instance.config.custom_blocked_useragents):void 0}}var io=$e("[PostHog ExternalIntegrations]"),ro={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class so{constructor(e){this._instance=e}it(e,t){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return io.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(t){var i,s,n;!r||null!=(i=v.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[t]||e.it(ro[t],()=>{var i;null==(i=v.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[t])||i.start(e._instance)}),!r&&null!=(s=v.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[t]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[t])||n.stop())};for(var[i,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;t(i)}}}var no="[SessionRecording]",oo=$e(no);class ao{get started(){var e;return!(null==(e=this.sr)||!e.isStarted)}get status(){return this.sr?this.sr.status:this.nr&&!this.ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.nr=!1,this.lr=void 0,this._instance=e,!this._instance.sessionManager)throw oo.error("started without valid sessionManager"),new Error(no+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(no+' cannot be used with cookieless_mode="always"')}get ar(){var e,t=!(null==(e=this._instance.get_property(et))||!e.enabled),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.ar||null==(t=this.sr)||!t.isStarted){var i=!A(Object.assign)&&!A(Array.from);this.ar&&i?(this.ur(e),oo.info("starting")):this.stopRecording()}}ur(e){var t,i,r;this.ar&&(null!=v&&null!=(t=v.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.hr(e):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.dr,t=>{if(t)return oo.error("could not load recorder",t);this.hr(e)}))}stopRecording(){var e,t;null==(e=this.lr)||e.call(this),this.lr=void 0,null==(t=this.sr)||t.stop()}vr(){var e;null==(e=this._instance.persistence)||e.unregister(it)}cr(e){if(this._instance.persistence){var t,i,r=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=j(i)?null:parseFloat(i);j(s)&&this.vr();var n=null==t?void 0:t.minimumDurationMilliseconds;r.register({[et]:y({enabled:!!t},t,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:A(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this.lr)||t.call(this),this.lr=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.cr(e),this.nr=!0,this.startIfEnabledOrStop()):this.nr=!0:oo.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.sr)&&i.log?this.sr.log(e,t):oo.warn("log called before recorder was ready")}get dr(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(et);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}hr(e){var t,i;if(null==(t=v.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.sr||(this.sr=null==(i=v.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.sr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.sr.start(e)}onRRwebEmit(e){var t;null==(t=this.sr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.sr||null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}),null==(e=this.sr)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.sr||null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}),null==(e=this.sr)||e.overrideSampling()}overrideTrigger(e){var t,i;this.sr||null==(i=this._instance.persistence)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.sr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.sr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.sr)||!i.tryAddCustomEvent(e,t))}}var lo={},co=()=>{},uo="posthog",ho=!Ws&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),po=e=>{var t;return{api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:He(null==c?void 0:c.location),persistence:"localStorage+cookie",persistence_name:"",loaded:co,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!(e&&e>="2025-05-24")||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:u&&D(null==u?void 0:u.search)&&-1!==u.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;Pe.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Nn},error_tracking:{},_onCapture:co,__preview_eager_load_replay:!1}},go=e=>{var t={};A(e.process_person)||(t.person_profiles=e.process_person),A(e.xhr_headers)||(t.request_headers=e.xhr_headers),A(e.cookie_name)||(t.persistence_name=e.cookie_name),A(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),A(e.store_google)||(t.save_campaign_params=e.store_google),A(e.verbose)||(t.debug=e.verbose);var i=Re({},t,e);return O(e.property_blacklist)&&(A(e.property_denylist)?i.property_denylist=e.property_blacklist:O(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:Pe.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class vo{constructor(){this.__forceAllowLocalhost=!1}get pr(){return this.__forceAllowLocalhost}set pr(e){Pe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class _o{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new vo,this.gr=!1,this.version=_.LIB_VERSION,this._r=new kn,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=po(),this.SentryIntegration=qi,this.sentryIntegration=e=>function(e,t){var i=Ui(e,t);return{name:Hi,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mr=!1,this.yr=null,this.br=null,this.wr=null,this.featureFlags=new dn(this),this.toolbar=new zi(this),this.scrollManager=new qn(this),this.pageViewManager=new ds(this),this.surveys=new Rn(this),this.experiments=new to(this),this.exceptions=new rn(this),this.rateLimiter=new An(this),this.requestRouter=new Qn(this),this.consent=new Ci(this),this.externalIntegrations=new so(this),this.people={set:(e,t,i)=>{var r=D(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=D(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>Pe.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==uo){var r,s=null!==(r=lo[i])&&void 0!==r?r:new _o;return s._init(e,t,i),lo[i]=s,lo[uo][i]=s,s}return this._init(e,t,i)}_init(e,t,i){var s;if(void 0===t&&(t={}),A(e)||L(e))return Pe.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={},t.debug=this.$r(t.debug),this.Sr=t,this.Er=[],t.person_profiles&&(this.br=t.person_profiles),this.set_config(Re({},po(t.defaults),go(t),{name:i,token:e})),this.config.on_xhr_error&&Pe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ei.GZipJS;var n=this.kr();this.persistence=new gn(this.config,n),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new gn(y({},this.config,{persistence:"sessionStorage"}),n);var o=y({},this.persistence.props),a=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Pr=new jn(e=>this.Tr(e),this.config.request_queue_config),this.Ir=new Un(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Gn(this),this.sessionPropsManager=new Vn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Pe.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Rr(l)},0)):(Pe.info("Initializing extensions synchronously"),this.Rr(l)),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&Pe.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:o,s:a}),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var c,u,h=this.config.get_device_id(_i()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(ht,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Cr()){var p,g,v=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var r;return e[i]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,e},{}),f=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>v[e]).reduce((e,i)=>{var r,s;return null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(e[i]=null==(s=t.bootstrap)||null==(s=s.featureFlagPayloads)?void 0:s[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:f})}if(l)this.register_once({distinct_id:yt,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(_i());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ht,"anonymous")}return qe(r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||_i();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(ht,"identified")),t()},s=i.user();"then"in s&&T(s.then)?s.then(e=>r(e)):r(s)}(e,()=>{i.register((e=>{Promise&&Promise.resolve||ji.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ji.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ji.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,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,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.Or()):this.Or(),T(this.config._onCapture)&&this.config._onCapture!==co&&(Pe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&Pe.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}Rr(e){var t=performance.now();this.historyAutocapture=new Ni(this),this.historyAutocapture.startIfEnabled();var i=[];i.push(()=>{new Xi(this).startIfEnabledOrStop()}),i.push(()=>{var e;this.siteApps=new Xn(this),null==(e=this.siteApps)||e.init()}),e||i.push(()=>{this.sessionRecording=new ao(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.push(()=>{this.autocapture=new ci(this),this.autocapture.startIfEnabled()}),i.push(()=>{this.surveys.loadIfEnabled()}),i.push(()=>{this.heatmaps=new hs(this),this.heatmaps.startIfEnabled()}),i.push(()=>{this.webVitalsAutocapture=new ls(this)}),i.push(()=>{this.exceptionObserver=new Di(this),this.exceptionObserver.startIfEnabled()}),i.push(()=>{this.deadClicksAutocapture=new Mi(this,Ri),this.deadClicksAutocapture.startIfEnabled()}),i.push(()=>{if(this.Fr){var e=this.Fr;this.Fr=void 0,this.fi(e)}}),this.Mr(i,t)}Mr(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Mr(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){Pe.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&Pe.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var t,i,r,s,n,o,a,l;if(!c||!c.body)return Pe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.fi(e)},500);this.config.__preview_deferred_init_extensions&&(this.Fr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=k(e.supportedCompression,ei.GZipJS)?ei.GZipJS:k(e.supportedCompression,ei.Base64)?ei.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.br?this.br:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(s=this.autocapture)||s.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(o=this.webVitalsAutocapture)||o.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}Or(){try{this.config.loaded(this)}catch(e){Pe.critical("`loaded` function failed",e)}this.Ar(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Dr()},1),new Ln(this).load(),this.featureFlags.flags()}Ar(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Pr)||e.enable())}_dom_loaded(){this.is_capturing()&&Oe(this.__request_queue,e=>this.Tr(e)),this.__request_queue=[],this.Ar()}_handle_unload(){var e,t;this.config.request_batching?(this.jr()&&this.capture("$pageleave"),null==(e=this.Pr)||e.unload(),null==(t=this.Ir)||t.unload()):this.jr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(ho?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=zs(e.url,{ip:this.config.ip?1:0}),e.headers=y({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=y({},e);s.timeout=s.timeout||6e4,s.url=zs(s.url,{_:(new Date).getTime().toString(),ver:_.LIB_VERSION,compression:s.compression});var n=null!==(t=s.transport)&&void 0!==t?t:"fetch",o=Js.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),a=null!==(i=null==(r=Ue(o,e=>e.transport===n))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");a(s)})(y({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(r=this.config).on_request_error)||i.call(r,t)),null==e.callback||e.callback(t)}}))))}Tr(e){this.Ir?this.Ir.retriableRequest(e):this.ci(e)}_execute_array(e){var t,i=[],r=[],s=[];Oe(e,e=>{e&&(t=e[0],O(t)?s.push(e):T(e)?e.call(this):O(e)&&"alias"===t?i.push(e):O(e)&&-1!==t.indexOf("capture")&&T(this[t])?s.push(e):r.push(e))});var n=function(e,t){Oe(e,function(e){if(O(e[0])){var i=t;Te(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(r,this),n(s,this)}Cr(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pr){if(this.is_capturing())if(!A(e)&&D(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=t&&t.$current_url&&!D(null==t?void 0:t.$current_url)&&(Pe.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),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 o=new Date,a=(null==i?void 0:i.timestamp)||o,l=_i(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},a,l)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var u,h=this.Lr(null==i?void 0:i.$set_once);if(h&&(c.$set_once=h),(c=function(e,t){return i=e,r=e=>D(e)&&!N(t)?e.slice(0,t):e,s=new Set,function e(t,i){return t!==Object(t)?r?r(t):t:s.has(t)?void 0:(s.add(t),O(t)?(n=[],Oe(t,t=>{n.push(e(t))})):(n={},Te(t,(t,i)=>{s.has(t)||(n[i]=e(t))})),n);var n}(i);var i,r,s}(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,A(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===wn.DISMISSED||e===wn.SENT){var d=null==t?void 0:t[En.SURVEY_ID],p=null==t?void 0:t[En.SURVEY_ITERATION];u={id:d,current_iteration:p},localStorage.getItem(Fn(u))||localStorage.setItem(Fn(u),"true"),c.$set=y({},c.$set,{[In({id:d,current_iteration:p},e===wn.SENT?"responded":"dismissed")]:!0})}var g=y({},c.properties.$set,c.$set);if(M(g)||this.setPersonPropertiesForFlags(g),!j(this.config.before_send)){var v=this.Nr(c);if(!v)return;c=v}this._r.emit("eventCaptured",c);var _={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Tr(_):this.Pr.enqueue(_),c}Pe.critical("This capture call is ignored due to client rate limiting.")}}else Pe.error("No event name provided to posthog.capture")}else Pe.uninitializedWarning("posthog.capture")}Mi(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n=s?void 0:this.persistence.remove_event_timer(e),o=y({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),"$snapshot"===e){var a=y({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!D(o.distinct_id)&&!H(o.distinct_id)||L(o.distinct_id))&&Pe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,u=ns(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());o.$session_id=h,o.$window_id=d}this.sessionPropsManager&&Re(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Re(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(p=this.Ir)?void 0:p.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Zn.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||s?"$pageleave"!==e||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),o=Re(o,l),"$pageview"===e&&c&&(o.title=c.title),!A(n)){var v=i.getTime()-n;o.$duration=parseFloat((v/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Re({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),O(this.config.property_denylist)?Te(this.config.property_denylist,function(e){delete o[e]}):Pe.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(Pe.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var f=this.Ur();return o.$process_person_profile=f,f&&!s&&this.zr("_calculate_event_properties"),o}Lr(e){var t;if(!this.persistence||!this.Ur())return e;if(this.gr)return e;var i=this.persistence.get_initial_props(),r=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),s=Re({},i,r||{},e||{}),n=this.config.sanitize_properties;return n&&(Pe.error("sanitize_properties is deprecated. Use before_send instead"),s=n(s,"$set_once")),this.gr=!0,M(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Hr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._r.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=On),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return Pe.uninitializedWarning("posthog.identify");if(H(e)&&(e=e.toString(),Pe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Pe.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.');else if(e!==yt){if(this.zr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(Ve)&&(this.unregister(Ve),this.register({distinct_id:e}));var n="anonymous"===(this.persistence.get_property(ht)||"anonymous");e!==r&&n?(this.persistence.set_property(ht,"identified"),this.setPersonPropertiesForFlags(y({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.wr=Ks(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(ut))}}else Pe.critical('The string "'+yt+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Pe.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.zr("posthog.setPersonProperties")){var i=Ks(this.get_distinct_id(),e,t);this.wr!==i?(this.setPersonPropertiesForFlags(y({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.wr=i):Pe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.zr("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}}else Pe.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.zr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,r,s;if(Pe.info("reset"),!this.__loaded)return Pe.uninitializedWarning("posthog.reset");var n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(ht,"anonymous"),null==(s=this.sessionManager)||s.resetSessionId(),this.wr=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:yt,$device_id:null},"");else{var o=this.config.get_device_id(_i());this.register_once({distinct_id:o,$device_id:e?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var s,n=null!==(s=e.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(Be)?(Pe.critical("Attempting to create alias for existing People user - aborting."),-2):this.zr("posthog.alias")?(A(t)&&(t=this.get_distinct_id()),e!==t?(this.Hr(Ve,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Pe.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(R(e)){var i,r,s,n,o;Re(this.config,go(e));var a=this.kr();null==(i=this.persistence)||i.update_config(this.config,t,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new gn(y({},this.config,{persistence:"sessionStorage"}),a);var l=this.$r(this.config.debug);U(l)&&(this.config.debug=l),U(this.config.debug)&&(this.config.debug?(_.DEBUG=!0,Ei.H()&&Ei.G("ph_debug","true"),Pe.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(_.DEBUG=!1,Ei.H()&&Ei.V("ph_debug"))),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Br(),null==(o=this.externalIntegrations)||o.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,r,s,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},r,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:uo;return t!==uo&&(t=uo+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(ht))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(ht))}Ur(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&M(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ve])&&(null==(t=this.persistence)||null==(t=t.props)||!t[ft]))}jr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Ur()||this.zr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}zr(e){return"never"===this.config.person_profiles?(Pe.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Hr(ft,!0),!0)}kr(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Br(){var e,t,i,r,s=this.kr();return(null==(e=this.persistence)?void 0:e.wi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.wi)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),null==(t=this.sessionManager)||t.destroy(),this.sessionManager=new Gn(this),this.persistence&&(this.sessionPropsManager=new Vn(this,this.sessionManager,this.persistence)),this.sessionRecording=new ao(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Br(),this.Ar(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(A(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(i=null==e?void 0:e.captureEventName)&&void 0!==i?i:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Dr()):Pe.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Br(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:yt,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this.Dr())):Pe.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}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===Fi.GRANTED?"granted":e===Fi.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Br()}_is_bot(){return l?Jn(l,this.config.custom_blocked_useragents):void 0}Dr(){c&&("visible"===c.visibilityState?this.mr||(this.mr=!0,this.capture("$pageview",{title:c.title},{send_instantly:!0}),this.yr&&(c.removeEventListener("visibilitychange",this.yr),this.yr=null)):this.yr||(this.yr=this.Dr.bind(this),qe(c,"visibilitychange",this.yr)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.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}))}M(){var e,t,i,r,s,n,o=this.Sr||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Pe.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):(i="advanced_disable_decide",r=Pe,s=(t="advanced_disable_flags")in(e=o)&&!A(e[t]),n=i in e&&!A(e[i]),s?e[t]:!!n&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]))}Nr(e){if(j(this.config.before_send))return e;var t=O(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(i=r(i),j(i)){var s="Event '"+e.event+"' was rejected in beforeSend function";return q(e.event)?Pe.warn(s+". This can cause unexpected behavior."):Pe.info(s),null}i.properties&&!M(i.properties)||Pe.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Vt)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}$r(e){var t=U(e)&&!e,i=Ei.H()&&"true"===Ei.q("ph_debug");return!t&&(!!i||e)}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=Le(e.prototype[t[i]])}(_o,["identify"]);var fo,mo=(fo=lo[uo]=new _o,function(){function e(){e.done||(e.done=!0,ho=!1,Te(lo,function(e){e._dom_loaded()}))}null!=c&&c.addEventListener?"complete"===c.readyState?e():qe(c,"DOMContentLoaded",e,{capture:!1}):r&&Pe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),fo)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunksignalpilot_ai_internal=self.webpackChunksignalpilot_ai_internal||[]).push([[481],{47481:(e,n,t)=>{t.r(n),t.d(n,{Diff:()=>s,applyPatch:()=>J,applyPatches:()=>q,arrayDiff:()=>A,canonicalize:()=>T,characterDiff:()=>o,convertChangesToDMP:()=>Z,convertChangesToXML:()=>B,createPatch:()=>U,createTwoFilesPatch:()=>V,cssDiff:()=>W,diffArrays:()=>$,diffChars:()=>r,diffCss:()=>E,diffJson:()=>N,diffLines:()=>C,diffSentences:()=>x,diffTrimmedLines:()=>P,diffWords:()=>w,diffWordsWithSpace:()=>b,formatPatch:()=>_,jsonDiff:()=>F,lineDiff:()=>L,parsePatch:()=>I,reversePatch:()=>M,sentenceDiff:()=>S,structuredPatch:()=>R,wordDiff:()=>v,wordsWithSpaceDiff:()=>y});class s{diff(e,n,t={}){let s;"function"==typeof t?(s=t,t={}):"callback"in t&&(s=t.callback);const o=this.castInput(e,t),r=this.castInput(n,t),i=this.removeEmpty(this.tokenize(o,t)),l=this.removeEmpty(this.tokenize(r,t));return this.diffWithOptionsObj(i,l,t,s)}diffWithOptionsObj(e,n,t,s){var o;const r=e=>(e=this.postProcess(e,t),s?void setTimeout(function(){s(e)},0):e),i=n.length,l=e.length;let u=1,a=i+l;null!=t.maxEditLength&&(a=Math.min(a,t.maxEditLength));const c=null!==(o=t.timeout)&&void 0!==o?o:1/0,f=Date.now()+c,h=[{oldPos:-1,lastComponent:void 0}];let d=this.extractCommon(h[0],n,e,0,t);if(h[0].oldPos+1>=l&&d+1>=i)return r(this.buildValues(h[0].lastComponent,n,e));let p=-1/0,g=1/0;const m=()=>{for(let s=Math.max(p,-u);s<=Math.min(g,u);s+=2){let o;const u=h[s-1],a=h[s+1];u&&(h[s-1]=void 0);let c=!1;if(a){const e=a.oldPos-s;c=a&&0<=e&&e<i}const f=u&&u.oldPos+1<l;if(c||f){if(o=!f||c&&u.oldPos<a.oldPos?this.addToPath(a,!0,!1,0,t):this.addToPath(u,!1,!0,1,t),d=this.extractCommon(o,n,e,s,t),o.oldPos+1>=l&&d+1>=i)return r(this.buildValues(o.lastComponent,n,e))||!0;h[s]=o,o.oldPos+1>=l&&(g=Math.min(g,s-1)),d+1>=i&&(p=Math.max(p,s+1))}else h[s]=void 0}u++};if(s)!function e(){setTimeout(function(){if(u>a||Date.now()>f)return s(void 0);m()||e()},0)}();else for(;u<=a&&Date.now()<=f;){const e=m();if(e)return e}}addToPath(e,n,t,s,o){const r=e.lastComponent;return r&&!o.oneChangePerToken&&r.added===n&&r.removed===t?{oldPos:e.oldPos+s,lastComponent:{count:r.count+1,added:n,removed:t,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:n,removed:t,previousComponent:r}}}extractCommon(e,n,t,s,o){const r=n.length,i=t.length;let l=e.oldPos,u=l-s,a=0;for(;u+1<r&&l+1<i&&this.equals(t[l+1],n[u+1],o);)u++,l++,a++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return a&&!o.oneChangePerToken&&(e.lastComponent={count:a,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,u}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){const s=[];let o;for(;e;)s.push(e),o=e.previousComponent,delete e.previousComponent,e=o;s.reverse();const r=s.length;let i=0,l=0,u=0;for(;i<r;i++){const e=s[i];if(e.removed)e.value=this.join(t.slice(u,u+e.count)),u+=e.count;else{if(!e.added&&this.useLongestToken){let s=n.slice(l,l+e.count);s=s.map(function(e,n){const s=t[u+n];return s.length>e.length?s:e}),e.value=this.join(s)}else e.value=this.join(n.slice(l,l+e.count));l+=e.count,e.added||(u+=e.count)}}return s}}const o=new class extends s{};function r(e,n,t){return o.diff(e,n,t)}function i(e,n){let t;for(t=0;t<e.length&&t<n.length;t++)if(e[t]!=n[t])return e.slice(0,t);return e.slice(0,t)}function l(e,n){let t;if(!e||!n||e[e.length-1]!=n[n.length-1])return"";for(t=0;t<e.length&&t<n.length;t++)if(e[e.length-(t+1)]!=n[n.length-(t+1)])return e.slice(-t);return e.slice(-t)}function u(e,n,t){if(e.slice(0,n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(n)}; this is a bug`);return t+e.slice(n.length)}function a(e,n,t){if(!n)return e+t;if(e.slice(-n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(n)}; this is a bug`);return e.slice(0,-n.length)+t}function c(e,n){return u(e,n,"")}function f(e,n){return a(e,n,"")}function h(e,n){return n.slice(0,function(e,n){let t=0;e.length>n.length&&(t=e.length-n.length);let s=n.length;e.length<n.length&&(s=e.length);const o=Array(s);let r=0;o[0]=0;for(let e=1;e<s;e++){for(n[e]==n[r]?o[e]=o[r]:o[e]=r;r>0&&n[e]!=n[r];)r=o[r];n[e]==n[r]&&r++}r=0;for(let s=t;s<e.length;s++){for(;r>0&&e[s]!=n[r];)r=o[r];e[s]==n[r]&&r++}return r}(e,n))}function d(e){let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function p(e){const n=e.match(/^\s*/);return n?n[0]:""}const g="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",m=new RegExp(`[${g}]+|\\s+|[^${g}]`,"ug"),v=new class extends s{equals(e,n,t){return t.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e.trim()===n.trim()}tokenize(e,n={}){let t;if(n.intlSegmenter){const s=n.intlSegmenter;if("word"!=s.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');t=Array.from(s.segment(e),e=>e.segment)}else t=e.match(m)||[];const s=[];let o=null;return t.forEach(e=>{/\s/.test(e)?null==o?s.push(e):s.push(s.pop()+e):null!=o&&/\s/.test(o)?s[s.length-1]==o?s.push(s.pop()+e):s.push(o+e):s.push(e),o=e}),s}join(e){return e.map((e,n)=>0==n?e:e.replace(/^\s+/,"")).join("")}postProcess(e,n){if(!e||n.oneChangePerToken)return e;let t=null,s=null,o=null;return e.forEach(e=>{e.added?s=e:e.removed?o=e:((s||o)&&k(t,o,s,e),t=e,s=null,o=null)}),(s||o)&&k(t,o,s,null),e}};function w(e,n,t){return null==(null==t?void 0:t.ignoreWhitespace)||t.ignoreWhitespace?v.diff(e,n,t):b(e,n,t)}function k(e,n,t,s){if(n&&t){const o=p(n.value),r=d(n.value),h=p(t.value),g=d(t.value);if(e){const s=i(o,h);e.value=a(e.value,h,s),n.value=c(n.value,s),t.value=c(t.value,s)}if(s){const e=l(r,g);s.value=u(s.value,g,e),n.value=f(n.value,e),t.value=f(t.value,e)}}else if(t){if(e){const e=p(t.value);t.value=t.value.substring(e.length)}if(s){const e=p(s.value);s.value=s.value.substring(e.length)}}else if(e&&s){const t=p(s.value),o=p(n.value),r=d(n.value),h=i(t,o);n.value=c(n.value,h);const g=l(c(t,h),r);n.value=f(n.value,g),s.value=u(s.value,t,g),e.value=a(e.value,t,t.slice(0,t.length-g.length))}else if(s){const e=p(s.value),t=h(d(n.value),e);n.value=f(n.value,t)}else if(e){const t=h(d(e.value),p(n.value));n.value=c(n.value,t)}}const y=new class extends s{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${g}]+|[^\\S\\n\\r]+|[^${g}]`,"ug");return e.match(n)||[]}};function b(e,n,t){return y.diff(e,n,t)}const L=new class extends s{constructor(){super(...arguments),this.tokenize=j}equals(e,n,t){return t.ignoreWhitespace?(t.newlineIsToken&&e.includes("\n")||(e=e.trim()),t.newlineIsToken&&n.includes("\n")||(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),n.endsWith("\n")&&(n=n.slice(0,-1))),super.equals(e,n,t)}};function C(e,n,t){return L.diff(e,n,t)}function P(e,n,t){return t=function(e,n){if("function"==typeof e)n.callback=e;else if(e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}(t,{ignoreWhitespace:!0}),L.diff(e,n,t)}function j(e,n){n.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));const t=[],s=e.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(let e=0;e<s.length;e++){const o=s[e];e%2&&!n.newlineIsToken?t[t.length-1]+=o:t.push(o)}return t}function O(e){return"."==e||"!"==e||"?"==e}const S=new class extends s{tokenize(e){var n;const t=[];let s=0;for(let o=0;o<e.length;o++){if(o==e.length-1){t.push(e.slice(s));break}if(O(e[o])&&e[o+1].match(/\s/)){for(t.push(e.slice(s,o+1)),o=s=o+1;null===(n=e[o+1])||void 0===n?void 0:n.match(/\s/);)o++;t.push(e.slice(s,o+1)),s=o+1}}return t}};function x(e,n,t){return S.diff(e,n,t)}const W=new class extends s{tokenize(e){return e.split(/([{}:;,]|\s+)/)}};function E(e,n,t){return W.diff(e,n,t)}const F=new class extends s{constructor(){super(...arguments),this.tokenize=j}get useLongestToken(){return!0}castInput(e,n){const{undefinedReplacement:t,stringifyReplacer:s=(e,n)=>void 0===n?t:n}=n;return"string"==typeof e?e:JSON.stringify(T(e,null,null,s),null," ")}equals(e,n,t){return super.equals(e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),t)}};function N(e,n,t){return F.diff(e,n,t)}function T(e,n,t,s,o){let r,i;for(n=n||[],t=t||[],s&&(e=s(void 0===o?"":o,e)),r=0;r<n.length;r+=1)if(n[r]===e)return t[r];if("[object Array]"===Object.prototype.toString.call(e)){for(n.push(e),i=new Array(e.length),t.push(i),r=0;r<e.length;r+=1)i[r]=T(e[r],n,t,s,String(r));return n.pop(),t.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),"object"==typeof e&&null!==e){n.push(e),i={},t.push(i);const o=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&o.push(l);for(o.sort(),r=0;r<o.length;r+=1)l=o[r],i[l]=T(e[l],n,t,s,l);n.pop(),t.pop()}else i=e;return i}const A=new class extends s{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function $(e,n,t){return A.diff(e,n,t)}function z(e){return Array.isArray(e)?e.map(e=>z(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((n,t)=>{var s;return n.startsWith("\\")||n.endsWith("\r")||(null===(s=e.lines[t+1])||void 0===s?void 0:s.startsWith("\\"))?n:n+"\r"})}))})}function D(e){return Array.isArray(e)?e.map(e=>D(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith("\r")?e.substring(0,e.length-1):e)}))})}function I(e){const n=e.split(/\n/),t=[];let s=0;function o(){const e={};for(t.push(e);s<n.length;){const t=n[s];if(/^(---|\+\+\+|@@)\s/.test(t))break;const o=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(t);o&&(e.index=o[1]),s++}for(r(e),r(e),e.hunks=[];s<n.length;){const t=n[s];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(t))break;if(/^@@/.test(t))e.hunks.push(i());else{if(t)throw new Error("Unknown line "+(s+1)+" "+JSON.stringify(t));s++}}}function r(e){const t=/^(---|\+\+\+)\s+(.*)\r?$/.exec(n[s]);if(t){const n=t[2].split("\t",2),o=(n[1]||"").trim();let r=n[0].replace(/\\\\/g,"\\");/^".*"$/.test(r)&&(r=r.substr(1,r.length-2)),"---"===t[1]?(e.oldFileName=r,e.oldHeader=o):(e.newFileName=r,e.newHeader=o),s++}}function i(){var e;const t=s,o=n[s++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),r={oldStart:+o[1],oldLines:void 0===o[2]?1:+o[2],newStart:+o[3],newLines:void 0===o[4]?1:+o[4],lines:[]};0===r.oldLines&&(r.oldStart+=1),0===r.newLines&&(r.newStart+=1);let i=0,l=0;for(;s<n.length&&(l<r.oldLines||i<r.newLines||(null===(e=n[s])||void 0===e?void 0:e.startsWith("\\")));s++){const e=0==n[s].length&&s!=n.length-1?" ":n[s][0];if("+"!==e&&"-"!==e&&" "!==e&&"\\"!==e)throw new Error(`Hunk at line ${t+1} contained invalid line ${n[s]}`);r.lines.push(n[s]),"+"===e?i++:"-"===e?l++:" "===e&&(i++,l++)}if(i||1!==r.newLines||(r.newLines=0),l||1!==r.oldLines||(r.oldLines=0),i!==r.newLines)throw new Error("Added line count did not match for hunk at line "+(t+1));if(l!==r.oldLines)throw new Error("Removed line count did not match for hunk at line "+(t+1));return r}for(;s<n.length;)o();return t}function H(e,n,t){let s=!0,o=!1,r=!1,i=1;return function l(){if(s&&!r){if(o?i++:s=!1,e+i<=t)return e+i;r=!0}if(!o)return r||(s=!0),n<=e-i?e-i++:(o=!0,l())}}function J(e,n,t={}){let s;if(s="string"==typeof n?I(n):Array.isArray(n)?n:[n],s.length>1)throw new Error("applyPatch only works with a single input.");return function(e,n,t={}){var s;(t.autoConvertLineEndings||null==t.autoConvertLineEndings)&&((s=e).includes("\r\n")&&!s.startsWith("\n")&&!s.match(/[^\r]\n/)&&function(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith("\\")&&e.endsWith("\r"))))}(n)?n=z(n):function(e){return!e.includes("\r\n")&&e.includes("\n")}(e)&&function(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith("\r"))))&&e.every(e=>e.hunks.every(e=>e.lines.every((n,t)=>{var s;return n.startsWith("\\")||n.endsWith("\r")||(null===(s=e.lines[t+1])||void 0===s?void 0:s.startsWith("\\"))})))}(n)&&(n=D(n)));const o=e.split("\n"),r=n.hunks,i=t.compareLine||((e,n,t,s)=>n===s),l=t.fuzzFactor||0;let u=0;if(l<0||!Number.isInteger(l))throw new Error("fuzzFactor must be a non-negative integer");if(!r.length)return e;let a="",c=!1,f=!1;for(let e=0;e<r[r.length-1].lines.length;e++){const n=r[r.length-1].lines[e];"\\"==n[0]&&("+"==a[0]?c=!0:"-"==a[0]&&(f=!0)),a=n}if(c){if(f){if(!l&&""==o[o.length-1])return!1}else if(""==o[o.length-1])o.pop();else if(!l)return!1}else if(f)if(""!=o[o.length-1])o.push("");else if(!l)return!1;function h(e,n,t,s=0,r=!0,l=[],u=0){let a=0,c=!1;for(;s<e.length;s++){const f=e[s],d=f.length>0?f[0]:" ",p=f.length>0?f.substr(1):f;if("-"===d){if(!i(n+1,o[n],d,p))return t&&null!=o[n]?(l[u]=o[n],h(e,n+1,t-1,s,!1,l,u+1)):null;n++,a=0}if("+"===d){if(!r)return null;l[u]=p,u++,a=0,c=!0}if(" "===d){if(a++,l[u]=o[n],!i(n+1,o[n],d,p))return c||!t?null:o[n]&&(h(e,n+1,t-1,s+1,!1,l,u+1)||h(e,n+1,t-1,s,!1,l,u+1))||h(e,n,t-1,s+1,!1,l,u);u++,r=!0,c=!1,n++}}return u-=a,n-=a,l.length=u,{patchedLines:l,oldLineLastI:n-1}}const d=[];let p=0;for(let e=0;e<r.length;e++){const n=r[e];let t;const s=o.length-n.oldLines+l;let i;for(let e=0;e<=l;e++){i=n.oldStart+p-1;const o=H(i,u,s);for(;void 0!==i&&(t=h(n.lines,i,e),!t);i=o());if(t)break}if(!t)return!1;for(let e=u;e<i;e++)d.push(o[e]);for(let e=0;e<t.patchedLines.length;e++){const n=t.patchedLines[e];d.push(n)}u=t.oldLineLastI+1,p=i+1-n.oldStart}for(let e=u;e<o.length;e++)d.push(o[e]);return d.join("\n")}(e,s[0],t)}function q(e,n){const t="string"==typeof e?I(e):e;let s=0;!function e(){const o=t[s++];if(!o)return n.complete();n.loadFile(o,function(t,s){if(t)return n.complete(t);const r=J(s,o,n);n.patched(o,r,function(t){if(t)return n.complete(t);e()})})}()}function M(e){return Array.isArray(e)?e.map(e=>M(e)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(e=>e.startsWith("-")?`+${e.slice(1)}`:e.startsWith("+")?`-${e.slice(1)}`:e)}))})}function R(e,n,t,s,o,r,i){let l;l=i?"function"==typeof i?{callback:i}:i:{},void 0===l.context&&(l.context=4);const u=l.context;if(l.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!l.callback)return a(C(t,s,l));{const{callback:e}=l;C(t,s,Object.assign(Object.assign({},l),{callback:n=>{const t=a(n);e(t)}}))}function a(t){if(!t)return;function s(e){return e.map(function(e){return" "+e})}t.push({value:"",lines:[]});const i=[];let l=0,a=0,c=[],f=1,h=1;for(let e=0;e<t.length;e++){const n=t[e],o=n.lines||X(n.value);if(n.lines=o,n.added||n.removed){if(!l){const n=t[e-1];l=f,a=h,n&&(c=u>0?s(n.lines.slice(-u)):[],l-=c.length,a-=c.length)}for(const e of o)c.push((n.added?"+":"-")+e);n.added?h+=o.length:f+=o.length}else{if(l)if(o.length<=2*u&&e<t.length-2)for(const e of s(o))c.push(e);else{const e=Math.min(o.length,u);for(const n of s(o.slice(0,e)))c.push(n);const n={oldStart:l,oldLines:f-l+e,newStart:a,newLines:h-a+e,lines:c};i.push(n),l=0,a=0,c=[]}f+=o.length,h+=o.length}}for(const e of i)for(let n=0;n<e.lines.length;n++)e.lines[n].endsWith("\n")?e.lines[n]=e.lines[n].slice(0,-1):(e.lines.splice(n+1,0,"\"),n++);return{oldFileName:e,newFileName:n,oldHeader:o,newHeader:r,hunks:i}}}function _(e){if(Array.isArray(e))return e.map(_).join("\n");const n=[];e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),n.push("==================================================================="),n.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":"\t"+e.oldHeader)),n.push("+++ "+e.newFileName+(void 0===e.newHeader?"":"\t"+e.newHeader));for(let t=0;t<e.hunks.length;t++){const s=e.hunks[t];0===s.oldLines&&(s.oldStart-=1),0===s.newLines&&(s.newStart-=1),n.push("@@ -"+s.oldStart+","+s.oldLines+" +"+s.newStart+","+s.newLines+" @@");for(const e of s.lines)n.push(e)}return n.join("\n")+"\n"}function V(e,n,t,s,o,r,i){if("function"==typeof i&&(i={callback:i}),!(null==i?void 0:i.callback)){const l=R(e,n,t,s,o,r,i);if(!l)return;return _(l)}{const{callback:l}=i;R(e,n,t,s,o,r,Object.assign(Object.assign({},i),{callback:e=>{l(e?_(e):void 0)}}))}}function U(e,n,t,s,o,r){return V(e,e,n,t,s,o,r)}function X(e){const n=e.endsWith("\n"),t=e.split("\n").map(e=>e+"\n");return n?t.pop():t.push(t.pop().slice(0,-1)),t}function Z(e){const n=[];let t,s;for(let o=0;o<e.length;o++)t=e[o],s=t.added?1:t.removed?-1:0,n.push([s,t.value]);return n}function B(e){const n=[];for(let t=0;t<e.length;t++){const s=e[t];s.added?n.push("<ins>"):s.removed&&n.push("<del>"),n.push(G(s.value)),s.added?n.push("</ins>"):s.removed&&n.push("</del>")}return n.join("")}function G(e){let n=e;return n=n.replace(/&/g,"&amp;"),n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(/"/g,"&quot;"),n}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunksignalpilot_ai_internal=self.webpackChunksignalpilot_ai_internal||[]).push([[512],{68512:(e,t,r)=>{r.r(t),r.d(t,{InvalidTokenError:()=>n,jwtDecode:()=>a});class n extends Error{}function a(e,t){if("string"!=typeof e)throw new n("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,a=e.split(".")[r];if("string"!=typeof a)throw new n(`Invalid token specified: missing part #${r+1}`);let i;try{i=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return atob(t)}}(a)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new n(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}}]);