posthog-js 1.455.0 → 1.455.1

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 (42) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/customizations.js +1 -1
  13. package/dist/default-extensions.js +1 -1
  14. package/dist/exception-autocapture.d.ts +4 -3
  15. package/dist/exception-autocapture.js +1 -1
  16. package/dist/exception-autocapture.js.map +1 -1
  17. package/dist/extension-bundles.js +1 -1
  18. package/dist/external-scripts-loader.js +1 -1
  19. package/dist/integrity.json +28 -28
  20. package/dist/lazy-recorder.js +1 -1
  21. package/dist/main.js +1 -1
  22. package/dist/module.full.cjs +1 -1
  23. package/dist/module.full.js +1 -1
  24. package/dist/module.full.js.map +1 -1
  25. package/dist/module.full.no-external.cjs +1 -1
  26. package/dist/module.full.no-external.js +1 -1
  27. package/dist/module.full.no-external.js.map +1 -1
  28. package/dist/module.js +1 -1
  29. package/dist/module.mjs +1 -1
  30. package/dist/module.no-external.cjs +1 -1
  31. package/dist/module.no-external.js +1 -1
  32. package/dist/module.slim.js +1 -1
  33. package/dist/module.slim.no-external.js +1 -1
  34. package/dist/posthog-recorder.js +1 -1
  35. package/dist/src/entrypoints/exception-autocapture.d.ts +4 -3
  36. package/dist/surveys-preview.js +1 -1
  37. package/dist/surveys.js +1 -1
  38. package/lib/package.json +1 -1
  39. package/lib/src/entrypoints/exception-autocapture.d.ts +4 -3
  40. package/lib/src/entrypoints/exception-autocapture.js +92 -42
  41. package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
  42. package/package.json +4 -4
@@ -1,2 +1,2 @@
1
- !function(){var e=["retriesPerformedSoFar"],t=["$set_once","$set"];function n(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}function s(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=Object.create((r&&r.prototype instanceof a?r:a).prototype);return c(u,"_invoke",function(n,r,i){var o,a,u,l=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,f.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!d&&l&&!i&&c.length>t;t++){var i,o=c[t],h=f.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):h>=o[0]&&((i=2>n&&o[1]>h)?(a=0,f.v=r,f.n=o[1]):p>h&&(i=3>n||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,a=0))}if(i||n>1)return s;throw d=!0,r}return function(i,c,p){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,p),a=c,u=p;(t=2>a?e:u)||!d;){o||(a?3>a?(a>1&&(f.n=-1),h(a,u)):f.n=u:f.v=u);try{if(l=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,2>a&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),2>a&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(d=0>f.n)?u:n.call(r,f))!==s)break}catch(t){o=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,i,o),!0),u}var s={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),h=d.prototype=a.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=d,c(h,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,i,"GeneratorFunction"),c(h),c(h,i,"Generator"),c(h,r,function(){return this}),c(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function c(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}c=function(e,t,n,r){function o(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},c(e,t,n,r)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(null,arguments)}function f(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){f(o,r,i,s,a,"next",e)}function a(e){f(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return e.length>r?{done:!1,value:e[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}!function(s,u,c,f){var _,v,g,m,y,b,w,S,k,x,C,P,E,T,F,I=function(e,t){return function(){return t||(e((t={exports:{}}).exports,t),e=null),t.exports}},R=I(function(e,t){var n=function(e){return e&&e.Math===Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}),A=I(function(e,t){t.exports=function(e){try{return!!e()}catch(e){return!0}}}),M=I(function(e,t){t.exports=!A()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),O=I(function(e,t){t.exports=!A()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}),L=I(function(e,t){var n=O(),r=function(){}.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}}),D=I(function(e){var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t}),q=I(function(e,t){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}}),N=I(function(e,t){var n=O(),r=Function.prototype,i=r.call,o=n&&r.bind.bind(i,i);t.exports=n?o:function(e){return function(){return i.apply(e,arguments)}}}),B=I(function(e,t){var n=N(),r=n({}.toString),i=n("".slice);t.exports=function(e){return i(r(e),8,-1)}}),j=I(function(e,t){var n=N(),r=A(),i=B(),o=Object,s=n("".split);t.exports=r(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?s(e,""):o(e)}:o}),H=I(function(e,t){t.exports=function(e){return null==e}}),z=I(function(e,t){var n=H(),r=TypeError;t.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}}),U=I(function(e,t){var n=j(),r=z();t.exports=function(e){return n(r(e))}}),W=I(function(e,t){var n="object"==typeof document&&document.all;t.exports=void 0===n&&void 0!==n?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}}),V=I(function(e,t){var n=W();t.exports=function(e){return"object"==typeof e?null!==e:n(e)}}),G=I(function(e,t){var n=R(),r=W();t.exports=function(e,t){return 2>arguments.length?r(i=n[e])?i:void 0:n[e]&&n[e][t];var i}}),K=I(function(e,t){t.exports=N()({}.isPrototypeOf)}),Q=I(function(e,t){var n=R().navigator,r=n&&n.userAgent;t.exports=r?String(r):""}),Y=I(function(e,t){var n,r,i=R(),o=Q(),s=i.process,a=i.Deno,u=s&&s.versions||a&&a.version,l=u&&u.v8;l&&(r=(n=l.split("."))[0]>0&&4>n[0]?1:+(n[0]+n[1])),!r&&o&&((n=o.match(/Edge\/(\d+)/))&&74>n[1]||(n=o.match(/Chrome\/(\d+)/))&&(r=+n[1])),t.exports=r}),J=I(function(e,t){var n=Y(),r=A(),i=R().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&41>n})}),Z=I(function(e,t){t.exports=J()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),X=I(function(e,t){var n=G(),r=W(),i=K(),o=Z(),s=Object;t.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&i(t.prototype,s(e))}}),ee=I(function(e,t){var n=String;t.exports=function(e){try{return n(e)}catch(e){return"Object"}}}),te=I(function(e,t){var n=W(),r=ee(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a function")}}),ne=I(function(e,t){var n=te(),r=H();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}}),re=I(function(e,t){var n=L(),r=W(),i=V(),o=TypeError;t.exports=function(e,t){var s,a;if("string"===t&&r(s=e.toString)&&!i(a=n(s,e)))return a;if(r(s=e.valueOf)&&!i(a=n(s,e)))return a;if("string"!==t&&r(s=e.toString)&&!i(a=n(s,e)))return a;throw new o("Can't convert object to primitive value")}}),ie=I(function(e,t){t.exports=!1}),oe=I(function(e,t){var n=R(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}}),se=I(function(e,t){var n=ie(),r=R(),i=oe(),o="__core-js_shared__",s=t.exports=r[o]||i(o,{});(s.versions||(s.versions=[])).push({version:"3.49.0",mode:n?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),ae=I(function(e,t){var n=se();t.exports=function(e,t){return n[e]||(n[e]=t||{})}}),ue=I(function(e,t){var n=z(),r=Object;t.exports=function(e){return r(n(e))}}),le=I(function(e,t){var n=N(),r=ue(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}}),ce=I(function(e,t){var n=N(),r=0,i=Math.random(),o=n(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+i,36)}}),de=I(function(e,t){var n=R(),r=ae(),i=le(),o=ce(),s=J(),a=Z(),u=n.Symbol,l=r("wks"),c=a?u.for||u:u&&u.withoutSetter||o;t.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:c("Symbol."+e)),l[e]}}),fe=I(function(e,t){var n=L(),r=V(),i=X(),o=ne(),s=re(),a=de(),u=TypeError,l=a("toPrimitive");t.exports=function(e,t){if(!r(e)||i(e))return e;var a,c=o(e,l);if(c){if(void 0===t&&(t="default"),a=n(c,e,t),!r(a)||i(a))return a;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}}),he=I(function(e,t){var n=fe(),r=X();t.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}}),pe=I(function(e,t){var n=R(),r=V(),i=n.document,o=r(i)&&r(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}}),_e=I(function(e,t){var n=M(),r=A(),i=pe();t.exports=!n&&!r(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),ve=I(function(e){var t=M(),n=L(),r=D(),i=q(),o=U(),s=he(),a=le(),u=_e(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=o(e),t=s(t),u)try{return l(e,t)}catch(e){}if(a(e,t))return i(!n(r.f,e,t),e[t])}}),ge=I(function(e,t){var n=M(),r=A();t.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),me=I(function(e,t){var n=V(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not an object")}}),ye=I(function(e){var t=M(),n=_e(),r=ge(),i=me(),o=he(),s=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",d="writable";e.f=t?r?function(e,t,n){if(i(e),t=o(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=u(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:c in n?n[c]:r[c],enumerable:l in n?n[l]:r[l],writable:!1})}return a(e,t,n)}:a:function(e,t,r){if(i(e),t=o(t),i(r),n)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new s("Accessors not supported");return"value"in r&&(e[t]=r.value),e}}),be=I(function(e,t){var n=M(),r=ye(),i=q();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}}),we=I(function(e,t){var n=M(),r=le(),i=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,s=r(i,"name");t.exports={EXISTS:s,PROPER:s&&"something"===function(){}.name,CONFIGURABLE:s&&(!n||n&&o(i,"name").configurable)}}),Se=I(function(e,t){var n=N(),r=W(),i=se(),o=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),t.exports=i.inspectSource}),ke=I(function(e,t){var n=R(),r=W(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))}),xe=I(function(e,t){var n=ae(),r=ce(),i=n("keys");t.exports=function(e){return i[e]||(i[e]=r(e))}}),Ce=I(function(e,t){t.exports={}}),Pe=I(function(e,t){var n,r,i,o=ke(),s=R(),a=V(),u=be(),l=le(),c=se(),d=xe(),f=Ce(),h="Object already initialized",p=s.TypeError;if(o||c.state){var _=c.state||(c.state=new(0,s.WeakMap));_.get=_.get,_.has=_.has,_.set=_.set,n=function(e,t){if(_.has(e))throw new p(h);return t.facade=e,_.set(e,t),t},r=function(e){return _.get(e)||{}},i=function(e){return _.has(e)}}else{var v=d("state");f[v]=!0,n=function(e,t){if(l(e,v))throw new p(h);return t.facade=e,u(e,v,t),t},r=function(e){return l(e,v)?e[v]:{}},i=function(e){return l(e,v)}}t.exports={set:n,get:r,has:i,enforce:function(e){return i(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=r(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}),Ee=I(function(e,t){var n=N(),r=A(),i=W(),o=le(),s=M(),a=we().CONFIGURABLE,u=Se(),l=Pe(),c=l.enforce,d=l.get,f=String,h=Object.defineProperty,p=n("".slice),_=n("".replace),v=n([].join),g=s&&!r(function(){return 8!==h(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=t.exports=function(e,t,n){"Symbol("===p(f(t),0,7)&&(t="["+_(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||a&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&o(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=c(e);return o(r,"source")||(r.source=v(m,"string"==typeof t?t:"")),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||u(this)},"toString")}),Te=I(function(e,t){var n=W(),r=ye(),i=Ee(),o=oe();t.exports=function(e,t,s,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:t;if(n(s)&&i(s,l,a),a.global)u?e[t]=s:o(t,s);else{try{a.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=s:r.f(e,t,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}}),Fe=I(function(e,t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}}),Ie=I(function(e,t){var n=Fe();t.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}}),Re=I(function(e,t){var n=Ie(),r=Math.max,i=Math.min;t.exports=function(e,t){var o=n(e);return 0>o?r(o+t,0):i(o,t)}}),Ae=I(function(e,t){var n=Ie(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}}),Me=I(function(e,t){var n=Ae();t.exports=function(e){return n(e.length)}}),Oe=I(function(e,t){var n=U(),r=Re(),i=Me(),o=function(e){return function(t,o,s){var a=n(t),u=i(a);if(0===u)return!e&&-1;var l,c=r(s,u);if(e&&o!=o){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((e||c in a)&&a[c]===o)return e||c||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}}),Le=I(function(e,t){var n=N(),r=le(),i=U(),o=Oe().indexOf,s=Ce(),a=n([].push);t.exports=function(e,t){var n,u=i(e),l=0,c=[];for(n in u)!r(s,n)&&r(u,n)&&a(c,n);for(;t.length>l;)r(u,n=t[l++])&&(~o(c,n)||a(c,n));return c}}),De=I(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),$e=I(function(e){var t=Le(),n=De().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}}),qe=I(function(e){e.f=Object.getOwnPropertySymbols}),Ne=I(function(e,t){var n=G(),r=N(),i=$e(),o=qe(),s=me(),a=r([].concat);t.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=o.f;return n?a(t,n(e)):t}}),Be=I(function(e,t){var n=le(),r=Ne(),i=ve(),o=ye();t.exports=function(e,t,s){for(var a=r(t),u=o.f,l=i.f,c=0;a.length>c;c++){var d=a[c];n(e,d)||s&&n(s,d)||u(e,d,l(t,d))}}}),je=I(function(e,t){var n=A(),r=W(),i=/#|\.prototype\./,o=function(e,t){var i=a[s(e)];return i===l||i!==u&&(r(t)?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=o.data={},u=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o}),He=I(function(e,t){var n=R(),r=ve().f,i=be(),o=Te(),s=oe(),a=Be(),u=je();t.exports=function(e,t){var l,c,d,f,h,p=e.target,_=e.global,v=e.stat;if(l=_?n:v?n[p]||s(p,{}):n[p]&&n[p].prototype)for(c in t){if(f=t[c],d=e.dontCallGetSet?(h=r(l,c))&&h.value:l[c],!u(_?c:p+(v?".":"#")+c,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;a(f,d)}(e.sham||d&&d.sham)&&i(f,"sham",!0),o(l,c,f,e)}}}),ze=I(function(e,t){t.exports=!A()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),Ue=I(function(e,t){var n=le(),r=W(),i=ue(),o=xe(),s=ze(),a=o("IE_PROTO"),u=Object,l=u.prototype;t.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(n(t,a))return t[a];var o=t.constructor;return r(o)&&t instanceof o?o.prototype:t instanceof u?l:null}}),We=I(function(e,t){var n=Le(),r=De();t.exports=Object.keys||function(e){return n(e,r)}}),Ve=I(function(e,t){var n=M(),r=A(),i=N(),o=Ue(),s=We(),a=U(),u=i(D().f),l=i([].push),c=n&&r(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),d=function(e){return function(t){for(var r,i=a(t),d=s(i),f=c&&null===o(i),h=d.length,p=0,_=[];h>p;)r=d[p++],n&&!(f?r in i:u(i,r))||l(_,e?[r,i[r]]:i[r]);return _}};t.exports={entries:d(!0),values:d(!1)}}),Ge=I(function(){var $=He(),e=Ve().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}),Ke=I(function(e,t){t.exports=R()}),Qe=I(function(e,t){Ge(),t.exports=Ke().Object.entries}),Ye=I(function(e,t){t.exports=Qe()}),Je=I(function(e,t){t.exports=Ye()}),Ze=I(function(e,t){t.exports=Je()}),Xe=I(function(e,t){t.exports=Ze()}),et=I(function(e){var t=M(),n=ge(),r=ye(),i=me(),o=U(),s=We();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),u=s(t),l=u.length,c=0;l>c;)r.f(e,n=u[c++],a[n]);return e}}),tt=I(function(e,t){t.exports=G()("document","documentElement")}),nt=I(function(e,t){var n,r=me(),i=et(),o=De(),s=Ce(),a=tt(),u=pe(),l=xe(),c="prototype",d="script",f=l("IE_PROTO"),h=function(){},p=function(e){return"<"+d+">"+e+"</"+d+">"},_=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;v="undefined"!=typeof document?document.domain&&n?_(n):(t=u("iframe"),r="java"+d+":",t.style.display="none",a.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):_(n);for(var i=o.length;i--;)delete v[c][o[i]];return v()};s[f]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(h[c]=r(e),n=new h,h[c]=null,n[f]=e):n=v(),void 0===t?n:i.f(n,t)}}),rt=I(function(e,t){var n=de(),r=nt(),i=ye().f,o=n("unscopables"),s=Array.prototype;void 0===s[o]&&i(s,o,{configurable:!0,value:r(null)}),t.exports=function(e){s[o][e]=!0}}),it=I(function(e,t){t.exports={}}),ot=I(function(e,t){var n,r,i,o=A(),s=W(),a=V(),u=nt(),l=Ue(),c=Te(),d=de(),f=ie(),h=d("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(r=l(l(i)))!==Object.prototype&&(n=r):p=!0),!a(n)||o(function(){var e={};return n[h].call(e)!==e})?n={}:f&&(n=u(n)),s(n[h])||c(n,h,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}}),st=I(function(e,t){var n=ye().f,r=le(),i=de()("toStringTag");t.exports=function(e,t,o){e&&!o&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}}),at=I(function(e,t){var n=ot().IteratorPrototype,r=nt(),i=q(),o=st(),s=it(),a=function(){return this};t.exports=function(e,t,u,l){var c=t+" Iterator";return e.prototype=r(n,{next:i(+!l,u)}),o(e,c,!1,!0),s[c]=a,e}}),ut=I(function(e,t){var n=N(),r=te();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}}),lt=I(function(e,t){var n=V();t.exports=function(e){return n(e)||null===e}}),ct=I(function(e,t){var n=lt(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i("Can't set "+r(e)+" as a prototype")}}),dt=I(function(e,t){var n=ut(),r=V(),i=z(),o=ct();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=n(Object.prototype,"__proto__","set"))(s,[]),t=s instanceof Array}catch(e){}return function(n,s){return i(n),o(s),r(n)?(t?e(n,s):n.__proto__=s,n):n}}():void 0)}),ft=I(function(e,t){var $=He(),n=L(),r=ie(),i=we(),o=W(),s=at(),a=Ue(),u=dt(),l=st(),c=be(),d=Te(),f=de(),h=it(),p=ot(),_=i.PROPER,v=i.CONFIGURABLE,g=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",w="values",S="entries",k=function(){return this};t.exports=function(e,t,i,f,p,x,C){s(i,t,f);var P,E,T,F=function(e){if(e===p&&O)return O;if(!m&&e&&e in A)return A[e];switch(e){case b:case w:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},I=t+" Iterator",R=!1,A=e.prototype,M=A[y]||A["@@iterator"]||p&&A[p],O=!m&&M||F(p),L="Array"===t&&A.entries||M;if(L&&(P=a(L.call(new e)))!==Object.prototype&&P.next&&(r||a(P)===g||(u?u(P,g):o(P[y])||d(P,y,k)),l(P,I,!0,!0),r&&(h[I]=k)),_&&p===w&&M&&M.name!==w&&(!r&&v?c(A,"name",w):(R=!0,O=function(){return n(M,this)})),p)if(E={values:F(w),keys:x?O:F(b),entries:F(S)},C)for(T in E)(m||R||!(T in A))&&d(A,T,E[T]);else $({target:t,proto:!0,forced:m||R},E);return r&&!C||A[y]===O||d(A,y,O,{name:p}),h[t]=O,E}}),ht=I(function(e,t){t.exports=function(e,t){return{value:e,done:t}}}),pt=I(function(e,t){var n=U(),r=rt(),i=it(),o=Pe(),s=ye().f,a=ft(),u=ht(),l=ie(),c=M(),d="Array Iterator",f=o.set,h=o.getterFor(d);t.exports=a(Array,"Array",function(e,t){f(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=h(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,u(void 0,!0);switch(e.kind){case"keys":return u(n,!1);case"values":return u(t[n],!1)}return u([n,t[n]],!1)},"values");var p=i.Arguments=i.Array;if(r("keys"),r("values"),r("entries"),!l&&c&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch(e){}}),_t=I(function(e,t){var n=B(),r=N();t.exports=function(e){if("Function"===n(e))return r(e)}}),vt=I(function(e,t){var n=_t(),r=te(),i=O(),o=n(n.bind);t.exports=function(e,t){return r(e),void 0===t?e:i?o(e,t):function(){return e.apply(t,arguments)}}}),gt=I(function(e,t){var n=de(),r=it(),i=n("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}}),mt=I(function(e,t){var n={};n[de()("toStringTag")]="z",t.exports="[object z]"===String(n)}),yt=I(function(e,t){var n=mt(),r=W(),i=B(),o=de()("toStringTag"),s=Object,a="Arguments"===i(function(){return arguments}());t.exports=n?i:function(e){var t,n,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:a?i(t):"Object"===(u=i(t))&&r(t.callee)?"Arguments":u}}),bt=I(function(e,t){var n=yt(),r=ne(),i=H(),o=it(),s=de()("iterator");t.exports=function(e){if(!i(e))return r(e,s)||r(e,"@@iterator")||o[n(e)]}}),wt=I(function(e,t){var n=L(),r=te(),i=me(),o=ee(),s=bt(),a=TypeError;t.exports=function(e,t){var u=2>arguments.length?s(e):t;if(r(u))return i(n(u,e));throw new a(o(e)+" is not iterable")}}),St=I(function(e,t){var n=L(),r=me(),i=ne();t.exports=function(e,t,o){var s,a;r(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw o;return o}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw o;if(a)throw s;return r(s),o}}),kt=I(function(e,t){var n=vt(),r=L(),i=me(),o=ee(),s=gt(),a=Me(),u=K(),l=wt(),c=bt(),d=St(),f=TypeError,h=function(e,t){this.stopped=e,this.result=t},p=h.prototype;t.exports=function(e,t,_){var v,g,m,y,b,w,S,k=!(!_||!_.AS_ENTRIES),x=!(!_||!_.IS_RECORD),C=!(!_||!_.IS_ITERATOR),P=!(!_||!_.INTERRUPTED),E=n(t,_&&_.that),T=function(e){var t=v;return v=void 0,t&&d(t,"normal"),new h(!0,e)},F=function(e){return k?(i(e),P?E(e[0],e[1],T):E(e[0],e[1])):P?E(e,T):E(e)};if(x)v=e.iterator;else if(C)v=e;else{if(!(g=c(e)))throw new f(o(e)+" is not iterable");if(s(g)){for(m=0,y=a(e);y>m;m++)if((b=F(e[m]))&&u(p,b))return b;return new h(!1)}v=l(e,g)}for(w=x?e.next:v.next;!(S=r(w,v)).done;){var I=S.value;try{b=F(I)}catch(e){if(!v)throw e;d(v,"throw",e)}if("object"==typeof b&&b&&u(p,b))return b}return new h(!1)}}),xt=I(function(e,t){var n=M(),r=ye(),i=q();t.exports=function(e,t,o){n?r.f(e,t,i(0,o)):e[t]=o}}),Ct=I(function(){var $=He(),e=kt(),t=xt();$({target:"Object",stat:!0},{fromEntries:function(n){var r={};return e(n,function(e,n){t(r,e,n)},{AS_ENTRIES:!0}),r}})}),Pt=I(function(e,t){pt(),Ct(),t.exports=Ke().Object.fromEntries}),Et=I(function(e,t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),Tt=I(function(e,t){var n=pe()("span").classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r}),Ft=I(function(){var e=R(),t=Et(),n=Tt(),r=pt(),i=be(),o=st(),s=de()("iterator"),a=r.values,u=function(e,n){if(e){if(e[s]!==a)try{i(e,s,a)}catch(t){e[s]=a}if(o(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{i(e,u,r[u])}catch(t){e[u]=r[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);u(n,"DOMTokenList")}),It=I(function(e,t){var n=Pt();Ft(),t.exports=n}),Rt=I(function(e,t){t.exports=It()}),At=I(function(e,t){t.exports=Rt()}),Mt=I(function(e,t){t.exports=At()}),Ot=I(function(e,t){var n=V(),r=be();t.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}}),Lt=I(function(e,t){var n=N(),r=Error,i=n("".replace),o=String(new r("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,a=s.test(o);t.exports=function(e,t){if(a&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=i(e,s,"");return e}}),Dt=I(function(e,t){var n=A(),r=q();t.exports=!n(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)})}),$t=I(function(e,t){var n=be(),r=Lt(),i=Dt(),o=Error.captureStackTrace;t.exports=function(e,t,s,a){i&&(o?o(e,t):n(e,"stack",r(s,a)))}}),qt=I(function(e,t){var n=yt(),r=String;t.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}}),Nt=I(function(e,t){var n=qt();t.exports=function(e,t){return void 0===e?2>arguments.length?"":t:n(e)}}),Bt=I(function(){var $=He(),e=K(),t=Ue(),n=dt(),r=Be(),i=nt(),o=be(),s=q(),a=Ot(),u=$t(),l=kt(),c=Nt(),d=de()("toStringTag"),f=Error,h=[].push,p=function(r,s){var v,g=e(_,this);n?v=n(new f,g?t(this):_):(v=g?this:i(_),o(v,d,"Error")),void 0!==s&&o(v,"message",c(s)),u(v,p,v.stack,1),arguments.length>2&&a(v,arguments[2]);var m=[];return l(r,h,{that:m}),o(v,"errors",m),v};n?n(p,f):r(p,f,{name:!0});var _=p.prototype=i(f.prototype,{constructor:s(1,p),message:s(1,""),name:s(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:p})}),jt=I(function(){Bt()}),Ht=I(function(e,t){var n=mt(),r=yt();t.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}}),zt=I(function(){var e=mt(),t=Te(),n=Ht();e||t(Object.prototype,"toString",n,{unsafe:!0})}),Ut=I(function(e,t){var n=R(),r=Q(),i=B(),o=function(e){return r.slice(0,e.length)===e};t.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}),Wt=I(function(e,t){t.exports="NODE"===Ut()}),Vt=I(function(e,t){var n=Ee(),r=ye();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}}),Gt=I(function(e,t){var n=G(),r=Vt(),i=de(),o=M(),s=i("species");t.exports=function(e){var t=n(e);o&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}}),Kt=I(function(e,t){var n=K(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}}),Qt=I(function(e,t){var n=N(),r=A(),i=W(),o=yt(),s=G(),a=Se(),u=function(){},l=s("Reflect","construct"),c=/^\s*(?:class|function)\b/,d=n(c.exec),f=!c.test(u),h=function(e){if(!i(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},p=function(e){if(!i(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!d(c,a(e))}catch(e){return!0}};p.sham=!0,t.exports=!l||r(function(){var e;return h(h.call)||!h(Object)||!h(function(){e=!0})||e})?p:h}),Yt=I(function(e,t){var n=Qt(),r=ee(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a constructor")}}),Jt=I(function(e,t){var n=me(),r=Yt(),i=H(),o=de()("species");t.exports=function(e,t){var s,a=n(e).constructor;return void 0===a||i(s=n(a)[o])?t:r(s)}}),Zt=I(function(e,t){var n=O(),r=Function.prototype,i=r.apply,o=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(i):function(){return o.apply(i,arguments)})}),Xt=I(function(e,t){t.exports=N()([].slice)}),en=I(function(e,t){var n=TypeError;t.exports=function(e,t){if(t>e)throw new n("Not enough arguments");return e}}),tn=I(function(e,t){var n=Q();t.exports=/ipad|iphone|ipod/i.test(n)&&/applewebkit/i.test(n)}),nn=I(function(e,t){var n,r,i,o,s=R(),a=Zt(),u=vt(),l=W(),c=le(),d=A(),f=tt(),h=Xt(),p=pe(),_=en(),v=tn(),g=Wt(),m=s.setImmediate,y=s.clearImmediate,b=s.process,w=s.Dispatch,S=s.Function,k=s.MessageChannel,x=s.String,C=0,P={},E="onreadystatechange";d(function(){n=s.location});var T=function(e){if(c(P,e)){var t=P[e];delete P[e],t()}},F=function(e){return function(){T(e)}},I=function(e){T(e.data)},M=function(e){s.postMessage(x(e),n.protocol+"//"+n.host)};m&&y||(m=function(e){_(arguments.length,1);var t=l(e)?e:S(e),n=h(arguments,1);return P[++C]=function(){a(t,void 0,n)},r(C),C},y=function(e){delete P[e]},g?r=function(e){b.nextTick(F(e))}:w&&w.now?r=function(e){w.now(F(e))}:k&&!v?(o=(i=new k).port2,i.port1.onmessage=I,r=u(o.postMessage,o)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!d(M)?(r=M,s.addEventListener("message",I,!1)):r=E in p("script")?function(e){f.appendChild(p("script"))[E]=function(){f.removeChild(this),T(e)}}:function(e){setTimeout(F(e),0)}),t.exports={set:m,clear:y}}),rn=I(function(e,t){var n=R(),r=M(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(n,e);return t&&t.value}}),on=I(function(e,t){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=n}),sn=I(function(e,t){var n=Q();t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble}),an=I(function(e,t){var n=Q();t.exports=/web0s(?!.*chrome)/i.test(n)}),un=I(function(e,t){var n,r,i,o,s,a=R(),u=rn(),l=vt(),c=nn().set,d=on(),f=tn(),h=sn(),p=an(),_=Wt(),v=a.MutationObserver||a.WebKitMutationObserver,g=a.document,m=a.process,y=a.Promise,b=u("queueMicrotask");if(!b){var w=new d,S=function(){var e,t;for(_&&(e=m.domain)&&e.exit();t=w.get();)try{t()}catch(e){throw w.head&&n(),e}e&&e.enter()};f||_||p||!v||!g?!h&&y&&y.resolve?((o=y.resolve(void 0)).constructor=y,s=l(o.then,o),n=function(){s(S)}):_?n=function(){m.nextTick(S)}:(c=l(c,a),n=function(){c(S)}):(r=!0,i=g.createTextNode(""),new v(S).observe(i,{characterData:!0}),n=function(){i.data=r=!r}),b=function(e){w.head||n(),w.add(e)}}t.exports=b}),ln=I(function(e,t){t.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}}),cn=I(function(e,t){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}}),dn=I(function(e,t){t.exports=R().Promise}),fn=I(function(e,t){var n=R(),r=dn(),i=W(),o=je(),s=Se(),a=de(),u=Ut(),l=ie(),c=Y(),d=r&&r.prototype,f=a("species"),h=!1,p=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:o("Promise",function(){var e=s(r),t=e!==String(r);if(!t&&66===c)return!0;if(l&&(!d.catch||!d.finally))return!0;if(!c||51>c||!/native code/.test(e)){var n=new r(function(e){e(1)}),i=function(e){e(function(){},function(){})};if((n.constructor={})[f]=i,!(h=n.then(function(){})instanceof i))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)}),REJECTION_EVENT:p,SUBCLASSING:h}}),hn=I(function(e,t){var n=te(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw new r("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}}),pn=I(function(){var e,t,n,r,$=He(),i=ie(),o=Wt(),s=R(),a=Ke(),u=L(),l=Te(),c=dt(),d=st(),f=Gt(),h=te(),p=W(),_=V(),v=Kt(),g=Jt(),m=nn().set,y=un(),b=ln(),w=cn(),S=on(),k=Pe(),x=dn(),C=fn(),P=hn(),E="Promise",T=C.CONSTRUCTOR,F=C.REJECTION_EVENT,I=C.SUBCLASSING,A=k.getterFor(E),M=k.set,O=x&&x.prototype,D=x,q=O,N=s.TypeError,B=s.document,j=s.process,H=P.f,z=H,U=!!(B&&B.createEvent&&s.dispatchEvent),G="unhandledrejection",K=function(e){var t;return!(!_(e)||!p(t=e.then))&&t},Q=function(e,t){var n,r,i,o=t.value,s=1===t.state,a=s?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&ee(t),t.rejection=1),!0===a?n=o:(d&&d.enter(),n=a(o),d&&(d.exit(),i=!0)),n===e.promise?c(new N("Promise-chain cycle")):(r=K(n))?u(r,n,l,c):l(n)):c(o)}catch(e){d&&!i&&d.exit(),c(e)}},Y=function(e,t){e.notified||(e.notified=!0,y(function(){for(var n,r=e.reactions;n=r.get();)Q(n,e);e.notified=!1,t&&!e.rejection&&Z(e)}))},J=function(e,t,n){var r,i;U?((r=B.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),s.dispatchEvent(r)):r={promise:t,reason:n},!F&&(i=s["on"+e])?i(r):e===G&&b("Unhandled promise rejection",n)},Z=function(e){u(m,s,function(){var t,n=e.facade,r=e.value;if(X(e)&&(t=w(function(){o?j.emit("unhandledRejection",r,n):J(G,n,r)}),e.rejection=o||X(e)?2:1,t.error))throw t.value})},X=function(e){return 1!==e.rejection&&!e.parent},ee=function(e){u(m,s,function(){var t=e.facade;o?j.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)})},ne=function(e,t,n){return function(r){e(t,r,n)}},re=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Y(e,!0))},oe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new N("Promise can't be resolved itself");var r=K(t);r?y(function(){var n={done:!1};try{u(r,t,ne(oe,n,e),ne(re,n,e))}catch(t){re(n,t,e)}}):(e.value=t,e.state=1,Y(e,!1))}catch(t){re({done:!1},t,e)}}};if(T&&(D=function(t){v(this,q),h(t),u(e,this);var n=A(this);try{t(ne(oe,n),ne(re,n))}catch(e){re(n,e)}},(e=function(e){M(this,{type:E,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:null})}).prototype=l(q=D.prototype,"then",function(e,t){var n=A(this),r=H(g(this,D));return n.parent=!0,r.ok=!p(e)||e,r.fail=p(t)&&t,r.domain=o?j.domain:void 0,0===n.state?n.reactions.add(r):y(function(){Q(r,n)}),r.promise}),t=function(){var t=new e,n=A(t);this.promise=t,this.resolve=ne(oe,n),this.reject=ne(re,n)},P.f=H=function(e){return e===D||e===n?new t(e):z(e)},!i&&p(x)&&O!==Object.prototype)){r=O.then,I||l(O,"then",function(e,t){var n=this;return new D(function(e,t){u(r,n,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}c&&c(O,q)}$({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:D}),n=a.Promise,d(D,E,!1,!0),f(E)}),_n=I(function(e,t){var n=de()("iterator"),r=!1;try{var i=0,o={next:function(){return{done:!!i++}},return:function(){r=!0}};o[n]=function(){return this},Array.from(o,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!r)return!1}catch(e){return!1}var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}}),vn=I(function(e,t){var n=dn(),r=_n();t.exports=fn().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})}),gn=I(function(){var $=He(),e=L(),t=te(),n=hn(),r=cn(),i=kt();$({target:"Promise",stat:!0,forced:vn()},{all:function(o){var s=this,a=n.f(s),u=a.resolve,l=a.reject,c=r(function(){var n=t(s.resolve),r=[],a=0,c=1;i(o,function(t){var i=a++,o=!1;c++,e(n,s,t).then(function(e){o||(o=!0,r[i]=e,--c||u(r))},l)}),--c||u(r)});return c.error&&l(c.value),a.promise}})}),mn=I(function(){var $=He(),e=ie(),t=fn().CONSTRUCTOR,n=dn(),r=G(),i=W(),o=Te(),s=n&&n.prototype;if($({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(e){return this.then(void 0,e)}}),!e&&i(n)){var a=r("Promise").prototype.catch;s.catch!==a&&o(s,"catch",a,{unsafe:!0})}}),yn=I(function(){var $=He(),e=L(),t=te(),n=hn(),r=cn(),i=kt();$({target:"Promise",stat:!0,forced:vn()},{race:function(o){var s=this,a=n.f(s),u=a.reject,l=r(function(){var n=t(s.resolve);i(o,function(t){e(n,s,t).then(a.resolve,u)})});return l.error&&u(l.value),a.promise}})}),bn=I(function(){var $=He(),e=hn();$({target:"Promise",stat:!0,forced:fn().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}),wn=I(function(e,t){var n=me(),r=V(),i=hn();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var o=i.f(e);return(0,o.resolve)(t),o.promise}}),Sn=I(function(){var $=He(),e=G(),t=ie(),n=dn(),r=fn().CONSTRUCTOR,i=wn(),o=e("Promise"),s=t&&!r;$({target:"Promise",stat:!0,forced:t||r},{resolve:function(e){return i(s&&this===o?n:this,e)}})}),kn=I(function(){pn(),gn(),mn(),yn(),bn(),Sn()}),xn=I(function(){var $=He(),e=L(),t=te(),n=hn(),r=cn(),i=kt();$({target:"Promise",stat:!0,forced:vn()},{allSettled:function(o){var s=this,a=n.f(s),u=a.resolve,l=a.reject,c=r(function(){var n=t(s.resolve),r=[],a=0,l=1;i(o,function(t){var i=a++,o=!1;l++,e(n,s,t).then(function(e){o||(o=!0,r[i]={status:"fulfilled",value:e},--l||u(r))},function(e){o||(o=!0,r[i]={status:"rejected",reason:e},--l||u(r))})}),--l||u(r)});return c.error&&l(c.value),a.promise}})}),Cn=I(function(){var $=He(),e=L(),t=te(),n=G(),r=hn(),i=cn(),o=kt(),s=vn(),a="No one promise resolved";$({target:"Promise",stat:!0,forced:s},{any:function(s){var u=this,l=n("AggregateError"),c=r.f(u),d=c.resolve,f=c.reject,h=i(function(){var n=t(u.resolve),r=[],i=0,c=1,h=!1;o(s,function(t){var o=i++,s=!1;c++,e(n,u,t).then(function(e){s||h||(h=!0,d(e))},function(e){s||h||(s=!0,r[o]=e,--c||f(new l(r,a)))})}),--c||f(new l(r,a))});return h.error&&f(h.value),c.promise}})}),Pn=I(function(){var $=He(),e=R(),t=Zt(),n=Xt(),r=hn(),i=te(),o=cn(),s=e.Promise,a=!1;$({target:"Promise",stat:!0,forced:!s||!s.try||o(function(){s.try(function(e){a=8===e},8)}).error||!a},{try:function(e){var s=arguments.length>1?n(arguments,1):[],a=r.f(this),u=o(function(){return t(i(e),void 0,s)});return(u.error?a.reject:a.resolve)(u.value),a.promise}})}),En=I(function(){var $=He(),e=hn();$({target:"Promise",stat:!0},{withResolvers:function(){var t=e.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})}),Tn=I(function(){var $=He(),e=ie(),t=dn(),n=A(),r=G(),i=W(),o=Jt(),s=wn(),a=Te(),u=t&&t.prototype;if($({target:"Promise",proto:!0,real:!0,forced:!!t&&n(function(){u.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=o(this,r("Promise")),n=i(e);return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}}),!e&&i(t)){var l=r("Promise").prototype.finally;u.finally!==l&&a(u,"finally",l,{unsafe:!0})}}),Fn=I(function(e,t){var n=N(),r=Ie(),i=qt(),o=z(),s=n("".charAt),a=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,n){var l,c,d=i(o(t)),f=r(n),h=d.length;return 0>f||f>=h?e?"":void 0:55296>(l=a(d,f))||l>56319||f+1===h||56320>(c=a(d,f+1))||c>57343?e?s(d,f):l:e?u(d,f,f+2):c-56320+(l-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}}),In=I(function(){var e=Fn().charAt,t=qt(),n=Pe(),r=ft(),i=ht(),o="String Iterator",s=n.set,a=n.getterFor(o);r(String,"String",function(e){s(this,{type:o,string:t(e),index:0})},function(){var t,n=a(this),r=n.string,o=n.index;return r.length>o?(t=e(r,o),n.index+=t.length,i(t,!1)):i(void 0,!0)})}),Rn=I(function(e,t){jt(),pt(),zt(),kn(),xn(),Cn(),Pn(),En(),Tn(),In(),t.exports=Ke().Promise}),An=I(function(e,t){var n=Rn();Ft(),t.exports=n}),Mn=I(function(){Pn()}),On=I(function(){En()}),Ln=I(function(e,t){var n=An();Mn(),On(),t.exports=n}),Dn=I(function(){jt()}),$n=I(function(){xn()}),qn=I(function(){Cn()}),Nn=I(function(e,t){var n=Ln();Dn(),$n(),qn(),t.exports=n}),Bn=I(function(e,t){t.exports=Nn()}),jn=I(function(){He()({target:"Math",stat:!0},{trunc:Fe()})}),Hn=I(function(e,t){jn(),t.exports=Ke().Math.trunc}),zn=I(function(e,t){t.exports=Hn()}),Un=I(function(e,t){t.exports=zn()}),Wn=I(function(e,t){t.exports=Un()}),Vn=I(function(e,t){t.exports=Wn()}),Gn=I(function(e,t){var n=V(),r=Math.floor;t.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&r(e)===e}}),Kn=I(function(){He()({target:"Number",stat:!0},{isInteger:Gn()})}),Qn=I(function(e,t){Kn(),t.exports=Ke().Number.isInteger}),Yn=I(function(e,t){t.exports=Qn()}),Jn=I(function(e,t){t.exports=Yn()}),Zn=I(function(e,t){t.exports=Jn()}),Xn=I(function(e,t){t.exports=Zn()});Xe(),Mt(),Bn(),Vn(),Xn();var er={},tr=[],nr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rr=Array.isArray;function ir(e,t){for(var n in t)e[n]=t[n];return e}function or(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function sr(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?_.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return ar(e,s,r,i,null)}function ar(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++g:i,__i:-1,__u:0};return null==i&&null!=v.vnode&&v.vnode(o),o}function ur(e){return e.children}function lr(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var n;e.__k.length>t;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?$(e):null}function cr(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=ir({},t);o.__v=t.__v+1,v.vnode&&v.vnode(o),wr(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?$(t):n,!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,kr(r,o,i),t.__e=t.__=null,o.__e!=n&&dr(o)}}function dr(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),dr(e)}function fr(e){(!e.__d&&(e.__d=!0)&&m.push(e)&&!hr.__r++||y!=v.debounceRendering)&&((y=v.debounceRendering)||b)(hr)}function hr(){try{for(var e,t=1;m.length;)m.length>t&&m.sort(w),e=m.shift(),t=m.length,cr(e)}finally{m.length=hr.__r=0}}function pr(e,t,n,r,i,o,s,a,u,l,c){var d,f,h,p,_,v,g,m=r&&r.__k||tr,y=t.length;for(u=_r(n,t,m,u,y),d=0;y>d;d++)null!=(h=n.__k[d])&&(f=-1!=h.__i&&m[h.__i]||er,h.__i=d,v=wr(e,h,f,i,o,s,a,u,l,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Pr(f.ref,null,h),c.push(h.ref,h.__c||p,h)),null==_&&null!=p&&(_=p),(g=!!(4&h.__u))||f.__k===h.__k?(u=vr(h,u,e,g),g&&f.__e&&(f.__e=null)):"function"==typeof h.type&&void 0!==v?u=v:p&&(u=p.nextSibling),h.__u&=-7);return n.__e=_,u}function _r(e,t,n,r,i){var o,s,a,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(i),o=0;i>o;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[o]=ar(null,s,null,null,null):rr(s)?s=e.__k[o]=ar(ur,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=ar(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,u=o+f,s.__=e,s.__b=e.__b+1,a=null,-1!=(l=s.__i=gr(s,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?f--:c>i&&f++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,s.__u|=4))):e.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==r&&(r=$(a)),Er(a,a));return r}function vr(e,t,n,r){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&i.length>o;o++)i[o]&&(i[o].__=e,t=vr(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=$(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function gr(e,t,n,r){var i,o,s,a=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==a||c&&a==l.key&&u==l.type)return n;if(r>(c?1:0))for(i=n-1,o=n+1;i>=0||t.length>o;)if(null!=(l=t[s=0>i?o++:i--])&&!(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function mr(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||nr.test(t)?n:n+"px"}function yr(e,t,n,r,i){var o,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||mr(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||mr(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(C,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[x]=r[x]:(n[x]=P,e.addEventListener(t,o?T:E,o)):e.removeEventListener(t,o?T:E,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function br(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[k])t[k]=P++;else if(n[x]>t[k])return;return n(v.event?v.event(t):t)}}}function wr(e,t,n,r,i,o,s,a,u,l){var c,d,f,h,p,_,g,m,y,b,$,w,S,k,x,C,P=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=v.__b)&&c(t);e:if("function"==typeof P){d=s.length;try{if(y=t.props,b=P.prototype&&P.prototype.render,$=(c=P.contextType)&&r[c.__c],w=c?$?$.props.value:c.__:r,n.__c?m=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new P(y,w):(t.__c=f=new lr(y,w),f.constructor=P,f.render=Tr),$&&$.sub(f),f.state||(f.state={}),f.__n=r,h=f.__d=!0,f.__h=[],f._sb=[]),b&&null==f.__s&&(f.__s=f.state),b&&null!=P.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=ir({},f.__s)),ir(f.__s,P.getDerivedStateFromProps(y,f.__s))),p=f.props,_=f.state,f.__v=t,h)b&&null==P.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),b&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(b&&null==P.getDerivedStateFromProps&&y!==p&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,w),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,w)){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),tr.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,w),b&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(p,_,g)})}if(f.context=w,f.props=y,f.__P=e,f.__e=!1,S=v.__r,k=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),tr.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++k);f.state=f.__s,null!=f.getChildContext&&(r=ir(ir({},r),f.getChildContext())),b&&!h&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(p,_)),x=null!=c&&c.type===ur&&null==c.key?xr(c.props.children):c,a=pr(e,rr(x)?x:[x],t,n,r,i,o,s,a,u,l),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),m&&(f.__E=f.__=null)}catch(e){if(s.length=d,t.__v=null,u||null!=o)if(e.then){for(t.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),t.__e=a}else{if(null!=o)for(C=o.length;C--;)or(o[C]);Sr(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||Sr(t);v.__e(e,t,n)}}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Cr(n.__e,t,n,r,i,o,s,u,l);return(c=v.diffed)&&c(t),128&t.__u?void 0:a}function Sr(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Sr))}function kr(e,t,n){for(var r=0;n.length>r;r++)Pr(n[r],n[++r],n[++r]);v.__c&&v.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){v.__e(e,t.__v)}})}function xr(e){return"object"!=typeof e||null==e||e.__b>0?e:rr(e)?e.map(xr):void 0!==e.constructor?null:ir({},e)}function Cr(e,t,n,r,i,o,s,a,u){var l,c,d,f,h,p,g,m=n.props||er,y=t.props,b=t.type;if("svg"==b?i="http://www.w3.org/2000/svg":"math"==b?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;o.length>l;l++)if((h=o[l])&&"setAttribute"in h==!!b&&(b?h.localName==b:3==h.nodeType)){e=h,o[l]=null;break}if(null==e){if(null==b)return document.createTextNode(y);e=document.createElementNS(i,b,y.is&&y),a&&(v.__m&&v.__m(t,o),a=!1),o=null}if(null==b)m===y||a&&e.data==y||(e.data=y);else{if(o="textarea"==b&&null!=y.defaultValue?null:o&&_.call(e.childNodes),!a&&null!=o)for(m={},l=0;e.attributes.length>l;l++)m[(h=e.attributes[l]).name]=h.value;for(l in m)h=m[l],"dangerouslySetInnerHTML"==l?d=h:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||yr(e,l,null,h,i);for(l in y)h=y[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?p=h:"checked"==l?g=h:a&&"function"!=typeof h||m[l]===h||yr(e,l,h,m[l],i);if(c)a||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),pr("template"==t.type?e.content:e,rr(f)?f:[f],t,n,r,"foreignObject"==b?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:n.__k&&$(n,0),a,u),null!=o)for(l=o.length;l--;)or(o[l]);a&&"textarea"!=b||(l="value","progress"==b&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[l]||"progress"==b&&!p||"option"==b&&p!=m[l])&&yr(e,l,p,m[l],i),l="checked",null!=g&&g!=e[l]&&yr(e,l,g,m[l],i))}return e}function Pr(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){v.__e(e,n)}}function Er(e,t,n){var r,i;if(v.unmount&&v.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Pr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){v.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;r.length>i;i++)r[i]&&Er(r[i],t,n||"function"!=typeof e.type);n||or(e.__e),e.__c=e.__=e.__e=void 0}function Tr(e,t,n){return this.constructor(e,n)}function Fr(e,t,n){var r,i,o,s;t==document&&(t=document.documentElement),v.__&&v.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],s=[],wr(t,e=(!r&&n||t).__k=sr(ur,null,[e]),i||er,er,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?_.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),kr(o,e,s),e.props.children=null}_=tr.slice,v={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},g=0,lr.prototype.setState=function(e,t){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ir({},this.state);"function"==typeof e&&(e=e(ir({},n),this.props)),e&&ir(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),fr(this))},lr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),fr(this))},lr.prototype.render=ur,m=[],b="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,w=function(e,t){return e.__v.__b-t.__v.__b},hr.__r=0,S=Math.random().toString(8),k="__d"+S,x="__a"+S,C=/(PointerCapture)$|Capture$/i,P=0,E=br(!1),T=br(!0),F=0;var Ir=0;function Rr(e,t,n,r,i,o){t||(t={});var s,a,u=t;if("ref"in u)for(a in u={},t)"ref"==a?s=t[a]:u[a]=t[a];var l={type:e,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ir,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return v.vnode&&v.vnode(l),l}var Ar="$surveys",Mr="$surveys_loaded_at",Or="PostHog loadExternalDependency extension not found.",Lr="$surveys_activated",Dr="$surveys_activated_session",$r="$surveys_activated_timestamps",qr="featureFlagsCommon";function Nr(e){var t,n=e.client,r=e.config;if(n&&r.uiHost){var i=null==(t=n.session)?void 0:t.sessionId;if(i)return r.uiHost+"/project/"+n.projectToken+"/replay/"+i}}var Br=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),jr=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Hr="min_length",zr="max_length",Ur=["$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"],Wr=["token"];function Vr(e,t){return-1!==e.indexOf(t)}var Gr=function(e){return e.trim()},Kr=function(e){return e.replace(/^\$/,"")};function Qr(e){var t,n=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return"[Circular]";n.push(t)}return t}}))&&void 0!==t?t:"null"}var Yr=Object.prototype,Jr=Yr.hasOwnProperty,Zr=Yr.toString,Xr=Array.isArray||function(e){return"[object Array]"===Zr.call(e)},ei=function(e){return"function"==typeof e},ti=function(e){return e===Object(e)&&!Xr(e)},ni=function(e){if(ti(e)){for(var t in e)if(Jr.call(e,t))return!1;return!0}return!1},ri=function(e){return void 0===e},ii=function(e){return"[object String]"==Zr.call(e)},oi=function(e){return ii(e)&&0===e.trim().length},si=function(e){return null===e},ai=function(e){return ri(e)||si(e)},ui=function(e){return"[object Number]"==Zr.call(e)&&e==e},li=function(e){return ui(e)&&e>0},ci=function(e){return"[object Boolean]"===Zr.call(e)},di=function(e){return Vr(Ur,e)},fi=function(e){return Vr(Wr,e)};function hi(e){return null===e||"object"!=typeof e}function pi(e,t){return{}.toString.call(e)==="[object "+t+"]"}function _i(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return gi(e,Error)}}function vi(e){return"u">typeof Event&&gi(e,Event)}function gi(e,t){try{return e instanceof t}catch(e){return!1}}var mi=[!0,"true",1,"1","yes"],yi=function(e){return Vr(mi,e)},bi=[!1,"false",0,"0","no"],wi=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","lightpanda","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"],Si=new Map,ki=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=function(e,t){for(var n="",r=0;t.length>r;r++){var i=t[r];n+=i.length+":"+i}return e.length+":"+e+"|"+t.length+":"+n}(e,t),r=Si.get(n);if(void 0!==r)return r;var i=e.toLowerCase(),o=wi.concat(t).some(function(e){return-1!==i.indexOf(e.toLowerCase())});return 256>Si.size||Si.clear(),Si.set(n,o),o};function xi(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),ui(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),xi(null!=i?i:n,t,n,r))}var Ci=function(){"use strict";function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=xi(e.bucketSize,0,100,e._logger),this._refillRate=xi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=xi(e.refillInterval,0,864e5,e._logger)}var t=e.prototype;return t._applyRefill=function(e,t){var n=Math.floor((t-e.lastAccess)/this._refillInterval);n>0&&(e.tokens=Math.min(e.tokens+n*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+n*this._refillInterval)},t.consumeRateLimit=function(e){var t,n=Date.now(),r=String(e),i=this._buckets[r];return i?this._applyRefill(i,n):this._buckets[r]=i={tokens:this._bucketSize,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===i.tokens)},t.stop=function(){this._buckets={}},e}(),Pi="Mobile",Ei="Android",Ti="Tablet",Fi="Android Tablet",Ii="iPad",Ri="Apple Watch",Ai="Safari",Mi="BlackBerry",Oi="Samsung Internet",Li="Chrome",Di="Chrome iOS",$i="Internet Explorer",qi="Internet Explorer Mobile",Ni="Opera",Bi="Microsoft Edge",ji="Firefox",Hi="Firefox iOS",zi="Nintendo",Ui="PlayStation",Wi="Xbox",Vi="Android Mobile",Gi="Mobile Safari",Ki="Windows",Qi="Windows Phone",Yi="Nokia",Ji="Ouya",Zi="Generic tablet",Xi="Konqueror",eo="Oculus Browser",to="Vivaldi",no="Yandex",ro="Whale",io="DuckDuckGo",oo="Pale Moon",so="Waterfox",ao="Brave",uo="Claude",lo="Codex",co="ChatGPT",fo="Google Search App",ho=new RegExp("Version/(\\d+(\\.\\d+)?)"),po=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),_o=new RegExp(Wi,"i"),vo=new RegExp("PlayStation \\w+","i"),go=new RegExp("Nintendo \\w+","i"),mo=new RegExp("BlackBerry|PlayBook|BB10","i"),yo={"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"},bo=function(e,t,n,r){t=t||"";var i=function(e){return null!=e&&e.brave?ao:null}(n);return i||(null!=r&&r.detectGoogleSearchApp&&Vr(e,"GSA/")?fo:Vr(e," OPR/")&&Vr(e,"Mini")?"Opera Mini":Vr(e," OPR/")?Ni:mo.test(e)?Mi:Vr(e,"IEMobile")||Vr(e,"WPDesktop")?qi:Vr(e,"OculusBrowser")?eo:Vr(e,"SamsungBrowser")?Oi:Vr(e,"Edge")||Vr(e,"Edg/")?Bi:Vr(e,"Vivaldi/")?to:Vr(e,"YaBrowser/")?no:Vr(e,"Whale/")?ro:Vr(e,"DuckDuckGo/")||Vr(e,"Ddg/")?io:Vr(e,"Claude/")?uo:Vr(e,"Codex/")?lo:Vr(e,"ChatGPT/")?co:Vr(e,"FBIOS")?"Facebook Mobile":Vr(e,"UCWEB")||Vr(e,"UCBrowser")?"UC Browser":Vr(e,"CriOS")?Di:Vr(e,"CrMo")||Vr(e,Li)?Li:Vr(e,Ei)&&Vr(e,Ai)?Vi:Vr(e,"FxiOS")?Hi:Vr(e.toLowerCase(),Xi.toLowerCase())?Xi:Vr(e,"Brave/")?ao:function(e,t){return t&&Vr(t,"Apple")||function(e){return Vr(e,Ai)&&!Vr(e,Li)&&!Vr(e,Ei)}(e)}(e,t)?Vr(e,Pi)?Gi:Ai:Vr(e,"PaleMoon/")?oo:Vr(e,"Waterfox/")?so:Vr(e,ji)?ji:Vr(e,"MSIE")||Vr(e,"Trident/")?$i:Vr(e,"Gecko")?ji:"")},wo=((s={})[qi]=[new RegExp("rv:(\\d+(\\.\\d+)?)")],s[Bi]=[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],s[Li]=[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],s[Di]=[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],s["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],s[Ai]=[ho],s[Gi]=[ho],s[Ni]=[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],s[ji]=[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],s[Hi]=[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],s[Xi]=[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],s[Mi]=[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),ho],s[Vi]=[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],s[Oi]=[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],s[eo]=[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],s[to]=[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],s[no]=[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],s[ro]=[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],s[ao]=[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],s[uo]=[po],s[lo]=[po],s[co]=[po],s[io]=[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],s[oo]=[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],s[so]=[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],s[fo]=[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],s[$i]=[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],s.Mozilla=[new RegExp("rv:(\\d+(\\.\\d+)?)")],s),So=function(e,t,n,r){var i=wo[bo(e,t,n,r)];if(ri(i))return null;for(var o=0;i.length>o;o++){var s=e.match(i[o]);if(s)return parseFloat(s[s.length-2])}return null},ko=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),function(e){return[Wi,e&&e[1]||""]}],[new RegExp(zi,"i"),[zi,""]],[new RegExp(Ui,"i"),[Ui,""]],[mo,[Mi,""]],[new RegExp(Ki,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Qi,""];if(new RegExp(Pi).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=yo[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Ki,r]}return[Ki,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=ri(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),function(e){return e&&e[2]?[Ei,[e[2],e[3],e[4]||"0"].join(".")]:[Ei,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],xo=function(e){for(var t=0;ko.length>t;t++){var n=ko[t],r=n[1],i=n[0].exec(e),o=i&&(ei(r)?r(i,e):r);if(o)return o}return["",""]},Co=function(e){return go.test(e)?zi:vo.test(e)?Ui:_o.test(e)?Wi:new RegExp(Ji,"i").test(e)?Ji:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Qi:/iPad/.test(e)?Ii:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ri:mo.test(e)?Mi:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Yi,"i").test(e)?Yi:/(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(Pi).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)?Ei:Fi:new RegExp("(pda|Mobile)","i").test(e)?"Generic mobile":new RegExp(Ti,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Zi:""},Po=function(e,t){var n,r,i,o,s=Co(e);return s===Ii||s===Fi||"Kobo"===s||"Kindle Fire"===s||s===Zi?Ti:s===zi||s===Wi||s===Ui||s===Ji?"Console":s===Ri?"Wearable":s?Pi:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(n=null==t?void 0:t.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==t?void 0:t.screenWidth)&&void 0!==r?r:0,null!==(i=null==t?void 0:t.screenHeight)&&void 0!==i?i:0)/(null!==(o=null==t?void 0:t.devicePixelRatio)&&void 0!==o?o:1)?Pi:Ti:"Desktop"},Eo=/\bFBAV\/(\d+(?:\.\d+)*)/i,To=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Eo],[/\bFBAN\/EMA\b/i,"Facebook Lite",Eo],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Eo],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Fo="[Truncated]",Io="[Unserializable]";function Ro(e){for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{var i=e.charCodeAt(n+1);56320>i||i>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}function Ao(e,t){if(!t)return e;var n=[];try{n=Object.keys(t)}catch(e){n=[]}for(var r,i=p(n);!(r=i()).done;){var o=r.value,s=void 0;try{s=t[o]}catch(e){s=Io}Object.defineProperty(e,o,{value:s,enumerable:!0,writable:!0,configurable:!0})}return e}Date,Date;var Mo,Oo,Lo,Do,$o=3e5,qo=function(){"use strict";function e(){this._until=0,this._installedAt=0}var t=e.prototype;return t.record=function(e){if("too-large"!==e.kind)if("retry-later"===e.kind){if(e.retryAfterMs){var t=this.isOpen(),n=Date.now(),r=Math.min(e.retryAfterMs,$o);if(!t)return this._installedAt=n,void(this._until=n+r);this._until=Math.max(this._until,Math.min(n+r,this._installedAt+$o))}}else this.reset()},t.remainingMs=function(){var e=Date.now();if(this._installedAt-5e3>e)return this.reset(),0;var t=Math.min($o,Math.max(0,this._until-e));return 0===t&&this.reset(),t},t.isOpen=function(){return this.remainingMs()>0},t.reset=function(){this._until=0,this._installedAt=0},e}(),No=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Bo(e,t){return"string"==typeof(n=e)&&No.test(n)?e:t();var n}function jo(e,t){var n=new Error(t);try{Object.defineProperty(n,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return n}function Ho(e){return e?e.split("#")[0]:e}function zo(e){try{return e()}catch(e){return}}function Uo(e,t){var n=setTimeout(e,t);return null!=n&&n.unref&&(null==n||n.unref()),n}function Wo(e,t,n){return Vo.apply(this,arguments)}function Vo(){return(Vo=h(l().m(function e(t,n,r){var i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.race([t,new Promise(function(e,t){i=Uo(function(){try{null==r||r(),e()}catch(e){t(e)}},n)})]);case 1:return e.a(2,e.v);case 2:return e.p=2,clearTimeout(i),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))).apply(this,arguments)}function Go(e){var t=globalThis._posthogChunkIds,n=globalThis._debugIds;if(t||n){var r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Do&&Ko(t,r,Oo)&&Ko(n,i,Lo))return Do;Oo=t?d({},t):void 0,Lo=n?d({},n):void 0,Do={},null!=Mo||(Mo={});var o=function(t,n){for(var r,i=p(t);!(r=i()).done;){var o,s=r.value,a=n[s];if(a){var u=null==(o=Mo)?void 0:o[s];if(u)Do[u]=a;else for(var l=e(s),c=l.length-1;c>=0;c--){var d,f=null==(d=l[c])?void 0:d.filename;if(f){Do[f]=a,Mo[s]=f;break}}}}};return n&&o(i,n),t&&o(r,t),Do}}function Ko(e,t,n){return e&&n?t.length===Object.keys(n).length&&t.every(function(t){return e[t]===n[t]}):e===n}var Qo=function(){"use strict";function e(e,t,n){void 0===n&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}var t=e.prototype;return t.buildFromUnknown=function(e,t){void 0===t&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),o=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}},t.modifyFrames=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:n=p(t);case 1:if((r=n()).done){e.n=4;break}if(!((i=r.value).stacktrace&&i.stacktrace.frames&&Xr(i.stacktrace.frames))){e.n=3;break}return e.n=2,this.applyModifiers(i.stacktrace.frames);case 2:i.stacktrace.frames=e.v;case 3:e.n=1;break;case 4:return e.a(2,t)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.coerceFallback=function(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}},t.parseStacktrace=function(e,t){var n,r,i,o=this;if(null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return d({},e,{cause:r,stack:i,errors:null==(n=e.errors)?void 0:n.map(function(e){return o.parseStacktrace(e,t)})})},t.applyChunkIds=function(e,t){return e.map(function(e){return e.filename&&t&&(e.chunk_id=t[e.filename]),e})},t.applyCoercers=function(e,t){for(var n,r=p(this.coercers);!(n=r()).done;){var i=n.value;if(i.match(e))return i.coerce(e,t)}return this.coerceFallback(t)},t.applyModifiers=function(){var e=h(l().m(function e(t){var n,r,i,o;return l().w(function(e){for(;;)switch(e.n){case 0:n=t,r=p(this.modifiers);case 1:if((i=r()).done){e.n=4;break}return o=i.value,e.n=2,o(n);case 2:n=e.v;case 3:e.n=1;break;case 4:return e.a(2,n)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.convertToExceptionList=function(e,t){var n=[],r=function(e,i,o){var s=n.length,a=void 0===i?d({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:s}):{type:"chained",source:o,synthetic:e.synthetic,exception_id:s,parent_id:i},u={type:e.type,value:e.value,mechanism:a};e.stack&&(u.stacktrace={type:"raw",frames:e.stack}),n.push(u),e.cause&&r(e.cause,s,"cause");for(var l,c=p(null!==(f=e.errors)&&void 0!==f?f:[]);!(l=c()).done;){var f;r(l.value,s,"member")}};return r(e),n},t.buildParsingContext=function(e){var t;return{chunkIdMap:Go(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.getAggregateErrors=function(e){try{if(_i(e))for(var t=Object.getPrototypeOf(e),n=0;t&&100>n;n++){var r,i=null==(r=Object.getOwnPropertyDescriptor(t,"constructor"))?void 0:r.value;if("function"==typeof i&&"AggregateError"===i.name){var o=e.errors;return Xr(o)?o:void 0}t=Object.getPrototypeOf(t)}}catch(e){}},t.buildCoercingContext=function(e,t,n){var r=this;void 0===n&&(n=0);var i=0,o=0,s=!1,a=new Set,u=[],l={},c=function(e,t,n){void 0===n&&(n=0);var c=f(t,n),h=c.apply;if(c.apply=function(t){u.push(e);try{return h(t)}finally{u.pop()}},n>4||n>0&&-1!==u.indexOf(e))return r.coerceFallback(c);var p="object"==typeof e&&null!==e||"function"==typeof e;if(!(0===n&&i>=50||p&&a.has(e))){p&&a.add(e),0===n&&i++;var _,v,g=r.getAggregateErrors(e);s||(s=!!g);try{if(!(_=r.applyCoercers(e,c)))throw l}catch(e){if(e===l)return void(0===n&&i--);if(!s)throw e;_=r.coerceFallback(c)}if(!g||i>=50)return _;try{v=g.length}catch(e){return _}if(!Number.isInteger(v)||0>v||v>4294967295)return _;for(var m=[],y=0;50>i&&1e3>o&&v>y;y++){o++;var b=void 0;try{b=c.next(g[y])}catch(e){i++,b=r.coerceFallback(f(t+1))}b&&m.push(b)}return d({},_,{errors:m})}},f=function(n,r){return void 0===r&&(r=0),d({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:0==n?e:{},apply:function(e){var t=c(e,n,r+1);if(!t)throw l;return t},next:function(e){return c(e,n+1)}})},h=f(n);return d({},h,{apply:function(e){var t;return null!==(t=c(e,n))&&void 0!==t?t:r.coerceFallback(h)}})},e}(),Yo=/^([a-z][a-z0-9.+-]+):/i,Jo=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Zo(e){if(!e||"<anonymous>"===e)return!1;var t=Yo.exec(e);return!t||Jo.includes(t[1].toLowerCase())}function Xo(e,t,n,r,i){var o={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:Zo(t)};return ri(r)||(o.lineno=r),ri(i)||(o.colno=i),o}var es=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ts=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ns=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,rs=/\((\S*)(?::(\d+))(?::(\d+))\)/,is=function(e,t){var n=ts.exec(e);if(n)return Xo(t,n[1],"?",+n[2],+n[3]);var r=ns.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var i=rs.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var o=es(r[1]||"?",r[2]);return Xo(t,o[1],o[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},os=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ss=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,as=function(e,t){var n=os.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=ss.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],o=n[1]||"?",s=es(o,i);return Xo(t,i=s[1],o=s[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},us=/\(error: (.*)\)/;function ls(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function cs(e){for(var t=1;10>=t;t++){var n=e.length-2*t;if(0>n)break;for(var r=!0,i=0;t>i;i++)if(!ls(e[n+i],e[n+t+i])){r=!1;break}if(r){for(var o=0;t>o;o++)e[n+o]=e[n+t+o];return e.length=n+t,{start:n,length:t}}}}function ds(e,t){var n=t.start+t.length,r=hs(e,t);r&&e.splice(n+r===e.length?n:t.start,r)}function fs(e,t){for(var n=t.start;n>0&&ls(e[n-1],e[n-1+t.length]);)n--;return t.start-n}function hs(e,t){for(var n=t.start+t.length,r=n;e.length>r&&ls(e[r],e[r-t.length]);)r++;return r-n}function ps(e,t){for(var n,r=t[0],i=e.length-(r?fs(e,r):0),o=p(t);!(n=o()).done;)i-=hs(e,n.value);return i}function _s(e,t,n){for(var r=0;e.length>r;r++){var i=e[(t+r)%e.length],o=e[(n+r)%e.length];if(i!==o)return o>i}return!1}var vs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return this.isDOMException(e)||this.isDOMError(e)},t.coerce=function(e,t){var n=ii(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}},t.getType=function(e){return this.isDOMError(e)?"DOMError":"DOMException"},t.getValue=function(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t},t.isDOMException=function(e){return pi(e,"DOMException")},t.isDOMError=function(e){return pi(e,"DOMError")},e}(),gs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return _i(e)},t.coerce=function(e,t){var n,r=this.getStack(e),i=void 0===r?null==(n=t.syntheticException)?void 0:n.stack:void 0,o=!!i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:i,cause:e.cause?t.next(e.cause):void 0,synthetic:o}},t.getType=function(e){return e.name||e.constructor.name},t.getMessage=function(e,t){var n=e.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)},t.getStack=function(e){try{var t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;var n=e.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(e){return}},e}(),ms=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return!!pi(e,"ErrorEvent")&&(null!=e.error||this._hasUsableMessage(e))},t.coerce=function(e,t){var n;if(null!=e.error)return t.apply(e.error);var r=t.apply(e.message);return d({},r,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:r.stack,synthetic:!0})},t._hasUsableMessage=function(e){return ii(e.message)&&e.message.length>0},t._buildLocationStack=function(e){var t,n,r=e,i=null!==(t=r.lineno)&&void 0!==t?t:0,o=null!==(n=r.colno)&&void 0!==n?n:0;if(ii(r.filename)&&0!==r.filename.length&&0!==i)return"Error\n at "+r.filename+":"+i+":"+o},e}(),ys=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,bs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"string"==typeof e},t.coerce=function(e,t){var n,r=this.getInfos(e),i=r[0],o=r[1];return{type:null!=i?i:"Error",value:null!=o?o:e,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},t.getInfos=function(e){var t="Error",n=e,r=e.match(ys);return r&&(t=r[1],n=r[2]),[t,n]},e}(),ws=["fatal","error","warning","log","info","debug"];function Ss(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r="",i=0,o=n;o.length>i;i++){var s=o[i],a=r?r+", "+s:s;if(a.length>t)break;r=a}return r}var ks=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"object"==typeof e&&null!==e},t.coerce=function(e,t){var n,r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null!==(n=this.getStack(e))&&void 0!==n?n:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}},t.getType=function(e){if(vi(e))return e.constructor.name;var t="name"in e?e.name:void 0;return ii(t)&&!oi(t)?t:"Error"},t.getValue=function(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 n=this.getObjectClassName(e);return(n&&"Object"!==n?"'"+n+"'":"Object")+" captured as exception with keys: "+Ss(e)},t.isSeverityLevel=function(e){return ii(e)&&!oi(e)&&ws.indexOf(e)>=0},t.getStack=function(e){try{return ii(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ii(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}},t.getErrorPropertyFromObject=function(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(_i(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),xs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return vi(e)},t.coerce=function(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Ss(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Cs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return hi(e)},t.coerce=function(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Ps=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return pi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!vi(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}},t.coerce=function(e,t){var n,r=this.getUnhandledRejectionReason(e);return hi(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(r)},t.getUnhandledRejectionReason=function(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e},e}(),Es="$message",Ts="$timestamp",Fs=new Set([Es,Ts]),Is={enabled:!0,max_bytes:32768};function Rs(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Is.enabled,max_bytes:Ms(e.max_bytes,Is.max_bytes)}:d({},Is)}var As=function(){"use strict";function e(e){this._entries=[],this._totalBytes=0,this._config=Rs(e)}var t=e.prototype;return t.setConfig=function(e){this._config=Rs(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=Qr(e)}catch(e){return}try{var n=JSON.parse(t);if(!ti(n))return;var r=n,i=r[Es],o=r[Ts];if(!ii(i)||0===i.trim().length)return;if(!ii(o)&&!ui(o))return;return{step:r,json:t}}catch(e){return}}(e);if(t){var n=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)"%"===t[r]?(n+=1,r+=2):n+=1;return n}(t.json);n>this._config.max_bytes||(this._entries.push({step:t.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}},t.getAttachable=function(){return this._entries.map(function(e){return e.step})},t.clear=function(){this._entries=[],this._totalBytes=0},t.size=function(){return this._entries.length},t._trimToMaxBytes=function(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}},e}();function Ms(e,t){if(!ui(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var Os=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Ls(e){return"string"==typeof e||e}function Ds(e){return"string"==typeof e?e:void 0}var $s,qs=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain"].concat(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],["$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"]),Ns="NativeGzipValidationError",Bs=function(e){return e.length>=2&&31===e[0]&&139===e[1]},js=function(e,t){return e===jr.GZipJS||t===jr.GZipJS||"gzip"===t},Hs=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},zs=function(e){for(var t=function(){if($s)return $s;$s=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;$s[e]=t>>>0}return $s}(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0},Us=function(e){throw jo(Ns,"Native gzip produced invalid output: "+e)},Ws=0,Vs=!1,Gs=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a;return l().w(function(e){for(;;)switch(e.n){case 0:return 18>t.size&&Us("too-short"),s=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return r=new s(e.v),Bs(r)&&8===r[2]||Us("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:i=new a(e.v),o=n.length>>>0,i.getUint32(4,!0)!==o&&Us("invalid-size"),(Vs||3>Ws)&&(i.getUint32(0,!0)!==zs(n)&&(Vs=!0,Us("invalid-crc")),Ws++);case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function Ks(e,t,n){return Qs.apply(this,arguments)}function Qs(){return Qs=h(l().m(function e(t,n,r){var i,o,s,a,u,c,d;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return void 0===n&&(n=!0),e.p=1,i=(new TextEncoder).encode(t),o=new globalThis.CompressionStream("gzip"),s=o.writable.getWriter(),a=s.write(i).then(function(){return s.close()}).catch(function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,s.abort(t);case 1:e.n=3;break;case 2:e.p=2;case 3:throw t;case 4:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}()),u=new Response(o.readable).blob(),e.n=2,Promise.all([u,a]);case 2:return c=e.v[0],e.n=3,Gs(c,i);case 3:return e.a(2,c);case 4:if(e.p=4,d=e.v,null==r||!r.rethrow){e.n=5;break}throw d;case 5:return n&&console.error("Failed to gzip compress data",d),e.a(2,null)}},e,null,[[1,4]])})),Qs.apply(this,arguments)}var Ys="[redacted]",Js=/^[A-Za-z0-9+/\n\r]+=*$/,Zs=/^[A-Za-z0-9_-]+={0,2}$/,Xs=/[-_]/,ea=/^data:[^,\s]*;base64,/i,ta=/^[A-Za-z0-9+/_-]+={0,2}$/,na=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,ra=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,ia=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,oa=/[\s<>"]/,sa=function(){return new RegExp(ia.source,"i")}(),aa=/[a-z][a-z0-9+.-]{0,63}:\/\//i,ua=function(){return new RegExp("^"+aa.source,"i")}(),la=function(){return new RegExp(aa.source,"gi")}(),ca=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,da=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,fa=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,ha=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,pa=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,_a=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,va=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,ga=/\d+/g,ma=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,ya=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function ba(e){return function(e){return ra.test(e)}(e)||ca.test(e)||da.test(e)}function wa(e){return e.split("&",129).length>128}function Sa(e,t,n){return ba(e)||t.includes(";")&&function(e){return e.split(";").some(function(e){return ba(e.split("=",1)[0])})}(t)?Ys:sa.test(t)?n?Ta(t,{allowNestedUrls:!1,stripPunctuation:!0}):Ys:t}function ka(e,t){for(var n,r=new URLSearchParams,i=!1,o=!1,s=p(new URLSearchParams(e));!(n=s()).done;){var a=n.value,u=a[0],l=a[1],c=Fa(u),d=Fa(l);i||(i=c!==u||d!==l);var f=Sa(c,d,t);i||(i=f!==d),o=ba(c)||f!==d,r.append(c,f)}return{changed:i,lastFieldSensitive:o,serialized:r.toString()}}function xa(e,t){if(!e.includes("="))return{value:Ca(e,t),lastFieldSensitive:!1};var n=ka(e,t);return{value:n.changed?n.serialized:e,lastFieldSensitive:n.lastFieldSensitive}}function Ca(e,t){return t?Ta(e,{allowNestedUrls:!1,stripPunctuation:!0}):sa.test(e)?Ys:e}function Pa(e,t,n){return"#"===e?!t.fragment&&(t.fragment=!0):"?"===e&&(t.fragment?"="!==n&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function Ea(e,t){var n;if(e.length>8192&&ua.test(e))return Ys;var r,i=t.stripPunctuation?function(e){for(var t=e.length;t>0&&".,;:!?)]}'".includes(e[t-1]);)t--;return{address:e.slice(0,t),suffix:e.slice(t)}}(e):{address:e,suffix:""},o=i.address,s=i.suffix;try{r=new URL(o)}catch(e){return Ys+s}var a=r.search.slice(1),u=""!==r.hash,l=function(e){var t=e.slice(1),n=t.indexOf("?");return 0>n?{head:t,tail:null}:{head:t.slice(0,n),tail:t.slice(n+1)}}(r.hash);if(wa(a)||wa(l.head)||wa(null!==(n=l.tail)&&void 0!==n?n:""))return Ys+s;var c=!1;(r.username||r.password)&&(r.username=Ys,r.password="",c=!0);var d=ka(a,t.allowNestedUrls);d.changed&&(r.search=d.serialized,c=!0);var f,h=xa(l.head,t.allowNestedUrls),p=null===l.tail?null:(f=l.tail,h.lastFieldSensitive?{value:""===f?"":Ys,lastFieldSensitive:!0}:xa(f,t.allowNestedUrls)),_=null===p?h.value:h.value+"?"+p.value;_!==r.hash.slice(1)&&(r.hash=_,c=!0);var v=u?null!=p?p:h:d;return(c?Fa(r.toString()):o)+(v.lastFieldSensitive?"":s)}function Ta(e,t){return e.replace(ia,function(n){return function(e,t){var n=function(e){if(!e.includes("://"))return[];for(var t=[].concat(e.matchAll(la)).map(function(e){return e.index}),n=[],r={query:!1,fragment:!1,fragmentQuery:!1},i=0,o=!1,s="",a=0;e.length>a&&t.length>i;a++){t[i]===a&&(a>0&&"="!==s&&n.push(a),i++);var u=e[a];Pa(u,r,s)?(s=u,o=!0):o&&"=&".includes(u)&&(s=u)}return n}(e);if(0===n.length)return Ea(e,t);for(var r,i="",o=0,s=p(n);!(r=s()).done;){var a=r.value;i+=Ea(e.slice(o,a),d({},t,{stripPunctuation:!1})),o=a}return i+Ea(e.slice(o),t)}(n,d({},t,{stripPunctuation:t.stripPunctuation&&n.length!==e.length}))})}function Fa(e){return e.replace(na,Ys)}function Ia(e,t){return function(e){return e.length>=10240&&(Js.test(e)||function(e){var t,n=ea.exec(e);if(!n)return!1;try{t=decodeURIComponent(e.slice(n[0].length))}catch(e){return!1}return ta.test(t.replace(/[\r\n]/g,""))}(e)||Xs.test(e)&&Zs.test(e))}(e)?"[binary data redacted - not supported by PostHog MCP analytics]":function(e,t,n){var r=4*n.maxStringLength;if(e.length>r){var i=t(e.slice(0,function(e,t){for(var n=t;n>0&&!oa.test(e[n-1]);)n--;return n}(e,r)));if(i.length>=2*n.maxStringLength)return i+n.truncationSuffix}return t(e)}(e,function(e){return function(e){return Ta(e,{allowNestedUrls:!0,stripPunctuation:!0})}(function(e){var t=e.replace(fa," ");return t=function(e){for(var t="",n=0,r=La(e,0);null!==r;r=La(e,r[1]))t+=e.slice(n,r[0])+Da(e.slice(r[0],r[1])),n=r[1];return t+e.slice(n)}(t=(t=(t=t.replace(ha,Ys)).replace(pa,Ys)).replace(_a,"$1"+Ys)),(t=(t=t.replace(va,Ys)).replace(ma,"$1"+Ys)).replace(ya,"$1"+Ys)}(Fa(e)))},t)}function Ra(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;if(0>i||i>9)return!1;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function Aa(e,t){var n=e.charCodeAt(t);return n>=48&&57>=n}function Ma(e,t){var n=e.charCodeAt(t);return Aa(e,t)||95===n||n>=65&&90>=n||n>=97&&122>=n}function Oa(e,t){for(var n=t;Aa(e,n);)n++;return n}function La(e,t){for(var n=t;e.length>n;n++)if(Aa(e,n)&&!Ma(e,n-1)){for(var r=0,i=-1,o=n;;){var s=Oa(e,o);if(13>(r+=s-o)||Ma(e,s)||(i=s),o=s+1,!" ./-".includes(e.charAt(s))||!Aa(e,o))break}if(i>=0)return[n,i];n=o-1}return null}function Da(e){for(var t=[],n=ga.exec(e);null!==n;n=ga.exec(e))t.push({digits:n[0],start:n.index,end:n.index+n[0].length});for(var r="",i=0,o=0;t.length>o;){for(var s="",a=-1,u=o;t.length>u&&19>=(s+=t[u].digits).length;u++)s.length>=13&&Ra(s)&&(a=u);0>a?o++:(r+=e.slice(i,t[o].start)+Ys,i=t[a].end,o=a+1)}return r+e.slice(i)}var $a={}.propertyIsEnumerable;function qa(e,t){try{return ja(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function Na(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:Fo};if(n.remainingNodes--,ci(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),r=BigInt("9223372036854775808");return e>=r||-r>e?(null==t||t.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}(e,t);if("number"==typeof e){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};var i=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if("string"==typeof e)return{stringValue:Ro(e)};if("function"==typeof e)return{stringValue:"[Function]"};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(n.ancestors.has(e))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Fo};if(e instanceof Date){var o=e.getTime(),s=Number.isFinite(o)?e.toISOString():String(e);return{stringValue:"string"==typeof s?Ro(s):String(s)}}n.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return Na(a.call(e),t,n,r+1)}catch(e){}return Xr(e)?{arrayValue:{values:Ba(e,t,n,r+1)}}:{kvlistValue:{values:ja(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:Ro(String(e))}}function Ba(e,t,n,r){for(var i=[],o=Math.min(e.length,1e3),s=0;o>s&&n.remainingNodes>0;s++)try{var a=s in e?e[s]:void 0;if(ai(a))continue;i.push(Na(a,t,n,r))}catch(e){i.push({stringValue:Io})}return e.length>s&&i.push({stringValue:Fo}),i}function ja(e,t,n,r){var i=[];for(var o in e)if($a.call(e,o)){if(!o){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||0>=n.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var s=e[o];if(si(s)||ri(s))continue;i.push({key:Ro(o),value:Na(s,t,n,r)})}catch(e){i.push({key:Ro(o),value:{stringValue:Io}})}}return i}function Ha(e,t,n){return d({},Ao({},e.resourceAttributes),{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}var za=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Ua(e,t){for(var n=Ao({},e),r={},i=0,o=za;o.length>i;i++){var s=o[i];({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s])}return[].concat(qa(n,t),qa(r,t))}var Wa={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"};var Va={text:"INFO",number:9},Ga={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:Va,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function Ka(e){try{return Ro(String(e))}catch(e){return Io}}function Qa(e,t,n,r){var i,o=Ga[e.level||"info"]||Va,s=o.text,a=o.number,u=(void 0===(i=ui(r)?r:void 0)&&(i=Date.now()),String(i)+"000000"),l={};t.distinctId&&(l.posthogDistinctId=t.distinctId),t.sessionId&&(l.sessionId=t.sessionId),t.windowId&&(l["window.id"]=t.windowId),ai(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),ai(t.lastActivityTimestamp)||(l.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(l["url.full"]=t.currentUrl),t.screenName&&(l["screen.name"]=t.screenName),t.appState&&(l["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(l.feature_flags=t.activeFeatureFlags);var c=d({},l),f=e.attributes;if(f){var h=[];try{h=Object.keys(f)}catch(e){h=[]}for(var _,v=p(h);!(_=v()).done;){var g=_.value,m=void 0;try{m=f[g]}catch(e){m=Io}Object.defineProperty(c,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var y={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:a,severityText:s,body:{stringValue:Ka(e.body)},attributes:qa(c,n)};return e.trace_id&&(y.traceId=e.trace_id),e.span_id&&(y.spanId=e.span_id),ri(e.trace_flags)||(y.flags=e.trace_flags),y}function Ya(e,t,n){return Ha(e,t,n)}function Ja(e,t,n,r){return{resourceLogs:[{resource:{attributes:Ua(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Za=function(){"use strict";function e(e){this._onFire=e,this._firesAt=0}var t=e.prototype;return t.arm=function(e){var t=this;this.clear(),this._firesAt=Date.now()+e,this._timer=Uo(function(){t._timer=void 0,t._onFire()},e)},t.armNoEarlierThan=function(e){this._timer&&Date.now()+e<=this._firesAt||this.arm(e)},t.clear=function(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)},a(e,[{key:"pending",get:function(){return!!this._timer}}])}();function Xa(){return.75+.5*Math.random()}function eu(e,t,n,r){var i=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===r?i:Math.min(i,Math.max(r,e)))*n)}var tu=function(){"use strict";function e(e,t,n,r,i,o,s,a){var u,l=this;void 0===o&&(o=function(){return Promise.resolve()}),void 0===a&&(a=function(){return!1}),this._instance=e,this._config=t,this._logger=n,this._getContext=r,this._onReady=i,this._waitForStoragePersist=o,this._scopeName=s,this._isConsentWithdrawn=a,this._flushTimer=new Za(function(){return l._flushInBackground()}),this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._backgroundFlushPromise=null,this._retryAfter=new qo,this._consecutiveFlushFailures=0,this._flushJitter=1,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!==(u=t.maxQueueSize)&&void 0!==u?u:t.maxBufferSize,t.maxBufferSize),this._flushIntervalMs=t.flushIntervalMs,this._maxBatchRecordsPerPost=t.maxBatchRecordsPerPost,this._rateCapWindowMs=t.rateCapWindowMs,this._maxLogsPerInterval=t.maxLogsPerInterval}var t=e.prototype;return t.clearQueue=function(){this._queueGeneration++,this._instance.setPersistedProperty(Br.LogsQueue,[])},t.reset=function(){this._flushTimer.clear(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.reset(),this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.isOpen()?this._hasQueuedRecords()&&this._armFlushTimer():this._flushInBackground()},t.captureLog=function(e,t){var n,r=this;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var i=this._runBeforeSend(e);if(null!==i)if(i.body){if(this._checkRateLimit()){var o={record:Qa(i,null!==(n=null==t?void 0:t.context)&&void 0!==n?n:this._getContext(),this._logger,null==t?void 0:t.occurredAtMs)};this._onReady(function(){return r._enqueue(o)})}}else this._logger.info("Log was rejected in beforeSend function")}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=p(Xr(t)?t:[t]);!(n=i()).done;){var o=n.value;try{var s=o(r);if(!s)return this._logger.info("Log was rejected in beforeSend function"),null;r=s}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}}return r},t._checkRateLimit=function(){if(void 0===this._maxLogsPerInterval)return!0;var e=Date.now(),t=e-this._intervalWindowStart;return this._rateCapWindowMs>t&&t>=0||(this._intervalWindowStart=e,this._intervalLogCount=0,this._droppedWarned=!1),this._maxLogsPerInterval>this._intervalLogCount?(this._intervalLogCount++,!0):(this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+this._maxLogsPerInterval+" logs per "+this._rateCapWindowMs+"ms"),this._droppedWarned=!0),!1)},t.flush=function(){var e=h(l().m(function e(){var t=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(!this._instance.isDisabled){e.n=1;break}return e.a(2);case 1:if(!this._flushPromise){e.n=2;break}return e.a(2,this._flushPromise);case 2:return this._flushPromise=this._flushInner().finally(function(){t._flushPromise=null}),e.a(2,this._flushPromise)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._flushInner=function(){var e=h(l().m(function e(){var t,n,r,i,o,s,a,u,c,d,f,h;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),!this._discardQueueIfConsentWithdrawn()){e.n=1;break}return e.a(2);case 1:if(0!==(n=null!==(t=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==t?t:[]).length){e.n=2;break}return e.a(2);case 2:r=n.length,i=0;case 3:if(0>=n.length||i>=r){e.n=11;break}if(!this._discardQueueIfConsentWithdrawn()){e.n=4;break}return e.a(2);case 4:return a=this._queueGeneration,this._evictedSinceAdvance=0,u=Math.min(n.length,this._maxBatchRecordsPerPost),c=n.slice(0,u),d=c.map(function(e){return e.record}),f=Ja(d,this._buildResourceAttributes(),null!==(o=this._scopeName)&&void 0!==o?o:this._instance.getLibraryId(),this._instance.getLibraryVersion()),e.n=5,this._instance._sendLogsBatch(f);case 5:if(h=e.v,this._queueGeneration===a){e.n=6;break}return e.a(2);case 6:if("too-large"!==h.kind||1>=c.length){e.n=7;break}return this._maxBatchRecordsPerPost=Math.max(1,Math.floor(c.length/2)),this._logger.warn("Logs batch of size "+c.length+" was too large for the ingestion endpoint, reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,3);case 7:if(this._retryAfter.record(h),this._flushTimer.pending&&this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs())),"retry-later"!==h.kind){e.n=8;break}throw h.error;case 8:return"too-large"===h.kind?this._logger.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===h.kind&&this._config.maxBatchRecordsPerPost>this._maxBatchRecordsPerPost&&(this._maxBatchRecordsPerPost=Math.min(this._config.maxBatchRecordsPerPost,this._maxBatchRecordsPerPost+1)),e.n=9,this._persistQueueAdvance(c.length);case 9:if(n=null!==(s=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==s?s:[],i+=c.length,"fatal"!==h.kind){e.n=10;break}throw h.error;case 10:e.n=3;break;case 11:return e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._discardQueueIfConsentWithdrawn=function(){return!!this._isConsentWithdrawn()&&(this._hasQueuedRecords()&&this.clearQueue(),!0)},t._persistQueueAdvance=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return r=Math.max(0,t-this._evictedSinceAdvance),i=null!==(n=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(Br.LogsQueue,i.slice(r)),e.n=1,this._waitForStoragePersist();case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t._buildResourceAttributes=function(){return Ya(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion())},t._enqueue=function(e){var t;if(!this._instance.optedOut){var n=null!==(t=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==t?t:[];this._maxQueueSize>n.length||(n.shift(),this._evictedSinceAdvance++,this._logger.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(Br.LogsQueue,n),this._maxBufferSize>n.length||this._retryAfter.isOpen()?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs()))},t._nextFlushDelay=function(){return Math.max(eu(this._flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(Br.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=h(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),n=this.flush().catch(function(){}),void 0!==t){e.n=2;break}return e.n=1,n;case 1:return e.a(2,void 0);case 2:return e.n=3,Wo(n,t);case 3:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=h(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:return n=this.flush(),e.n=1,Wo(n,t,function(){n.catch(function(){})});case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushInBackground=function(){var e=this;if(this._backgroundFlushPromise)return this._backgroundFlushPromise;var t=this.flush().then(function(){e._consecutiveFlushFailures=0,e._flushJitter=1},function(t){e._consecutiveFlushFailures++,e._flushJitter=Xa(),e._logger.error("PostHog logs flush failed:",t)}).finally(function(){e._backgroundFlushPromise===t&&(e._backgroundFlushPromise=null),!e._instance.isDisabled&&e._hasQueuedRecords()&&e._flushTimer.armNoEarlierThan(e._nextFlushDelay())});return this._backgroundFlushPromise=t,t},t._flushInBackground=function(){this.flushInBackground()},a(e,[{key:"throttled",get:function(){return this._retryAfter.isOpen()}}])}(),nu=/^[0-9a-f]+$/;function ru(e,t,n){return"string"==typeof e&&e.length===t&&e!==n&&nu.test(e)}var iu=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;var ou="00",su=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function au(e){return String(e)+"000000"}function uu(e,t,n,r){var i="";return r&&(i=Object.keys(r).sort().map(function(e){return JSON.stringify(e)+":"+JSON.stringify(r[e])}).join(",")),e+"\0"+t+"\0"+(null!=n?n:"")+"\0"+i}var lu=function(){"use strict";function e(e,t,n){var r=this;this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushTimer=new Za(function(){return r.flush().catch(function(e){r._logger.error("Metrics flush failed:",e)})}),this._flushPromise=null,this._queuedFlush=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._boundsByHistogram=new Map,this._boundsConflictWarned=new Set,this._boundsCapWarned=!1,this._retryAfter=new qo,this._consecutiveFlushFailures=0,this._flushJitter=1,this._generation=0}var t=e.prototype;return t.count=function(e,t,n){void 0===t&&(t=1),this._capture({name:e,type:"count",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.gauge=function(e,t,n){this._capture({name:e,type:"gauge",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.histogram=function(e,t,n){this._capture({name:e,type:"histogram",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes,bounds:Xr(null==n?void 0:n.bounds)?n.bounds.slice():null==n?void 0:n.bounds})},t.flush=function(){var e=this,t=this._flushPromise,n=function(){var n=h(l().m(function n(){return l().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=1;break}return n.n=1,t.catch(function(){});case 1:return n.n=2,e._doFlush();case 2:return n.a(2)}},n)}));return function(){return n.apply(this,arguments)}}()().finally(function(){e._flushPromise===n&&(e._flushPromise=null)});return this._flushPromise=n,n},t.flushCoalesced=function(){var e,t,n=this;return this._isBackingOff()?null!==(e=this._flushPromise)&&void 0!==e?e:Promise.resolve():(this._queuedFlush||(this._queuedFlush=(null!==(t=this._flushPromise)&&void 0!==t?t:Promise.resolve()).catch(function(){}).then(function(){return n._queuedFlush=null,n._isBackingOff()?void 0:n.flush()})),this._queuedFlush)},t._isBackingOff=function(){return this._consecutiveFlushFailures>0||this._retryAfter.remainingMs()>0},t.drainWindow=function(){if(0===this._series.size)return null;var e=this._series;return this._startWindow(),this._buildPayload(e)},t.reset=function(){this._generation++,this._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=1,this._flushTimer.clear(),this._flushPromise=null,this._queuedFlush=null,this._startWindow(),this._boundsByHistogram=new Map,this._boundsCapWarned=!1},t._startWindow=function(){this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._boundsConflictWarned=new Set},t._capture=function(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this._runBeforeSend(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type||"gauge"===t.type||"histogram"===t.type)if("count"===t.type&&0>t.value)this._logger.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=t.attributes?d({},t.attributes):void 0,r=uu(t.type,t.name,t.unit,n)}catch(e){return void this._logger.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,o=this._series.get(r);if((o||this._admitNewSeries())&&("histogram"!==t.type||(i=this._histogramBounds(t.name,t.unit,t.bounds)))){o||(o={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now(),hist:i&&du(i)},this._series.set(r,o));var s=this._typeByName.get(t.name);void 0===s?this._typeByName.set(t.name,t.type):s===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+s+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(o,t.value);var a=this._activeTraceContext();a&&(o.exemplar=d({},a,{value:t.value,timeMs:Date.now()})),this._armFlushTimer()}}else this._logger.warn("Dropping metric '"+t.name+"': unknown type '"+String(t.type)+"'");else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}},t._activeTraceContext=function(){try{var e,t,n=(r=null==(e=(t=this._instance).getActiveSpan)||null==(e=e.call(t))?void 0:e.traceparent(),o=function(e){if("string"==typeof e){var t=iu.exec(e.trim());if(t){var n=t[1],r=t[2],i=t[3],o=t[4];if("ff"!==n&&("00"!==n||!t[5])&&function(e){return ru(e,32,"00000000000000000000000000000000")}(r)&&function(e){return ru(e,16,"0000000000000000")}(i))return{version:n,traceId:r,spanId:i,flags:o}}}}(r),o&&{traceId:o.traceId,spanId:o.spanId,flags:(i=o.flags,1&parseInt(i,16)?"01":ou)});if(n&&"01"===n.flags)return{traceId:n.traceId,spanId:n.spanId}}catch(e){}var r,i,o},t._admitNewSeries=function(){return this._config.maxSeriesPerFlush>this._series.size||(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn("Metric series cap reached ("+this._config.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)},t._histogramBounds=function(e,t,n){if(void 0===n||function(e){if(!Xr(e)||0===e.length)return!1;for(var t=0;e.length>t;t++)if(!Number.isFinite(e[t])||t>0&&e[t-1]>=e[t])return!1;return!0}(n)){var r=uu("histogram",e,t,void 0),i=this._boundsByHistogram.get(r);if(i)return this._warnOnBoundsConflict(e,r,i,n),i;if(this._boundsByHistogram.size>=this._config.maxSeriesPerFlush){if(this._boundsCapWarned||(this._boundsCapWarned=!0,this._logger.warn("Histogram bounds limit reached ("+this._config.maxSeriesPerFlush+" distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.")),n&&!cu(n,su))return;return su}var o=n?n.slice():su;return this._boundsByHistogram.set(r,o),o}this._logger.warn("Dropping histogram '"+e+"': bounds must be a non-empty array of finite, strictly increasing numbers")},t._warnOnBoundsConflict=function(e,t,n,r){cu(n,null!=r?r:su)||this._boundsConflictWarned.has(t)||(this._boundsConflictWarned.add(t),this._logger.warn("Histogram '"+e+"' already uses the bounds ["+n.join(", ")+"]; samples that pass different bounds are recorded in those buckets."))},t._fold=function(e,t){var n;switch(e.type){case"count":e.total=(null!==(n=e.total)&&void 0!==n?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,r.bounds)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=p(Xr(t)?t:[t]);!(n=i()).done;){var o=n.value;try{var s=o(r);if(!s)return this._logger.info("Metric was rejected in beforeSend function"),null;r=s}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}}return r},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())},t._nextFlushDelay=function(){return Math.max(eu(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._doFlush=function(){var e=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),0!==this._series.size){e.n=1;break}return e.a(2);case 1:return t=this._series,this._startWindow(),n=this._generation,e.n=2,this._instance._sendMetricsBatch(this._buildPayload(t));case 2:if(r=e.v,n===this._generation){e.n=3;break}return e.a(2);case 3:this._retryAfter.record(r),"retry-later"===r.kind?(this._consecutiveFlushFailures++,this._flushJitter=Xa()):(this._consecutiveFlushFailures=0,this._flushJitter=1),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),e.n="ok"===(i=r.kind)?4:"retry-later"===i?5:"too-large"===i?6:"fatal"===i?7:8;break;case 4:case 8:return e.a(2);case 5:return this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay()),e.a(2);case 6:return this._logger.warn("Metrics batch exceeded the server size limit and was dropped"),e.a(2);case 7:return this._logger.error("Failed to send metrics batch:",r.error),e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._buildPayload=function(e){return t=this._buildMetrics(e),n=function(e,t,n){return Ha(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ua(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i},t._buildMetrics=function(e){for(var t,n=au(Date.now()),r=new Map,i=p(e.values());!(t=i()).done;){var o,s=t.value,a=uu(s.type,s.name,s.unit,void 0),u=r.get(a);u||(u=d({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},r.set(a,u));var l=qa(null!==(o=s.attributes)&&void 0!==o?o:{},this._logger),c=au(s.windowStartMs),f=fu(s.exemplar);if("count"===s.type){var h,_=d({attributes:l,startTimeUnixNano:c,timeUnixNano:n,asDouble:null!==(h=s.total)&&void 0!==h?h:0},f);u.sum.dataPoints.push(_)}else if("gauge"===s.type){var v,g=d({attributes:l,timeUnixNano:n,asDouble:null!==(v=s.last)&&void 0!==v?v:0},f);u.gauge.dataPoints.push(g)}else{var m=s.hist,y=d({attributes:l,startTimeUnixNano:c,timeUnixNano:n,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},f);u.histogram.dataPoints.push(y)}}return Array.from(r.values())},t._mergeWindowBack=function(e){for(var t,n,r,i=p(e);!(r=i()).done;){var o,s=r.value,a=s[0],u=s[1],l=this._series.get(a);if(l)switch(l.windowStartMs=Math.min(l.windowStartMs,u.windowStartMs),l.exemplar=null!==(o=l.exemplar)&&void 0!==o?o:u.exemplar,l.type){case"count":l.total=(null!==(t=l.total)&&void 0!==t?t:0)+(null!==(n=u.total)&&void 0!==n?n:0);break;case"gauge":break;case"histogram":var c=l.hist,d=u.hist;c.count+=d.count,c.sum+=d.sum,c.min=Math.min(c.min,d.min),c.max=Math.max(c.max,d.max);for(var f=0;c.bucketCounts.length>f;f++)c.bucketCounts[f]+=d.bucketCounts[f]}else this._admitNewSeries()&&this._series.set(a,u)}},e}();function cu(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function du(e){return{bounds:e,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(e.length+1).fill(0)}}function fu(e){return e?{exemplars:[{filteredAttributes:[],timeUnixNano:au(e.timeMs),asDouble:e.value,traceId:e.traceId,spanId:e.spanId}]}:{}}function hu(e,t){var n;if(e)return null==(n=e.find(function(e){return e.type===t}))?void 0:n.value}var pu,_u,vu,gu,mu,yu,bu=function(){"use strict";function e(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}e.fromFieldsV7=function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/256,o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)};var t=e.prototype;return t.toString=function(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e},t.clone=function(){return new e(this.bytes.slice(0))},t.equals=function(e){return 0===this.compareTo(e)},t.compareTo=function(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0},e}(),wu=function(){"use strict";function e(){this._timestamp=0,this._counter=0,this._random=new ku}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!ri(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(ri(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e=function(){var e=Date.now();return ui(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0}();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return bu.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())},t._resetCounter=function(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())},e}(),Su=function(e){if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e},ku=function(){"use strict";function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._buffer.length>this._cursor||((null!=pu?pu:pu="u">typeof window&&!ri(window.crypto)&&crypto.getRandomValues?function(e){try{return crypto.getRandomValues(e)}catch(t){return Su(e)}}:Su)(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),xu=function(){return Cu().toString()},Cu=function(){return(_u||(_u=new wu)).generate()},Pu=0,Eu=[],Tu=v,Fu=Tu.__b,Iu=Tu.__r,Ru=Tu.diffed,Au=Tu.__c,Mu=Tu.unmount,Ou=Tu.__;function Lu(e,t){Tu.__h&&Tu.__h(gu,e,Pu||t),Pu=0;var n=gu.__H||(gu.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Du(e){return Pu=1,function(e,t){var n=Lu(vu++,2);if(n.t=e,!n.__c&&(n.__=[Gu(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=gu,!gu.__f)){var r=function(e,t,r){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==e;if(n.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),i){var a=i.call(this,e,t,r);return o?a||s:a}return!o||s};gu.__f=!0;var i=gu.shouldComponentUpdate,o=gu.componentWillUpdate;gu.componentWillUpdate=function(e,t,n){if(this.__e){var s=i;i=void 0,r(e,t,n),i=s}o&&o.call(this,e,t,n)},gu.shouldComponentUpdate=r}return n.__N||n.__}(Gu,e)}function $u(e,t){var n=Lu(vu++,3);!Tu.__s&&Vu(n.__H,t)&&(n.__=e,n.u=t,gu.__H.__h.push(n))}function qu(e){return Pu=5,Nu(function(){return{current:e}},[])}function Nu(e,t){var n=Lu(vu++,7);return Vu(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Bu(e){var t,n=gu.context[e.__c],r=Lu(vu++,9);return r.c=e,n?(null!==(t=r.__)&&void 0!==t||(r.__=!0,n.sub(gu)),n.props.value):e.__}function ju(){for(var e;e=Eu.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Uu),t.__h.some(Wu),t.__h=[]}catch(n){t.__h=[],Tu.__e(n,e.__v)}}}Tu.__b=function(e){gu=null,Fu&&Fu(e)},Tu.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ou&&Ou(e,t)},Tu.__r=function(e){Iu&&Iu(e),vu=0;var t=(gu=e.__c).__H;t&&(mu===gu?(t.__h=[],gu.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&ju(),vu=0)),mu=gu},Tu.diffed=function(e){Ru&&Ru(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Eu.push(t)&&yu===Tu.requestAnimationFrame||((yu=Tu.requestAnimationFrame)||zu)(ju)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),mu=gu=null},Tu.__c=function(e,t){t.some(function(e){try{e.__h.some(Uu),e.__h=e.__h.filter(function(e){return!e.__||Wu(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Tu.__e(n,e.__v)}}),Au&&Au(e,t)},Tu.unmount=function(e){Mu&&Mu(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Uu(e)}catch(e){t=e}}),n.__H=void 0,t&&Tu.__e(t,n.__v))};var Hu="function"==typeof requestAnimationFrame;function zu(e){var t,n=function(){clearTimeout(r),Hu&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Hu&&(t=requestAnimationFrame(n))}function Uu(e){var t=gu,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),gu=t}function Wu(e){var t=gu;e.__c=e.__(),gu=t}function Vu(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Gu(e,t){return"function"==typeof t?t(e):t}var Ku="events",Qu="cancelEvents",Yu="tab",Ju="left",Zu="center",Xu="right",el="next_to_trigger",tl="popover",nl="widget",rl="external_survey",il="open",ol="multiple_choice",sl="single_choice",al="rating",ul="end",ll="always",cl="survey shown",dl="survey dismissed",fl="survey sent",hl="$survey_id",pl="$survey_name",_l="$survey_iteration",vl="$survey_iteration_start_date",gl="$survey_language",ml="popover",yl="0.14.1",bl={DEBUG:!1,LIB_VERSION:yl,LIB_NAME:"browser-common",JS_SDK_VERSION:yl},wl=function(e,t){var n=(void 0===t?{}:t).debugEnabled,r={_log:function(t){var r;try{r=typeof window>"u"?void 0:window}catch(e){return}for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;i>s;s++)o[s-1]=arguments[s];r&&(bl.DEBUG||r.POSTHOG_DEBUG||n)&&!ri(r.console)&&r.console&&("__rrweb_original__"in r.console[t]?r.console[t].__rrweb_original__:r.console[t]).apply(void 0,[e].concat(o))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["debug"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["error"].concat(t))},critical:function(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];(t=console).error.apply(t,[e].concat(r))},uninitializedWarning:function(e){r.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return wl(e+" "+t,n)}};return r},Sl=wl("[PostHog.js]"),kl=function(e,t){return Sl.createLogger(e,t)};function xl(e,t){Xr(e)&&e.forEach(t)}function Cl(e,t){if(!ai(e))if(Xr(e))e.forEach(t);else if(function(e){return e instanceof FormData}(e))e.forEach(function(e,n){return t(e,n)});else for(var n in e)Jr.call(e,n)&&t(e[n],n)}var Pl=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i=0,o=n;o.length>i;i++){var s=o[i];for(var a in s)void 0!==s[a]&&(e[a]=s[a])}return e};function El(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Tl=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Sl.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Sl.critical(e)}}},Fl=function(e){var t={};return Cl(e,function(e,n){(ii(e)&&e.length>0||ui(e))&&(t[n]=e)}),t};function Il(e){for(var t=d({},e),n=0,r=["name","message","stack","cause","errors"];r.length>n;n++){var i=r[n];try{i in e&&(t[i]=e[i])}catch(e){}}return t}var Rl=["herokuapp.com","vercel.app","netlify.app"];function Al(e){var t=null==e?void 0:e.hostname;if(!ii(t))return!1;for(var n=t.split(".").slice(-2).join("."),r=0,i=Rl;i.length>r;r++)if(n===i[r])return!1;return!0}function Ml(e,t,n,r){var i=null!=r?r:{},o=i.capture,s=i.passive;null==e||e.addEventListener(t,n,{capture:void 0!==o&&o,passive:void 0===s||s})}function Ol(e){return"ph_toolbar_internal"===e.name}function Ll(e){return"$survey_response_"+e}function Dl(e,t){if(!t)return null;var n=e[Ll(t)];return Xr(n)?[].concat(n):n}function $l(e){var t,n=e.event,r=e.survey,i=e.responses,o=void 0===i?{}:i,s=e.submissionId,a=e.completed,u=e.surveyLanguage,l=e.questionSnapshots;return d({},!ri(s)&&{$survey_submission_id:s},"sent"===n?!ri(a)&&{$survey_completed:a}:{$survey_partially_completed:ql(o)},u&&((t={}).$survey_language=u,t),function(e,t,n){void 0===e&&(e={});var r={};return t.questions.forEach(function(t){if(!ri(t.originalQuestionIndex)){var n,i=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,o=Dl(e,t.id);ri(o)||(r[i]=o)}}),d({$survey_questions:t.questions.map(function(t){var r,i;return{id:t.id,question:null!==(r=null==n?void 0:n[null!==(i=t.id)&&void 0!==i?i:""])&&void 0!==r?r:t.question,response:Dl(e,t.id)}})},e,r)}(o,r,l))}function ql(e){return void 0===e&&(e={}),Object.values(e).some(function(e){return!ai(e)})}function Nl(e,t){var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n}function Bl(e){return"string"==typeof e&&e.trim()?e.trim():null}function jl(e){return e.toLowerCase()}function Hl(e,t,n){if(!e||!t)return null;var r=jl(t),i=Object.keys(e).find(function(e){return jl(e)===r});if(i)return null==n||n.debug("Found exact translation match: "+i),i;if(r.includes("-")){var o=r.split("-")[0],s=Object.keys(e).find(function(e){return jl(e)===o});if(s)return null==n||n.debug("Found base language translation match: "+s+" (from "+t+")"),s}return null}var zl=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ul(e,t,n){var r,i=Hl(e.translations,t,n),o=d({},e),s=!1;if(i){var a,u=null==(a=e.translations)?void 0:a[i];if(u)if(null==n||n.info("Applying survey-level translation for language: "+i),ri(u.name)||(o.name=u.name,s=!0),o.appearance){for(var l=d({},o.appearance),c=0,f=zl;f.length>c;c++){var h=f[c],p=u[h];ri(p)||(l[h]=p,s=!0)}o.appearance=l}else(function(e){return zl.some(function(t){return!ri(e[t])})})(u)&&(s=!0)}var _=e.questions.map(function(e){return function(e,t,n){var r,i=Hl(e.translations,t,n);if(!i)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(r=e.translations)?void 0:r[i];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var s=d({},e),a=!1;return ri(o.question)||(s.question=o.question,a=!0),ri(o.description)||(s.description=o.description,a=!0),ri(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!ri(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!ri(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!ri(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(e){return Xr(e.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:e,matchedKey:a?i:null,hasChanges:a}}(e,t,n)}),v=_.map(function(e){return e.question}),g=_.some(function(e){return e.hasChanges}),m=null;return i||(m=(null==(r=_.find(function(e){return e.matchedKey}))?void 0:r.matchedKey)||null),g&&(o.questions=v,s=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:s?i||m:null}}function Wl(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Vl(e){var t;return Wl(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Gl=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}},Kl=function(e){return e.toLowerCase()},Ql={exact:function(e,t){return t.some(function(t){return e.some(function(e){return t===e})})},is_not:function(e,t){return t.every(function(t){return e.every(function(e){return t!==e})})},regex:function(e,t){return t.some(function(t){return e.some(function(e){return Gl(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!Gl(t,e)})})},icontains:function(e,t){return t.map(Kl).some(function(t){return e.map(Kl).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(Kl).every(function(t){return e.map(Kl).every(function(e){return!t.includes(e)})})},gt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n>parseFloat(e)})})},lt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n<parseFloat(e)})})}};function Yl(e,t){return!e||Object.entries(e).every(function(e){var n=e[1],r=null==t?void 0:t[e[0]];if(null==r)return!1;var i=Ql[n.operator];return!!i&&i(n.values.map(String),[String(r)])})}var Jl=function(e){for(var t=[].concat(e),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=[t[r],t[n]];t[n]=i[0],t[r]=i[1]}return t},Zl=kl("[Surveys]"),Xl="PostHog is not capturing, so a survey response cannot be recorded";function ec(e){return!(!e.start_date||e.end_date)}function tc(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var nc=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},rc=function(e){return nc("seenSurvey_",e)},ic=function(e){try{var t=rc(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Zl.error("Failed to persist survey seen state",e)}},oc=[tl,nl,"api"],sc={ignoreConditions:!1,ignoreDelay:!1,displayType:ml};function ac(e,t){this.v=e,this.k=t}function uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function lc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cc(e){var t,n;function r(t,n){try{var o=e[t](n),s=o.value,a=s instanceof ac;Promise.resolve(a?s.v:s).then(function(n){if(a){var u="return"===t&&s.k?t:"next";if(!s.k||n.done)return r(u,n);n=e[u](n).value}i(!!o.done,n)},function(e){r("throw",e)})}catch(e){i(2,e)}}function i(e,i){2===e?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};n?n=n.next=a:(t=n=a,r(e,i))})},"function"!=typeof e.return&&(this.return=void 0)}cc.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},cc.prototype.next=function(e){return this._invoke("next",e)},cc.prototype.throw=function(e){return this._invoke("throw",e)},cc.prototype.return=function(e){return this._invoke("return",e)};var dc=Object.entries,fc=Object.keys,hc=Object.setPrototypeOf,pc=Object.isFrozen,_c=Object.getPrototypeOf,vc=Object.getOwnPropertyDescriptor,gc=Object.freeze,mc=Object.seal,yc=Object.create,bc="undefined"!=typeof Reflect&&Reflect,wc=bc.apply,Sc=bc.construct;gc||(gc=function(e){return e}),mc||(mc=function(e){return e}),wc||(wc=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];return e.apply(t,r)}),Sc||(Sc=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var s=new(e.bind.apply(e,r));return n&&i(s,n.prototype),s}(e,n)});var kc=Kc([].forEach),xc=Kc([].lastIndexOf),Cc=Kc([].pop),Pc=Kc([].push),Ec=Kc([].slice),Tc=Kc([].splice),Fc=Array.isArray,Ic=Qc(Set),Rc=Kc(Set.prototype.add),Ac=Kc(Set.prototype.has),Mc=Kc("".toLowerCase),Oc=Kc("".toString),Lc=Kc("".match),Dc=Kc("".replace),$c=Kc("".indexOf),qc=Kc("".trim),Nc=Kc((0).toString),Bc=Kc(Boolean.prototype.toString),jc="undefined"==typeof BigInt?null:Kc(BigInt.prototype.toString),Hc="undefined"==typeof Symbol?null:Kc(Symbol.prototype.toString),zc=Kc({}.hasOwnProperty),Uc=Kc({}.toString),Wc=/t/.test,Vc=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),wc(Wc,e,[t])},Gc=Qc(TypeError);function Kc(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];return wc(e,t,r)}}function Qc(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return Sc(e,n)}}function Yc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mc;if(hc&&hc(e,null),!Fc(t))return e;for(var r=t.length;r--;){var i=t[r];if("string"==typeof i){var o=n(i);o!==i&&(pc(t)||(t[r]=o),i=o)}e[i]=!0}return e}function Jc(e){for(var t=0;e.length>t;t++)zc(e,t)||(e[t]=null);return e}function Zc(e){for(var t,n=yc(null),r=p(dc(e));!(t=r()).done;){var i=lc(t.value,2),o=i[0],s=i[1];zc(e,o)&&(n[o]=Fc(s)?Jc(s):s&&"object"==typeof s&&s.constructor===Object?Zc(s):s)}return n}function Xc(e){for(var t=yc(null),n=fc(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}function ed(e,t){for(;null!==e;){var n=vc(e,t);if(n){if(n.get)return Kc(n.get);if("function"==typeof n.value)return Kc(n.value)}e=_c(e)}return function(){return null}}var td,nd=gc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),rd=gc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),id=gc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),od=gc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),sd=gc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ad=gc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ud=gc(["#text"]),ld=gc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),cd=gc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dd=gc(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fd=gc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hd=mc(/{{[\w\W]*|^[\w\W]*}}/g),pd=mc(/<%[\w\W]*|^[\w\W]*%>/g),_d=mc(/\${[\w\W]*/g),vd=mc(/{{|}}|\${|<%|%>|&lt;%|%&gt;/),gd=mc(/^data-[\-\w.\u00B7-\uFFFF]+$/),md=mc(/^aria-[\-\w]+$/),yd=mc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bd=mc(/^(?:\w+script|data):/i),wd=mc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sd=mc(/^html$/i),kd=mc(/^[a-z][.\w]*(-[.\w]+)+$/i),xd=mc(/<[/\w!]/g),Cd=mc(/<[/\w]/g),Pd=mc(/<\/no(script|embed|frames)/i),Ed=mc(/\/>/i),Td=mc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Fd=mc(/^[\r\n\t ]+/),Id=gc(Yc({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Rd=function(){return"undefined"==typeof window?null:window},Ad=function(e,t,n,r){return zc(e,t)&&Fc(e[t])?Yc(r.base?Xc(r.base):{},e[t],r.transform):n},Md=function(e,t,n){var r=zc(e,t)?e[t]:void 0;return r&&"object"==typeof r?Zc(r):n},Od=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rd(),n=function(t){return e(t)};if(n.version="3.4.18",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;var r,i=t.document,o=i,s=o.currentScript,a=t.HTMLTemplateElement,u=t.Node,l=t.NodeFilter,c=t.DOMParser,d=t.trustedTypes,f=t.Element.prototype,h=ed(f,"cloneNode"),p=ed(f,"remove"),_=ed(f,"removeAttributeNode"),v=ed(f,"nextSibling"),g=ed(f,"childNodes"),m=ed(f,"parentNode"),y=ed(f,"shadowRoot"),b=ed(f,"attributes"),w=u&&u.prototype?ed(u.prototype,"nodeType"):null,S=u&&u.prototype?ed(u.prototype,"nodeName"):null,k=u&&u.prototype?ed(u.prototype,"ownerDocument"):null,x=function(e){return w?w(e):e.nodeType},C=function(e){return S?S(e):e.nodeName},P=function(e){for(;null!==e;){var t=vc(e,"namespaceURI");if(t)return t.get?Kc(t.get):null;e=_c(e)}return null}(f),E=function(e){return P?P(e):e.namespaceURI};if("function"==typeof a){var T=i.createElement("template");T.content&&T.content.ownerDocument&&(i=T.content.ownerDocument)}var F,I="",R=!1,A=0,M=function(){if(A>0)throw Gc('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},O=function(e){M(),A++;try{return r.createHTML(e)}finally{A--}},L=function(e){return r&&ye?O(e):e},D=i.implementation,q=i.createNodeIterator,N=i.createDocumentFragment,B=i.getElementsByTagName,j=o.importNode,H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof dc&&"function"==typeof m&&D&&void 0!==D.createHTMLDocument;var z=hd,U=pd,W=_d,V=gd,G=md,K=bd,Q=wd,Y=kd,J=yd,Z=null,X=Yc({},[].concat(nd,rd,id,sd,ud)),ee=null,te=Yc({},[].concat(ld,cd,dd,fd)),ne=null,re=null,ie=null,oe=Object.seal(yc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),se=!0,ae=!0,ue=!1,le=!0,ce=!1,de=!0,fe=!1,he=!1,pe=null,_e=null,ve=!1,ge=!1,me=!1,ye=!1,be=!0,we=!1,Se="user-content-",ke=!0,xe=!1,Ce=null,Pe=!1,Ee=null,Te=Yc({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Fe=null,Ie=Yc({},["audio","video","img","source","image","track"]),Re=null,Ae=Yc({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Oe="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml",De=Le,$e=!1,qe=null,Ne=Yc({},[Me,Oe,Le],Oc),Be=gc(Yc({},["mi","mo","mn","ms","mtext"])),je=null,He=gc(Yc({},["annotation-xml"])),ze=null,Ue=gc(yc(null)),We=Yc({},["title","style","font","a","script"]),Ve=null,Ge=["application/xhtml+xml","text/html"],Ke=null,Qe=null,Ye=i.createElement("form"),Je=function(e){return e instanceof RegExp||e instanceof Function},Ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e&&"object"==typeof e||(e={}),e=Zc(e),Ve=-1===Ge.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Z=Ad(e,"ALLOWED_TAGS",X,{transform:Ke="application/xhtml+xml"===Ve?Oc:Mc}),ee=Ad(e,"ALLOWED_ATTR",te,{transform:Ke}),qe=Ad(e,"ALLOWED_NAMESPACES",Ne,{transform:Oc}),Re=Ad(e,"ADD_URI_SAFE_ATTR",Ae,{transform:Ke,base:Ae}),Fe=Ad(e,"ADD_DATA_URI_TAGS",Ie,{transform:Ke,base:Ie}),Ee=Ad(e,"FORBID_CONTENTS",Te,{transform:Ke}),re=Ad(e,"FORBID_TAGS",yc(null),{transform:Ke}),ie=Ad(e,"FORBID_ATTR",yc(null),{transform:Ke}),Pe=!!zc(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?Zc(e.USE_PROFILES):e.USE_PROFILES),se=!1!==e.ALLOW_ARIA_ATTR,ae=!1!==e.ALLOW_DATA_ATTR,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,le=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ce=e.SAFE_FOR_TEMPLATES||!1,de=!1!==e.SAFE_FOR_XML,fe=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,me=e.RETURN_DOM_FRAGMENT||!1,ye=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,be=!1!==e.SANITIZE_DOM,we=e.SANITIZE_NAMED_PROPS||!1,ke=!1!==e.KEEP_CONTENT,xe=e.IN_PLACE||!1,J=function(e){if(!e)return!1;try{return Vc(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:yd,De="string"==typeof e.NAMESPACE?e.NAMESPACE:Le,je=Md(e,"MATHML_TEXT_INTEGRATION_POINTS",Be),ze=Md(e,"HTML_INTEGRATION_POINTS",He);var t=Md(e,"CUSTOM_ELEMENT_HANDLING",Ue);if(ne=yc(null),zc(t,"tagNameCheck")&&Je(t.tagNameCheck)&&(ne.tagNameCheck=t.tagNameCheck),zc(t,"attributeNameCheck")&&Je(t.attributeNameCheck)&&(ne.attributeNameCheck=t.attributeNameCheck),zc(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(ne.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),mc(ne),ce&&(ae=!1),me&&(ge=!0),Pe&&((zc(e,"ALLOWED_TAGS")||zc(e,"ALLOWED_ATTR"))&&"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),Z=Yc({},ud),ee=yc(null),!0===Pe.html&&(Yc(Z,nd),Yc(ee,ld)),!0===Pe.svg&&(Yc(Z,rd),Yc(ee,cd),Yc(ee,fd)),!0===Pe.svgFilters&&(Yc(Z,id),Yc(ee,cd),Yc(ee,fd)),!0===Pe.mathMl&&(Yc(Z,sd),Yc(ee,dd),Yc(ee,fd))),oe.tagCheck=null,oe.attributeCheck=null,zc(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?oe.tagCheck=e.ADD_TAGS:Fc(e.ADD_TAGS)&&(Z===X&&(Z=Xc(Z)),Yc(Z,e.ADD_TAGS,Ke))),zc(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?oe.attributeCheck=e.ADD_ATTR:Fc(e.ADD_ATTR)&&(ee===te&&(ee=Xc(ee)),Yc(ee,e.ADD_ATTR,Ke))),zc(e,"ADD_FORBID_CONTENTS")&&Fc(e.ADD_FORBID_CONTENTS)&&(Ee===Te&&(Ee=Xc(Ee)),Yc(Ee,e.ADD_FORBID_CONTENTS,Ke)),ke&&(Z["#text"]=!0),fe&&Yc(Z,["html","head","body"]),Z.table&&(Z.tbody=!0,delete re.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Gc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Gc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');var n=r;r=e.TRUSTED_TYPES_POLICY;try{I=O("")}catch(e){throw r=n,e}}else null===e.TRUSTED_TYPES_POLICY?(r=void 0,I=""):(void 0===r&&(R||(F=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(d,s),R=!0),r=F),r&&"string"==typeof I&&(I=O("")));Qe=gc(e)},Xe=Yc({},[].concat(rd,id,od)),et=Yc({},[].concat(sd,ad)),tt=function(e){Pc(n.removed,{element:e});try{m(e).removeChild(e)}catch(t){if(p(e),!m(e))throw Gc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},nt=function(e,t,n){try{_(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},rt=function(e){at(e);var t=g(e);t&&kc(Ec(t),function(e){try{p(e)}catch(e){}}),1===x(e)&&ot(e,!1)},it=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch(e){r=null}if(Pc(n.removed,{attribute:r||null,from:t}),r)nt(t,r,e);else try{t.removeAttribute(e)}catch(e){}if("is"===e)if(ge||me)try{tt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ot=function(e,t){var n=b(e);if(n)for(var r=n.length-1;r>=0;--r){var i=n[r],o=i&&i.name;"string"!=typeof o||t&&ee[Ke(o)]||nt(e,i,o)}},st=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[e];r.length>0;){var i=r.pop();if(!1!==t(i)){if(n&&1===x(i)){var o=y(i);mt(o)&&r.push(o)}var s=g(i);if(s)for(var a=s.length-1;a>=0;--a)r.push(s[a])}}},at=function(e){st(e,function(e){1===x(e)&&ot(e,!0)})},ut=function(e){var t=[];return st(e,function(e){t.push(e)},!0),t},lt=function(e,t){var r=!1;return kc(n.removed,function(t){t.element&&(r=r||t.element===e,at(t.element))}),function(e,t){var n=Ic();kc(ut(e),function(e){1===x(e)&&Rc(n,e)}),kc(t,function(e){1!==x(e)||Ac(n,e)||ot(e,!0)})}(e,t),r},ct=function(e,t){return!!de&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},dt=function(e){var t=null,n=null;if(ve)e="<remove></remove>"+e;else{var o=Lc(e,Fd);n=o&&o[0]}"application/xhtml+xml"===Ve&&De===Le&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var s=r?O(e):e;if(De===Le)try{t=(new c).parseFromString(s,Ve)}catch(e){}if(!t||!t.documentElement){t=D.createDocument(De,"template",null);try{t.documentElement.innerHTML=$e?I:s}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),De===Le?B.call(t,fe?"html":"body")[0]:fe?t.documentElement:a},ft=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=k?k(e):e.ownerDocument;return q.call(n||e,e,(t?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ht=function(e){return e=Dc(e,z," "),e=Dc(e,U," "),Dc(e,W," ")},pt=function(e){var t;_t(e);var n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&kc(n,function(e){mt(e.content)&&pt(e.content)})},_t=function(e){e.normalize();for(var t=ft(e,!0),n=t.nextNode();n;)n.data=ht(n.data),n=t.nextNode()},vt=function(e){var t=S?S(e):null;return"string"==typeof t&&"form"===Ke(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==b(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.removeAttributeNode||"function"!=typeof e.getAttributeNode||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==w(e)||e.childNodes!==g(e))},gt=function(e){if(!w||"object"!=typeof e||null===e)return null;try{var t=w(e);return"number"==typeof t?t:null}catch(e){return null}},mt=function(e){return 11===gt(e)},yt=function(e){return null!==gt(e)};function bt(e,t,r){0!==e.length&&kc(e,function(e){e.call(n,t,r,Qe)})}var wt=function(e,t){if(e instanceof RegExp)return Vc(e,t);if(e instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];return Boolean(e.apply(void 0,[t].concat(r)))}return!1},St=function(e,t,n,r){return 0===e.length?t:t===n||t===r?Xc(t):t},kt=function(e,t){return e!==t&&null===m(e)&&(xe&&at(e),!0)},xt=function(e,t){if(Ce&&Rc(Ce,e),bt(H.beforeSanitizeElements,e,null),kt(e,t))return!0;if(vt(e))return tt(e),!0;var r=Ke(C(e)),i=x(e);if(Z=St(H.uponSanitizeElement,Z,X,pe),bt(H.uponSanitizeElement,e,{tagName:r,allowedTags:Z}),kt(e,t))return!0;if(function(e,t,n){return!!(de&&1===n&&e.hasChildNodes()&&!yt(e.firstElementChild)&&Vc(xd,e.textContent)&&Vc(xd,e.innerHTML))||!!(de&&Id[t]&&1===n&&E(e)===Le&&(yt(e.firstElementChild)||"string"==typeof e.textContent&&Vc(xd,e.textContent)))||7===n||!(!de||8!==n||!Vc(Cd,e.data))}(e,r,i))return tt(e),!0;if(re[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!Z[r]){var o=function(e,t,n){if(!re[t]&&Et(t)&&wt(ne.tagNameCheck,t))return!1;if(ke&&!Ee[t]&&!Ee[Mc(t)]){var r=m(e),i=g(e);if(i&&r)for(var o=i.length-1;o>=0;--o){var s=e===n?h(i[o],!0):i[o];r.insertBefore(s,v(e))}}return tt(e),!0}(e,r,t);return!(!1!==o||(bt(H.afterSanitizeElements,e,null),!kt(e,t)))||o}if(1===i&&!function(e){var t=E(e),n=Mc(C(e)),r=m(e),i=De,o="template";return r&&1===x(r)&&(i=E(r),o=Mc(C(r))),!!qe[t]&&(t===Oe?function(e,t,n){return t===Le?"svg"===e:t===Me?"svg"===e&&("annotation-xml"===n||je[n]):Boolean(Xe[e])}(n,i,o):t===Me?function(e,t,n){return t===Le?"math"===e:t===Oe?"math"===e&&ze[n]:Boolean(et[e])}(n,i,o):t===Le?function(e,t,n){return!(t===Oe&&!ze[n])&&!(t===Me&&!je[n])&&!et[e]&&(We[e]||!Xe[e])}(n,i,o):"application/xhtml+xml"===Ve)}(e))return tt(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&Vc(Pd,e.innerHTML))return tt(e),!0;if(ce&&3===i){var s=e.textContent,a=ht(s);s!==a&&(Pc(n.removed,{element:e.cloneNode()}),e.textContent=a)}return bt(H.afterSanitizeElements,e,null),kt(e,t)},Ct=function(e,t,n){if(ie[t])return!1;if(ct(t,e))return!1;if(be&&("id"===t||"name"===t)&&(n in i||n in Ye))return!1;var r=ee[t]||oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e);if(ae&&Vc(V,t))return!0;if(se&&Vc(G,t))return!0;if(!r)return Et(e)&&wt(ne.tagNameCheck,e)&&wt(ne.attributeNameCheck,t,e)||"is"===t&&ne.allowCustomizedBuiltInElements&&wt(ne.tagNameCheck,n);if(Re[t])return!0;var o=Dc(n,Q,"");return!(!Vc(J,o)&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==$c(n,"data:")||!Fe[e])&&(!ue||Vc(K,o))&&n)},Pt=Yc({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Et=function(e){return!Pt[Mc(e)]&&Vc(Y,e)},Tt=function(e,t,n,i){if(r&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!n)switch(d.getAttributeType(e,t)){case"TrustedHTML":return O(i);case"TrustedScriptURL":return function(e){M(),A++;try{return r.createScriptURL(e)}finally{A--}}(i)}return i},Ft=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!vt(e)||(tt(e),!1)}catch(n){return it(t,e),!1}},It=function(e,t){return!(!de||!Vc(Td,t))||"attributename"===Mc(e)&&-1!==$c(t,"href")},Rt=function(e,t){xt(e,t),function(e,t){if(bt(H.beforeSanitizeAttributes,e,null),!kt(e,t)){var r=e.attributes;if(r&&!vt(e)){for(var i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee=St(H.uponSanitizeAttribute,ee,te,_e),forceKeepAttr:void 0},o=r.length,s=Ke(C(e));o--;){var a=r[o],u=a.name,l=a.namespaceURI,c=a.value,d=Ke(u),f=c,h="value"===u?f:qc(f),p=!1;i.attrName=d,i.attrValue=h,i.keepAttr=!0,i.forceKeepAttr=void 0,bt(H.uponSanitizeAttribute,e,i),h=i.attrValue,!we||"id"!==d&&"name"!==d||0===$c(h,Se)||(it(u,e,a),h=Se+h,p=!0),It(u,h)?it(u,e,a):i.forceKeepAttr||(!i.keepAttr||!le&&Vc(Ed,h)?it(u,e,a):(ce&&(h=ht(h)),Ct(s,d,h)?(h=Tt(s,d,l,h))!==f&&Ft(e,u,l,h)&&p&&Cc(n.removed):it(u,e,a)))}bt(H.afterSanitizeAttributes,e,null),kt(e,t)}}}(e,t),mt(e.content)&&At(e.content)},At=function(e){var t=null,n=ft(e);for(bt(H.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(bt(H.uponSanitizeShadowNode,t,null),Rt(t,e),1===x(t)){var r=y(t);mt(r)&&(Mt(r),At(r))}ce&&_t(e),bt(H.afterSanitizeShadowDOM,e,null)},Mt=function(e){for(var t=[{node:e,shadow:null}];t.length>0;){var n=t.pop();if(n.shadow)At(n.shadow);else{var r=n.node,i=1===x(r),o=g(r);if(o)for(var s=o.length-1;s>=0;--s)t.push({node:o[s],shadow:null});if(i){var a=S?S(r):null;if("string"==typeof a&&"template"===Ke(a)){var u=r.content;mt(u)&&t.push({node:u,shadow:null})}}if(i){var l=y(r);mt(l)&&t.push({node:null,shadow:l},{node:l,shadow:null})}}}};return n.sanitize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,a=null;if(($e=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!yt(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return Nc(e);case"boolean":return Bc(e);case"bigint":return jc?jc(e):"0";case"symbol":return Hc?Hc(e):"Symbol()";case"undefined":default:return Uc(e);case"function":case"object":if(null===e)return Uc(e);var t=e,n=ed(t,"toString");if("function"==typeof n){var r=n(t);return"string"==typeof r?r:Uc(r)}return Uc(e)}}(e)))throw Gc("dirty is not a string, aborting");if(!n.isSupported)return e;he?(Z=pe,ee=_e):Ze(t),n.removed=[];var u=xe&&"string"!=typeof e&&yt(e),l=[],c=Ce;if(u){de&&st(e,function(e){var t=x(e);if(7===t||8===t&&Vc(Cd,e.data)){try{p(e)}catch(e){}return!1}if(1===t){var n=e,r=Ke(C(e));try{n.hasAttribute&&n.hasAttribute("patchsrc")&&n.removeAttribute("patchsrc"),n.hasAttribute&&n.hasAttribute("for")&&ct("for",r)&&n.removeAttribute("for")}catch(e){}}return!0});var d=C(e);if("string"==typeof d){var f=Ke(d);if(!Z[f]||re[f])throw rt(e),Gc("root node is forbidden and cannot be sanitized in-place")}if(vt(e))throw rt(e),Gc("root node is clobbered and cannot be sanitized in-place");l=ut(e),Ce=Ic()}else if(yt(e))1===(i=(r=dt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),Mt(r);else{if(!ge&&!ce&&!fe&&-1===e.indexOf("<"))return L(e);if(!(r=dt(e)))return ge?null:ye?I:""}r&&ve&&tt(r.firstChild);var h=u?e:r;try{u&&Mt(e);for(var _=ft(h);s=_.nextNode();)Rt(s,h);u&&function(e,t){for(var n,r=Ce,i=null,o=function(){return i||(i=Ic(),kc(t,function(e){Rc(i,e)})),i},s=function(){var t=ut(e),n=[e],i=!1;if(kc(t,function(e){11===x(e)?Pc(n,e):i||Ac(r,e)||(i=Ac(o(),e))}),!i)return{v:void 0};if(a>=8)throw Gc("the tree kept changing during in-place sanitization; refusing to return it");kc(n,function(t,n){!function(e,t,n,r){for(var i,o=ft(e);i=o.nextNode();)Ac(r,i)&&!Ac(Ce,i)&&(t&&bt(H.uponSanitizeShadowNode,i,null),Rt(i,n))}(t,n>0,e,o())})},a=0;;a++)if(n=s())return n.v}(e,l)}catch(t){throw u&&(rt(e),lt(e,l)),t}finally{Ce=c}if(u){if(lt(e,l))throw Gc("a node selected for removal could not be safely returned; refusing to sanitize in place");return ce&&pt(e),e}if(ge){if(ce&&pt(r),me)for(a=N.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ee.shadowroot||ee.shadowrootmode)&&(a=j.call(o,a,!0)),a}var v=function(){return fe?r.outerHTML:r.innerHTML},g=v();return ce&&Vc(vd,g)&&(_t(r),g=v()),fe&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Vc(Sd,r.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+g),L(g)},n.setConfig=function(){Ze(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),he=!0,pe=Z,_e=ee},n.clearConfig=function(){Qe=null,he=!1,pe=null,_e=null,r=F,I=""},n.isValidAttribute=function(e,t,n){Qe||Ze({});var r=Ke(e),i=Ke(t);return("string"!=typeof n||!(It(t,n)||!le&&Vc(Ed,n)))&&Ct(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&zc(H,e)&&Pc(H[e],t)},n.removeHook=function(e,t){if(zc(H,e)){if(void 0!==t){var n=xc(H[e],t);return-1===n?void 0:Tc(H[e],n,1)[0]}return Cc(H[e])}},n.removeHooks=function(e){zc(H,e)&&(H[e]=[])},n.removeAllHooks=function(){H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Ld=["a","abbr","acronym","area","article","aside","b","bdi","bdo","blockquote","br","caption","center","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","ins","kbd","li","map","mark","nav","ol","p","pre","q","rp","rt","rtc","ruby","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","time","tr","tt","u","ul","var","wbr"],Dd=["style","lang","title","width","height"],$d=["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],qd={a:["href","hreflang","target","rel"],bdo:["dir"],blockquote:["cite"],col:["align","char","charoff","span"],colgroup:["align","char","charoff","span"],del:["cite","datetime"],hr:["align","size","width"],img:["align","alt","height","src","width"],ins:["cite","datetime"],ol:["start","type"],q:["cite"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:$d,tfoot:["align","char","charoff","valign"],th:$d,thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"]};function Nd(e){for(var t=(null!=td?td:td=Od()).sanitize(e,{ALLOWED_TAGS:Ld,ALLOWED_ATTR:[],ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1,ALLOWED_NAMESPACES:["http://www.w3.org/1999/xhtml"],ADD_ATTR:function(e,t){return-1!==Dd.indexOf(e)||{}.hasOwnProperty.call(qd,t)&&-1!==(qd[t]||[]).indexOf(e)},RETURN_DOM_FRAGMENT:!0}),n=t.querySelectorAll("a"),r=0;n.length>r;r++)n.item(r).relList.add("noopener");var i=document.createElement("div");return i.appendChild(t),i.innerHTML}function Bd(e,t){var n,r=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!ei(r))return t;try{var i=r(t);return ii(i)&&i?i:t}catch(e){return Sl.error("Error in get_current_url, falling back to window.location.href",e),t}}function jd(e){var t,n=null==(t=typeof window>"u"?void 0:window)||null==(t=t.location)?void 0:t.href;return ri(n)?void 0:Bd(e,n)}var Hd=kl("[Stylesheet Loader]"),zd="#020617",Ud={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Xu,widgetType:Yu,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:zd,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Wd=[Zu,Ju,Xu];function Vd(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Gd(e){var t;void 0===e&&(e=Ud.backgroundColor),"#"===e[0]&&(t=Vd(e)),e.startsWith("rgb")&&(t=e);var n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(n&&(t=Vd(n)),!t)return zd;var r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),s=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?zd:"white"}return zd}var Kd=function(e,t,n){var r=pf(e),i=document.querySelector("."+r);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};var o=document.createElement("div");(function(e,t,n){var r,i=d({},Ud,n),o=e.style,s=!Wd.includes(i.position)||t===nl&&(null==n?void 0:n.widgetType)===Yu;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),o.setProperty("--ph-survey-box-padding",i.boxPadding),o.setProperty("--ph-survey-max-width",i.maxWidth),o.setProperty("--ph-survey-z-index",i.zIndex),o.setProperty("--ph-survey-border-color",i.borderColor),s?(o.setProperty("--ph-survey-border-radius",i.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",i.backgroundColor),o.setProperty("--ph-survey-box-shadow",i.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Gd(i.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Gd(i.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Gd(i.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r=o,"white"===Gd(i.backgroundColor)?r.setProperty("--ph-logo-mono","1"):r.removeProperty("--ph-logo-mono"),o.setProperty("--ph-widget-color",i.widgetColor),o.setProperty("--ph-widget-text-color",Gd(i.widgetColor)),o.setProperty("--ph-widget-z-index",i.zIndex);var a=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),u=a||i.inputBackground;a||"white"!==i.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==n?void 0:n.inputTextColor)||Gd(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,e.type,e.appearance),o.className=r;var s=o.attachShadow({mode:"open"}),a=function(e){var t=function(e,t,n){var r=e.createElement("style");r.innerText=t;var i=function(e){var t;return ei(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return i&&(r=i(r)),r||(Hd.error("prepare_external_dependency_stylesheet returned null"),null)}(document,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null==e?void 0:e.config.prepareStylesheet);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(a){var u=s.querySelector("style");u&&s.removeChild(u),s.appendChild(a)}return(n||document.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},Qd=function(e){try{var t=rc(e);localStorage.getItem(t)||localStorage.setItem(t,"true")}catch(e){Zl.error("Failed to persist survey seen state",e)}},Yd=function(e){var t,n,r,i,o,s=e.responses,a=e.survey,u=e.surveySubmissionId,l=e.posthog,c=e.isSurveyCompleted,f=e.properties,h=e.surveyLanguage,p=e.questionSnapshots;l?null!=(t=l.client)&&t.canCapture&&(Qd(a),c&&hf(a),null==(n=l.client)||n.capture(fl,d(((r={})[pl]=a.name,r[hl]=a.id,r[_l]=a.current_iteration,r[vl]=a.current_iteration_start_date,r.sessionRecordingUrl=Nr(l),r),$l(d({event:"sent",survey:a,responses:s,submissionId:u,completed:c},!ri(h)&&{surveyLanguage:h},!ri(p)&&{questionSnapshots:p})),f,{$set:(i={},i[Nl(a,"responded")]=!0,i)})),c&&(window.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:a.id}})),null==(o=l.client)||null==(o=o.getExtension(qr))||o.reloadFeatureFlags())):Zl.error("[survey sent] event not captured, PostHog instance not found.")},Jd=function(e,t,n,r){var i;return d(((i={})[pl]=t.name,i[hl]=t.id,i[_l]=t.current_iteration,i[vl]=t.current_iteration_start_date,i.sessionRecordingUrl=Nr(r),i),$l(d({event:e,survey:t},!ri(null==n?void 0:n.responses)&&{responses:n.responses},!ri(null==n?void 0:n.surveySubmissionId)&&{submissionId:n.surveySubmissionId},!ri(null==n?void 0:n.surveyLanguage)&&{surveyLanguage:n.surveyLanguage},!ri(null==n?void 0:n.questionSnapshots)&&{questionSnapshots:n.questionSnapshots})))},Zd=function(e,t,n,r){var i,o,s;if(t){if(!n){var a=df(e),u=a?a.surveyLanguage:r,l=d({},Jd("dismissed",e,a,t),u&&((i={})[gl]=u,i),{$set:(o={},o[Nl(e,"dismissed")]=!0,o)});hf(e),Qd(e),null==(s=t.client)||s.capture(dl,l),window.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Zl.error("[survey dismissed] event not captured, PostHog instance not found.")},Xd=function(e,t){var n,r;if(t){if(null!=(n=t.client)&&n.canCapture){var i=function(e){return nc("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(i))return}catch(e){return}var o=df(e);if(o){try{localStorage.setItem(i,"true")}catch(e){}null==(r=t.client)||r.capture("survey abandoned",Jd("abandoned",e,o,t),{delivery:"unload"})}}}else Zl.error("[survey abandoned] event not captured, PostHog instance not found.")},ef=function(e){var t=e.map(function(e){return e.id});return t.every(function(e){return!!e})?t:void 0},tf=function(e,t){var n,r,i;return function(e){return e.questions.some(function(e){var t;return!(null==(t=e.branching)||!t.type)})}(e)?e.questions:t?null!==(n=function(e,t){if(!t||t.length!==e.questions.length)return null;for(var n,r=new Map(e.questions.map(function(e){return[e.id,e]})),i=[],o=p(t);!(n=o()).done;){var s=r.get(n.value);if(!s)return null;i.push(s)}return i}(e,t.questionOrder))&&void 0!==n?n:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?(r=e.questions,i=Jl(e.questions),r.length===i.length&&r.every(function(e,t){return e===i[t]})?i.reverse():i):e.questions},nf=function(e){return Vl(e)||ff(e)},rf=function(){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,fr(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),t.children}return e.__c="__cC"+F++,e.__={isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},onPreviewBack:function(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null},e.Provider=e.__l=(e.Consumer=function(e,t){return e.children(t)}).contextType=e,e}(),of=function(){return Bu(rf)},sf=function(e){var t=e.children,n=e.style;return function(e,t,n){var r,i,o,s,a=ir({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&null!=s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?_.call(arguments,2):n),ar(e.type,a,r||e.key,i||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:Nd(t)},style:n}:{children:t,style:n})};function af(e,t){var n,r,i;if(null==(n=e.conditions)||!n.url)return!0;var o,s=null!==(r=jd(t))&&void 0!==r?r:"u">typeof window?window.location.href:void 0;return!!s&&Ql[o=null==(i=e.conditions)?void 0:i.urlMatchType,null!=o?o:"icontains"]([e.conditions.url],[s])}var uf=function(e){return nc("inProgressSurvey_",e)},lf={},cf=function(e,t){var n=uf(e);try{localStorage.setItem(n,JSON.stringify(t)),delete lf[n]}catch(e){Zl.error("Error setting in-progress survey state in localStorage",e),lf[n]=t}},df=function(e){var t=uf(e),n=lf[t];if(n)return n;try{var r=localStorage.getItem(t);if(r)return JSON.parse(r)}catch(e){Zl.error("Error getting in-progress survey state from localStorage",e)}return null},ff=function(e){var t=df(e);return!ai(null==t?void 0:t.surveySubmissionId)},hf=function(e){var t=uf(e);delete lf[t];try{localStorage.removeItem(t)}catch(e){Zl.error("Error clearing in-progress survey state from localStorage",e)}};function pf(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function _f(e,t,n){if(void 0===t&&(t=Xu),e===rl)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ju:return{left:"30px"};case Zu:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===nl&&n===Yu?"60px":"30px"}}}var vf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),gf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),mf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),yf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),bf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),wf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rr("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Sf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rr("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),kf=Rr("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Rr("g",{"clip-path":"url(#ph-survey-logo-clip)",style:"opacity: calc(1 - var(--ph-logo-mono, 0))",children:[Rr("path",{fill:"currentColor",d:"M51.66 25.22A1.9 1.9 0 0 0 50 23.33l-.34-.04c-1-.13-1.94-.6-2.65-1.33L33.28 7.75V28H49a2.66 2.66 0 0 0 2.67-2.67zM39.2 23.54h-.09a1.78 1.78 0 1 1 .1 0"}),Rr("path",{fill:"url(#ph-survey-logo-paint0)",d:"M21.96 2.67v4.96l11.3 11.6h.02V7.75L26.63.85a2.8 2.8 0 0 0-2-.85 2.67 2.67 0 0 0-2.67 2.67"}),Rr("path",{fill:"url(#ph-survey-logo-paint1)",d:"M21.96 7.63v11.05L31.03 28h2.25v-8.75z"}),Rr("path",{fill:"url(#ph-survey-logo-paint2)",d:"M21.96 28h9.07l-9.07-9.32z"}),Rr("path",{fill:"url(#ph-survey-logo-paint3)",d:"M10.74 2.66v4.5l11.22 11.52V7.63L15.3.8a2.66 2.66 0 0 0-4.56 1.86"}),Rr("path",{fill:"url(#ph-survey-logo-paint4)",d:"M10.74 28h8.96l-8.96-9.32z"}),Rr("path",{fill:"url(#ph-survey-logo-paint5)",d:"M10.74 7.16v11.52L19.7 28h2.26v-9.32z"}),Rr("path",{fill:"url(#ph-survey-logo-paint6)",d:"M10.74 7.16 4.54.8A2.66 2.66 0 0 0 0 2.66V7.5l10.74 11.18z"}),Rr("path",{fill:"url(#ph-survey-logo-paint7)",d:"M9.19 28h1.55v-9.32L0 7.5v10.73z"}),Rr("path",{fill:"url(#ph-survey-logo-paint8)",d:"M0 25.41A2.6 2.6 0 0 0 2.58 28H9.2L0 18.23z"})]}),Rr("path",{"clip-path":"url(#ph-survey-logo-clip)",fill:"currentColor",style:"opacity: var(--ph-logo-mono, 0)",d:"m50.02 23.34-.34-.04c-1-.13-1.95-.6-2.66-1.33L35.58 10.11a.5.5 0 0 0-.86.35V27.5c0 .28.22.5.5.5H49c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.66-1.9m-10.81.2a1.78 1.78 0 1 1 0-3.56 1.78 1.78 0 0 1 0 3.57M0 25.41A2.6 2.6 0 0 0 2.59 28h5.22a.5.5 0 0 0 .37-.84L.87 19.13a.5.5 0 0 0-.87.34zm18.81 1.74a.5.5 0 0 1-.36.85h-7.09a.5.5 0 0 1-.37-.17L8.94 25.5.13 15.82A.5.5 0 0 1 0 15.5V8.75a.5.5 0 0 1 .86-.34zM0 2.68C0 .28 2.92-.91 4.59.82l25.6 26.33a.5.5 0 0 1-.36.85h-7.76a.5.5 0 0 1-.37-.17l-2.1-2.33L.28 5.3A1 1 0 0 1 0 4.6zm10.74 0c0-2.4 2.92-3.59 4.59-1.87L32.5 18.48l.5.51v7.3a.5.5 0 0 1-.86.35l-1.12-1.14L11.3 5.23a2 2 0 0 1-.57-1.4zM33 7.46v7.8a.5.5 0 0 1-.85.36l-9.61-9.89a2 2 0 0 1-.57-1.4V2.69c0-2.4 2.92-3.59 4.59-1.86z"}),Rr("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),Rr("defs",{children:[Rr("linearGradient",{id:"ph-survey-logo-paint0",x1:"21.96",x2:"33.28",y1:"9.62",y2:"9.62",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ffd849"}),Rr("stop",{offset:".96","stop-color":"#fbae01"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint1",x1:"21.96",x2:"33.28",y1:"17.81",y2:"17.81",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ffb700"}),Rr("stop",{offset:"1","stop-color":"#f9aa01"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint2",x1:"21.96",x2:"31.03",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ff9500"}),Rr("stop",{offset:"1","stop-color":"#f8aa00"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint3",x1:"10.74",x2:"21.96",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ff651e"}),Rr("stop",{offset:"1","stop-color":"#e4400a"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint4",x1:"10.74",x2:"19.7",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#c42c00"}),Rr("stop",{offset:"1","stop-color":"#d63600"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint5",x1:"10.74",x2:"21.96",y1:"17.58",y2:"17.58",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ef3c00"}),Rr("stop",{offset:"1","stop-color":"#d63601"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint6",x1:"0",x2:"10.74",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#3f80ff"}),Rr("stop",{offset:"1","stop-color":"#084fe0"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint7",x1:"0",x2:"10.74",y1:"17.75",y2:"17.75",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#0255ff"}),Rr("stop",{offset:"1","stop-color":"#0145d2"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint8",x1:"0",x2:"9.19",y1:"23.11",y2:"23.11",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#0041c6"}),Rr("stop",{offset:"1","stop-color":"#0045d0"})]}),Rr("clipPath",{id:"ph-survey-logo-clip",children:Rr("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})]})]});function xf(e){var t=e.urlParams,n=t?Object.entries(t).map(function(e){var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)}).join("&"):"";return Rr("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",kf]})}function Cf(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,o=e.link,s=e.onPreviewSubmit,a=e.skipSubmitButton,u=e.canGoBack,l=e.onBack,c=Bu(rf).isPreviewMode,d=!!u&&!!l,f=!a&&Rr("button",{className:"form-submit",disabled:n,type:"button",onClick:function(){var e;o&&(null==(e=window)||e.open(o)),c?null==s||s():i()},children:t});return Rr("div",{className:"bottom-section",children:[d?Rr("div",{className:"form-buttons form-buttons-with-back",children:[Rr("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:r.backButtonText||"Back"}),f]}):f,!r.whiteLabel&&Rr(xf,{urlParams:{utm_source:"survey-footer"}})]})}function Pf(e){var t=e.question,n=e.forceDisableHtml;return Rr("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Rr(t.type===il?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&sf({component:sr("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function Ef(e){var t,n,r;return Rr("button",{className:"form-cancel",onClick:e.onClick,disabled:Bu(rf).isPreviewMode,"aria-label":"Close survey",type:"button",children:(t={fill:"black"},n=(void 0===t?{}:t).fill,r=void 0===n?"currentColor":n,Rr("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Rr("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Rr("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]}))})}function Tf(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=Bu(rf).isPopup;return $u(function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),s())};return Ml(window,"keydown",e),function(){window.removeEventListener("keydown",e)}},[s]),Rr("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&Rr(Ef,{onClick:function(){return s()}}),Rr("h3",{className:"thank-you-message-header",children:t}),n&&sf({component:sr("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&Rr(Cf,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})}function Ff(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onStart,a=Bu(rf),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return Rr("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==o.hideCancelButton&&Rr(Ef,{onClick:function(){return l()}}),t&&Rr("h3",{className:"intro-screen-header",children:t}),n&&sf({component:sr("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!i&&"text"!==r}),Rr(Cf,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:s,onPreviewSubmit:function(){return u(null)}})]})}var If=function(e){return Xr(e)&&e.every(function(e){return ii(e)})};function Rf(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=e.onPreviewSubmit,s=e.displayQuestionIndex,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=of().isPreviewMode,d=qu(null),f=Du(function(){return ii(a)?a:""}),h=f[0],_=f[1],v=null==r?void 0:r.disableAutofocus;$u(function(){v||setTimeout(function(){var e;c||null==(e=d.current)||e.focus()},100)},[c,v]);var g="surveyQuestion"+s,m=Nu(function(){return function(e,t,n){var r,i,o=e.trim();if(!n&&""===o)return"This field is required";if(""===o)return!1;if(t&&t.length>0)for(var s,a=p(t);!(s=a()).done;){var u=s.value;switch(u.type){case Hr:if(void 0!==u.value&&u.value>o.length)return null!==(r=u.errorMessage)&&void 0!==r?r:"Please enter at least "+u.value+" characters";break;case zr:if(void 0!==u.value&&o.length>u.value)return null!==(i=u.errorMessage)&&void 0!==i?i:"Please enter no more than "+u.value+" characters"}}return!1}(h,t.validation,t.optional)},[h,t.validation,t.optional]),y=hu(t.validation,Hr),b=hu(t.validation,zr),w=Nu(function(){return function(e,t){var n=1===e?void 0:e;return n&&t?"Enter "+n+"-"+t+" characters":n?"Enter at least "+n+" "+(1===n?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(y,b)},[y,b]),S=function(){m||i(h.trim())},k=function(){m||o(h.trim())};return Rr(ur,{children:[Rr("div",{className:"question-container",children:[Rr(Pf,{question:t,forceDisableHtml:n,htmlFor:g}),Rr("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput:function(e){_(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||m||(e.preventDefault(),c?k():S())},value:h}),w&&Rr("div",{className:"validation-hint",children:w})]}),Rr(Cf,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:S,onPreviewSubmit:k,canGoBack:u,onBack:l})]})}function Af(e){var t=e.question,n=e.appearance,r=e.onSubmit,i=e.onPreviewSubmit,o=e.canGoBack,s=e.onBack;return Rr(ur,{children:[Rr("div",{className:"question-container",children:Rr(Pf,{question:t,forceDisableHtml:e.forceDisableHtml})}),Rr(Cf,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:function(){return r("link clicked")},onPreviewSubmit:function(){return i("link clicked")},canGoBack:o,onBack:s})]})}function Mf(e){var t,n=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,o=e.appearance,s=e.onSubmit,a=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,c=e.onBack,d=n.scale,f=10===n.scale?0:1,h=Du(function(){return ui(u)?u:Xr(u)&&u.length>0&&ui(parseInt(u[0]))?parseInt(u[0]):ii(u)&&ui(parseInt(u))?parseInt(u):null}),p=h[0],_=h[1],v="emoji"===n.display&&2===n.scale,g=of().isPreviewMode,m=function(e){return g?a(e):s(e)};return Rr(ur,{children:[Rr("div",{className:"question-container",children:[Rr(Pf,{question:n,forceDisableHtml:r}),Rr("div",{className:"rating-section",children:[Rr("div",{className:"rating-options",children:["emoji"===n.display&&Rr("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Nf[n.scale])?void 0:t.map(function(e,t){return Rr("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-rating-"+t+" "+(t+1===p?"rating-active":""),value:t+1,type:"button",onClick:function(){var e=t+1;_(e),n.skipSubmitButton&&m(e)},children:e},t)})}),"number"===n.display&&Rr("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-f+1)+", minmax(0, 1fr))"},children:Bf(n.scale).map(function(e,t){return Rr(Of,{displayQuestionIndex:i,active:p===e,appearance:o,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)})})]}),!v&&Rr("div",{className:"rating-text",children:[Rr("div",{children:n.lowerBoundLabel}),Rr("div",{children:n.upperBoundLabel})]})]})]}),Rr(Cf,{text:n.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:si(p)&&!n.optional,appearance:o,onSubmit:function(){return s(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function Of(e){var t=e.num,n=e.setActiveNumber;return Rr("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick:function(){n(t)},children:t})}function Lf(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=qu(null),f=Nu(function(){return function(e){var t;if(!e.shuffleOptions)return e.choices;var n,r,i=[].concat(e.choices),o=e.hasOpenChoice&&null!==(t=i.pop())&&void 0!==t?t:null,s=(n=i,(r=Jl(i)).length>1&&n.every(function(e,t){return e===r[t]})?r.reverse():r);return si(o)||s.push(o),s}(t)},[t]),h=Du(function(){return function(e,t){return ii(e)||If(e)?e:t===sl?null:[]}(a,t.type)}),p=h[0],_=h[1],v=Du(function(){return function(e,t){if(ii(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(If(e)){var n=e.find(function(e){return!t.includes(e)});if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}}(a,f)}),g=v[0],m=v[1],y=of().isPreviewMode,b=t.type===sl,w=t.type===ol,S=t.skipSubmitButton&&b&&!t.hasOpenChoice,k=function(e,t){if(t){var n=!g.isSelected;return m(function(e){return d({},e,{isSelected:n,inputValue:n?e.inputValue:""})}),b&&_(""),void(n&&setTimeout(function(){var e;return null==(e=c.current)?void 0:e.focus()},75))}if(b)return _(e),m(function(e){return d({},e,{isSelected:!1,inputValue:""})}),void(S&&(o(e),y&&s(e)));w&&Xr(p)&&(p.includes(e)?_(p.filter(function(t){return t!==e})):_([].concat(p,[e])))},x=function(e){e.stopPropagation();var t=e.currentTarget.value;m(function(e){return d({},e,{inputValue:t})}),b&&_(t)},C=function(e){e.stopPropagation(),"Enter"!==e.key||P()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),m(function(e){return d({},e,{isSelected:!1,inputValue:""})}),b&&_(null))},P=function(){return!(t.optional||!si(p)&&(!Xr(p)||g.isSelected||0!==p.length)&&(!g.isSelected||""!==g.inputValue.trim()))},E=function(){g.isSelected&&w?Xr(p)&&(y?s([].concat(p,[g.inputValue])):o([].concat(p,[g.inputValue]))):y?s(p):o(p)};return Rr(ur,{children:[Rr("div",{className:"question-container",children:[Rr(Pf,{question:t,forceDisableHtml:n}),Rr("fieldset",{className:"multiple-choice-options limit-height",children:[Rr("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),f.map(function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,o="surveyQuestion"+r+"Choice"+n,s=o+"Open",a=i?g.isSelected:b?p===e:Xr(p)&&p.includes(e);return Rr("label",{className:i?"choice-option-open":"",children:[Rr("div",{className:"response-choice",children:[Rr("input",{type:b?"radio":"checkbox",name:o,checked:a,onChange:function(){return k(e,i)},id:o,"aria-controls":s}),Rr("span",{children:i?e+":":e})]}),i&&Rr("input",{type:"text",ref:c,id:s,name:"question"+r+"Open",value:g.inputValue,onKeyDown:C,onInput:x,onClick:function(t){g.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)})]})]}),Rr(Cf,{text:t.buttonText||"Submit",submitDisabled:P(),appearance:i,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:S,canGoBack:u,onBack:l})]})}var Df=[1,2,3,4,5],$f=[1,2,3,4,5,6,7],qf=[0,1,2,3,4,5,6,7,8,9,10],Nf={2:[wf,Sf],3:[mf,gf,vf],5:[yf,mf,gf,vf,bf]};function Bf(e){switch(e){case 5:default:return Df;case 7:return $f;case 10:return qf}}var jf=kl("[Surveys]");function Hf(e,t,n){var r,i=e.questions[t],o=t+1;if(null==(r=i.branching)||!r.type)return t===e.questions.length-1?ul:o;if(i.branching.type===ul)return ul;if("specific_question"===i.branching.type){if(Number.isInteger(i.branching.index))return i.branching.index}else if("response_based"===i.branching.type){if(i.type===sl){var s,a=i.choices.indexOf(""+n);if(-1===a&&i.hasOpenChoice&&(a=i.choices.length-1),null!=(s=i.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var u=i.branching.responseValues[a];if(Number.isInteger(u))return u;if(u===ul)return ul}}else if(i.type===al){var l;if(i.optional&&ai(n))return o===e.questions.length?ul:o;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];if(Number.isInteger(d))return d;if(d===ul)return ul}}return o}return jf.warn("Falling back to next question index due to unexpected branching type"),o}var zf="$early_access_features",Uf="$active_feature_flags",Wf="$feature_flag_details",Vf="$feature_flag_errors",Gf="$feature_flag_evaluated_at",Kf="$feature_flag_request_id",Qf="$minimal_flag_called_events",Yf="$enabled_feature_flags",Jf="$stored_group_properties",Zf="$stored_person_properties",Xf="$flag_call_reported",eh="$flag_call_reported_session_id",th="$feature_flag_payloads",nh="$override_feature_flags",rh="$override_feature_flag_payloads",ih="visibilitychange",oh="$autocapture_disabled_server_side",sh=kl("[SurveyTranslations]");function ah(e,t){var n=function(e){var t;return function(e,t){var n=e.storedPersonProperties,r=e.locale,i=Bl(e.overrideLanguage);if(i)return null==t||t.info("Using override display language: "+i),i;var o=function(e){return e&&"object"==typeof e&&"language"in e?Bl(e.language):null}(n);if(o)return null==t||t.info("Using person property language: "+o),o;var s=Bl(r);return s?(null==t||t.info("Using detected locale: "+s),s):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.overrideLanguage,storedPersonProperties:null==(t=e.client)?void 0:t.kv.get(Zf),locale:"u">typeof navigator?navigator.language||navigator.userLanguage:void 0},sh)}(t);if(!n)return sh.info("No user language detected"),{survey:e,language:null};var r=Ul(e,n,sh);return{survey:r.survey,language:r.matchedKey}}var uh="ph:show_survey_widget",lh="PHWidgetSurveyClickListener";function ch(e,t){try{var n=e.getBoundingClientRect(),r=window.innerHeight,i=window.innerWidth,o=n.left+n.width/2-t/2;o+t>i-20&&(o=i-t-20),20>o&&(o=20);var s=r-n.bottom,a=250>s&&n.top>s;return{position:"fixed",top:a?"auto":n.bottom+12+"px",left:o+"px",right:"auto",bottom:a?r-n.top+12+"px":"auto",zIndex:Ud.zIndex}}catch(e){return Zl.warn("Failed to calculate trigger position:",e),null}}var dh=function(){"use strict";function e(e){var t,n,r=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTabWidgets=new Map,this._renderedTargets=new Map,this._prefillHandledSurveys=new Set,this._disposed=!1,this._currentLanguage=null,this._surveyIsRendered=!1,this._languageChangeListener=null,this._unsubscribeFeatureFlags=null,this._surveyPopupProps=null,this._loggedFeatureFlagsDisabledWarning=!1,this.handlePageUnload=function(){var e,t=null==(e=r._host.client)?void 0:e.kv.get(Ar);if(t)for(var n,i=p(t);!(n=i()).done;){var o=n.value;ff(o)&&Xd(o,r._host)}},this.handlePopoverSurvey=function(e,t,n){var i,o,s,a,u,l,c=(void 0===n?{}:n).resumeDelayFromActivation,f=void 0!==c&&c;if(null!=(i=r._host.client)&&i.canCapture){var h=r._translateSurveyForRendering(e),p=h.survey,_=h.language;r._currentLanguage=_,r._surveyPopupProps=null,r._displayOptions=t;var v=r._applyDisplayOverrides(p,t);r._clearSurveyTimeout(v.id);var g=null!=t?t:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&r._handleInitialResponses(v,y,m,_);if(!b||null!=(o=v.appearance)&&o.displayThankYouMessage){r._addSurveyToFocus(v);var w={};if((null==(s=v.appearance)?void 0:s.position)===el&&null!=(a=v.appearance)&&a.widgetSelector){var S,k=document.querySelector(v.appearance.widgetSelector);k&&(w=ch(k,parseInt((null==(S=v.appearance)?void 0:S.maxWidth)||Ud.maxWidth))||{})}var x=(null==(u=v.appearance)?void 0:u.surveyPopupDelaySeconds)||0,C=Kd(v,r._host).shadow;r._renderedTargets.set(C,C.host);var P={posthog:r._host,survey:v,removeSurveyFromFocus:r._removeSurveyFromFocus,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:_};if(r._surveyPopupProps=P,0>=x)return r._surveyIsRendered=!0,Fr(Rr(_h,d({},P)),C);var E=function(){var n;if(null==(n=r._host.client)||!n.canCapture||!r._shouldDisplaySurvey(v))return Zl.info("Survey "+v.id+" no longer eligible when its display delay elapsed; not displaying"),r._removeSurveyFromFocus(v);!function(){r._surveyIsRendered=!0;var n=r._translateSurveyForRendering(e),i=n.survey,o=n.language;r._currentLanguage=o;var s=r._applyDisplayOverrides(i,t),a=d({},P,{survey:s,surveyLanguage:o});r._surveyPopupProps=a,Fr(Rr(_h,d({},a,{survey:d({},s,{appearance:d({},s.appearance,{surveyPopupDelaySeconds:0})})})),C)}()},T=f?null==(l=r._host.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(v.id):void 0,F=ui(T)?Math.max(0,Date.now()-T):0,I=Math.max(0,1e3*x-F);if(0>=I)return E();var R=window.setTimeout(function(){r._surveyTimeouts.delete(v.id),E()},I);r._surveyTimeouts.set(v.id,R)}}},this._handleWidget=function(e){var t,n=r._translateSurveyForRendering(e),i=n.survey,o=n.language,s=Kd(i,r._host),a=s.shadow,u=s.isNewlyCreated;r._renderedTargets.set(a,a.host),(null==(t=e.appearance)?void 0:t.widgetType)===Yu&&r._renderedTabWidgets.set(e.id,e),u&&Fr(Rr(gh,{posthog:r._host,survey:i,surveyLanguage:o},e.id),a)},this._detachWidgetSelectorListener=function(e){var t=r._widgetSelectorListeners.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(lh),r._widgetSelectorListeners.delete(e),Zl.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){r._isWidgetSurveyOpen(e)||(r._removeSurveyFromDom(e),r._detachWidgetSelectorListener(e.id))},this._removeTabWidget=function(e){r._isWidgetSurveyOpen(e)||(r._removeSurveyFromDom(e),r._renderedTabWidgets.delete(e.id))},this._isWidgetSurveyOpen=function(e){try{var t;return!(null==(t=document.querySelector(pf(e,!0)))||null==(t=t.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,t){var n=document.querySelector(t),i=r._widgetSelectorListeners.get(e.id);if(n){if(r._handleWidget(e),i){if(n===i.element)return;Zl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),r._detachWidgetSelectorListener(e.id)}if(!n.hasAttribute(lh)){var o=function(t){var n,r;t.stopPropagation();var i=(null==(n=e.appearance)?void 0:n.position)===el?ch(t.currentTarget,parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||Ud.maxWidth)):{};window.dispatchEvent(new CustomEvent(uh,{detail:{surveyId:e.id,position:i}}))};Ml(n,"click",o),n.setAttribute(lh,"true"),r._widgetSelectorListeners.set(e.id,{element:n,listener:o,survey:e}),Zl.info("Attached click listener for feedback button survey "+e.id)}}else i&&r._removeWidgetSelectorListener(e)},this.renderPopover=function(e){var t;if(null!=(t=r._host.client)&&t.canCapture){var n=r._translateSurveyForRendering(e),i=n.survey,o=n.language,s=Kd(i,r._host).shadow;r._renderedTargets.set(s,s.host),Fr(Rr(_h,{posthog:r._host,survey:i,removeSurveyFromFocus:r._removeSurveyFromFocus,surveyLanguage:o}),s)}},this.renderSurvey=function(e,t,n){var i;if(null!=(i=r._host.client)&&i.canCapture){var o=r._translateSurveyForRendering(e),s=o.survey,a=o.language,u=!1;r._host.config.prefillFromUrl&&(u=r._handleUrlPrefill(s,a,n)),Fr(Rr(_h,{posthog:r._host,survey:s,removeSurveyFromFocus:r._removeSurveyFromFocus,isPopup:!1,properties:n,isSurveyCompleted:u,surveyLanguage:a}),t)}},this.getActiveMatchingSurveys=function(e,t){var n;void 0===t&&(t=!1),null==(n=r._host.surveys)||n.getSurveys(function(t){e(t.filter(function(e){return r._shouldDisplaySurvey(e)}))},t)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),r.getActiveMatchingSurveys(function(e){for(var t,n=null==(t=r._host.client)?void 0:t.canCapture,i=e.filter(function(e){return n&&(e.type===tl||e.type===nl)}),o=new Set(i.map(function(e){return e.id})),s=0,a=Array.from(r._surveyTimeouts.keys());a.length>s;s++){var u=a[s];o.has(u)||r.cancelSurvey(u)}var l=r._sortSurveysByAppearanceDelay(i),c=new Set,d=new Set;l.forEach(function(e){if(e.type===nl){var t,n,i,o;if((null==(t=e.appearance)?void 0:t.widgetType)===Yu)return d.add(e.id),void r._handleWidget(e);"selector"===(null==(n=e.appearance)?void 0:n.widgetType)&&null!=(i=e.appearance)&&i.widgetSelector&&(c.add(e.id),r._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector))}si(r._surveyInFocus)&&e.type===tl&&r.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),r._widgetSelectorListeners.forEach(function(e){var t=e.survey;c.has(t.id)||r._removeWidgetSelectorListener(t)}),r._renderedTabWidgets.forEach(function(e,t){d.has(t)||r._removeTabWidget(e)})},e)},this._addSurveyToFocus=function(e){si(r._surveyInFocus)||Zl.error("Survey "+r._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),r._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){r._surveyInFocus!==e.id&&Zl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),r._clearSurveyTimeout(e.id),r._surveyInFocus=null,r._currentLanguage=null,r._surveyIsRendered=!1,r._surveyPopupProps=null,r._displayOptions=void 0,r._removeSurveyFromDom(e)},this._host=e,this._surveyInFocus=null,this._languageChangeListener=function(){return r._onLanguageChange()},Ml(window,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=null!==(t=null==(n=e.client)||null==(n=n.getExtension("featureFlagsCommon"))?void 0:n.onFeatureFlags(function(){return r._onLanguageChange()}))&&void 0!==t?t:null}var t=e.prototype;return t._onLanguageChange=function(){var e,t=this;if(!si(this._surveyInFocus)){var n=null==(e=this._host.client)||null==(e=e.kv.get(Ar))?void 0:e.find(function(e){return e.id===t._surveyInFocus});if(n){var r=this._translateSurveyForRendering(n),i=r.survey,o=r.language;if(o!==this._currentLanguage&&(this._currentLanguage=o,this._surveyIsRendered)){var s=this._applyDisplayOverrides(i,this._displayOptions),a=Kd(s,this._host).shadow;Fr(Rr(_h,d({},this._surveyPopupProps,{posthog:this._host,survey:s,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:o})),a)}}}},t._applyDisplayOverrides=function(e,t){return null!=t&&t.position||null!=t&&t.selector?d({},e,{appearance:d({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e},t._clearSurveyTimeout=function(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))},t.cancelSurvey=function(e){this._surveyTimeouts.has(e)&&(Zl.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null,this._currentLanguage=null,this._surveyIsRendered=!1,this._surveyPopupProps=null,this._displayOptions=void 0))},t.startAutomaticDisplay=function(){if(!this._disposed&&!this._automaticDisplayDispose&&!1!==this._host.config.automaticDisplay){this._automaticDisplayDispose=function(){};var e=function(e){var t;e.callSurveysAndEvaluateDisplayLogic(!0);var n=function(){ri(t)&&(t=setInterval(function(){e.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},r=function(){ri(t)||(clearInterval(t),t=void 0)};n();var i=function(){document.hidden?r():(e.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ml(document,"visibilitychange",i),function(){r(),document.removeEventListener("visibilitychange",i)}}(this);this._disposed?e():this._automaticDisplayDispose=e}},t.clearInMemoryInProgressSurveyState=function(){!function(){for(var e=0,t=Object.keys(lf);t.length>e;e++)delete lf[t[e]]}()},t.dispose=function(){var e,t=this;this._disposed=!0,null==(e=this._automaticDisplayDispose)||e.call(this),this._automaticDisplayDispose=void 0,this._languageChangeListener&&(window.removeEventListener("languagechange",this._languageChangeListener),this._languageChangeListener=null),this._unsubscribeFeatureFlags&&(this._unsubscribeFeatureFlags(),this._unsubscribeFeatureFlags=null),this._surveyTimeouts.forEach(function(e,n){return t._clearSurveyTimeout(n)}),this._widgetSelectorListeners.forEach(function(e,n){return t._detachWidgetSelectorListener(n)}),this._renderedTargets.forEach(function(e,t){Fr(null,t),null==e||e.remove()}),this._renderedTargets.clear(),this._renderedTabWidgets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort(function(e,t){var n,r,i=ff(e),o=ff(t);if(i&&!o)return-1;if(!i&&o)return 1;var s=e.schedule===ll,a=t.schedule===ll;return s&&!a?1:!s&&a?-1:((null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0)-((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})},t._translateSurveyForRendering=function(e){return ah(e,this._host)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(){var e={},t=!1,n=window.location.search.replace(/^\?/,"");if(!n)return{params:e,autoSubmit:t};for(var r,i=p(n.split("&"));!(r=i()).done;){var o=r.value,s=o.indexOf("=");if(s>0){var a=void 0,u=void 0;try{a=decodeURIComponent(o.slice(0,s)),u=decodeURIComponent(o.slice(s+1))}catch(e){continue}if("auto_submit"!==a||"true"!==u){var l=a.match(/^q(\d+)$/);if(l){var c=parseInt(l[1],10);e[c]||(e[c]=[]),e[c].push(u)}}else t=!0}}return{params:e,autoSubmit:t}}().params;if(0===Object.keys(r).length)return!1;Zl.info("[Survey Prefill] Detected URL prefill parameters");var i=this._processPrefillData(e,r,t);return!!i&&(this._autoSubmitPrefilledResponses(e,i,n,t),this._prefillHandledSurveys.add(e.id),i.isSurveyCompleted)},t._autoSubmitPrefilledResponses=function(e,t,n,r){var i=t.responses,o=t.submissionId,s=t.isSurveyCompleted,a=t.skippedResponses;(Object.keys(a).length>0&&e.enable_partial_responses||s)&&Yd({responses:s?i:a,survey:e,surveySubmissionId:o,posthog:this._host,isSurveyCompleted:s,properties:n,surveyLanguage:r})},t._handleInitialResponses=function(e,t,n,r){for(var i={},o=0,s=Object.entries(t);s.length>o;o++){var a=s[o],u=a[1];i[parseInt(a[0])]=Xr(u)?u.map(String):[String(u)]}Zl.info("[Survey] Processing initial responses");var l=this._processPrefillData(e,i,r);return!!l&&(this._autoSubmitPrefilledResponses(e,l,n,r),l.isSurveyCompleted)},t._processPrefillData=function(e,t,n){try{var r=function(e,t){var n={};return e.questions.forEach(function(e,r){if(t[r]&&e.id){var i=t[r],o=Ll(e.id);try{switch(e.type){case sl:if(!e.choices||0===e.choices.length)return void Sl.warn("[Survey Prefill] Question "+r+" has no choices");var s=parseInt(i[0],10);if(isNaN(s)||0>s||s>=e.choices.length)return void Sl.warn("[Survey Prefill] Invalid choice index for q"+r+": "+i[0]);n[o]=e.choices[s];break;case ol:if(!e.choices||0===e.choices.length)return void Sl.warn("[Survey Prefill] Question "+r+" has no choices");var a=i.map(function(e){return parseInt(e,10)}).filter(function(t){return!isNaN(t)&&t>=0&&e.choices.length>t});if(0===a.length)return void Sl.warn("[Survey Prefill] No valid choices for q"+r);var u=[].concat(new Set(a.map(function(t){return e.choices[t]})));a.length>u.length&&Sl.warn("[Survey Prefill] Removed duplicate choices for q"+r),n[o]=u;break;case al:var l=parseInt(i[0],10),c=e.scale||10,d=10===c?0:1;if(isNaN(l)||d>l||l>c)return void Sl.warn("[Survey Prefill] Invalid rating for q"+r+": "+i[0]+" (scale: "+d+"-"+c+")");n[o]=l;break;default:Sl.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Sl.error("[Survey Prefill] Error converting q"+r+":",e)}}}),n}(e,t);if(0===Object.keys(r).length)return Zl.warn("[Survey Prefill] No valid responses after conversion"),null;var i=xu(),o=function(e,t,n){for(var r=0,i={},o=[],s=e.questions.length+1,a=0;e.questions.length>r&&s>a&&(a++,t.includes(r));){var u=e.questions[r];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=Ll(u.id);ri(n[l])||(i[l]=n[l])}o.push(r);var c=Hf(e,r,u.id?n[Ll(u.id)]:null);if(c===ul)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:o};r=c}return{startQuestionIndex:r,skippedResponses:i,skippedIndices:o}}(e,Object.keys(t).map(function(e){return parseInt(e,10)}).filter(function(t){var n=e.questions[t];return(null==n?void 0:n.id)&&!ri(r[Ll(n.id)])}),r),s=o.startQuestionIndex,a=o.skippedResponses,u=o.skippedIndices,l=s>=e.questions.length;return cf(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:s,questionOrder:ef(e.questions),visitedIndices:u,surveyLanguage:n}),Zl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:l,skippedResponses:a}}catch(e){return Zl.error("[Survey Prefill] Error handling prefill:",e),null}},t._isSurveyFeatureFlagEnabled=function(e,t){var n;if(!e)return!0;var r=null==(n=this._host.client)?void 0:n.getExtension(qr),i=!(null==r||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),o=!0;t&&(o=(null==r?void 0:r.getFeatureFlag(e,{send_event:!1}))===t||"any"===t);var s=i&&o;return s||this._warnIfFeatureFlagsDisabled(e),s},t._warnIfFeatureFlagsDisabled=function(e){this._loggedFeatureFlagsDisabledWarning||!1!==this._host.config.featureFlagEvaluation||(this._loggedFeatureFlagsDisabledWarning=!0,Zl.warn('Survey feature flag "'+e+'" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.'))},t._isSurveyConditionMatched=function(e){return!e.conditions||af(e,this._host)&&function(e){var t,n;return function(e,t){var n,r,i,o;if(!e||0===e.length)return!0;var s="u">typeof window?window:void 0,a=null==(n="u">typeof globalThis?globalThis:s)?void 0:n.navigator,u=null==a?void 0:a.userAgent;if(!u)return!1;var l=Po(u,{userAgentDataPlatform:null==a||null==(r=a.userAgentData)?void 0:r.platform,maxTouchPoints:null==a?void 0:a.maxTouchPoints,screenWidth:null==s||null==(i=s.screen)?void 0:i.width,screenHeight:null==s||null==(o=s.screen)?void 0:o.height,devicePixelRatio:null==s?void 0:s.devicePixelRatio});return Ql[null!=t?t:"icontains"](e,[l])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(e){var t,n;return null==(t=e.conditions)||!t.selector||!(null==(n=document)||!n.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return nf(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._host.client)&&null!=(t=t.getExtension("featureFlagsCommon"))&&t.hasLoadedFlags?{satisfied:this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)}:(this._warnIfFeatureFlagsDisabled(e.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"})},t.checkSurveyEligibility=function(e){var t,n,r={eligible:!0,reason:void 0};if(!ec(e))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+e.end_date,r;if(!oc.includes(e.type))return r.eligible=!1,r.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",r;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this._isSurveyFeatureFlagEnabled(e.linked_flag_key,i))return r.eligible=!1,r.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",r;if(!this._isSurveyFeatureFlagEnabled(e.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var o,s=this._internalFlagCheckSatisfied(e);return s.satisfied?function(e){var t=null;try{t=localStorage.getItem("lastSeenSurveyDate")}catch(e){Zl.error("localStorage error: "+e)}return function(e,t){if(!e||!t)return!0;var n="string"==typeof t?new Date(t):t,r=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(r/864e5)>e}(e,t)}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays)?(function(e){var t=null;try{t=localStorage.getItem(rc(e))}catch(e){Zl.error("localStorage error: "+e)}return!!t&&!nf(e)}(e)&&(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again"),r):(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(o=s.reason)&&void 0!==o?o:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)},t.checkSurveyCaptureEligibility=function(){var e;return null!=(e=this._host.client)&&e.canCapture?{eligible:!0}:{eligible:!1,reason:Xl}},t.checkSurveyDisplayEligibility=function(e){var t=this.checkSurveyCaptureEligibility();return t.eligible?this.checkSurveyEligibility(e):t},t.checkSurveyRenderability=function(e){var t=this.checkSurveyDisplayEligibility(e);return t.eligible&&!this._hasActionOrEventTriggeredSurvey(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t},t._hasActionOrEventTriggeredSurvey=function(e){var t;return!Wl(e)&&!tc(e)||!(null==(t=this._host.surveys)||null==(t=t._surveyEventReceiver)||null==(t=t.getSurveys())||!t.includes(e.id))},t._checkFlags=function(e){var t,n=this;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every(function(e){var t=e.value;return!e.key||!t||n._isSurveyFeatureFlagEnabled(t)})},t._shouldDisplaySurvey=function(e){return this.checkSurveyEligibility(e).eligible&&this._isSurveyConditionMatched(e)&&this._hasActionOrEventTriggeredSurvey(e)&&this._checkFlags(e)},t._removeSurveyFromDom=function(e){try{var t=document.querySelector(pf(e,!0));null!=t&&t.shadowRoot&&(Fr(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Zl.warn("Failed to remove survey "+e.id+" from DOM:",t)}},t.getTestAPI=function(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay.bind(this),checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this),onLanguageChange:this._onLanguageChange.bind(this),currentLanguage:this._currentLanguage,surveyIsRendered:this._surveyIsRendered}},e}();function fh(e){var t=e.survey,n=e.removeSurveyFromFocus,r=void 0===n?function(){}:n,i=e.setSurveyVisible,o=e.isPreviewMode,s=void 0!==o&&o,a=e.posthog;$u(function(){var e;if(!s&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===nl,o=af(t,a),s=(null==(e=t.appearance)?void 0:e.widgetType)===Yu&&n;if(!o)return Zl.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(Zl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};Ml(window,"popstate",n),Ml(window,"hashchange",n);var o=window.history.pushState,u=window.history.replaceState;return window.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),n()},window.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];u.apply(this,t),n()},function(){window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),window.history.pushState=o,window.history.replaceState=u}}},[s,t,r,i,a])}var hh=200;function ph(e){switch(void 0===e&&(e="right"),e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function _h(e){var t,n,r,i,o,s,a,u,l,c,f,h,p=e.survey,_=e.forceDisableHtml,v=e.posthog,g=e.style,m=void 0===g?{}:g,y=e.previewPageIndex,b=e.removeSurveyFromFocus,w=void 0===b?function(){}:b,S=e.isPopup,k=void 0===S||S,x=e.onPreviewSubmit,C=void 0===x?function(){}:x,P=e.onPreviewBack,E=void 0===P?function(){}:P,T=e.onPopupSurveyDismissed,F=void 0===T?function(){}:T,I=e.onCloseConfirmationMessage,R=void 0===I?function(){}:I,A=e.properties,M=e.isSurveyCompleted,O=e.skipShownEvent,L=e.surveyLanguage,D=qu(null),q=Number.isInteger(y),N=function(e,t,n,r,i,o,s,a,u){var l=Du(r||0===n||e.type===rl),c=l[0],f=l[1],h=Du(!1),p=h[0],_=h[1],v=qu(!1),g=function(){var t=function(){o&&i(e),f(!1)};if(!v.current){var n=null==s?void 0:s.current;n?(v.current=!0,n.style.transition="opacity "+hh+"ms ease-out",n.style.opacity="0",setTimeout(function(){v.current=!1,t()},250)):t()}},m=function(t){t.detail.surveyId===e.id&&g()};return $u(function(){if(t){if(!r){var i,o=function(t){var n,r;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return g();_(!0),null!=(r=e.appearance)&&r.autoDisappear&&(i&&clearTimeout(i),i=setTimeout(g,5e3))}},s=function(){var n,r,i;if(af(e,t)){f(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}window.dispatchEvent(new Event("PHSurveyShown")),a||null==(n=t.client)||n.capture(cl,d(((r={})[pl]=e.name,r[hl]=e.id,r[_l]=e.current_iteration,r[vl]=e.current_iteration_start_date,r),u&&((i={})[gl]=u,i),{sessionRecordingUrl:Nr(t)}))}};Ml(window,"PHSurveyClosed",m),Ml(window,"PHSurveySent",o);var l=n>0?setTimeout(s,n):void 0;return ri(l)&&s(),function(){ri(l)||clearTimeout(l),ri(i)||clearTimeout(i),window.removeEventListener("PHSurveyClosed",m),window.removeEventListener("PHSurveySent",o)}}}else Zl.error("usePopupVisibility hook called without a PostHog instance.")},[]),fh({survey:e,removeSurveyFromFocus:i,setSurveyVisible:f,isPreviewMode:r,posthog:t}),{isPopupVisible:c,isSurveySent:p,setIsPopupVisible:f,hidePopupWithAnimation:g}}(p,v,null!=(t=p.appearance)&&t.surveyPopupDelaySeconds?1e3*p.appearance.surveyPopupDelaySeconds:0,q,w,k,D,O,L),B=N.isPopupVisible,j=N.hidePopupWithAnimation,H=N.isSurveySent||y===p.questions.length||!0===M,z=Du(!1),U=z[0],W=z[1],V=Nu(function(){return!!df(p)},[p]),G=!!(null!=(n=p.appearance)&&n.introScreenHeader||null!=(r=p.appearance)&&r.introScreenDescription),K=q?-1===y:!(null==(i=p.appearance)||!i.displayIntroScreen)&&G&&!U&&!V,Q=Nu(function(){var e,t=(null==(e=df(p))?void 0:e.surveySubmissionId)||xu()||"";return{isPreviewMode:q,previewPageIndex:y,onPopupSurveyDismissed:function(){L?Zd(p,v,q,L):Zd(p,v,q),F()},isPopup:k||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:E,posthog:v,properties:A,surveyLanguage:L}},[q,y,k,v,p,F,C,E,A,L]);return B?Rr(rf.Provider,{value:Q,children:Rr("div",{className:"ph-survey",style:d({},_f(p.type,null==(o=p.appearance)?void 0:o.position,null==(s=p.appearance)?void 0:s.widgetType),m),ref:D,children:H?Rr(Tf,{header:(null==(a=p.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(u=p.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!_,contentType:null==(l=p.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:p.appearance||Ud,onClose:function(){j(),R()}}):K?Rr(Ff,{header:(null==(c=p.appearance)?void 0:c.introScreenHeader)||"",description:(null==(f=p.appearance)?void 0:f.introScreenDescription)||"",forceDisableHtml:!!_,contentType:null==(h=p.appearance)?void 0:h.introScreenDescriptionContentType,appearance:p.appearance||Ud,onStart:function(){return W(!0)}}):Rr(vh,{survey:p,forceDisableHtml:!!_,posthog:v})})}):null}function vh(e){var t,n,r=e.survey,i=e.forceDisableHtml,o=e.posthog,s=Nu(function(){var e=df(r);if(!e)return null;var t=ui(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&r.questions.length>e.lastQuestionIndex?e:(hf(r),null)},[r]),a=Du(function(){return null!=s&&s.responses&&Zl.info("Survey is already in progress, filling in initial responses"),(null==s?void 0:s.responses)||{}}),u=a[0],l=a[1],c=Du(!1),f=c[0],h=c[1],p=Bu(rf),_=p.previewPageIndex,v=p.onPopupSurveyDismissed,g=p.isPopup,m=p.onPreviewSubmit,y=p.onPreviewBack,b=p.surveySubmissionId,w=p.isPreviewMode,S=p.properties,k=p.surveyLanguage,x=Du(function(){var e=null==s?void 0:s.lastQuestionIndex,t=ui(e)&&e>=0&&r.questions.length>e?e:0;return ui(_)&&_>=0?_:t}),C=x[0],P=x[1],E=Du(function(){var e;return(null!==(e=null==s?void 0:s.visitedIndices)&&void 0!==e?e:[]).filter(function(e){return e>=0&&r.questions.length>e})}),T=E[0],F=E[1],I=Du(function(){var e,t;return null!==(e=null==(t=df(r))?void 0:t.questionSnapshots)&&void 0!==e?e:{}}),R=I[0],A=I[1],M=Nu(function(){return ef(tf(r,s))},[r.id,s]),O=Nu(function(){if(!M||new Set(M).size!==M.length)return tf(r,s);var e=new Map(r.questions.map(function(e){return[e.id,e]})),t=M.map(function(t){return e.get(t)}).filter(function(e){return!!e});return t.length===M.length?t:r.questions},[M,r.questions,r,s]);$u(function(){!w||ri(_)||0>_||P(_)},[_,w]);var L=!(null==(t=r.appearance)||!t.allowGoBack)&&(w?(null!=_?_:0)>0:T.length>0),D=O.at(C);return D?Rr("form",{className:"survey-form",name:"surveyForm",children:[g&&!0!==(null==(n=r.appearance)?void 0:n.hideCancelButton)&&Rr(Ef,{onClick:function(){v()}}),Rr("div",{className:"survey-box","data-question-index":C,children:[f&&Rr("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),mh({question:D,forceDisableHtml:i,displayQuestionIndex:C,appearance:r.appearance||Ud,onSubmit:function(e){return function(e){var t,n=e.res,i=e.displayQuestionIndex,s=e.questionId;if(o)if(null!=(t=o.client)&&t.canCapture)if(h(!1),s){var a=function(e,t,n,r){var i,o,s=e.questionSnapshots,a=void 0===s?{}:s;return{responses:d({},e.responses,(i={},i[Ll(t)]=n,i)),questionSnapshots:null!=r&&r.id?d({},a,(o={},o[r.id]=r.question,o)):a}}({responses:u,questionSnapshots:R},s,n,O[i]),c=a.responses,f=a.questionSnapshots;l(c),A(f);var p=Hf(r,i,n),_=p===ul,v=[].concat(T,[i]);if(_||(F(v),P(p),cf(r,{surveySubmissionId:b,responses:c,lastQuestionIndex:p,questionOrder:ef(O),visitedIndices:v,surveyLanguage:k,questionSnapshots:f})),r.enable_partial_responses||_){var g=new Set(v.map(function(e){var t;return null==(t=O[e])?void 0:t.id}).filter(function(e){return!!e}).map(function(e){return Ll(e)}));Yd({responses:Object.fromEntries(Object.entries(c).filter(function(e){return g.has(e[0])})),survey:r,surveySubmissionId:b,isSurveyCompleted:_,posthog:o,properties:S,surveyLanguage:k,questionSnapshots:f})}}else Zl.error("onNextButtonClick called without a questionId.");else h(!0);else Zl.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:C,questionId:D.id})},onPreviewSubmit:m,initialValue:D.id?u[Ll(D.id)]:void 0,canGoBack:L,onBack:function(){if(w)y();else if(0!==T.length){var e=T[T.length-1],t=T.slice(0,-1);F(t),P(e),cf(r,{surveySubmissionId:b,responses:u,lastQuestionIndex:e,questionOrder:ef(O),visitedIndices:t,surveyLanguage:k,questionSnapshots:R})}}})]})]}):null}function gh(e){var t,n,r,i,o,s,a,u,l=e.survey,c=e.forceDisableHtml,d=e.posthog,f=e.readOnly,h=e.surveyLanguage,p=Du(!0),_=p[0],v=p[1],g=Du(!1),m=g[0],y=g[1],b=Du({}),w=b[0],S=b[1],k=qu(void 0),x=function(){var e;(m||!d||f||null!=(e=d.client)&&e.canCapture)&&y(!m)};if($u(function(){var e,t;if(d){if(!f){var n;"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&S((n=null==(t=l.appearance)?void 0:t.position)&&n!==Xu&&n!==el?{}:{top:"50%",bottom:"auto"});var r=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===l.id&&(Zl.info("Received show event for feedback button survey "+l.id),S(n.detail.position||{}),x())};return Ml(window,uh,r),function(){ri(k.current)||(clearTimeout(k.current),k.current=void 0),window.removeEventListener(uh,r)}}}else Zl.error("FeedbackWidget called without a PostHog instance.")},[d,f,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(n=l.appearance)?void 0:n.position,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),fh({survey:l,setSurveyVisible:v,posthog:d}),!_)return null;var C=function(){l.schedule!==ll&&v(!1),ri(k.current)||clearTimeout(k.current),k.current=setTimeout(function(){k.current=void 0,y(!1)},200)};return Rr(ur,{children:["tab"===(null==(o=l.appearance)?void 0:o.widgetType)&&Rr("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:x,disabled:f,style:ph(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(u=l.appearance)?void 0:u.widgetLabel)||""}),m&&Rr(_h,{posthog:d,survey:l,forceDisableHtml:c,style:w,onPopupSurveyDismissed:C,onCloseConfirmationMessage:C,surveyLanguage:h})]})}var mh=function(e){var t=e.question,n=e.onSubmit,r=e.onPreviewSubmit,i={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit:function(e){r(e)},onSubmit:function(e){n(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case il:return sr(Rf,d({},i,{question:t,key:t.id}));case"link":return sr(Af,d({},i,{question:t,key:t.id}));case al:return sr(Mf,d({},i,{question:t,key:t.id}));case sl:case ol:return sr(Lf,d({},i,{question:t,key:t.id}));default:return Zl.error("Unsupported question type: "+t.type),null}},yh="gzip-js",bh="base64";function wh(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&ei(n.then)&&n.then(void 0,function(){})}}}}var Sh=function(){"use strict";function e(){this._events={}}var t=e.prototype;return t.on=function(e,t){var n=this;return this._events[e]||(this._events[e]=[]),this._events[e].push(t),function(){n._events[e]=n._events[e].filter(function(e){return e!==t})}},t.emit=function(e,t){for(var n,r=p(this._events[e]||[]);!(n=r()).done;)(0,n.value)(t);for(var i,o=p(this._events["*"]||[]);!(i=o()).done;)(0,i.value)(e,t)},e}();function kh(e,t,n){if(ai(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var xh=function(){"use strict";function e(e){var t=this;this._host=e,this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new Sh,this._checkStep=function(e,n){return t._checkStepEvent(e,n)&&t._checkStepUrl(e,n)&&t._checkStepElement(e,n)&&t._checkStepProperties(e,n)},this._checkStepEvent=function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}}var t=e.prototype;return t.init=function(){var e,t,n=this;ri(null==(e=this._host)?void 0:e.subscribeCapture)||(this._captureHookUnsubscribe=null==(t=this._host)?void 0:t.subscribeCapture(function(e,t){n.on(e,t)}))},t.dispose=function(){var e,t;null==(e=this._captureHookUnsubscribe)||e.call(this),this._captureHookUnsubscribe=void 0,null==(t=this._host)||null==t.setElementSelectors||t.setElementSelectors(new Set,this),this._debugEventEmitter=new Sh},t.register=function(e){var t,n,r=this;if(!ri(null==(t=this._host)?void 0:t.subscribeCapture)&&(e.forEach(function(e){var t;r._actionRegistry.add(e),null==(t=e.steps)||t.forEach(function(e){r._actionEvents.add((null==e?void 0:e.event)||"")})}),null!=(n=this._host)&&n.setElementSelectors)){var i=new Set;this._actionRegistry.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&i.add(e.selector)})}),this._host.setElementSelectors(i,this)}},t.replace=function(e){this._actionRegistry.clear(),this._actionEvents.clear(),this.register(e)},t.on=function(e,t){var n=this;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(t.event))&&this._actionRegistry.forEach(function(e){n._checkAction(t,e)&&n._debugEventEmitter.emit("actionCaptured",e.name)})},t._addActionHook=function(e){this.onAction("actionCaptured",function(t){return e(t)})},t._checkAction=function(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n,r=p(t.steps);!(n=r()).done;)if(this._checkStep(e,n.value))return!0;return!1},t.onAction=function(e,t){return this._debugEventEmitter.on(e,t)},t._checkStepUrl=function(e,t){if(null!=t&&t.url){var n,r=null==e||null==(n=e.properties)?void 0:n.$current_url;if(null==e||!e.properties||!("$current_url"in e.properties))try{var i;r=null==(i=this._host)||null==i.getActionUrl?void 0:i.getActionUrl()}catch(e){return!1}if(!r||"string"!=typeof r)return!1;if(!kh(r,t.url,t.url_matching||"contains"))return!1}return!0},t._checkStepElement=function(e,t){return!!this._checkStepHref(e,t)&&!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t)},t._checkStepHref=function(e,t){var n;if(null==t||!t.href)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return kh(e.href,t.href,t.href_matching||"exact")});var i,o=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!o&&kh((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")},t._checkStepText=function(e,t){var n;if(null==t||!t.text)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return kh(e.text,t.text,t.text_matching||"exact")||kh(e.$el_text,t.text,t.text_matching||"exact")});var i,o,s,a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!ai(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),o=t.text,s=t.text_matching||"exact",i.some(function(e){return kh(e,o,s)}))},t._checkStepSelector=function(e,t){var n,r;if(null==t||!t.selector)return!0;if(null!=e&&null!=(n=e.properties)&&null!=(n=n.$element_selectors)&&n.includes(t.selector))return!0;var i=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}catch(e){}return!1},t._getElementsList=function(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements},t._checkStepProperties=function(e,t){return null==t||!t.properties||0===t.properties.length||Yl(t.properties.reduce(function(e,t){var n=Xr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:n,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)},e}(),Ch=function(e){"use strict";function t(t,n,r,i){var o,s=e.call(this,{subscribeCapture:function(e){var n=t.onEvent(function(t){return e(t.event,t)});return function(){return n.dispose()}},subscribeSession:function(e){var n=t.onSession(e);return function(){return n.dispose()}},getSessionId:function(){var e;return null==(e=t.session)?void 0:e.sessionId},getProperty:function(e){return t.kv.get(e)},getActionUrl:null==r?void 0:r.getActionUrl,setElementSelectors:null!==(o=null==r?void 0:r.setElementSelectors)&&void 0!==o?o:function(e,n){var r;return null==(r=t.getExtension("autocapture"))?void 0:r.setElementSelectors(e,n)}},i)||this;return s._client=t,s._surveys=n,s._subscribeSession(),s}r(t,e);var n=t.prototype;return n._getActivatedKey=function(){return Lr},n._getActivatedSessionKey=function(){return Dr},n._getActivationTimestampsKey=function(){return $r},n._writeActivationTimestamps=function(e){var t;this._client.kv.set(((t={})[$r]=e,t))},n._clearActivationTimestampsStore=function(){this._client.kv.remove($r)},n._shouldPersistArmedActivation=function(e){var t,n;this._getItems(function(t){n=t.find(function(t){return t.id===e})});var r=null==(t=n)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return ui(r)&&r>0},n._getShownEventName=function(){return cl},n._getItems=function(e){this._surveys.getSurveys(e)},n._cancelPendingItem=function(e){this._surveys.cancelPendingSurvey(e)},n._getLogger=function(){return Zl},n._setActivatedItems=function(e){var t;this._client.kv.set(((t={})[Lr]=e,t))},n._setActivatedSession=function(e){var t;this._client.kv.set(((t={})[Dr]=e,t))},n._clearActivatedSession=function(){this._client.kv.remove(Dr)},n._isItemPermanentlyIneligible=function(){return!1},n._activationOutcome=function(e,t,n){var r,i;return e===fl&&!1===(null==n||null==(r=n.properties)?void 0:r.$survey_completed)?"ignore":(this._getItems(function(e){i=e.find(function(e){return e.id===t})}),!i||Vl(i)?e===cl?"consume":"ignore":e===cl?"persist":e===dl||e===fl?"consume":"ignore")},n.getSurveys=function(){return this.getActivatedIds()},n.getEventToSurveys=function(){return this.getEventToItemsMap()},t}(function(){"use strict";function e(e,t){this._onActivationChanged=t,this._pendingActivatedItems=[],this._host=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}var t=e.prototype;return t._subscribeSession=function(){var e,t,n=this;this._sessionIdUnsubscribe=null==(e=(t=this._host).subscribeSession)?void 0:e.call(t,function(e){return n._onSessionIdChanged(e)})},t._shouldPersistArmedActivation=function(e){return!1},t._getActivationTimestampsKey=function(){return null},t._writeActivationTimestamps=function(e){},t._clearActivationTimestampsStore=function(){},t._doesEventMatchFilter=function(e,t){return!!e&&Yl(e.propertyFilters,null==t?void 0:t.properties)},t._buildEventToItemMap=function(e,t){var n=new Map;return e.forEach(function(e){var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(function(t){if(null!=t&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}})}),n},t._getMatchingItems=function(e,t,n){var r=this,i=(n===Ku?this._eventToItems:this._cancelEventToItems).get(e),o=[];return this._getItems(function(e){o=e.filter(function(e){return null==i?void 0:i.includes(e.id)})}),o.filter(function(i){var o,s=null==(o=i.conditions)||null==(o=o[n])||null==(o=o.values)?void 0:o.find(function(t){return t.name===e});return r._doesEventMatchFilter(s,t)})},t.register=function(e){this._register(e,!1)},t.replace=function(e){this._register(e,!0)},t._register=function(e,t){ri(this._host.subscribeCapture)||(this._setupEventBasedItems(e,t),this._setupActionBasedItems(e,t))},t._setupActionBasedItems=function(e,t){var n=this,r=e.filter(function(e){var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this._actionToItems.clear(),0!==r.length){this._actionMatcher||(this._actionMatcher=new xh(this._host),this._actionMatcher.init(),this._actionMatcher._addActionHook(function(e){return n.onAction(e)}));var i=[];r.forEach(function(e){var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(function(t){if(i.push(t),t.name){var r,o=null!==(r=n._actionToItems.get(t.name))&&void 0!==r?r:[];o.includes(e.id)||o.push(e.id),n._actionToItems.set(t.name,o)}})}),t?this._actionMatcher.replace(i):this._actionMatcher.register(i)}else{var o;t&&(null==(o=this._actionMatcher)||o.replace([]))}},t._mergeItemMaps=function(e,t){t.forEach(function(t,n){var r,i=null!==(r=e.get(n))&&void 0!==r?r:[];t.forEach(function(e){i.includes(e)||i.push(e)}),e.set(n,i)})},t._setupEventBasedItems=function(e,t){var n,r,i,o=this,s=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}),a=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(n=e.conditions)||null==(n=n.cancelEvents)||null==(n=n.values)?void 0:n.length)>0}),u=this._buildEventToItemMap(e,Ku),l=this._buildEventToItemMap(e,Qu);t?(this._eventToItems=u,this._cancelEventToItems=l):(this._mergeItemMaps(this._eventToItems,u),this._mergeItemMaps(this._cancelEventToItems,l)),(0!==s.length||0!==a.length||e.some(function(e){var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length}))&&(null!==(n=this._captureHookUnsubscribe)&&void 0!==n||(this._captureHookUnsubscribe=null==(r=(i=this._host).subscribeCapture)?void 0:r.call(i,function(e,t){o.onEvent(e,t)})))},t.onEvent=function(e,t){var n,r,i=this,o=this._getLogger(),s=(null==t||null==(n=t.properties)?void 0:n.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var a=this._activationOutcome(e,s,t);if("consume"===a)return o.info("event consumed activated item, removing it",{event:e,itemId:s}),void this._deactivateItems([s]);if("persist"===a)return o.info("shown item promoted to persisted activation",{event:e,itemId:s}),this._persistActivation(s),void this._clearActivationTimestamps([s])}if(this._cancelEventToItems.has(e)){var u=this._getMatchingItems(e,t,Qu);u.length>0&&(o.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map(function(e){return e.id})}),this._deactivateItems(u.map(function(e){return e.id})),u.forEach(function(e){return i._cancelPendingItem(e.id)}))}if(this._eventToItems.has(e)){o.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var l=this._getMatchingItems(e,t,Ku);this._activateItems(l.map(function(e){return e.id}))}},t.onAction=function(e){this._actionToItems.has(e)&&this._activateItems(this._actionToItems.get(e)||[])},t._activateItems=function(e){if(0!==e.length){for(var t,n=!!this._host.getSessionId(),r=[],i=p(e);!(t=i()).done;){var o=t.value;n&&this._shouldPersistArmedActivation(o)?this._persistActivation(o)&&this._recordActivationTimestamp(o):r.push(o)}r.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,r)))),this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()}),this._notifyActivationChanged()}},t._persistActivation=function(e){this._pendingActivatedItems=this._pendingActivatedItems.filter(function(t){return t!==e});var t=this._getPersistedActivatedIds();return!t.includes(e)&&(this._setActivatedItems([].concat(t,[e])),this._stampActivationSession(),!0)},t._deactivateItems=function(e){var t=new Set(e);this._pendingActivatedItems=this._pendingActivatedItems.filter(function(e){return!t.has(e)});var n=this._getRawPersistedActivatedIds(),r=n.filter(function(e){return!t.has(e)});r.length!==n.length&&(this._setActivatedItems(r),0===r.length&&this._clearActivationSession()),this._clearActivationTimestamps(e),this._notifyActivationChanged()},t._notifyActivationChanged=function(){try{var e;null==(e=this._onActivationChanged)||e.call(this)}catch(e){this._getLogger().error("Error while handling activated items change",e)}},t._getRawActivationTimestamps=function(){var e=this._getActivationTimestampsKey();if(!e)return{};var t=this._host.getProperty(e);return t&&"object"==typeof t?t:{}},t._recordActivationTimestamp=function(e){var t;if(this._getActivationTimestampsKey()){var n=this._getRawActivationTimestamps();this._writeActivationTimestamps(d({},n,((t={})[e]=Date.now(),t)))}},t._clearActivationTimestamps=function(e){if(this._getActivationTimestampsKey()){for(var t=this._getRawActivationTimestamps(),n={},r=!1,i=0,o=Object.entries(t);o.length>i;i++){var s=o[i],a=s[0],u=s[1];e.includes(a)?r=!0:n[a]=u}r&&(ni(n)?this._clearActivationTimestampsStore():this._writeActivationTimestamps(n))}},t._clearAllActivationTimestamps=function(){this._getActivationTimestampsKey()&&this._clearActivationTimestampsStore()},t.getActivationTimestamp=function(e){if(this._getPersistedActivatedIds().includes(e)){var t=this._getRawActivationTimestamps()[e];return ui(t)?t:void 0}},t._getRawPersistedActivatedIds=function(){var e=this._getActivatedKey();return this._host.getProperty(e)||[]},t._getPersistedActivatedIds=function(){var e=this._getRawPersistedActivatedIds();if(0===e.length)return[];var t=this._host.getProperty(this._getActivatedSessionKey()),n=this._host.getSessionId();return n&&t===n?e:[]},t._stampActivationSession=function(){var e=this._host.getSessionId();e&&this._setActivatedSession(e)},t._clearActivationSession=function(){this._clearActivatedSession()},t._onSessionIdChanged=function(e){var t=this,n=this._host.getProperty(this._getActivatedSessionKey());if(n&&n!==e){var r=this._getRawPersistedActivatedIds(),i=this._getRawActivationTimestamps();r.length>0&&(this._setActivatedItems([]),r.filter(function(e){return ui(i[e])}).forEach(function(e){return t._cancelPendingItem(e)})),this._clearActivationSession(),this._clearAllActivationTimestamps(),r.length>0&&this._notifyActivationChanged()}},t.getActivatedIds=function(){var e=this;return[].concat(new Set([].concat(this._getPersistedActivatedIds(),this._pendingActivatedItems))).filter(function(t){return!e._isItemPermanentlyIneligible(t)})},t.dispose=function(){var e,t,n;null==(e=this._sessionIdUnsubscribe)||e.call(this),this._sessionIdUnsubscribe=void 0,null==(t=this._captureHookUnsubscribe)||t.call(this),this._captureHookUnsubscribe=void 0,null==(n=this._actionMatcher)||n.dispose(),this._actionMatcher=void 0},t.reset=function(){this._pendingActivatedItems=[],this._getRawPersistedActivatedIds().length>0&&this._setActivatedItems([]),this._clearActivationSession(),this._clearAllActivationTimestamps(),this._notifyActivationChanged()},t.getEventToItemsMap=function(){return this._eventToItems},t._getActionMatcher=function(){return this._actionMatcher},e}()),Ph=function(e,t){return null!=e&&e.then?e.then(t):t(e)},Eh="SDK is not enabled or survey functionality is not yet loaded",Th="Disabled. Not loading surveys.",Fh=function(){"use strict";function e(e){var t=this;this._configSource=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyInitializationFailed=!1,this._surveyCallbacks=[],this._activeMatchingSurveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._disposed=!1,this._renderTimeouts=new Set,this.onRemoteConfig=function(e){if(!t._disposed&&!t._config.disableSurveys){if(!e.ok)return t._surveyInitializationFailed=!0,t._notifyActiveMatchingSurveyCallbacks({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Zl.warn("Remote config unavailable. Not loading surveys.");var n=e.config.surveys;if(ai(n))return Zl.warn("Flags not loaded yet. Not loading surveys.");t._isSurveysEnabled=ci(n)?n:n.length>0,Zl.info("flags response received, isSurveysEnabled: "+t._isSurveysEnabled),t.loadIfEnabled()}},this._notifyActiveMatchingSurveyCallbacks=function(e){t._activeMatchingSurveyCallbacks.slice().forEach(function(n){return t._notifyActiveMatchingSurveyCallback(n,e)})}}var t=e.prototype;return t.setup=function(e){var t=this;if(!this._disposed)return this._initializingClient=e,Ph(e.kv.initialize(),function(){if(t._initializingClient===e&&!t._disposed){t._initializingClient=void 0,t._client=e;var n=e.onRemoteConfig(t.onRemoteConfig);t._disposed?n.dispose():(t._remoteConfigSubscription=n,t.loadIfEnabled())}})},t.dispose=function(){var e,t,n,r;this._disposed||(this._disposed=!0,this._initializingClient=void 0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(n=this._surveyManager)||null==n.dispose||n.dispose(),this._surveyManager=null,this._surveyCallbacks=[],this._activeMatchingSurveyCallbacks.forEach(function(e){e.active=!1}),this._activeMatchingSurveyCallbacks=[],null==(r=this._activeMatchingSurveyConditionsUnsubscribe)||r.call(this),this._activeMatchingSurveyConditionsUnsubscribe=void 0,this._getSurveysInFlightPromise=null,this._renderTimeouts.forEach(function(e){return clearTimeout(e)}),this._renderTimeouts.clear())},t.getRenderContext=function(){if(this._client){var e=this;return{client:this._client,get config(){return e._config},surveys:e}}},t.initialize=function(){this.loadIfEnabled()},t.reset=function(){var e;null==(e=this._surveyManager)||null==e.clearInMemoryInProgressSurveyState||e.clearInMemoryInProgressSurveyState();try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith("seenSurvey_")||null!=i&&i.startsWith("inProgressSurvey_"))&&n.push(i)}n.forEach(function(e){return localStorage.removeItem(e)})}catch(e){}this._notifyActiveMatchingSurveyCallbacks()},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._client){var t=this._config;if(!this._surveyManager)if(this._isInitializingSurveys)Zl.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Zl.info(Th);else if(t.cookielessMode&&this._client.isOptedOut)Zl.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!ri(this._isSurveysEnabled)||t.advancedEnableSurveys){var r=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0,this._surveyInitializationFailed=!1;try{var i=n.generateSurveys;if(i)return this._completeSurveyInitialization(i,r),void(this._isInitializingSurveys=!1);var o=n.loadExternalDependency;if(!o)return this._handleSurveyLoadError(Or),void(this._isInitializingSurveys=!1);o(function(t){try{if(e._disposed)return;var n=e._configSource.getExtensions();t||null==n||!n.generateSurveys?e._handleSurveyLoadError("Could not load surveys script",t):e._completeSurveyInitialization(n.generateSurveys,r)}finally{e._isInitializingSurveys=!1}})}catch(e){throw this._isInitializingSurveys=!1,this._handleSurveyLoadError("Error initializing surveys",e),e}}}else this._handleSurveyLoadError("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){var n;if(!this._disposed){this._surveyManager=e(t),this._surveyEventReceiver=this._createEventReceiver(this._client,this._notifyActiveMatchingSurveyCallbacks);var r=null==(n=this._client)?void 0:n.kv.get(Ar);r&&this._registerEventOrActionBasedSurveys(r),Zl.info("Surveys loaded successfully"),this._startActiveMatchingSurveyConditions(),this._notifyActiveMatchingSurveyCallbacks(),this._notifySurveyCallbacks({isLoaded:!0})}},t._createEventReceiver=function(e,t){return new Ch(e,this,void 0,t)},t._handleSurveyLoadError=function(e,t){this._surveyInitializationFailed=!0,Zl.error(e,t),this._notifyActiveMatchingSurveyCallbacks({isLoaded:!1,error:e}),this._notifySurveyCallbacks({isLoaded:!1,error:e})},t.onSurveysLoaded=function(e){var t=this;return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),function(){t._surveyCallbacks=t._surveyCallbacks.filter(function(t){return t!==e})}},t.getSurveys=function(e,t){var n=this;if(void 0===t&&(t=!1),!this._disposed){var r=this._client;if(!r)return e([],{isLoaded:!1,error:Eh});if(this._config.disableSurveys)return Zl.info(Th),e([]);var i=r.kv.get(Ar);if(i&&!t)return e(i,{isLoaded:!0}),void(this._shouldBackgroundRefreshSurveys()&&this.getSurveys(function(){},!0));if(this._getSurveysInFlightPromise)this._getSurveysInFlightPromise.then(function(t){n._disposed||e(t.surveys,t.context)}).catch(function(e){return Zl.error("Error in survey callback",e)});else{var o=r.sendRequest("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then(function(e){try{return n._handleSurveyResponse(r,e)}catch(e){return Zl.error("Error processing surveys response",e),n._handleSurveyResponse(r,{statusCode:0,error:e})}},function(e){return n._handleSurveyResponse(r,{statusCode:0,error:e})});this._getSurveysInFlightPromise=o;var s=function(){n._getSurveysInFlightPromise===o&&(n._getSurveysInFlightPromise=null)};o.then(function(t){s(),n._disposed||(n._notifyActiveMatchingSurveyCallbacks(t.context),e(t.surveys,t.context))},s).catch(function(e){return Zl.error("Error in survey callback",e)})}}},t._handleSurveyResponse=function(e,t){var n;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:Eh}};var r=t.statusCode;if(200!==r||!t.json){var i="Surveys API could not be loaded, status: "+r;return 0!==r?Zl.error(i):t.error||Zl.warn(i),this._lastSurveyRefreshFailedAt=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this._lastSurveyRefreshFailedAt=null;var o=t.json.surveys||[];return e.kv.set(((n={})[Ar]=o,n[Mr]=Date.now(),n)),this._registerEventOrActionBasedSurveys(o),{surveys:o,context:{isLoaded:!0}}},t._registerEventOrActionBasedSurveys=function(e){var t=e.filter(function(e){return ec(e)&&(Wl(e)||tc(e))});this._registerSurveyTriggers(t)},t._registerSurveyTriggers=function(e){var t;null==(t=this._surveyEventReceiver)||t.replace(e)},t._shouldBackgroundRefreshSurveys=function(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()},t._isSurveyCacheStale=function(){var e,t=null==(e=this._client)?void 0:e.kv.get(Mr);return ui(t)&&Date.now()-t>3e5},t._isSurveyRefreshBackingOff=function(){return ui(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n;ic({id:e,current_iteration:null!==(n=null==t?void 0:t.iteration)&&void 0!==n?n:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}this._notifyActiveMatchingSurveyCallbacks()},t._notifySurveyCallbacks=function(e){for(var t,n=p(this._surveyCallbacks);!(t=n()).done;){var r=t.value;if(this._disposed)return;try{e.isLoaded?this.getSurveys(r):r([],e)}catch(e){Zl.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!ai(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Zl.warn("init was not called")},t.onActiveMatchingSurveysChanged=function(e){var t,n=this;if(this._disposed)return function(){};var r={callback:e,active:!0,revision:0};this._activeMatchingSurveyCallbacks.push(r),this._startActiveMatchingSurveyConditions();var i=null==(t=this._client)?void 0:t.kv.get(Ar);return this._config.disableSurveys||!this._surveyManager&&this._surveyInitializationFailed&&!this._isInitializingSurveys||!i&&!ai(this._lastSurveyRefreshFailedAt)&&!this._getSurveysInFlightPromise?this._notifyActiveMatchingSurveyCallback(r,{isLoaded:!1}):this._surveyManager&&this._notifyActiveMatchingSurveyCallback(r),function(){r.active=!1,n._activeMatchingSurveyCallbacks=n._activeMatchingSurveyCallbacks.filter(function(e){return e!==r}),0===n._activeMatchingSurveyCallbacks.length&&(null==n._activeMatchingSurveyConditionsUnsubscribe||n._activeMatchingSurveyConditionsUnsubscribe(),n._activeMatchingSurveyConditionsUnsubscribe=void 0)}},t._startActiveMatchingSurveyConditions=function(){var e,t,n;this._surveyManager&&this._activeMatchingSurveyCallbacks.length>0&&(null!==(e=this._activeMatchingSurveyConditionsUnsubscribe)&&void 0!==e||(this._activeMatchingSurveyConditionsUnsubscribe=null==(t=(n=this._configSource).onMatchingConditionsChanged)?void 0:t.call(n,this._notifyActiveMatchingSurveyCallbacks)))},t._notifyActiveMatchingSurveyCallback=function(e,t){var n=this;if(!this._disposed&&e.active){var r=++e.revision,i=function(i){if(!n._disposed&&e.active&&r===e.revision)try{var o=null!=t?t:{isLoaded:!0},s=JSON.stringify([i,o]);if(s===e.lastResult)return;e.lastResult=s,e.callback(i,o)}catch(e){Zl.error("Error in active matching surveys callback",e)}};try{t&&!t.isLoaded?i([]):this.getActiveMatchingSurveys(i)}catch(e){Zl.error("Error in active matching surveys callback",e)}}},t._getSurveyById=function(e){var t=null;return this.getSurveys(function(n){var r;t=null!==(r=n.find(function(t){return t.id===e}))&&void 0!==r?r:null}),t},t._checkSurveyEligibility=function(e){if(ai(this._surveyManager))return{eligible:!1,reason:Eh};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}},t._checkSurveyRenderability=function(e){var t;if(null==(t=this._client)||!t.canCapture)return{eligible:!1,reason:Xl};if(ai(this._surveyManager))return{eligible:!1,reason:Eh};var n="string"==typeof e?this._getSurveyById(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(ai(this._surveyManager))return Zl.warn("init was not called"),{visible:!1,disabledReason:Eh};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return ai(this._surveyManager)?(Zl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Eh})):new Promise(function(r){n.getSurveys(function(t){var i,o=null!==(i=t.find(function(t){return t.id===e}))&&void 0!==i?i:null;if(o){var s=n._checkSurveyRenderability(o);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})},t.renderSurvey=function(e,t,n){var r,i,o,s=this;if(null!=(r=this._client)&&r.canCapture)if(ai(this._surveyManager))Zl.warn("init was not called");else{var a="string"==typeof e?this._getSurveyById(e):e;if(null!=a&&a.id)if(oc.includes(a.type)){var u=null==(i=typeof document>"u"?void 0:document)?void 0:i.querySelector(t);if(u)if(null!=(o=a.appearance)&&o.surveyPopupDelaySeconds){Zl.info("Rendering survey "+a.id+" with delay of "+a.appearance.surveyPopupDelaySeconds+" seconds");var l=setTimeout(function(){var e,t,r;s._renderTimeouts.delete(l),!s._disposed&&null!=(e=s._client)&&e.canCapture&&(Zl.info("Rendering survey "+a.id+" with delay of "+(null==(t=a.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(r=s._surveyManager)||r.renderSurvey(a,u,n),Zl.info("Survey "+a.id+" rendered"))},1e3*a.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(l)}else this._surveyManager.renderSurvey(a,u,n);else Zl.warn("Survey element not found")}else Zl.warn("Surveys of type "+a.type+" cannot be rendered in the app");else Zl.warn("Survey not found")}},t.displaySurvey=function(e,t){var n,r;if(null!=(n=this._client)&&n.canCapture)if(ai(this._surveyManager))Zl.warn("init was not called");else{var i=this._getSurveyById(e);if(i){var o=i;if(null!=(r=i.appearance)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=d({},i,{appearance:d({},i.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==ml&&t.initialResponses&&Zl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this._checkSurveyEligibility(i);if(!s.eligible)return void Zl.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Zl.warn("Survey not found")}},t.cancelPendingSurvey=function(e){ai(this._surveyManager)?Zl.warn("init was not called"):this._surveyManager.cancelSurvey(e)},t.handlePageUnload=function(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()},a(e,[{key:"_config",get:function(){return this._configSource.get()}}])}(),Ih="u">typeof window?window:void 0,Rh="u">typeof globalThis?globalThis:Ih,Ah=null==Rh?void 0:Rh.navigator,Mh=null==Rh?void 0:Rh.document,Oh=null==Rh?void 0:Rh.location,Lh=null==Rh?void 0:Rh.fetch,Dh=null!=Rh&&Rh.XMLHttpRequest&&"withCredentials"in new Rh.XMLHttpRequest?Rh.XMLHttpRequest:void 0,$h=null==Rh?void 0:Rh.AbortController,qh=null==Rh?void 0:Rh.CompressionStream,Nh=null==Ah?void 0:Ah.userAgent,Bh="undefined"!=typeof globalThis?globalThis:Ih;Bh&&"undefined"==typeof self&&(Bh.self=Bh),Bh&&"undefined"==typeof File&&(Bh.File=function(){});var jh=null!=Ih?Ih:{},Hh=function(e){var t,n=null==(t=typeof document>"u"?void 0:document)?void 0:t.createElement("a");return ri(n)?null:(n.href=e,n)},zh=function(){try{return"u">typeof window&&!1!==window.navigator.onLine}catch(e){return!1}},Uh=function(e,t){return e>=t&&zh()},Wh=function(e,t,n,r){if(0===e){if(zh()){var i=t+1;return i===n&&r(),i}return t}return 0},Vh=function(e,t){try{var n;return JSON.stringify(e,function(e,t){return _i(t)?(null!=n||(n=new WeakMap),n.has(t)||n.set(t,Il(t)),n.get(t)):"bigint"==typeof t?t.toString():t},t)}catch(t){return Qr(e)}},Gh=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var o=r[i].split(/=(.*)/);if(o[0]===t){n=o;break}}if(!Xr(n)||2>n.length)return"";var s=n[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch(e){Sl.error("Skipping decoding for malformed query param: "+s)}return s},Kh=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(/#(.*)/),i=r[1],o=(r[0]||"").split(/\?(.*)/),s=o[1],a=o[0],u=(s||"").split("&"),l=[],c=0;u.length>c;c++){for(var d=u[c].split("?"),f=0;d.length>f&&!t.includes(d[f].split("=")[0]);)f++;l.push(d.length>f?d.slice(0,f).concat(d[f].split("=")[0]+"="+n).join("?"):u[c])}var h=a;return null!=s&&(h+="?"+l.join("&")),null!=i&&(h+="#"+i),h},Qh=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Yh(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}bl.DEBUG=!1,bl.LIB_VERSION="1.455.0",bl.LIB_NAME="web";var Jh=bl,Zh="distinct_id",Xh="$device_id",ep="$device_model",tp="__alias",np="$fbc",rp="$fbc_persistence",ip="$fbp",op="$fbp_persistence",sp="__timers",ap="$heatmaps_enabled_server_side",up="$exception_capture_enabled_server_side",lp="$error_tracking_suppression_rules",cp="$error_tracking_capture_extension_exceptions",dp="$web_vitals_enabled_server_side",fp="$dead_clicks_enabled_server_side",hp="$product_tours_enabled_server_side",pp="$logs_capture_enabled_server_side",_p="$web_vitals_allowed_metrics",vp="$session_recording_remote_config",gp="$replay_sample_rate",mp="$replay_override_sampling",yp="$replay_override_linked_flag",bp="$replay_override_url_trigger",wp="$replay_override_event_trigger",Sp="$sesid",kp="$session_is_sampled",xp="$groups",Cp="ph_product_tours",Pp="$user_state",Ep="$client_session_props",Tp="$capture_rate_limit",Fp="$initial_campaign_params",Ip="$initial_referrer_info",Rp="$initial_person_info",Ap="$epp",Mp="$posthog_cookieless",Op="$cookieless_mode",Lp="$sdk_debug_extensions_init_method",Dp="$sdk_debug_extensions_init_time_ms",$p="$sdk_debug_recording_script_not_loaded",qp="$sdk_debug_replay_stale_config",Np="$sdk_debug_replay_event_trigger_status",Bp="$sdk_debug_replay_linked_flag_trigger_status",jp="$sdk_debug_replay_matched_recording_trigger_groups",Hp="$sdk_debug_replay_pending_trigger_conditions",zp="$sdk_debug_replay_remote_trigger_matching_config",Up="$sdk_debug_replay_trigger_groups_count",Wp="$sdk_debug_replay_url_trigger_status",Vp="anonymous",Gp="identified",Kp="identified_only",Qp="beforeunload",Yp="$pageview",Jp="$pageleave",Zp="$identify",Xp="$groupidentify";function e_(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function t_(e){return!!e&&1===e.nodeType}function n_(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function r_(e){return!!e&&3===e.nodeType}function i_(e){return!!e&&11===e.nodeType&&t_(e.host)}function o_(e){return e?Gr(e).split(/\s+/):[]}function s_(e,t){var n=jd(t);return!!(n&&e&&e.some(function(e){return n.match(e)}))}function a_(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 o_(t)}function u_(e){return ai(e)?null:Gr(e).split(/(\s+)/).filter(function(e){return N_(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function l_(e){var t="";return I_(e)&&!R_(e)&&e.childNodes&&e.childNodes.length&&Cl(e.childNodes,function(e){var n;r_(e)&&e.textContent&&(t+=null!==(n=u_(e.textContent))&&void 0!==n?n:"")}),Gr(t)}function c_(e){var t;return ri(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var d_=["a","button","form","input","select","textarea","label"];function f_(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch(e){return!1}}function h_(e,t){if(ri(t))return!0;for(var n,r,i=function(){var e=r.value;if(t.some(function(t){return f_(e,t)}))return{v:!0}},o=p(e);!(r=o()).done;)if(n=i())return n.v;return!1}function p_(e){var t=e.parentNode;return!(!t||!t_(t))&&t}var __=[".ph-no-autocapture","[data-ph-no-autocapture]"],v_=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],g_=function(){return[].concat(v_,["+","-","−","–"])}(),m_=function(){return g_.length+10}(),y_=["button","a","input","select","textarea","label"],b_=["button","link","tab","menuitem","option"],w_=function(e,t){return/[a-z0-9]/i.test(t)?Vr(g_,t)?new RegExp("\\b"+t+"\\b").test(e):e.includes(t):e===t},S_=function(e){return Vr(y_,e.tagName.toLowerCase())||Vr(b_,(e.getAttribute("role")||"").toLowerCase())};function k_(e){var t="",n="",r=function(e){t_(e)&&I_(e)&&!R_(e)&&(t+=" "+l_(e),n=n||e.getAttribute("aria-label")||"",Cl(e.childNodes,r))};r(e);var i=(N_(t=Gr(t.replace(/\s+/g," ")))?t:"").toLowerCase();return{safeText:i,ariaLabel:Gr(e.getAttribute("aria-label")||(i?"":n)).toLowerCase()}}var x_=[".ph-no-rageclick",".ph-no-capture"],C_=["","text","search","email","password","url","tel","number"];function P_(e,t){if(!(typeof window>"u"?void 0:window)||E_(e))return!1;var n,r,i,o,s;if(ci(t)?(n=!!t&&x_,r=void 0,i=!1):(n=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:x_,r=null==t?void 0:t.content_ignorelist,i=null!==(s=null==t?void 0:t.ignore_text_selection)&&void 0!==s&&s),!1===n)return!1;if(i&&function(e){return!(!e||!t_(e))&&(!!n_(e,"textarea")||(n_(e,"input")?Vr(C_,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var a=T_(e,!1),u=a.targetElementList;return!(!a.isComplete||r&&function(e,t){var n,r=t.safeText,i=t.ariaLabel;if(!0===e)n=v_;else{if(!Xr(e))return!1;if(e.length>m_)return Sl.error("[PostHog] content_ignorelist array cannot exceed "+m_+" items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map(function(e){return e.toLowerCase()})}return n.some(function(e){return w_(r,e)||w_(i,e)})}(r,function(e,t){for(var n,r=p(t);!(n=r()).done;){var i=n.value;if(S_(i))return k_(i)}for(var o,s=p(t);!(o=s()).done;){var a=o.value;try{var u;if("pointer"!==(null==(u=window)?void 0:u.getComputedStyle(a).getPropertyValue("cursor")))break}catch(e){break}var l=k_(a);if(l.safeText||l.ariaLabel)return l}return k_(e)}(e,u))||h_(u,n))}var E_=function(e){return!e||n_(e,"html")||!t_(e)},T_=function(e,t){var n=typeof window>"u"?void 0:window;if(!n||E_(e))return{parentIsUsefulElement:!1,targetElementList:[],isComplete:!1};for(var r=!1,i=[e],o=e,s=new Set([e]);!n_(o,"body");){var a=o.assignedSlot||o.parentNode,u=i_(a)?a.host:a&&t_(a)?a:null;if(!u)break;if(s.has(u)||s.size>=1e3)return{parentIsUsefulElement:r,targetElementList:i,isComplete:!1};if(s.add(u),i_(a))i.push(u),o=u;else{if(t||d_.indexOf(u.tagName.toLowerCase())>-1)r=!0;else try{var l=n.getComputedStyle(u);l&&"pointer"===l.getPropertyValue("cursor")&&(r=!0)}catch(e){}i.push(u),o=u}}return{parentIsUsefulElement:r,targetElementList:i,isComplete:!0}};function F_(e){for(var t=new Set,n=0,r=e;r;){if(n++>=1e3||t.has(r))return!0;t.add(r);var i=a_(r);if(Vr(i,"ph-sensitive")||Vr(i,"ph-no-capture"))return!0;var o=r.assignedSlot||r.parentNode;r=i_(o)?o.host:o&&t_(o)?o:null}return!1}function I_(e){if(F_(e))return!1;if(Vr(a_(e),"ph-include"))return!0;var t=e.type||"";if(ii(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!ii(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function R_(e){return!!(n_(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||n_(e,"select")||n_(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var A_=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),M_=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,O_=[16,15,14,13],L_=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),D_=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),$_=/[0-9A-Za-z_]/;function q_(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function N_(e,t){if(void 0===t&&(t=!0),ai(e))return!1;if(ii(e)){if(e=Gr(e),t?A_.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(M_.lastIndex=0;t=M_.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,""),i=0;r.length>i;i++)for(var o=0,s=O_;s.length>o;o++){var a=i+s[o];if(r.length>=a){var u=r.slice(i,a);if(A_.test(u)&&q_(u))return!0}}}return!1}(e))return!1;if(t?L_.test(e):function(e){var t;for(D_.lastIndex=0;t=D_.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&$_.test(n)&&$_.test(r)))return!0}return!1}(e))return!1}return!0}function B_(e){var t=l_(e);return N_(t=(t+" "+j_(e)).trim())?t:""}function j_(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Cl(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=l_(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+j_(e)).trim())}catch(e){Sl.error("[AutoCapture]",e)}}),t}function H_(e){return e.replace(/"|\\"/g,'\\"')}function z_(e){var t=e.attr__class;if(t)return Xr(t)?t:o_(t)}var U_=function(){"use strict";function e(e){this.disabled=!1===e;var t=ti(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}return e.prototype.isRageClick=function(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1},e}(),W_=function(){return typeof window>"u"?void 0:window},V_=function(){return typeof document>"u"?void 0:document},G_="$copy_autocapture",K_=["password","hidden","file","checkbox","button","submit","reset","image"],Q_=kl("[AutoCapture]");function Y_(e,t){return t.length>e?t.slice(0,e)+"...":t}function J_(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!t_(t));return t}function Z_(e,t){var n,r,i=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=t.disableCaptureUrlHashes;if(!t_(e))return{props:{}};for(var c=[e],f=new Set([e]),h=e;!n_(h,"body")&&1e3>c.length;){var _=h.assignedSlot||h.parentNode,v=i_(_)?_.host:_&&t_(_)?_:null;if(!v||f.has(v))break;f.add(v),c.push(v),h=v}var g="click"===i.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(function(e){return n_(e,"button")||n_(e,"a")}):-1;g>0&&(s=s||c.slice(0,g+1).some(function(e){return!I_(e)||R_(e)}));var m,y,b,w=[],S={},k=!1,x=!1;if(Cl(c,function(e){var t=I_(e);if(t&&n_(e,"a")&&!o&&(null==a||!a.includes("href"))){var n=e.getAttribute("href");k=!!(t&&n&&N_(n))&&(l?Ho(n):n)}Vr(a_(e),"ph-no-capture")&&(x=!0),w.push(function(e,t,n,r,i){void 0===i&&(i=!1);var o=e.tagName.toLowerCase(),s={tag_name:o};d_.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Y_(1024,B_(e)):Y_(1024,l_(e)));var a=a_(e);t||null!=r&&r.includes("class")||0>=a.length||(s.classes=a.filter(function(e){return""!==e})),Cl(F_(e)?[]:e.attributes,function(n){var o;if((!R_(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&N_(n.value)&&(!ii(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){var a=n.value;"class"===n.name&&(a=o_(a).join(" ")),s["attr__"+n.name]=Y_(1024,"href"===n.name&&i?Ho(a):a)}});for(var u=1,l=1,c=e;c=J_(c);)u++,c.tagName===e.tagName&&l++;return s.nth_child=u,s.nth_of_type=l,s}(e,o,s,a,l)),Cl(function(e){if(!I_(e))return{};var t={};return Cl(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&N_(r)&&(t[n]=r)}}),t}(e),function(e,t){({}).hasOwnProperty.call(S,t)||(S[t]=e)})}),x)return{props:{},explicitNoCapture:x};if(g>0&&(e=c[g],w.splice(0,g)),s||(w[0].$el_text=n_(e,"a")||n_(e,"button")?B_(e):l_(e)),k){var C,P;w[0].attr__href=k;var E=null==(C=Hh(k))?void 0:C.host,T=null==(P=W_())||null==(P=P.location)?void 0:P.host;E&&T&&E!==T&&(m=k)}return{props:Pl((y=i.type,{$event_type:y,$ce_version:1}),u?{}:{$elements:w},{$elements_chain:(b=w,Xr(b)?function(e){return e.map(function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();for(var i,o=p(e.attr_class);!(i=o()).done;)r+="."+i.value.replace(/"/g,"")}var s=d({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return El(s).sort(function(e,t){return function(e,t){return t>e?-1:e>t?1:0}(e[0],t[0])}).forEach(function(e){var t=e[1];return a[H_(e[0].toString())]=H_(t.toString())}),(r+=":")+El(a).map(function(e){return e[0]+'="'+e[1]+'"'}).join("")}).join(";")}(function(e){return e.map(function(e){var t,n,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(n=e.attr__href)?void 0:n.slice(0,2048),attr_class:z_(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return El(e).filter(function(e){return 0===e[0].indexOf("attr__")}).forEach(function(e){return r.attributes[e[0]]=e[1]}),r})}(b)):"")},null!=(n=w[0])&&n.$el_text?{$el_text:null==(r=w[0])?void 0:r.$el_text}:{},m&&"click"===i.type?{$external_click_url:m}:{},S),target:e}}var X_="autocapture",ev=function(){"use strict";function e(e){this._configSource=e,this.name=X_,this._initialized=!1,this._isDisabledServerSide=null,this._hasReceivedConfigResponse=!1,this._elementSelectorsByOwner=new Map,this._elementsChainAsString=!1,this._config={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this._disposed=!1,this._configSource.refresh(this._config),this.rageclicks=new U_(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return t._clearPointer=function(){this._pointerDown=void 0,clearTimeout(this._pointerExpiry),this._pointerExpiry=void 0},t._isExcludedPointerTarget=function(e){var t;if(!I_(e))return!0;for(var n,r=null!==(t=this._refreshConfig().css_selector_ignorelist)&&void 0!==t?t:__,i=new Set,o=e,s=function(){if(i.size>=1e3||i.has(o))return{v:!0};i.add(o);var e=o,t=a_(e);if(Vr(t,"ph-no-capture")||Vr(t,"ph-sensitive")||R_(e)||r.some(function(t){return f_(e,t)}))return{v:!0};var n=o.assignedSlot||o.parentNode;o=i_(n)?n.host:n&&t_(n)?n:null};o;)if(n=s())return n.v;return!1},t._trackPointer=function(e){var t=this;if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var n=this._pointerDown;n&&(e.pointerId!==n.id||Math.abs(e.clientX-n.x)>5||Math.abs(e.clientY-n.y)>5?this._clearPointer():"pointerup"===e.type&&(n.released=!0,this._pointerExpiry=setTimeout(function(){return t._clearPointer()},0)))}else{var r;this._clearPointer();var i=c_(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&t_(i)&&(this._pointerDown={target:i,excluded:this._isExcludedPointerTarget(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(r=this._client)?void 0:r.distinctId})}else this._clearPointer()},t._recoverClickTarget=function(e){var t,n=this._pointerDown;this._clearPointer();var r=c_(e);if(null!=n&&n.released&&n.target.isConnected&&n.distinctId===(null==(t=this._client)?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&r&&(n_(r,"html")||n_(r,"body"))){var i,o,s;if(n.excluded)return null;var a=null!==(i=this._refreshConfig().css_selector_ignorelist)&&void 0!==i?i:__;return[r,null==(o=V_())?void 0:o.documentElement,null==(s=V_())?void 0:s.body].some(function(e){if(!e)return!1;var t=a_(e);return Vr(t,"ph-no-capture")||Vr(t,"ph-sensitive")||!I_(e)||R_(e)||a.some(function(t){return f_(e,t)})})?null:n.target}},t.setup=function(e){this._compileUrlPatterns(),this._client=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this._disposed?t.dispose():(this._remoteConfigSubscription=t,this.startIfEnabled())},t.dispose=function(){var e;this._disposed||(this._disposed=!0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._elementSelectorsByOwner.clear(),this._elementSelectors=null,this._removeDomEventHandlers())},t._refreshConfig=function(){return this._configSource.refresh(this._config),this._config},t._compileUrlPatterns=function(){var e,t;return this._refreshConfig(),this._config.url_allowlist=null==(e=this._config.url_allowlist)?void 0:e.map(function(e){return new RegExp(e)}),this._config.url_ignorelist=null==(t=this._config.url_ignorelist)?void 0:t.map(function(e){return new RegExp(e)}),this._config},t._addDomEventHandlers=function(){var e=this,t=W_(),n=V_();if(this.isBrowserSupported()){if(t&&n){this._listenerWindow=t,this._listenerDocument=n;var r=this._domEventHandler=function(n){n=n||(null==t?void 0:t.event);try{if("blur"===n.type)return void e._clearPointer();if(0===n.type.indexOf("pointer"))return void e._trackPointer(n);var r="click"===n.type?e._recoverClickTarget(n):void 0;if(si(r))return;e._captureEvent(n,"$autocapture",r)}catch(e){Q_.error("Failed to capture event",e)}};if(Ml(t,"blur",r),Ml(n,"submit",r,{capture:!0}),Ml(n,"change",r,{capture:!0}),Ml(n,"click",r,{capture:!0}),Cl(["pointerdown","pointermove","pointerup","pointercancel"],function(e){Ml(n,e,r,{capture:!0})}),this._refreshConfig().capture_copied_text){var i=this._copiedTextHandler=function(n){n=n||(null==t?void 0:t.event);try{e._captureEvent(n,G_)}catch(e){Q_.error("Failed to capture clipboard event",e)}};Ml(n,"copy",i,{capture:!0}),Ml(n,"cut",i,{capture:!0}),Ml(n,"paste",i,{capture:!0})}}}else Q_.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){var e=this,t=this._listenerWindow,n=this._listenerDocument;this._clearPointer(),this._domEventHandler&&(null==t||t.removeEventListener("blur",this._domEventHandler),Cl(["pointerdown","pointermove","pointerup","pointercancel"],function(t){null==n||n.removeEventListener(t,e._domEventHandler,!0)}),null==n||n.removeEventListener("submit",this._domEventHandler,!0),null==n||n.removeEventListener("change",this._domEventHandler,!0),null==n||n.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==n||n.removeEventListener("copy",this._copiedTextHandler,!0),null==n||n.removeEventListener("cut",this._copiedTextHandler,!0),null==n||n.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._listenerWindow=void 0,this._listenerDocument=void 0,this._initialized=!1},t.startIfEnabled=function(){this.isEnabled||this._clearPointer(),!this._disposed&&this._client&&this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)},t.onRemoteConfig=function(e){if(!this._disposed)if(this._hasReceivedConfigResponse=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString);var n,r=t.autocapture_opt_out;ci(r)&&(null==(n=this._client)||n.kv.set(oh,r),this._isDisabledServerSide=r),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e,t){if(void 0===t&&(t=this),!this._disposed){e.size?this._elementSelectorsByOwner.set(t,new Set(e)):this._elementSelectorsByOwner.delete(t);var n=new Set;this._elementSelectorsByOwner.forEach(function(e){e.forEach(function(e){return n.add(e)})}),this._elementSelectors=n}},t.getElementSelectors=function(e,t){var n,r=[];return null==(n=this._elementSelectors)||n.forEach(function(n){var i;null==(i=V_())||null==(i=i.querySelectorAll(n))||i.forEach(function(i){e!==i&&t!==i||Vr(r,n)||r.push(n)})}),r},t._captureEvent=function(e,t,n){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r=n||c_(e);r_(r)&&(r=r.parentNode||null);var i,o=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&o.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&P_(r,o.rageclick)&&this._captureEvent(e,"$rageclick",n);var s,a=t===G_,u=a?d({},o,{dom_event_allowlist:void 0}):o;if(r&&function(e,t,n,r,i,o){var s,a=typeof window>"u"?void 0:window;if(!a||E_(e))return!1;if(null!=n&&n.url_allowlist&&!s_(n.url_allowlist,o))return!1;if(null!=n&&n.url_ignorelist&&s_(n.url_ignorelist,o))return!1;if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(function(e){return t.type===e}))return!1}var l=T_(e,r),c=l.parentIsUsefulElement,d=l.targetElementList;if(!l.isComplete)return!1;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(ri(n))return!0;for(var r,i,o=function(){var e=i.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},s=p(e);!(i=s()).done;)if(r=o())return r.v;return!1}(d,n))return!1;if(!h_(d,null==n?void 0:n.css_selector_allowlist))return!1;if(h_(d,null!==(s=null==n?void 0:n.css_selector_ignorelist)&&void 0!==s?s:__))return!1;try{var f=a.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return c?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(d_.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var l,c=Z_(r,{e:e,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),f=c.props;if(c.explicitNoCapture)return!1;var h=this.getElementSelectors(r,c.target);if(h&&h.length>0&&(f.$element_selectors=h),t===G_){var _=e.type||"clipboard";if("paste"!==_){var v,g,m=null==(v=W_())||null==(v=v.getSelection())?void 0:v.toString(),y=u_(m);if(!y)return!1;f.$selected_content=y,f.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}f.$copy_type=_}if("$autocapture"===t&&"change"===e.type&&o.capture_value_css_selector_allowlist&&!o.maskAllText&&(n_(s=r,"input")?!Vr(K_,s.type):n_(s,"textarea")||n_(s,"select")&&!s.multiple)&&function(e,t){var n;if(!I_(e))return!1;var r=null!==(n=t.css_selector_ignorelist)&&void 0!==n?n:__,i=new Set,o=e;n_(e,"select")&&(o=e.options[e.selectedIndex]||e);for(var s,a=function(){var e=o,t=a_(e);if(i.size>=1e3||i.has(o)||Vr(t,"ph-sensitive")||Vr(t,"ph-no-capture")||r.some(function(t){return f_(e,t)}))return{v:!1};i.add(o);var n=o.assignedSlot||o.parentNode;o=i_(n)?n.host:n&&t_(n)?n:null};o;)if(s=a())return s.v;return!0}(r,o)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){var b=o.capture_value_css_selector_allowlist,w=!1;try{w=ei(b)?!!b(r):Xr(b)&&b.some(function(e){return f_(r,e)})}catch(e){Q_.error("capture_value_css_selector_allowlist threw",e)}w&&(f.$input_value=r.value)}return null==(l=this._client)||l.capture(t,f),!0}}else this._clearPointer()},t.isBrowserSupported=function(){var e;return ei(null==(e=V_())?void 0:e.querySelectorAll)},a(e,[{key:"isEnabled",get:function(){var e,t;if(this._disposed)return!1;var n=null==(e=this._client)?void 0:e.kv.get(oh),r=this._isDisabledServerSide,i=this._refreshConfig();if(!i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse)return!1;var o=i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if(si(r)&&!ci(n)&&!o)return!1;var s=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!i.enabled&&!s}}])}(),tv="featureFlags",nv="logs",rv=Uint8Array,iv=Uint16Array,ov=Uint32Array,sv=new rv([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]),av=new rv([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]),uv=new rv([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lv=function(e,t){for(var n=new iv(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new ov(n[30]);for(r=1;30>r;++r)for(var o=n[r];n[r+1]>o;++o)i[o]=o-n[r]<<5|r;return[n,i]},cv=lv(sv,2),dv=cv[1];cv[0][28]=258,dv[258]=28;for(var fv=lv(av,0)[1],hv=new iv(32768),pv=0;32768>pv;++pv){var _v=(43690&pv)>>>1|(21845&pv)<<1;hv[pv]=((65280&(_v=(61680&(_v=(52428&_v)>>>2|(13107&_v)<<2))>>>4|(3855&_v)<<4))>>>8|(255&_v)<<8)>>>1}var vv=function(e,t,n){for(var r=e.length,i=0,o=new iv(t);r>i;++i)++o[e[i]-1];var s,a=new iv(t);for(i=0;t>i;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new iv(1<<t);var u=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,f=d|(1<<c)-1;f>=d;++d)s[hv[d]>>>u]=l}else for(s=new iv(r),i=0;r>i;++i)s[i]=hv[a[e[i]-1]++]>>>15-e[i];return s},gv=new rv(288);for(pv=0;144>pv;++pv)gv[pv]=8;for(pv=144;256>pv;++pv)gv[pv]=9;for(pv=256;280>pv;++pv)gv[pv]=7;for(pv=280;288>pv;++pv)gv[pv]=8;var mv=new rv(32);for(pv=0;32>pv;++pv)mv[pv]=5;var yv=vv(gv,9,0),bv=vv(mv,5,0),wv=function(e){return(e/8|0)+(7&e&&1)},Sv=function(e,t,n){(null==t||0>t)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof iv?iv:e instanceof ov?ov:rv)(n-t);return r.set(e.subarray(t,n)),r},kv=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},xv=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cv=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new rv(0),0];if(1==i){var s=new rv(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=i-1;)a=n[n[d].f>n[l].f?l++:d++],u=n[l!=c&&n[d].f>n[l].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(r=1;i>r;++r)o[r].s>f&&(f=o[r].s);var h=new iv(f+1),p=Pv(n[c-1],h,0);if(p>t){r=0;var _=0,v=p-t,g=1<<v;for(o.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});i>r;++r){var m=o[r].s;if(t>=h[m])break;_+=g-(1<<p-h[m]),h[m]=t}for(_>>>=v;_>0;){var y=o[r].s;t>h[y]?_-=1<<t-h[y]++-1:++r}for(;r>=0&&_;--r){var b=o[r].s;h[b]==t&&(--h[b],++_)}p=t}return[new rv(h),p]},Pv=function(e,t,n){return-1==e.s?Math.max(Pv(e.l,t,n+1),Pv(e.r,t,n+1)):t[e.s]=n},Ev=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new iv(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;t>=a;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Tv=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Fv=function(e,t,n){var r=n.length,i=wv(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;r>o;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Iv=function(e,t,n,r,i,o,s,a,u,l,c){kv(t,c++,n),++i[256];for(var d=Cv(i,15),f=d[0],h=d[1],p=Cv(o,15),_=p[0],v=p[1],g=Ev(f),m=g[0],y=g[1],b=Ev(_),w=b[0],S=b[1],k=new iv(19),x=0;m.length>x;++x)k[31&m[x]]++;for(x=0;w.length>x;++x)k[31&w[x]]++;for(var C=Cv(k,7),P=C[0],E=C[1],T=19;T>4&&!P[uv[T-1]];--T);var F,I,R,A,M=l+5<<3,O=Tv(i,gv)+Tv(o,mv)+s,L=Tv(i,f)+Tv(o,_)+s+14+3*T+Tv(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(O>=M&&L>=M)return Fv(t,c,e.subarray(u,u+l));if(kv(t,c,1+(O>L)),c+=2,O>L){F=vv(f,h,0),I=f,R=vv(_,v,0),A=_;var D=vv(P,E,0);for(kv(t,c,y-257),kv(t,c+5,S-1),kv(t,c+10,T-4),c+=14,x=0;T>x;++x)kv(t,c+3*x,P[uv[x]]);c+=3*T;for(var q=[m,w],N=0;2>N;++N){var B=q[N];for(x=0;B.length>x;++x)kv(t,c,D[j=31&B[x]]),c+=P[j],j>15&&(kv(t,c,B[x]>>>5&127),c+=B[x]>>>12)}}else F=yv,I=gv,R=bv,A=mv;for(x=0;a>x;++x)if(r[x]>255){var j;xv(t,c,F[257+(j=r[x]>>>18&31)]),c+=I[j+257],j>7&&(kv(t,c,r[x]>>>23&31),c+=sv[j]);var H=31&r[x];xv(t,c,R[H]),c+=A[H],H>3&&(xv(t,c,r[x]>>>5&8191),c+=av[H])}else xv(t,c,F[r[x]]),c+=I[r[x]];return xv(t,c,F[256]),c+I[256]},Rv=new ov([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Av=new rv(0),Mv=function(){for(var e=new ov(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ov=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Lv(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;t.length>r;++r)n=Mv[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o,s,a,u,l=(i=e,o=t,s=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,n,r,i,o){var s=e.length,a=new rv(r+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||8>s)for(var c=0;s>=c;c+=65535){var d=c+65535;s>d?l=Fv(u,l,e.subarray(c,d)):(u[c]=o,l=Fv(u,l,e.subarray(c,s)))}else{for(var f=Rv[t-1],h=f>>>13,p=8191&f,_=(1<<n)-1,v=new iv(32768),g=new iv(_+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new ov(25e3),S=new iv(288),k=new iv(32),x=0,C=0,P=(c=0,0),E=0,T=0;s>c;++c){var F=b(c),I=32767&c,R=g[F];if(v[I]=R,g[F]=I,c>=E){var A=s-c;if((x>7e3||P>24576)&&A>423){l=Iv(e,u,0,w,S,k,C,P,T,c-T,l),P=x=C=0,T=c;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)k[M]=0}var O=2,L=0,D=p,q=I-R&32767;if(A>2&&F==b(c-q))for(var N=Math.min(h,A)-1,B=Math.min(32767,c),j=Math.min(258,A);B>=q&&--D&&I!=R;){if(e[c+O]==e[c+O-q]){for(var H=0;j>H&&e[c+H]==e[c+H-q];++H);if(H>O){if(O=H,L=q,H>N)break;var z=Math.min(q,H-2),U=0;for(M=0;z>M;++M){var W=c-q+M+32768&32767,V=W-v[W]+32768&32767;V>U&&(U=V,R=W)}}}q+=(I=R)-(R=v[I])+32768&32767}if(L){w[P++]=268435456|dv[O]<<18|fv[L];var G=31&dv[O],K=31&fv[L];C+=sv[G]+av[K],++S[257+G],++k[K],E=c+O,++x}else w[P++]=e[c],++S[e[c]]}}l=Iv(e,u,o,w,S,k,C,P,T,c-T,l),o||(l=Fv(u,l,Av))}return Sv(a,0,r+wv(l)+i)}(i,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,s,a,!u)),c=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ov(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Ov(l,c-8,n.d()),Ov(l,c-4,r),l}var Dv=!!Dh||!!Lh,$v=new WeakMap,qv="text/plain",Nv=0,Bv=!1,jv=function(e,t){var n=e.split("#"),r=n[1],i=n[0].split("?"),o=i[0],s=i[1];if(!s)return e;var a=s.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return o+(a?"?"+a:"")+(r?"#"+r:"")},Hv=function(e,t,n){void 0===n&&(n=!0);var r=e.indexOf("#"),i=-1===r?"":e.slice(r),o=-1===r?e:e.slice(0,r),s=o.indexOf("?"),a=-1===s?o:o.slice(0,s),u=-1===s?"":o.slice(s+1),l=d({},t),c=u.split("&").filter(function(e){return""!==e}).map(function(e){var t=e.indexOf("="),r=-1===t?e:e.slice(0,t),i=n?l[r]:void 0;return delete l[r],ai(i)?e:r+"="+i}),f=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return Cl(e,function(e,t){ri(e)||ri(t)||"undefined"===t||(n=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n)}),i.join(t)}(l);return f&&c.push(f),""+(c.length>0?a+"?"+c.join("&"):a)+i},zv=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===yh){var r=Lv(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new rv(e.length+(e.length>>>1)),r=0,i=function(e){n[r++]=e},o=0;t>o;++o){if(r+5>n.length){var s=new rv(r+8+(t-o<<1));s.set(n),n=s}var a=e.charCodeAt(o);128>a?i(a):2048>a?(i(192|a>>>6),i(128|63&a)):a>55295&&57344>a?(i(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++o))>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|63&a)):(i(224|a>>>12),i(128|a>>>6&63),i(128|63&a))}return Sv(n,0,r)}(Vh(t)),{mtime:0});return{contentType:qv,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===bh){var i=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):e}(Vh(t)),o="sendBeacon"===e.transport,s=o?i:function(e){return"data="+encodeURIComponent("string"==typeof e?e:Vh(e))}(i);return{contentType:o?qv:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Vh(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Uv=function(e){var t,n,r=function(){return"sendBeacon"===e.transport?{url:Hv(e.url,{compression:bh}),encodedBody:zv(d({},e,{compression:bh,_encodedBody:void 0}))}:{url:jv(e.url,"compression"),encodedBody:zv(d({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=zv(e)}catch(t){if(js(e.compression,Gh(e.url,"compression")))return Sl.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&js(e.compression,Gh(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?Bs(new Uint8Array(n)):ArrayBuffer.isView(n)&&Bs(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Bv=!0,r()):{url:e.url,encodedBody:t}},Wv=function(e){try{return Uv(e)}catch(t){return Sl.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Vv=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return n=Vh(t.data),e.n=1,Ks(n,Jh.DEBUG,{rethrow:!0});case 1:if(r=e.v){e.n=2;break}return e.a(2,t);case 2:return e.n=3,r.arrayBuffer();case 3:return e.a(2,d({},t,{_encodedBody:{contentType:qv,body:i=e.v,estimatedSize:i.byteLength}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),Gv=function(e){return jo("AbortError","PostHog request timed out"+(e?" after "+e+"ms":""))},Kv=/Failed to fetch|NetworkError|Load failed/i,Qv=function(e){return"TypeError"===(null==e?void 0:e.name)&&Kv.test((null==e?void 0:e.message)||"")},Yv=function(e){try{var t=function(e,t,n){if(void 0===t&&(t=Date.now()),void 0===n&&(n=$o),"string"==typeof e&&e){var r=e.trim(),i=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(i)){var o=1e3*Math.min(Number(i),n/1e3);return o>0?o:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i)){var s=/^\w{3} \w{3} /.test(i)?i+" GMT":i,a=Date.parse(s)-t;if(Number.isFinite(a)&&a>0)return Math.min(a,n)}}}(e());return ri(t)?void 0:Math.min(t,3e4)}catch(e){return}},Jv=function(e){var t=Wv(e);if(t){var n=new Dh;$v.set(n,!0);var r=t.url,i=t.encodedBody;n.open(e.method||"GET",r,!0);var o=null!=i?i:{},s=o.contentType,a=o.body;Cl(e.headers,function(e,t){n.setRequestHeader(t,e)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout);var u=!1;n.ontimeout=function(){u=!0},n.onloadend=function(){if(u){var t=Gv(e.timeout);return Sl.warn(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}var r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(r,Yv(function(){return n.getResponseHeader("Retry-After")}))},null==e.onSend||e.onSend(r),n.send(a)}},Zv=function(e){var t=Wv(e);if(t){var n=t.url,r=t.encodedBody,i=null!=r?r:{},o=i.contentType,s=i.body,a=i.estimatedSize,u=new Headers;Cl(e.headers,function(e,t){u.append(t,e)}),o&&u.append("Content-Type",o);var l=null,c=!1;if($h){var f=new $h;l={signal:f.signal,timeout:setTimeout(function(){c=!0;try{f.abort(Gv(e.timeout))}catch(e){p(e)}},e.timeout)}}var h=!1,p=function(t){h||(h=!0,c&&"AbortError"===(null==t?void 0:t.name)||Qv(t)?Sl.warn(t):Sl.error(t),null==e.callback||e.callback({statusCode:0,error:t}))},_=0,v=function(){Nv-=_,_=0,l&&clearTimeout(l.timeout)};try{var g,m=d({method:(null==e?void 0:e.method)||"GET",headers:u,referrerPolicy:"strict-origin",body:s,signal:null==(g=l)?void 0:g.signal},e.fetchOptions);null==e.onSend||e.onSend(n);var y=null!=a?a:ri(s)?0:void 0;m.keepalive="POST"===m.method&&!e._keepaliveDisabled&&!1!==m.keepalive&&m.body===s&&!ri(y)&&y>=0&&52428.8>Nv+y,m.keepalive&&(Nv+=_=y),Lh(n,m).then(function(t){return t.text().then(function(n){if(!h){var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){Sl.error(e)}h=!0,v(),null==e.callback||e.callback(r,Yv(function(){return t.headers.get("Retry-After")}))}})}).catch(function(e){v(),p(e)}).finally(v)}catch(e){v(),p(e)}}},Xv=function(e){try{var t,n=Uv(e),r=n.url,i=n.encodedBody,o=null!=i?i:{},s=o.body,a=o.estimatedSize;if(!s)return;var u=s instanceof Blob?s:new Blob([s],{type:o.contentType});if(Ah.sendBeacon(r,u))return;var l=Xr(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Xr(l)&&l.length>1&&(null!=a?a:0)>16384){var c=Math.ceil(l.length/2),f=function(t){return Xr(e.data)?t:d({},e.data,{batch:t})};return Xv(d({},e,{data:f(l.slice(0,c))})),void Xv(d({},e,{data:f(l.slice(c))}))}Sl.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to "+(Lh?"fetch":"XHR")),Lh?Zv(d({},e,{_keepaliveDisabled:!0})):Jv(e)}catch(e){Sl.warn("Beacon send failed",e)}},eg=function(e,t,n,r){var i,o="query"===r?"POST"===t?"sent_at":"_":void 0;return Hv(n===yh?jv(e,"compression"):e,d({},o?((i={})[o]=Date.now().toString(),i):{},n===yh?{}:{compression:n}))},tg=function(){var e=[];return Lh&&e.push({transport:"fetch",method:Zv}),Dh&&e.push({transport:"XHR",method:Jv}),null!=Ah&&Ah.sendBeacon&&e.push({transport:"sendBeacon",method:Xv}),e}(),ng=function(){var e;return null!=Ih&&null!=(e=Ih.performance)&&e.now?Ih.performance.now():Date.now()},rg=[],ig=function(e){try{return og(e)}catch(e){return}},og=function(e){var t,n=null==Ih?void 0:Ih.PerformanceObserver,r=null==(t=Hh(e))?void 0:t.href;if(n&&r){var i,o,s,a=ng(),u={name:r,before:1/0,inFlight:!0},l=1/0,c=!1,d=function(){c||(c=!0,clearTimeout(s),_.disconnect(),rg.splice(rg.indexOf(u),1))},f=!1,h=function(e){for(var t,n=p(e);!(t=n()).done;){var s=t.value,c=s.startTime;s.name!==r||(f?a>=c:a>c)||c>=u.before||i&&c>=i.startTime||(i=s)}if(i&&o&&l>=i.startTime){var h=o;d(),h(i)}},_=new n(function(e){return h(e.getEntriesByName(r,"resource"))});_.observe({entryTypes:["resource"]});for(var v=0,g=rg;g.length>v;v++){var m=g[v];m.name===r&&(m.before=Math.min(m.before,a),f=f||m.inFlight)}return rg.push(u),{take:function(e,t){c||(l=e,u.inFlight=!1,o=t,s=setTimeout(d,5e3),ei(_.takeRecords)&&h(_.takeRecords()))},stop:d}}},sg=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4],ag=[5,10,25].concat(sg),ug=function(e,t){var n,r,i=t.statusCode||void 0,o={"server.address":(null!==(n=null==(r=Hh(e))?void 0:r.hostname)&&void 0!==n?n:e).replace(/^\[(.*)\]$/,"$1")};i&&(o["http.response.status_code"]=i);var s=function(e,t){return e?400>e?void 0:String(e):"AbortError"===(null==t?void 0:t.name)?"timeout":"_OTHER"}(i,t.error);s&&(o["error.type"]=s);var a=Yh();return a&&(o["client.timezone"]=a),o},lg=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);for(var n,r={},i=p(e);!(n=i()).done;){var o=n.value,s=null==t?void 0:t.get_property(o);ri(s)||(r[o]=s)}return r},t.set=function(e,t){var n,r;null==(n=this._instance.persistence)||n.register("string"==typeof e?((r={})[e]=t,r):e)},t.remove=function(e){var t;null==(t=this._instance.persistence)||t.unregister(e)},e}(),cg=function(){"use strict";function e(e){var t=this;this.instance=e,this._logger=Sl,this.kv=new lg(e),this.onSession=function(e){return wh(t.instance.onSessionId(function(n){try{e(n)}catch(e){t._logger.error("Browser extension session listener failed",e)}}))},this.onEvent=function(e){return wh(t.instance._addCaptureHook(function(n,r){if(r)try{e({event:n,properties:r.properties})}catch(e){t._logger.error("Browser extension event listener failed",e)}}))},this.onRemoteConfig=function(e){var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},r=t.instance._internalEventEmitter.on("extensionsRemoteConfig",n);return t.instance._lastRemoteConfig&&n(t.instance._lastRemoteConfig),wh(r)}}var t=e.prototype;return t.getExtension=function(e){var t;switch(e){case tv:case qr:t=this.instance.featureFlags;break;case nv:t=this.instance.logs;break;case"surveys":t=this.instance.surveys;break;case X_:t=this.instance.autocapture}return t},t.capture=function(e,t,n){if(!n)return this._notRateLimited(this.instance.capture(e,t));var r=d({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},"unload"===n.delivery?{transport:"sendBeacon",send_instantly:!0}:{},"immediate"===n.delivery?{send_instantly:!0}:{});return this._notRateLimited(this.instance.capture(e,t,r))},t._notRateLimited=function(e){var t;return!ri(e)||!(null!=(t=this.instance.rateLimiter)&&t.lastEventRateLimited)},t.registerDynamicEventProperties=function(e){return wh(this.instance._registerExtensionEventProperties(e))},t.sendRequest=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a,u=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),i=null!==(r=n.target)&&void 0!==r?r:"api",o=n.query?Hv(t,n.query):t,s=this.instance.requestRouter.endpointFor(i,o),a={method:n.method,url:s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:"flags"===n.target&&"best-available"===n.compression?jr.Base64:void 0,timestampMode:n.sentAt},"api"===i&&"/i/v1/logs"===t&&(a.batchKey="logs"),"sendBeacon"!==n.transport){e.n=1;break}return this.instance._send_request(a),e.a(2,{statusCode:202});case 1:return e.a(2,new Promise(function(e){var t,n,r;a.callback=e,"flags"===i&&null!=(t=u.instance.config.metrics)&&t.flags&&(a.onDispatch=function(){n=ng()},a.onSend=function(e){r=ig(e)},a.callback=function(t){var i;if(e(t),!ri(n)){var o=n,a=ng();try{var l=ug(s,t);if(u._recordFlagsHistogram("posthog.flags.request.duration",a-o,sg,l),t.statusCode&&r)return void r.take(a,function(e){return u._recordFlagsSplit(e,o,a,l)})}catch(e){Sl.error("Failed to record the /flags request timing",e)}null==(i=r)||i.stop()}}),u.instance._send_request(a)}))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t._recordFlagsSplit=function(e,t,n,r){if(e.responseEnd>=e.startTime)try{var i=Math.min(e.responseEnd,n);this._recordFlagsHistogram("posthog.flags.request.pre_send_duration",e.startTime-t,ag,r),this._recordFlagsHistogram("posthog.flags.request.network_duration",i-e.startTime,sg,r),this._recordFlagsHistogram("posthog.flags.request.main_thread_duration",n-i,ag,r)}catch(e){Sl.error("Failed to record the /flags request timing split",e)}},t._recordFlagsHistogram=function(e,t,n,r){var i;null==(i=this.instance.metrics)||i.histogram(e,t,{unit:"ms",attributes:d({},r),bounds:n})},a(e,[{key:"logger",get:function(){return this._logger}},{key:"distinctId",get:function(){return this.instance.get_distinct_id()}},{key:"anonymousId",get:function(){var e;return null!==(e=this.instance.get_property("$device_id"))&&void 0!==e?e:this.distinctId}},{key:"deviceId",get:function(){var e=this.instance.get_property(Xh);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:Jh.LIB_NAME,version:Jh.LIB_VERSION}}},{key:"initialPersonProperties",get:function(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}},{key:"groups",get:function(){return this.instance.getGroups()}},{key:"session",get:function(){try{var e,t,n,r,i,o=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==o?void 0:o.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==o?void 0:o.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(r=null==o?void 0:o.sessionStartTimestamp)&&void 0!==r?r:0,lastActivityTimestamp:null!==(i=null==o?void 0:o.lastActivityTimestamp)&&void 0!==i?i:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}},{key:"isOptedOut",get:function(){return this.instance.has_opted_out_capturing()}},{key:"canCapture",get:function(){return ei(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}},{key:"isRateLimited",get:function(){var e;return!(null==(e=this.instance.rateLimiter)||!e.isClientRateLimited)}},{key:"projectToken",get:function(){return this.instance.config.token}}])}(),dg=function(e){var t;return null!=e&&e.config.require_subresource_integrity?e.__loadExternalDependency:null==(t=jh.__PosthogExtensions__)?void 0:t.loadExternalDependency},fg=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.get=function(){var e,t,n,r,i=null==(e=this._instance)?void 0:e.config;return{disableSurveys:!(null==i||!i.disable_surveys),cookielessMode:!(null==i||!i.cookieless_mode),advancedEnableSurveys:!(null==i||!i.advanced_enable_surveys),requestTimeoutMs:null!==(t=null==i?void 0:i.surveys_request_timeout_ms)&&void 0!==t?t:1e4,prefillFromUrl:!(null==i||null==(n=i.surveys)||!n.prefillFromUrl),automaticDisplay:!(null!=i&&i.disable_surveys_automatic_display),featureFlagEvaluation:!(null!=i&&i.advanced_disable_feature_flags),overrideLanguage:null==i?void 0:i.override_display_language,prepareStylesheet:null==i?void 0:i.prepare_external_dependency_stylesheet,get_current_url:null==i?void 0:i.get_current_url,uiHost:null==(r=this._instance)||null==(r=r.requestRouter)?void 0:r.endpointFor("ui","")}},t.getExtensions=function(){var e=null==jh?void 0:jh.__PosthogExtensions__;if(e&&this._instance){var t=this._instance,n=e.generateSurveys,r=dg(t);return{generateSurveys:n?function(e){return n(t,e)}:void 0,loadExternalDependency:r?function(e){return r(t,"surveys",e)}:void 0}}},t.onMatchingConditionsChanged=function(e){var t,n,r=null==(t=this._instance)?void 0:t._addCaptureHook(function(t){"$pageview"!==t&&t!==cl&&t!==dl&&t!==fl||e()}),i=function(){return e()};Ml(Ih,"PHSurveyShown",i);var o=!1,s=null==(n=this._instance)?void 0:n.onFeatureFlags(function(){o&&e()});return o=!0,function(){o=!1,null==r||r(),null==s||s(),null==Ih||Ih.removeEventListener("PHSurveyShown",i)}},e}(),hg=function(e){"use strict";function t(t){return e.call(this,new fg(t))||this}return r(t,e),t}(Fh),pg=new WeakMap,_g=function(e,t){var n=function(e){var t,n=new fg(e);if(!e)return{get config(){return n.get()}};if(null!=(t=e.surveys)&&t.getRenderContext)return e.surveys.getRenderContext();var r=pg.get(e);return r||(r={client:new cg(e),get config(){return n.get()},surveys:e.surveys},pg.set(e,r)),r}(e);return n?function(e,t){if("u">=typeof document&&"u">=typeof window){var n=new dh(e);return!1===e.config.automaticDisplay?(Zl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n):!1===t?(Zl.info("There are no surveys to load or Surveys is disabled in the project settings."),n):(n.startAutomaticDisplay(),n)}}(n,t):void 0};function vg(e,t,n){return Vh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}jh.__PosthogExtensions__=jh.__PosthogExtensions__||{},jh.__PosthogExtensions__.generateSurveys=_g,jh.extendPostHogWithSurveys=_g;var gg=function(e){return _i(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message)},mg=kl("[Error tracking]"),yg="webkit-masked-url:",bg=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],wg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",yg],Sg=["__firefox__","__gCrWeb"];function kg(){return new Qo([new vs,new Ps,new ms,new gs,new xs,new ks,new bs,new Cs],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var i=[],o=t.split("\n"),s=Math.min(o.length,r+1e3),a=[],u=r;s>u;u++){var l=o[u];if(1024>=l.length){var c=us.test(l)?l.replace(us,"$1"):l;if(!c.match(/\S*Error: /)){for(var f=0,h=n;h.length>f;f++){var _=(0,h[f])(c,e);if(_){i.push(_);var v=cs(i);if(v){for(var g=a.length-1;g>=0;g--){var m=a[g];if(v.start>=m.start+m.length)break;a.pop()}a.push(v)}break}}if(ps(i,a)>=50)break}}}var y=[].concat(a).sort(function(e,t){return t.start-e.start}),b=y[y.length-1];if(b){var w=fs(i,b);i.splice(b.start-w,w);for(var S,k=p(y);!(S=k()).done;)S.value.start-=w}for(var x,C=p(y);!(x=C()).done;)ds(i,x.value);return a.some(function(e){return 0===e.start&&i.length===e.length})&&function(e){for(var t=e.map(function(e){return e.function+"|"+e.filename+"|"+e.lineno+"|"+e.colno+"|"+e.module}),n=0,r=1;t.length>r;r++)_s(t,r,n)&&(n=r);e.push.apply(e,e.splice(0,n))}(i),function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(function(e){return d({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||"?"});var n})}(i)}}("web:javascript",is,as))}var xg=function(){"use strict";function e(e){var t,n;this._suppressionRules=[],this._errorPropertiesBuilder=kg(),this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property("$error_tracking_suppression_rules"))&&void 0!==t?t:[],this._exceptionStepsConfig=Rs(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new As(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=Rs(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,r,i;if(e.ok){var o=e.config;if("errorTracking"in o){var s=null!==(t=null==(n=o.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[],a=null==(r=o.errorTracking)?void 0:r.captureExtensionExceptions;this._suppressionRules=s,this._instance.persistence&&this._instance.persistence.register(((i={})[lp]=this._suppressionRules,i[cp]=a,i))}}},t.buildProperties=function(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})},t.addExceptionStep=function(e,t){if(this._exceptionStepsConfig.enabled)try{var n;if(!ii(e)||0===e.trim().length)return void mg.warn("Ignoring exception step because message must be a non-empty string");var r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,r){return Fs.has(r)?(t.push(r),n):(n[r]=e[r],n)},{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),i=r.sanitizedProperties,o=r.droppedKeys;o.length>0&&mg.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this._exceptionStepsBuffer.add(d(((n={})[Es]=e,n[Ts]=(new Date).toISOString(),n),i))}catch(e){mg.error("Failed to add exception step. Ignoring breadcrumb.",e)}},t.sendExceptionEvent=function(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void mg.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void mg.info("Skipping exception capture because it was thrown by an extension");if(!this._captureExtensionExceptions&&this._isInjectedBrowserScriptException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by an injected browser script"),void mg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void mg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this._exceptionStepsConfig.enabled&&ai(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,r=function(){if("u">typeof process){var e,t=null==(e=process.env.POSTHOG_RELEASE_ID)?void 0:e.trim();if(t)return t}var n=globalThis._posthogReleaseId;return"string"==typeof n&&n.length>0?n:void 0}();r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return gg(e)||mg.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void(gg(e)||mg.error("Failed to process exception event. Ignoring this exception.",e))}},t._addBufferedExceptionSteps=function(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:d({},e,{$exception_steps:t})}catch(t){return mg.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}},t._addDroppedExceptionStep=function(e){var t;this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add(((t={})[Es]=e,t[Ts]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return ti(e)?d({},e):{}},t._getExceptionStepsConfig=function(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}},t._matchesSuppressionRule=function(e){if(0===e.length)return!1;try{var t=e.reduce(function(e,t){var n=t.type,r=t.value;return ii(n)&&n.length>0&&e.$exception_types.push(n),ii(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(function(e){var n=e.values.map(function(e){var n=Ql[e.operator],r=t[e.key];if(!n||!r)return!1;var i=Xr(e.value)?e.value:[e.value];return i.length>0&&n(i,r)});return"OR"===e.type?n.some(Boolean):n.every(Boolean)})}catch(e){return mg.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}},t._isExtensionException=function(e){var t=e.flatMap(function(e){var t,n;return null!==(t=null==(n=e.stacktrace)?void 0:n.frames)&&void 0!==t?t:[]}),n=t.filter(function(e){var t=e.filename;return!!t&&wg.some(function(e){return t.startsWith(e)})});return 0!==n.length&&(!n.every(function(e){var t=e.filename;return!!t&&t.startsWith(yg)})||e.some(function(e){var t=e.value;return"NoResponse"===e.type||ii(t)&&bg.some(function(e){var n=e.value;return e.exact?t===n:t.includes(n)})})&&!t.some(function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(yg))}))},t._isInjectedBrowserScriptException=function(e){return e.some(function(e){var t=e.value;return ii(t)&&Sg.some(function(e){return t.includes(e)})})},t._isPostHogException=function(e){if(e.length>0){var t,n,r,i,o=null!==(t=null==(n=e[0].stacktrace)?void 0:n.frames)&&void 0!==t?t:[];return null!==(r=null==(i=o[o.length-1])||null==(i=i.filename)?void 0:i.includes("posthog.com/static"))&&void 0!==r&&r}return!1},t._isExceptionList=function(e){return!ai(e)&&Xr(e)},a(e,[{key:"_captureExtensionExceptions",get:function(){var e,t,n=!!this._instance.get_property(cp);return null!==(e=null!==(t=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==t?t:n)&&void 0!==e&&e}}])}(),Cg=kl("[ExceptionAutocapture]"),Pg=kg(),Eg=function(e,t){try{return e()}catch(e){return t}},Tg=function(e,t){return Eg(function(){return e(t())},void 0)},Fg=function(e){return Eg(function(){return ei(e)&&ei(e.call)},!1)},Ig=function(e,t){return Eg(function(){e[t].__POSTHOG_INSTRUMENTED__=!0},void 0)},Rg=function(e,t,n){Eg(function(){var n;null==(n=e[t])||delete n.__POSTHOG_INSTRUMENTED__},void 0),Eg(function(){e[t]=n},void 0)},Ag=function(e){var t=Ih;t||Cg.info("window not available, cannot wrap onerror");var n=Eg(function(){return t.onerror},void 0);return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];return Tg(e,function(){return Pg.buildFromUnknown(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(null!=o)return o;if(ii(t)&&ii(n)&&n.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:n,lineno:r,colno:i})}catch(e){return t}return t}(i),{mechanism:{handled:!1}})}),!!Fg(n)&&null!==(t=n.apply(void 0,i))&&void 0!==t&&t},Ig(t,"onerror"),function(){return Rg(t,"onerror",n)}},Mg=function(e,t){void 0===t&&(t=!1);var n=Ih;n||Cg.info("window not available, cannot wrap onUnhandledRejection");var r=Eg(function(){return n.onunhandledrejection},void 0);return n.onunhandledrejection=function(n){var i;return Tg(e,function(){return Pg.buildFromUnknown(n,{mechanism:{handled:!1}})}),Fg(r)?null!==(i=r(n))&&void 0!==i&&i:t},Ig(n,"onunhandledrejection"),function(){return Rg(n,"onunhandledrejection",r)}},Og={wrapOnError:Ag,wrapUnhandledRejection:Mg,wrapConsoleError:function(e){var t=console;t||Cg.info("console not available, cannot wrap console.error");var n=Eg(function(){return t.error},void 0);return t.error=function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];Eg(function(){return r.length>1&&ii(r[0])&&(/^\[PostHog\.js\](?: |$)/.test(r[0])||"rrweb logger error:"===r[0])},!1)||Tg(e,function(){var e;e=1==r.length?r[0]:r.join(" ");var t=r.find(function(e){return e instanceof Error});return Pg.buildFromUnknown(t||e,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Fg(n)&&n.apply(void 0,r)},Ig(t,"error"),function(){return Rg(t,"error",n)}}};jh.__PosthogExtensions__=jh.__PosthogExtensions__||{},jh.__PosthogExtensions__.errorWrappingFunctions=Og,jh.posthogErrorWrappingFunctions=Og;var Lg=function(e,t){if(ei(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,r=!si(n)&&"object"==typeof n&&Xr(n.errors_to_ignore)?n.errors_to_ignore.reduce(function(e,t){try{e.push(new RegExp(t))}catch(e){Cg.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e},[]):[],i=function(t){try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){Cg.error("Failed to capture exception for a legacy client",e)}};Ag(function(e){r.some(function(t){return e.$exception_list.some(function(e){return t.test(e.value||"")})})||i(e)}),Mg(i,!0)}};jh.extendPostHogWithExceptionAutoCapture=Lg,jh.extendPostHogWithExceptionAutocapture=Lg;var Dg=function(){},$g=function(e){var t;if(ei(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function qg(e,t,n){try{if(!(t in e))return Dg;var r={next:e[t]},i=n(function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)});return ei(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,function(){if(e[t]!==i)for(var n=e[t],o=$g(n);o;){if(o.next===i)return void(o.next=r.next);o=$g(n=o.next)}else e[t]=r.next}}catch(e){return Dg}}var Ng="X-POSTHOG-SESSION-ID",Bg="X-POSTHOG-WINDOW-ID",jg="X-POSTHOG-DISTINCT-ID",Hg=[Ng,Bg,jg],zg="traceparent",Ug=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Wg=function(e,t){return{}.hasOwnProperty.call(e,t)},Vg=function(e){return"object"==typeof e&&!si(e)||ei(e)},Gg=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},Kg=function(e){try{var t;return Gg(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Ih||null==(t=Ih.location)?void 0:t.href).toString()}catch(e){return}},Qg=function(e,t,n,r,i){var o;try{o=new URL(r).hostname}catch(e){return!1}if(!e)return!1;if(Xr(e)&&!e.includes(o))return!1;var s=!1,a=function(e){return ei(e)?e():e}(t);if(a&&"$posthog_cookieless"!==a){try{i.set(jg,a)}catch(e){return!1}s=!0}if(n){var u=n.checkAndGetSessionAndWindowId(!0),l=u.windowId;i.set(Ng,u.sessionId),i.set(Bg,l),s=!0}return s},Yg=function(e){var t=new Uint8Array(e),n=null==Ih?void 0:Ih.crypto;if(n&&ei(n.getRandomValues))n.getRandomValues(t);else for(var r=0;e>r;r++)t[r]=Math.floor(256*Math.random());for(var i="",o=0;e>o;o++)i+=(16>t[o]?"0":"")+t[o].toString(16);return i},Jg=function(e){for(var t=Yg(e);/^0+$/.test(t);)t=Yg(e);return t},Zg=function(){return"00-"+Jg(16)+"-"+Jg(8)+"-01"},Xg=function(e){try{return new URL(e).origin}catch(e){return}},em=function(e,t){if(!Xr(e)||0===e.length)return!1;var n;try{n=new URL(t)}catch(e){return!1}for(var r=0;e.length>r;r++){var i=e[r];if(ii(i))if(i.indexOf("://")>-1){if(Xg(i)===n.origin)return!0}else if(i.toLowerCase()===n.hostname)return!0}return!1},tm=function(e,t,n){return!(n.has(zg)||!em(e,t)||(n.set(zg,Zg()),0))};jh.__PosthogExtensions__=jh.__PosthogExtensions__||{};var nm={_patchFetch:function(e,t,n,r){return qg(Ih,"fetch",function(i){return function(o,s){var a=arguments.length>1?[o,s]:[o],u=a;try{var l=Kg(o);if(l)if(Gg(o)){var c=new Request(o,s);u=[c];var f=new Headers;try{Qg(e,t,n,c.url,f),f.forEach(function(e,t){return c.headers.set(t,e)})}catch(e){}tm(r,c.url,c.headers)}else{var h=new Headers(Vg(s)?s.headers:void 0),p=Qg(e,t,n,l,h),_=tm(r,l,h);if(p||_){var v=function(e,t){if(ri(e)||si(e))return{headers:t};if(Vg(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(n);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),r}return new Proxy({headers:t},{get:function(e,t){return Wg(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return Wg(e,t)||t in n},ownKeys:function(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(n).forEach(function(e){return t.add(e)}),Ug.forEach(function(e){e in n&&t.add(e)}),Array.from(t)},getOwnPropertyDescriptor:function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r)return r;if("string"==typeof t&&Ug.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get:function(){return Reflect.get(n,t,n)}};var i=Reflect.getOwnPropertyDescriptor(n,t);return i?d({},i,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(s,h);v&&(u=[o,v])}}}catch(e){u=a}return i.apply(this,u)}})},_patchXHR:function(e,t,n,r){var i=Xr(r)&&"undefined"!=typeof WeakMap?new WeakMap:void 0,o=qg(Ih.XMLHttpRequest.prototype,"open",function(r){return function(o,s,a,u,l){void 0===a&&(a=!0);var c=this,d=new Headers,f=Kg(s);if(f)try{Qg(e,t,n,f,d)}catch(e){d=new Headers}i&&(i.delete(c),f&&i.set(c,f));var h=r.call(c,o,s,a,u,l);return Hg.forEach(function(e){var t=d.get(e);if(t)try{c.setRequestHeader(e,t)}catch(e){}}),h}});if(!i)return o;var s,a=Ih.XMLHttpRequest.prototype,u=qg(a,"setRequestHeader",function(e){return function(t,n){return function(e){try{return String(e).toLowerCase()===zg}catch(e){return!1}}(t)&&i.delete(this),e.call(this,t,n)}}),l=qg(a,"send",function(e){return function(){var t=i.get(this);if(t){i.delete(this);try{var n;!em(r,t)||function(e){try{return!!Ih&&new URL(e,Ih.location.href).origin===Ih.location.origin}catch(e){return!1}}(t)&&function(e){try{for(var t=e,n=0;ei(t)&&20>n;n++){var r,i,o,s=t;if(s.__wrapped)return!(null==Ih||null==(r=Ih[Symbol.for("opentelemetry.js.api.1")])||!r.propagation);t=null==(i=null!==(o=s.__posthog_layer__)&&void 0!==o?o:s.__rrweb_layer__)?void 0:i.next}return!1}catch(e){return!1}}(null==(n=s)?void 0:n.next)||this.setRequestHeader(zg,Zg())}catch(e){}}return e.apply(this,arguments)}});try{var c;s=null==(c=a.send)?void 0:c.__posthog_layer__}catch(e){}return function(){l(),u(),o()}}};jh.__PosthogExtensions__.tracingHeadersPatchFns=nm,jh.postHogTracingHeadersPatchFns=nm;var rm=function(e){if(Mh){try{for(var t=e+"=",n=Mh.cookie.split(";").filter(function(e){return e.length}),r=0;n.length>r;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},im="",om=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var sm=null,am={_is_supported:function(){if(!si(sm))return sm;if(sm=!1,Mh)try{var e="__ph_cookie_support_"+xu();am._set(e,"xyz"),sm='"xyz"'===rm(e),am._remove(e)}catch(e){sm=!1}return sm},_error:function(e){Sl.error("cookieStore error: "+e)},_get:rm,_parse:function(e){var t;try{t=JSON.parse(am._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(!Mh)return!1;try{var o="",s="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Mh),im)return im;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+xu();!im&&r--;){var o=n.slice(r).join("."),s=i+"=1;domain=."+o+";path=/";t.cookie=s+";max-age=3",t.cookie.includes(i)&&(t.cookie=s+";max-age=0",im=o)}return im}(e);if(!n){var r=function(e){var t=e.match(om);return t?t[0]:""}(e);r!==n&&Sl.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(Mh.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),o="; expires="+u.toUTCString()}i&&(s="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&Sl.warn("cookieStore warning: large cookie, len="+l.length),Mh.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Mh&&Mh.cookie&&(!t||!si(rm(e))))try{am._set(e,"",-1,t)}catch(e){return}}},um=null,lm={_is_supported:function(){if(!si(um))return um;var e=!0;if(ri(Ih))e=!1;else try{var t="__mplssupport__";lm._set(t,"xyz"),'"xyz"'!==lm._get(t)&&(e=!1),lm._remove(t)}catch(t){e=!1}return e||Sl.error("localStorage unsupported; falling back to cookie store"),um=e,e},_error:function(e){Sl.error("localStorage error: "+e)},_get:function(e){try{return null==Ih?void 0:Ih.localStorage.getItem(e)}catch(e){lm._error(e)}return null},_parse:function(e){try{return JSON.parse(lm._get(e))||{}}catch(e){}return null},_set:function(e,t){try{return null==Ih||Ih.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){lm._error(e)}return!1},_remove:function(e){try{null==Ih||Ih.localStorage.removeItem(e)}catch(e){lm._error(e)}}},cm=[Zf,Uf,Yf,Wf,th,Kf,Gf,Vf,Xf],dm=[Xh,Zh,Sp,kp,Ap,Rp,rp,Pp],fm=function(e){return e+"_cpm"},hm=["__proto__","constructor","prototype"],pm=function(e){if(!ti(e))return{};var t={};return Object.keys(e).forEach(function(n){-1===hm.indexOf(n)&&(t[n]=e[n])}),t},_m=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(dm,t).forEach(function(t){var r=e[t];ri(r)||si(r)||""===r||(n[t]=r)}),n},vm=function(e){for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},gm=function(e,t){return{p:t,f:vm(JSON.stringify(e))}},mm=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=am._parse(fm(e)),r=(null==n?void 0:n.f)===vm(t)&&Xr(n.p);return{properties:r?n.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},ym=function(e,t){return t+"|"+(am._get(fm(e))||"")},bm={},wm={_is_supported:function(){return!0},_error:function(e){Sl.error("memoryStorage error: "+e)},_get:function(e){return e in bm?bm[e]:null},_parse:function(e){return e in bm?bm[e]:null},_set:function(e,t){return bm[e]=t,!0},_remove:function(e){delete bm[e]}},Sm=null,km={_is_supported:function(){if(!si(Sm))return Sm;if(Sm=!0,ri(Ih))Sm=!1;else try{var e="__support__";km._set(e,"xyz"),'"xyz"'!==km._get(e)&&(Sm=!1),km._remove(e)}catch(e){Sm=!1}return Sm},_error:function(e){Sl.error("sessionStorage error: ",e)},_get:function(e){try{return null==Ih?void 0:Ih.sessionStorage.getItem(e)}catch(e){km._error(e)}return null},_parse:function(e){try{return JSON.parse(km._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Ih||Ih.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){km._error(e)}return!1},_remove:function(e){try{null==Ih||Ih.sessionStorage.removeItem(e)}catch(e){km._error(e)}}},xm=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return"always"===this._config.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._config.cookieless_mode},t.isOptedIn=function(){return!this.isOptedOut()},t.isExplicitlyOptedOut=function(){return 0===this.consent},t.isRejected=function(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default},t.optInOut=function(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)},t.reset=function(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)},t._getDnt=function(){return!!this._config.respect_dnt&&[null==Ah?void 0:Ah.doNotTrack,null==Ah?void 0:Ah.msDoNotTrack,jh.doNotTrack,null==Ah?void 0:Ah.globalPrivacyControl].some(function(e){return yi(e)})},a(e,[{key:"_config",get:function(){return this._instance.config}},{key:"consent",get:function(){return this._getDnt()?0:this._storedConsent}},{key:"_storageKey",get:function(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:"__ph_opt_in_out_"+t)}},{key:"_storedConsent",get:function(){var e=this._storage._get(this._storageKey);return yi(e)?1:Vr(bi,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?lm:am,n=t._is_supported()?t:wm;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var r="localStorage"===e?am:lm;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(yi(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}(),Cm=kl("[Dead Clicks]"),Pm=function(){return!0},Em=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(fp)),r=e.instance.config.capture_dead_clicks;return ci(r)?r:!!ti(r)||n},Tm=function(){"use strict";function e(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}var t=e.prototype;return t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register(((t={})[fp]=n.captureDeadClicks,t)),this.startIfEnabledOrStop())}},t.startIfEnabledOrStop=function(){var e=this;this.isEnabled(this)?this._loadScript(function(){e._start()}):this.stop()},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=dg(this.instance))||n(this.instance,"dead-clicks-autocapture",function(t){t?Cm.error("failed to load script",t):e()})},t._start=function(){var e;if(Mh){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=jh.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=ti(this.instance.config.capture_dead_clicks)?d({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=jh.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Mh),Cm.info("starting...")}}else Cm.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Cm.info("stopping..."))},a(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Fm=kl("[SegmentIntegration]");function Im(e,t,n){void 0===n&&(n=!0);var r=e.config.segment;if(!r)return t();var i,o=function(e){return ei(e.register)}(i=r)?{analytics:i}:i,s=o.analytics,a=o.filterProperties;!function(e,t,n,r){var i=function(t){var i=function(){return t.anonymousId()||xu()};e.config.get_device_id=i,r&&t.id()&&(e.register({distinct_id:t.id(),$device_id:i()}),e.persistence.set_property(Pp,Gp)),n(r?void 0:t.anonymousId()||void 0)},o=t.user();"then"in o&&ei(o.then)?o.then(i):i(o)}(e,s,function(n){s.register(function(e,t,n){var r=(void 0===n?{}:n).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Fm.warn("This browser does not have Promise support, and can not use the segment integration");var i=function(n,i){if(!i)return n;var o=!!t&&n.event.anonymousId===t&&!n.event.userId;o||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Fm.info("No userId set, resetting PostHog"),e.reset()),o||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Fm.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var s=e.calculateEventProperties(i,n.event.properties);if(!ai(r)){for(var a=n.event.properties||{},u={},l=0,c=Object.keys(s);c.length>l;l++){var f=c[l];Jr.call(a,f)||(u[f]=s[f])}var h=function(e,t){for(var n,r=Xr(e)?e:[e],i=d({},t),o=p(r);!(n=o()).done;){var s=n.value;try{if(i=s(i),ai(i))return null}catch(e){return Fm.error("Error in Segment filterProperties:",e),null}}return i}(r,u);if(ai(h))return n;s=h}return n.event.properties=Object.assign({},s,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return i(e,e.event.event)},page:function(e){return i(e,Yp)},identify:function(e){return i(e,Zp)},screen:function(e){return i(e,"$screen")}}}(e,n,{filterProperties:a})).then(function(){t()},function(e){Fm.error("Failed to register the Segment integration",e),t()})},n)}var Rm="posthog-js";function Am(e,t){var n=void 0===t?{}:t,r=n.organization,i=n.projectId,o=n.prefix,s=n.severityAllowList,a=void 0===s?["error"]:s,u=n.sendExceptionsToPostHog,l=void 0===u||u;return function(t){var n,s,u,c,f,h;if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _=(null==(n=t.exception)?void 0:n.values)||[],v=_.map(function(e){return d({},e,{stacktrace:e.stacktrace?d({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(function(e){return d({},e,{platform:"web:javascript"})})}):void 0})}),g={$exception_message:(null==(s=_[0])?void 0:s.value)||t.message,$exception_type:null==(u=_[0])?void 0:u.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=_[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(f=_[0])?void 0:f.type,$sentry_tags:t.tags};return r&&i&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),l&&(null==(h=e.exceptions)||h.sendExceptionEvent(g)),t}}var Mm=function(e,t,n,r,i,o){"use strict";this.name=Rm,this.setupOnce=function(s){s(Am(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==o||o}))}},Om=function(){"use strict";function e(e){var t=this;this._onSessionIdChange=function(e,n,r){r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(Sl.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),t._currentPageview=void 0,t._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}var t=e.prototype;return t._setupSessionRotationHandler=function(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)},t.destroy=function(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0},t.doPageView=function(e,t){var n,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Ih?void 0:Ih.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r},t.doPageLeave=function(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)},t.doEvent=function(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}},t._previousPageViewProperties=function(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var o=i.maxScrollHeight,s=i.lastScrollY,a=i.maxScrollY,u=i.maxContentHeight,l=i.lastContentY,c=i.maxContentY;if(!(ri(o)||ri(s)||ri(a)||ri(u)||ri(l)||ri(c))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var d=o>1?xi(s/o,0,1,Sl):1,f=o>1?xi(a/o,0,1,Sl):1,h=u>1?xi(l/u,0,1,Sl):1,p=u>1?xi(c/u,0,1,Sl):1;r=Pl(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r},e}(),Lm=["flags","surveys"],Dm=((u={}).$people_distinct_id={exposure:"hidden"},u[tp]={exposure:"hidden"},u.__cmpns={exposure:"hidden"},u[sp]={exposure:"hidden"},u[rp]={exposure:"hidden"},u[op]={exposure:"hidden"},u[oh]={exposure:"event"},u[ap]={exposure:"hidden"},u[pp]={exposure:"hidden"},u[up]={exposure:"event"},u[lp]={exposure:"hidden"},u[cp]={exposure:"event"},u[dp]={exposure:"event"},u[fp]={exposure:"event"},u[hp]={exposure:"hidden"},u[_p]={exposure:"event"},u[vp]={exposure:"hidden"},u.$session_recording_enabled_server_side={exposure:"hidden"},u[Sp]={exposure:"hidden"},u[kp]={exposure:"event"},u[gp]={exposure:"event",shouldSkipFromEventProperties:function(e){return si(e)}},u.$session_past_minimum_duration={exposure:"event"},u.$session_recording_url_trigger_activated_session={exposure:"event"},u.$session_recording_event_trigger_activated_session={exposure:"event"},u.$debug_first_full_snapshot_timestamp={exposure:"event"},u.$sess_rec_flush_size={exposure:"hidden"},u[Yf]={exposure:"hidden",storageGroup:"flags"},u[Uf]={exposure:"hidden",storageGroup:"flags"},u[zf]={exposure:"hidden"},u[Wf]={exposure:"hidden",storageGroup:"flags"},u[th]={exposure:"hidden",storageGroup:"flags"},u[Kf]={exposure:"hidden",storageGroup:"flags",volatile:!0},u[Qf]={exposure:"hidden",storageGroup:"flags"},u[nh]={exposure:"hidden"},u[rh]={exposure:"hidden"},u[Zf]={exposure:"hidden"},u[Jf]={exposure:"hidden"},u[Ar]={exposure:"hidden",storageGroup:"surveys"},u[Mr]={exposure:"hidden",storageGroup:"surveys",volatile:!0},u[Lr]={exposure:"event"},u[Dr]={exposure:"hidden"},u[$r]={exposure:"hidden"},u[Cp]={exposure:"hidden"},u.$product_tours_activated={exposure:"hidden"},u.$product_tours_activated_session={exposure:"hidden"},u.$conversations_widget_session_id={exposure:"event"},u.$conversations_ticket_id={exposure:"event"},u.$conversations_widget_state={exposure:"event"},u.$conversations_user_traits={exposure:"event"},u[Xf]={exposure:"hidden"},u[eh]={exposure:"hidden"},u[xp]={exposure:"event"},u[Vf]={exposure:"hidden"},u[Gf]={exposure:"hidden",storageGroup:"flags",volatile:!0},u[Pp]={exposure:"hidden"},u[Ep]={exposure:"hidden"},u[Tp]={exposure:"hidden"},u[Fp]={exposure:"hidden"},u[Ip]={exposure:"hidden"},u[Rp]={exposure:"hidden"},u[Ap]={exposure:"hidden"},u[mp]={exposure:"event"},u[yp]={exposure:"event"},u[bp]={exposure:"event"},u[wp]={exposure:"event"},u[Lp]={exposure:"event"},u[Dp]={exposure:"event"},u[$p]={exposure:"hidden"},u[qp]={exposure:"hidden"},u[Np]={exposure:"hidden"},u[Bp]={exposure:"hidden"},u[jp]={exposure:"hidden"},u[Hp]={exposure:"hidden"},u[zp]={exposure:"hidden"},u[Up]={exposure:"hidden"},u[Wp]={exposure:"hidden"},u.$session_recording_start_reason={exposure:"event"},u),$m=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],qm=function(e){var t=Dm[e];if(t)return t;for(var n=0,r=$m;r.length>n;n++){var i=r[n],o=i[1];if(0===e.indexOf(i[0]))return o}},Nm=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Bm=["ScCid","SsCid"],jm={sccid:Bm},Hm=function(){return[].concat(Nm,Bm,["sscid"])}(),zm=function(){return["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Nm)}(),Um="<masked>",Wm=["li_fat_id"];function Vm(e,t,n){if(!Mh)return{};var r,i=t?[].concat(Hm,n||[]):[],o=Gm(Kh(Mh.URL,i,Um),e);return Pl((r={},Cl(Wm,function(e){var t=rm(e);r[e]=t||null}),r),o)}function Gm(e,t){var n=zm.concat(t||[]),r={};return Cl(n,function(t){var n=Gh(e,t);!n&&Jr.call(jm,t)&&xl(jm[t],function(t){n=n||Gh(e,t)}),r[t]=n||null}),r}function Km(e){var t=function(e){return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!si(t)){r.$search_engine=t;var i=Mh?Gh(Mh.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function Qm(){return navigator.language||navigator.userLanguage}var Ym="$direct";function Jm(){return(null==Mh?void 0:Mh.referrer)||Ym}function Zm(e,t,n){var r;void 0===n&&(n=!1);var i=e?[].concat(Hm,t||[]):[],o=null==(r=n?Ho(null==Oh?void 0:Oh.href):null==Oh?void 0:Oh.href)?void 0:r.substring(0,1e3);return{r:Jm().substring(0,1e3),u:o?Kh(o,i,Um):void 0}}function Xm(e,t,n,r){var i;void 0===t&&(t=!1);var o=e.r,s=e.u,a=t?Ho(s):s,u=a&&n?Kh(a,[].concat(Hm,r||[]),Um):a,l={$referrer:o,$referring_domain:null==o?void 0:o==Ym?Ym:null==(i=Hh(o))?void 0:i.host};if(u){l.$current_url=u;var c=Hh(u);l.$host=null==c?void 0:c.host,l.$pathname=null==c?void 0:c.pathname,Pl(l,Gm(u))}return o&&Pl(l,Km(o)),l}function ey(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var ty={flags:Gf,surveys:Mr},ny=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ry=function(e){return e+"_cookie_identity_change_pending"},iy=function(e){for(var t,n="",r=0,i=p(e);!(t=i()).done;){var o=t.value,s=encodeURIComponent(JSON.stringify(o).slice(1,-1)).length;if(r+s>1e3)break;n+=o,r+=s}return n},oy="main",sy=[Yf,Uf,Wf,th,Kf,Gf,Qf,Zf],ay=function(e){return-1!==sy.indexOf(e)},uy=[rp,op],ly=function(e){return-1!==uy.indexOf(e)},cy=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return e===t}},dy=function(e){if(!e)return{};var t=JSON.parse(e);return ti(t)?t:{}},fy=function(e){var t,n=e[Wf];return ti(n)?d({},e,((t={})[Wf]=Object.fromEntries(Object.entries(n).map(function(e){var t,n=e[0],r=e[1];if(!ti(r)||!("value"in r)||1!==(null==(t=r.metadata)?void 0:t.config_version))return[n,r];var i=d({},r,{metadata:d({},r.metadata)});delete i.value;for(var o=0,s=["config_version","rule_type","rule_id","variant_key","forced_variant"];s.length>o;o++)delete i.metadata[s[o]];return[n,i]})),t)):e},hy=function(e,t){Cl(e,function(n,r){var i=qm(r);i&&"event"!==i.exposure||{}.hasOwnProperty.call(t,r)||delete e[r]})},py=function(){"use strict";function e(e,t,n,r){var i=this;if(void 0===n&&(n=!0),void 0===r&&(r=!e.cookieless_mode),this._slotState={},this._splitStorageEligible=!1,this._storesIdentityInCookie=!1,this._splitStorage=!1,this._cookieIdentityChangePending=!1,this._cookieSyncSuppressed=!1,this._pendingCrossTabFeatureFlagChanges=new Map,this._storageMigrationInProgress=!1,this._localIdentityChangePending=!1,this._crossTabFeatureFlagIdentityMismatch=!1,this._metaIdentifierChangePending=new Set,this._crossTabFeatureFlagHandlers=new Set,this._config=e,this._ownsSplitStorage=n,this.props={},this._campaign_params_url=void 0,this._name=function(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._disabled=e.disable_persistence||!!t,this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(r),this._markLoadedCrossTabFeatureFlagChangesPending(),e.debug&&Sl.info("Persistence loaded",e.persistence,d({},this.props)),this.update_config(e,e,t),this.save(),Ih){var o=function(){return i.flush()};Ml(Ih,"beforeunload",o,{capture:!1}),Ml(Ih,"pagehide",o,{capture:!1}),this._onStorage=function(e){if(i._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Ih?void 0:Ih.localStorage))&&e.key)if(e.key!==i._name){if(i._splitStorage){var t=Lm.find(function(t){return e.key===i._groupEntryName(t)});t&&i._syncCrossTabFeatureFlagProperties(e.key,t)}}else i._syncCrossTabFeatureFlagProperties(e.key,oy)},Ml(Ih,"storage",this._onStorage)}}var t=e.prototype;return t.reconcileFeatureFlagsBeforeMerge=function(){return!(this._disabled||this._cookieSyncSuppressed||this._storageMigrationInProgress)&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite()},t.markCrossTabFeatureFlagChanges=function(e){var t=this;Object.entries(e).forEach(function(e){var n=e[0],r=e[1],i=t._pendingCrossTabFeatureFlagChanges.get(n);if(ay(n)&&!0!==i)if(!0!==r){var o=new Set(i||[]);r.forEach(function(e){return o.add(e)}),o.size&&t._setCrossTabFeatureFlagChangesPending(n,o)}else t._setCrossTabFeatureFlagChangesPending(n,!0)})},t.onCrossTabFeatureFlagChange=function(e){var t=this;return this._crossTabFeatureFlagHandlers.add(e),function(){return t._crossTabFeatureFlagHandlers.delete(e)}},t.destroy=function(){this._onStorage&&Ih&&(Ih.removeEventListener("storage",this._onStorage),this._onStorage=void 0),this._crossTabFeatureFlagHandlers.clear()},t._syncCrossTabFeatureFlagProperties=function(e,t,n){if(void 0===n&&(n=!0),this._disabled)return!1;var r,i;try{if(i=lm._get(e),si(i)){var o=this._slotWriteState(t);return o.storageValue=null,t!==oy?o.persisted=!1:this._mergeMetaIdentifierProperties({}),!1}r=dy(i)}catch(e){return!1}t===oy&&this._mergeMetaIdentifierProperties(r);var s=t===oy?r:lm._parse(this._name);if(s&&this._hasCrossTabFeatureFlagIdentityMismatch(s))return!1;var a=this._mergeCrossTabFeatureFlagProperties(r,t,n);return t===oy&&this._splitStorage&&!cy(this._partitionProps().main,r)||this._rememberCrossTabStorageFingerprint(r,t,!0,i),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[Zh],n=e[Zh];return!ri(t)&&!ri(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,r){var i=this._slotWriteState(t);i.storageValue=r,t!==oy&&(i.persisted=n);try{i.fingerprint=this._entryFingerprint(e,t)}catch(e){i.fingerprint=void 0}},t._mergeCrossTabFeatureFlagProperties=function(e,t,n){var r=this,i=!1;return sy.forEach(function(n){var o,s=null==(o=qm(n))?void 0:o.storageGroup;if(!(t===oy&&r._splitStorage&&s||t!==oy&&s!==t)){var a=n in e,u=r._mergePendingCrossTabFeatureFlagChanges(n,a?e[n]:void 0),l=r._pendingCrossTabFeatureFlagChanges.has(n)?n in r.props:a;l===n in r.props&&cy(u,r.props[n])||(l?r._setProp(n,u,!1):r._deleteProp(n,!1),i=!0)}}),i&&n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}),i},t._mergeMetaIdentifierProperties=function(e){var t=this,n=this._storesIdentityInCookie&&this._config.cookieWinsOnConflict?[].concat(dm,this._config.cookie_persisted_properties||[]):[];uy.forEach(function(r){t._metaIdentifierChangePending.has(r)||-1!==n.indexOf(r)||(r in e?cy(e[r],t.props[r])||t._setProp(r,e[r],!1):r in t.props&&t._deleteProp(r,!1))})},t._metaIdentifierCookieSyncEnabled=function(){return this._storesIdentityInCookie&&this._splitStorageEligible&&!this._config.cookieWinsOnConflict},t._adoptMetaIdentifiersFromCookie=function(){var e=this;if(this._metaIdentifierCookieSyncEnabled()){var t;try{t=am._get(this._name)||void 0}catch(e){return}if(t&&t!==this._lastSeenMetaIdentifierCookieValue){var n;this._lastSeenMetaIdentifierCookieValue=t;try{n=pm(JSON.parse(t))}catch(e){return}uy.forEach(function(t){!(t in n)||t in e.props||e._metaIdentifierChangePending.has(t)||e._setProp(t,n[t],!1)})}}},t._rememberMetaIdentifierCookieValue=function(e){if(this._metaIdentifierCookieSyncEnabled())try{var t=JSON.stringify(_m(e,this._config.cookie_persisted_properties||[])),n=am._get(this._name)||void 0;n===t&&(this._lastSeenMetaIdentifierCookieValue=n)}catch(e){}},t._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=lm._get(this._name),r=this._slotWriteState(oy),i=!1,o=!1;if(n!==r.storageValue)if(si(n))ii(r.storageValue)&&this._mergeMetaIdentifierProperties({}),r.storageValue=null;else{if(t=dy(n),this._mergeMetaIdentifierProperties(t),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;o=this._mergeCrossTabFeatureFlagProperties(t,oy,!1),!this._splitStorage||cy(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,oy,!0,n):r.storageValue=n,i=!0}return this._splitStorage&&Lm.forEach(function(n){var r=lm._get(e._groupEntryName(n)),s=e._slotWriteState(n),a=t||{},u=i&&sy.some(function(e){var t;return(null==(t=qm(e))?void 0:t.storageGroup)===n&&e in a});if(r!==s.storageValue||u){if(si(r))return s.storageValue=null,s.persisted=!1,void(u&&(o=e._mergeCrossTabFeatureFlagProperties(a,n,!1)||o));var l=dy(r);o=e._mergeCrossTabFeatureFlagProperties(l,n,!1)||o,e._rememberCrossTabStorageFingerprint(l,n,!0,r)}}),o}catch(e){return!1}},t._setCrossTabFeatureFlagChangesPending=function(e,t){this._pendingCrossTabFeatureFlagChanges.set(e,t);var n=qm(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||oy).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;sy.forEach(function(t){return e._pendingCrossTabFeatureFlagChanges.set(t,!0)})},t._markLoadedCrossTabFeatureFlagChangesPending=function(){var e=this;if(this._splitStorageEligible)try{var t=lm._get(this._name),n=dy(t);this._slotWriteState(oy).storageValue=t,sy.forEach(function(t){var r,i=e._splitStorage?null==(r=qm(t))?void 0:r.storageGroup:void 0,o=i?lm._get(e._groupEntryName(i)):null;if(i){var s=e._slotWriteState(i);s.storageValue=o,s.persisted=!si(o)}var a=i&&!si(o)?dy(o):n;t in e.props?e._markPendingCrossTabFeatureFlagChanges(t,a[t],e.props[t]):t in a&&e._setCrossTabFeatureFlagChangesPending(t,!0)})}catch(e){}},t._mergePendingCrossTabFeatureFlagChanges=function(e,t){var n=this._pendingCrossTabFeatureFlagChanges.get(e);if(!n)return t;if(!0===n)return this.props[e];if("$active_feature_flags"===e){var r=new Set(Xr(t)?t:[]),i=new Set(Xr(this.props[e])?this.props[e]:[]);return n.forEach(function(e){return i.has(e)?r.add(e):r.delete(e)}),Array.from(r)}var o=ti(t)?d({},t):{},s=ti(this.props[e])?this.props[e]:{};return n.forEach(function(e){e in s?o[e]=s[e]:delete o[e]}),o},t._markPendingCrossTabFeatureFlagChanges=function(e,t,n){if(ay(e)){var r=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==r){var i=t;if(this._splitStorageEligible)try{var o,s=this._splitStorage?null==(o=qm(e))?void 0:o.storageGroup:void 0,a=s?this._groupEntryName(s):this._name;i=dy(lm._get(a))[e]}catch(e){}var u=new Set(r||[]);if("$active_feature_flags"===e){if(!ri(t)&&!Xr(t)||!ri(i)&&!Xr(i)||!Xr(n))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var l=new Set(t||[]),c=new Set(i||[]),d=new Set(n);new Set([].concat(l,d)).forEach(function(e){l.has(e)!==d.has(e)&&u.add(e)}),u.forEach(function(e){c.has(e)===d.has(e)&&u.delete(e)})}else{if(!ti(n))return void(cy(i,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!ri(t)&&!ti(t)||ri(t)&&ni(n)&&ri(i))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var f=ti(t)?t:{},h=ti(i)?i:{};new Set([].concat(Object.keys(f),Object.keys(n))).forEach(function(e){e in f==e in n&&cy(f[e],n[e])||u.add(e)}),u.forEach(function(e){e in h==e in n&&cy(h[e],n[e])&&u.delete(e)})}u.size?this._setCrossTabFeatureFlagChangesPending(e,u):this._pendingCrossTabFeatureFlagChanges.delete(e)}}},t._saveDebounceMs=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return ui(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=_m(e,this._config.cookie_persisted_properties||[]),n=gm(t,this._config.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),i=am._get(this._name)||void 0;i&&ym(this._name,i)===r&&(this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i)}catch(e){}else try{var o=am._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=o?ym(this._name,o):void 0,this._lastSeenMainCookieValue=o}catch(e){}},t.syncCookieProperties=function(){return this._syncCookieProperties(this._config)},t._syncCookieProperties=function(e,t){var n,r=this;if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{n=am._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var i,o=ym(this._name,n);try{i=pm(JSON.parse(n))}catch(e){return!1}if((am._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=o,this._lastSeenMainCookieValue=n;var s=mm(this._name,n),a=[].concat(dm,s.properties),u={};if(Object.keys(i).forEach(function(e){var t=i[e];(ri(t)||si(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(u[e]=!0,delete i[e])}),ni(i))return!1;var l="distinct_id"in i||"anonymous"===i.$user_state||"identified"===i.$user_state,c=this.props,d=c[Zh],f=c[Pp],h=Pl({},c);[].concat(dm,e.cookie_persisted_properties||[]).forEach(function(e){if(-1!==a.indexOf(e)&&!(e in i)&&!u[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=h[e];(s.isValid||-1===dm.indexOf(e)||!1!==t&&0!==t)&&delete h[e]}}),this.props=Pl(h,i),sy.forEach(function(e){var t=e in r.props;e in c===t&&cy(c[e],r.props[e])||(t?r._markPendingCrossTabFeatureFlagChanges(e,c[e],r.props[e]):r._setCrossTabFeatureFlagChangesPending(e,!0))}),!l||"$user_state"in i||"$user_state"in this.props||this._setProp(Pp,Vp);var p=this.props[Zh],_=this.props[Pp];return!l||p===d&&_===f||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,km._set(ry(this._name),!0),this._deleteProp(Zf),this._deleteProp(Uf),this._deleteProp(Yf),this._deleteProp(Wf),this._deleteProp(th),this._deleteProp(Kf),this._deleteProp(Gf),this._deleteProp(Vf),this._deleteProp(Xf),"anonymous"!==_||"identified"!==f&&"anonymous"!==i.$user_state&&(ri(d)||p===d)||(hy(this.props,i),this._deleteProp(Jf)),"identified"===_?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(tp)),!0},t.consumeCookieIdentityChange=function(){var e=ry(this._name),t=this._cookieIdentityChangePending||!!km._get(e);return this._cookieIdentityChangePending=!1,t&&km._remove(e),t},t._beginCookieSyncSuppression=function(e){return void 0===e&&(e=!1),!(this._cookieSyncSuppressed||this._disabled&&!e||!this._config.cookieWinsOnConflict||"localstorage+cookie"!==this._config.persistence.toLowerCase()||(this._cookieSyncSuppressed=!0,0))},t._publishSuppressedCookieSnapshot=function(){this._cookieSyncSuppressed&&(ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[oy],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){var t=this;-1===ny.indexOf(e.persistence.toLowerCase())&&(Sl.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=function(e,t,n){void 0===e&&(e=[]),void 0===t&&(t=!1),void 0===n&&(n=function(){return!1});var r=[].concat(dm,e);return d({},lm,{_parse:function(e){try{var i,o={};try{i=am._get(e)||void 0,o=i?pm(JSON.parse(i)):{}}catch(e){}var s,a=JSON.parse(lm._get(e)||"{}");if(t){var u=mm(e,i),l=[].concat(dm,u.properties),c={};Object.keys(o).forEach(function(e){var t=o[e];si(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(c[e]=t)});var d="distinct_id"in c||"anonymous"===c.$user_state||"identified"===c.$user_state;if(Object.keys(c).length>0){var f,h=a[Zh],p=null!==(f=a.$user_state)&&void 0!==f?f:"anonymous";r.forEach(function(e){if(-1!==l.indexOf(e)&&!(e in o)&&(d||"distinct_id"!==e&&"$user_state"!==e)){var t=a[e];(u.isValid||-1===dm.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!d||"$user_state"in o||"$user_state"in a||(a[Pp]=Vp),!d||("distinct_id"in c?c[Zh]:a[Zh])===h&&("$user_state"in c?c[Pp]:a[Pp])===p||(cm.forEach(function(e){return delete a[e]}),"identified"===c.$user_state&&"distinct_id"in c?a.$user_id=c[Zh]:delete a.$user_id,"identified"!==c.$user_state&&(delete a[xp],delete a[Jf]),delete a.__alias)}s=Pl(a,c)}else s=Pl(o,a);return n()||lm._set(e,s),s}catch(e){}return null},_set:function(n,r,i,o,s,a){var u=lm._set(n,r,void 0,void 0,a);try{var l=_m(r,e);if(Object.keys(l).length){if(t){var c=fm(n),d=gm(l,e);if(am._set(c,d,i,o,s,a),am._get(c)!==JSON.stringify(d)){am._remove(c,o);var f=_m(r);return am._set(n,f,i,o,s,a),u}}am._set(n,l,i,o,s,a)}}catch(e){lm._error(e)}return u},_remove:function(e,t){try{null==Ih||Ih.localStorage.removeItem(e),am._remove(e,t),am._remove(fm(e),t)}catch(e){lm._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,function(){return!!t._disabled}),i=!1,o=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&lm._is_supported()?(n=lm,o=!0):"localstorage+cookie"===s&&r._is_supported()?(n=r,o=!0,i=!0):"sessionstorage"===s&&km._is_supported()?n=km:"memory"===s?n=wm:"cookie"===s&&am._is_supported()?(n=am,i=!0):r._is_supported()?(n=r,o=!0,i=!0):am._is_supported()?(n=am,i=!0):n=wm,this._splitStorageEligible=o,this._storesIdentityInCookie=i,n},t._groupEntryName=function(e){return this._name+"__"+e},t._resolveSplitStorage=function(e){return this._splitStorageEligible&&!!e.split_storage},t.properties=function(){var e={};return Cl(this.props,function(t,n){var r=qm(n);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t))return;e[n]=t}}),e},t.load=function(e){var t=this;if(void 0===e&&(e=!1),!this._disabled||e){var n=this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase(),r=n?lm._parse(this._name):null,i={};if(n)try{Cl(i=pm(am._parse(this._name)),function(e,t){(ri(e)||si(e)||""===e)&&delete i[t]})}catch(e){}var o=this._storage._parse(this._name);if(o&&(this.props=Pl({},o)),this._splitStorage&&this._loadGroupEntries(),n&&o){var s,a,u=null==r?void 0:r[Zh],l=null!==(s=null==r?void 0:r.$user_state)&&void 0!==s?s:"anonymous",c=o[Zh],d=null!==(a=o.$user_state)&&void 0!==a?a:"anonymous",f=km._parse(this._name),h=!ri(u)||!ri(null==r?void 0:r.$user_state)||!!f&&!ni(f);if(c!==u||d!==l){h&&(this._cookieIdentityChangePending=!0,this._disabled||km._set(ry(this._name),!0));var p=Pl({},this.props);cm.forEach(function(e){return delete p[e]}),h&&"anonymous"===d&&("identified"===l||"anonymous"===i.$user_state||!ri(u)&&c!==u)&&(hy(p,i),delete p[Jf]),this.props=p;var _=new Set;cm.forEach(function(e){var t,n=null==(t=qm(e))?void 0:t.storageGroup;n&&_.add(n)}),_.forEach(function(e){if(!t._disabled){var n={};Cl(t.props,function(t,r){var i;(null==(i=qm(r))?void 0:i.storageGroup)===e&&(n[r]=t)});var r=fy(n);ni(n)?(lm._remove(t._groupEntryName(e)),t._slotState[e]={}):lm._set(t._groupEntryName(e),r)&&(t._slotState[e]={persisted:!0,fingerprint:t._entryFingerprint(r,e)})}})}}km._get(ry(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e=0,t=Lm;t.length>e;e++){var n=t[e],r=lm._parse(this._groupEntryName(n));if(r&&!ni(r)){var i=this._slotWriteState(n);i.persisted=!0,this._mainCarriesGroupKey(n)||(i.fingerprint=this._entryFingerprint(r,n)),this._groupEntryIsStale(n,r)||Pl(this.props,r)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=qm(t))?void 0:n.storageGroup)===e})},t._groupEntryIsStale=function(e,t){var n=ty[e];if(!n)return!1;var r=t[n],i=this.props[n];return ui(r)&&ui(i)&&i>r},t.refreshKey=function(e){this._refreshKeys([e])},t._refreshKeys=function(e){var t=this;if(!this._disabled){var n,r=!1,i=function(){return r||(n=t._storage._parse(t._name),r=!0),n};e.forEach(function(e){var n;if(!t._metaIdentifierChangePending.has(e)){var r=t._splitStorage?null==(n=qm(e))?void 0:n.storageGroup:void 0,o=r?lm._parse(t._groupEntryName(r)):i();if(o&&e in o)t._setProp(e,o[e],!1);else{if(r){var s=i();if(s&&e in s)return void t._setProp(e,s[e],!1)}t._deleteProp(e,!1)}}})}},t.refreshMetaIdentifiers=function(){this._disabled||(this._usesMetaIdentifierSnapshotRefresh()?this._refreshMetaIdentifiersIfStorageChanged():this._refreshKeys(uy))},t._refreshMetaIdentifiersIfStorageChanged=function(){var e=this._storageSnapshot();(ri(e)||e!==this._metaIdentifierStorageSnapshot)&&(this._refreshKeys(uy),this._rememberMetaIdentifierStorageSnapshot(e))},t._rememberMetaIdentifierStorageSnapshot=function(e){void 0===e&&(e=this._storageSnapshot()),this._metaIdentifierStorageSnapshot=0===this._metaIdentifierChangePending.size?e:void 0},t.refreshMetaIdentifiersBeforeCapture=function(){this._disabled||this._cookieSyncSuppressed||(this._usesMetaIdentifierSnapshotRefresh()||this._adoptMetaIdentifiersFromCookie(),this._refreshMetaIdentifiersIfStorageChanged())},t._usesMetaIdentifierSnapshotRefresh=function(){return this._storage===am||this._storage===km||this._storage===wm},t._storageSnapshot=function(){var e=this._storage._get(this._name);return ii(e)?e:void 0},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?ri(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(function(){e._pendingSaveTimer=void 0,e._writeNow()},t)):this._writeNow()}},t.flush=function(){ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())},t._writeNow=function(e){if(void 0===e&&(e=!1),!(this._disabled||this._cookieSyncSuppressed&&!e)){e||(this.syncCookieProperties(),this._usesMetaIdentifierSnapshotRefresh()&&this.refreshMetaIdentifiers());var t=!e&&!this._storageMigrationInProgress;t||(this._crossTabFeatureFlagIdentityMismatch=!1);var n=!!t&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&Sl.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(e||this._adoptMetaIdentifiersFromCookie(),this._splitStorage)return this._writeNowSplit(),void(n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}));var r=this._writeEntry(this._storage,this._name,this.props,oy);"written"===r&&(this._rememberCurrentCookieProperties(this.props),this._rememberMetaIdentifierCookieValue(this.props)),"failed"!==r&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear()),"written"===r&&this._rememberMetaIdentifierStorageSnapshot(),n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()})}}},t._writeNowSplit=function(){var e=this,t=this._partitionProps(),n=t.main,r=t.groups,i=this._writeEntry(this._storage,this._name,n,oy);"written"===i&&(this._rememberCurrentCookieProperties(n),this._rememberMetaIdentifierCookieValue(n)),"failed"!==i&&(this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear(),sy.forEach(function(t){var n;null!=(n=qm(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)})),"written"===i&&this._rememberMetaIdentifierStorageSnapshot();for(var o=function(){var t,n=a[s],i=r[n];if(ni(i)&&(null==(t=e._slotState[n])||!t.persisted))return sy.forEach(function(t){var r;(null==(r=qm(t))?void 0:r.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)}),1;var o=e._writeEntry(lm,e._groupEntryName(n),i,n);"failed"!==o&&sy.forEach(function(t){var r=qm(t);(null==r?void 0:r.storageGroup)!==n||"written"!==o&&r.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)})},s=0,a=Lm;a.length>s;s++)if(o())continue},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return Cl(this.props,function(n,r){var i,o=null==(i=qm(r))?void 0:i.storageGroup;o?t[o][r]=n:e[r]=n}),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===oy)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return Cl(e,function(e,t){var r;n[t]=null!=(r=qm(t))&&r.volatile?"__volatile__":e}),JSON.stringify(n)},t._writeEntry=function(e,t,n,r){var i=this._slotWriteState(r);if(r!==oy&&!i.dirty&&!ri(i.fingerprint))return"skipped";var o,s=n;try{if(s=fy(n),(o=this._entryFingerprint(s,r))===i.fingerprint)return i.dirty=!1,"skipped"}catch(e){o=void 0}return e._set(t,s,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(i.dirty=!1,r!==oy&&(i.persisted=!0),ri(o)||(i.fingerprint=o),this._splitStorageEligible&&(i.storageValue=lm._get(t)),"written"):(this._config.debug&&Sl.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")},t.remove=function(e){var t=(void 0===e?{}:e).keepGroupEntries,n=void 0!==t&&t;if(this._markAllCrossTabFeatureFlagChangesPending(),ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!n&&this._ownsSplitStorage)for(var r=0,i=Lm;i.length>r;r++)lm._remove(this._groupEntryName(i[r]));n?delete this._slotState[oy]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._lastSeenMetaIdentifierCookieValue=void 0},t.clear=function(){this.remove(),this.props={},this._campaign_params_url=void 0},t.register_once=function(e,t,n){var r=this;if(ti(e)){this.syncCookieProperties(),ri(t)&&(t="None"),this._expire_days=ri(n)?this._default_expiry:n;var i=!1;if(Cl(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r._setProp(n,e),i=!0)}),i)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(ti(e)){this.syncCookieProperties(),this._expire_days=ri(t)?this._default_expiry:t;var r=!1;if(Cl(e,function(t,i){e.hasOwnProperty(i)&&(n.props[i]!==t||ti(t)||Xr(t))&&(n._setProp(i,t),r=!0)}),r)return this.save(),!0}return!1},t.unregister=function(e){this.syncCookieProperties();for(var t,n=!1,r=p("string"==typeof e?[e]:e);!(t=r()).done;){var i=t.value;i in this.props&&(this._deleteProp(i),n=!0)}n&&this.save()},t.update_campaign_params=function(){var e=null==Mh?void 0:Mh.URL;if(e!==this._campaign_params_url){var t=Vm(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!ni(Fl(t));return n&&this.register(t),this._campaign_params_url=e,n?t:void 0}},t.update_search_keyword=function(){var e;this.register((e=null==Mh?void 0:Mh.referrer)?Km(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:Jm(),$referring_domain:null!=Mh&&Mh.referrer&&(null==(e=Hh(Mh.referrer))?void 0:e.host)||Ym},void 0)},t.set_initial_person_info=function(){var e;if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Zm(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[Rp]=this._storesIdentityInCookie?{r:iy(t.r),u:t.u?iy(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};Cl([Ip,Fp],function(n){var r=e.props[n];r&&Cl(r,function(e,n){t["$initial_"+Kr(n)]=e})});var n=this.props[Rp];return n&&Pl(t,function(e,t,n,r){void 0===t&&(t=!1);var i=Xm(e,t,n,r),o={};return Cl(i,function(e,t){o["$initial_"+Kr(t)]=e}),o}(n,this._config.disable_capture_url_hashes,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)),t},t.safe_merge=function(e){return Cl(this.props,function(t,n){n in e||(e[n]=t)}),e},t.update_config=function(e,t,n){var r=e.persistence!==t.persistence,i=!function(e,t){if(e.length!==t.length)return!1;var n=[].concat(e).sort(),r=[].concat(t).sort();return n.every(function(e,t){return e===r[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=r||i,s=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!n,u=!!this._disabled&&!a;a||this._syncCookieProperties(t,u),this._config=e,!a&&(r||i||s)&&(this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._lastSeenMetaIdentifierCookieValue=void 0,this._syncCookieProperties(d({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),u));var l=o||s?this._buildStorage(e):this._storage;this._truncateExistingPersonInfoForCookie();var c=this._resolveSplitStorage(e),f=o||c!==this._splitStorage,h=!a&&(f||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(u);this._storageMigrationInProgress=f;try{if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),f){var p=this.props;this.clear(),this._storage=l,this._splitStorage=c,this.props=p,this.save()}else s&&(this._storage=l,a||(delete this._slotState[oy],this._writeNow()))}finally{this._storageMigrationInProgress=!1,h&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[Rp];if(this._storesIdentityInCookie&&ti(e)&&"string"==typeof e.r){var t=iy(e.r),n="string"==typeof e.u?iy(e.u):e.u;t===e.r&&n===e.u||this._setProp(Rp,d({},e,{r:t,u:n}))}},t.set_disabled=function(e){this._disabled=e,this._disabled?this.remove():this.save()},t.set_cross_subdomain=function(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_secure=function(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this._setProp(sp,n),this.save()},t.remove_event_timer=function(e){var t=this.props.__timers||{},n=t[e];return ri(n)||(delete t[e],this._setProp(sp,t),this.save()),n},t.get_property=function(e){return this.props[e]},t.set_property=function(e,t){this._setProp(e,t),this.save()},t._setProp=function(e,t,n){var r;void 0===n&&(n=!0);var i=this.props[e];this.props[e]=t,n&&("distinct_id"!==e&&"$user_state"!==e||i===t||(this._localIdentityChangePending=!0),ly(e)&&!cy(i,t)&&this._metaIdentifierChangePending.add(e),this._markPendingCrossTabFeatureFlagChanges(e,i,t),null!=(r=qm(e))&&r.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(ay(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),ly(e)&&this._metaIdentifierChangePending.add(e),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=qm(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),_y=kl("[RateLimiter]"),vy=function(){"use strict";function e(e){var t=this;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(function(e){_y.info((e||"events")+" is quota limited."),t.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void _y.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}var t=e.prototype;return t.clientRateLimitContext=function(e){var t;void 0===e&&(e=!1);var n=this._refilledBucket(),r=1>n.tokens;if(r||e||(n.tokens=Math.max(0,n.tokens-1)),r&&!e){var i=(ui(n.dropped)?n.dropped:0)+1;n.dropped=i,!this.lastEventRateLimited&&this._captureWarning(i)&&(n.dropped=0)}return this.lastEventRateLimited=r,null==(t=this.instance.persistence)||t.set_property(Tp,n),{isRateLimited:r,remainingTokens:n.tokens}},t._refilledBucket=function(){var e,t=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,r=(new Date).getTime(),i=null==(e=this.instance.persistence)?void 0:e.get_property(Tp),o=i?d({},i):{tokens:t,last:r};return o.tokens+=Math.max(0,r-o.last)/1e3*n,o.last=Math.max(o.last,r),o.tokens>t&&(o.tokens=t),o},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Xr(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Oh&&Oh.pathname)return""+(null!==(e=Oh.origin)&&void 0!==e?e:"")+Oh.pathname},t._captureWarning=function(e){var t,n,r=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,o=this._triggeringPage(),s=this._isPropertyAllowed("$session_id")?null==(t=(n=this.instance).get_session_id)?void 0:t.call(n):void 0,a=[e+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,s?"session "+s:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+i+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})},t.isServerRateLimited=function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t},a(e,[{key:"captureEventsPerSecond",get:function(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}},{key:"captureEventsBurstLimit",get:function(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}},{key:"isClientRateLimited",get:function(){return 1>this._refilledBucket().tokens}}])}(),gy=kl("[RemoteConfig]"),my=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t=this,n=dg(this._instance);n?n(this._instance,"remote-config",function(){return e(t.remoteConfig)}):e()},t._loadRemoteConfigJSON=function(e){var t=this,n=this._instance.__pending_remote_config_callbacks;if(n)n.push(e);else{var r=[e];this._instance.__pending_remote_config_callbacks=r;try{this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),batchKey:"remote_config",fireCallbackOnDrop:!0,callback:function(e){t._instance.__pending_remote_config_callbacks=void 0,r.forEach(function(t){return t(e)})}})}catch(e){throw this._instance.__pending_remote_config_callbacks=void 0,e}}},t.load=function(){var e=this;try{if(this.remoteConfig)return gy.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void gy.warn("Remote config is disabled. Falling back to local config.");if(!this._instance.config.opt_in_site_apps)return void this._loadRemoteConfigJSON(function(t){e._onRemoteConfig(t.json,t)});this._loadRemoteConfigJs(function(t){if(!t)return gy.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON(function(t){e._onRemoteConfig(t.json,t)});e._onRemoteConfig(t)})}catch(e){gy.error("Error loading remote config",e),this._onRemoteConfig()}},t._onRemoteConfig=function(e,t){!e&&t&&(0===t.statusCode?t.error||gy.warn("Failed to fetch remote config from PostHog."):gy.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){gy.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;null==(n=this._instance.featureFlags)||n.ensureFlagsLoaded()}catch(e){gy.error("Error loading feature flags",e)}},a(e,[{key:"remoteConfig",get:function(){var e;return null==(e=jh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),yy=!Dv&&-1===(null==Nh?void 0:Nh.indexOf("MSIE"))&&-1===(null==Nh?void 0:Nh.indexOf("Mozilla"));function by(e,t,n){var r;n&&(t=d({},t,{callback:function(e){return n(e)}})),e.__loaded?yy?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=d({},e.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(r=e.compression)&&void 0!==r?r:t.compressionFallback:t.compression,(ri(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,null==t.onDispatch||t.onDispatch(),function(e,t){var n,r,i,o=d({},e,{callback:null!=t?t:function(t){return null==e.callback?void 0:e.callback(t)}});o.timeout=o.timeout||6e4;var s,a,u,l,c,f=null!==(n=o.transport)&&void 0!==n?n:"fetch";"sendBeacon"===f&&ri(o.compression)&&o.data&&(o.compression=bh),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!==(a=null==(c=(l=(Xr(s=o.data)?s:[s]).map(function(e){return d({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})}))[0])||null==(u=c.properties)?void 0:u.token)&&void 0!==a?a:null==c?void 0:c.token,batch:l,sent_at:(new Date).toISOString()}:"body"===o.timestampMode&&(o.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Xr(e)?e.map(function(e){return d({},e,{sent_at:t})}):d({},e,{sent_at:t})}(o.data))),o.url=eg(o.url,o.method,o.compression,o.timestampMode);var h=tg.filter(function(e){return!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport)}),p=null!==(r=null==(i=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(h,function(e){return e.transport===f}))?void 0:i.method)&&void 0!==r?r:h[0].method;if(!p)throw new Error("No available transport method");var _=function(e){try{p(e)}catch(e){Qv(e)?Sl.warn(e):Sl.error(e),null==o.callback||o.callback({statusCode:0,error:e})}};"sendBeacon"!==f&&!o.preferSyncCompression&&o.data&&o.compression===yh&&qh&&"undefined"!=typeof Promise&&!Bv?Vv(o).then(function(e){_(e)}).catch(function(t){if(Hs(t))return Bv=!0,void _(d({},o,{compression:void 0,url:eg(e.url,e.method,void 0,e.timestampMode)}));(function(e){if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return Hs(e)||t===Ns})(t)&&(Bv=!0),_(o)}):_(o)}(t,function(r,i){e.rateLimiter.checkForLimiting(r),400>r.statusCode||null==e.config.on_request_error||e.config.on_request_error(r),n?n(r,i):null==t.callback||t.callback(r)})):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}var wy=function(){"use strict";function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=xi((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,Sl.createLogger("flush interval"),3e3),this._sendRequest=e}var t=e.prototype;return t.enqueue=function(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()},t.unload=function(){var e=this;this._clearFlushTimeout();var t=this._queue.length>0?this._formatQueue():{},n=Object.values(t);[].concat(n.filter(function(e){return 0===e.url.indexOf("/e")}),n.filter(function(e){return 0!==e.url.indexOf("/e")})).map(function(t){e._sendRequestSafely(d({},t,{callback:void 0}),"sendBeacon")})},t.enable=function(){this._isPaused=!1,this._setFlushTimeout()},t._setFlushTimeout=function(){var e=this;this._isPaused||(this._flushTimeout=setTimeout(function(){e._clearFlushTimeout(),e._flush()},this._flushTimeoutMs))},t._flush=function(){if(this._queue.length>0){var e=this._formatQueue();for(var t in e)this._sendRequestSafely(e[t])}},t._sendRequestSafely=function(e,t){try{this._sendRequest(e,t)}catch(e){Sl.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={},t={};Cl(this._queue,function(n){var r,i=n,o=((i?i.batchKey:null)||i.url)+(i.batchGroup?":"+i.batchGroup:"");ri(e[o])&&(e[o]=d({},i,{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[o]=[]),null==(r=e[o].data)||r.push(i.data),i.callback&&t[o].push(i.callback)});var n=function(){var n=t[r];n.length&&(e[r].callback=function(e){for(var t,r=p(n);!(t=r()).done;)(0,t.value)(e)})};for(var r in t)n();return this._queue=[],e},e}(),Sy=function(){"use strict";function t(e){this._instance=e,this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._queue=[],this._areWeOnline=!0,this.resume()}var r=t.prototype;return r.resume=function(){var e=this;if(!ri(Ih)&&"onLine"in Ih.navigator){if(this._areWeOnline=Ih.navigator.onLine,this._onlineListener)return;this._onlineListener=function(){e._areWeOnline=!0,e._flush()},this._offlineListener=function(){e._areWeOnline=!1},Ml(Ih,"online",this._onlineListener),Ml(Ih,"offline",this._offlineListener)}},r.retriableRequest=function(t,r){var i=this,o=t.retriesPerformedSoFar,s=n(t,e);li(o)&&(s.url=Hv(s.url,{retry_count:o})),by(this._instance,r?d({},s,{transport:r}):s,function(e,t){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=o?o:0))return void i._enqueue(d({retriesPerformedSoFar:o},s),t);0===e.statusCode&&Sl.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=o?o:0)+" retries.")}null==s.callback||s.callback(e)})},r._enqueue=function(e,t){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=Math.max(function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(n),null!=t?t:0),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),Sl.warn(o),this._isPolling||(this._isPolling=!0,this._poll())},r._poll=function(){var e=this;if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout(function(){e._areWeOnline&&e._queue.length>0&&e._flush(),e._poll()},this._pollIntervalMs)},r._flush=function(){var e=Date.now(),t=[],n=this._queue.filter(function(n){return e>n.retryAt||(t.push(n),!1)});if(this._queue=t,n.length>0)for(var r,i=p(n);!(r=i()).done;)this.retriableRequest(r.value.requestOptions)},r.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,ri(Ih)||(this._onlineListener&&(Ih.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Ih.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=p(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(d({},n,{callback:Xr(n.data)?void 0:n.callback,transport:"sendBeacon"}))}catch(e){Sl.error(e)}}this._queue=[]},a(t,[{key:"length",get:function(){return this._queue.length}}])}(),ky=function(){"use strict";function e(e){var t=this;this._instance=e,this._updateScrollData=function(){var e,n,r,i;t._context||(t._context={});var o=t.scrollElement(),s=t.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=s+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;t._context.lastScrollY=Math.ceil(s),t._context.maxScrollY=Math.max(s,null!==(e=t._context.maxScrollY)&&void 0!==e?e:0),t._context.maxScrollHeight=Math.max(a,null!==(n=t._context.maxScrollHeight)&&void 0!==n?n:0),t._context.lastContentY=u,t._context.maxContentY=Math.max(u,null!==(r=t._context.maxContentY)&&void 0!==r?r:0),t._context.maxContentHeight=Math.max(l,null!==(i=t._context.maxContentHeight)&&void 0!==i?i:0)}}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return this._context=void 0,setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){Ml(Ih,"scroll",this._updateScrollData,{capture:!0}),Ml(Ih,"scrollend",this._updateScrollData,{capture:!0}),Ml(Ih,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Ih||null==(e=Ih.document)?void 0:e.documentElement;for(var t,n=p(Xr(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var r,i=null==Ih||null==(r=Ih.document)?void 0:r.querySelector(t.value);if(i)return i}},t._scrollPosition=function(e){var t,n,r="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var i=this.scrollElement();return i&&i[r]||0}return Ih?"y"===e?Ih.scrollY||Ih.pageYOffset||(null==(t=Ih.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Ih.scrollX||Ih.pageXOffset||(null==(n=Ih.document)||null==(n=n.documentElement)?void 0:n.scrollLeft)||0:0},t.scrollY=function(){return this._scrollPosition("y")},t.scrollX=function(){return this._scrollPosition("x")},a(e,[{key:"_scrollRoot",get:function(){return this._instance.config.scroll_root_selector}}])}(),xy=function(e){return Zm(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes)},Cy=function(){"use strict";function e(e,t,n,r){var i=this;this._onSessionIdCallback=function(e){var t,n=i._getStored();if(!n||n.sessionId!==e){var r={sessionId:e,props:i._sessionSourceParamGenerator(i._instance)};i._persistence.register(((t={})[Ep]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||xy,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Ep]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?Xm(t,this._instance.config.disable_capture_url_hashes,this._instance.config.mask_personal_data_properties,this._instance.config.custom_personal_data_properties):{$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}:{}},t.getSessionProps=function(){var e={};return Cl(Fl(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+Kr(n)]=t}),e},e}(),Py=kl("[SessionId]"),Ey=864e5,Ty=function(){"use strict";function e(e,t,n){var r,i=this;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new Sh,this._sessionHasBeenIdleTooLong=function(e,t){return!(!li(e)||!li(t))&&Math.abs(e-t)>i.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._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._pendingBootstrapSession=void 0,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||xu,this._windowIdGenerator=n||xu;var o=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*xi(this._config.session_idle_timeout_seconds||1800,60,36e3,Py.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var s=km._parse(this._window_id_storage_key),a=km._parse(this._primary_window_exists_storage_key);s&&!a?this._windowId=s:km._remove(this._window_id_storage_key),km._set(this._primary_window_exists_storage_key,!0)}null!=(r=this._config.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this._config.bootstrap.sessionID),this._listenToReloadWindow()}var t=e.prototype;return t.on=function(e,t){return this._eventEmitter.on(e,t)},t.onSessionId=function(e){var t=this;return ri(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(t){return t!==e})}},t._canUseSessionStorage=function(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&km._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&km._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?km._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!si(t)&&!si(e)&&5e3>Math.abs(e-t)},t._setSessionId=function(e,t,n){var r,i=t!==this._sessionActivityTimestamp,o=!(e!==this._sessionId||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,o&&!i||o&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register(((r={})[Sp]=[t,e,n],r)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return li(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(Sp):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!si(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var n=this._getSessionId();n[1]===this._sessionId&&n[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register(((t={})[Sp]=[this._sessionActivityTimestamp,null!==(e=this._sessionId)&&void 0!==e?e:null,this._sessionStartTimestamp],t)),this._persistence.flush())}},t._freshestActivityTimestamp=function(){var e=this._getSessionId()[0],t=li(e)?e:0,n=li(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)},t._isSessionIdleAfterCrossTabRefresh=function(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())},t._getSessionId=function(){var e=this._persistence.props[Sp];return Xr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},t.resetSessionId=function(){this._lastPersistedActivityTimestamp=null,this._pendingBootstrapSession=void 0,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)},t.setBootstrapSessionId=function(e,t){void 0===t&&(t=!1);var n=function(e,t){void 0===t&&(t=(new Date).getTime());try{var n=function(e){var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)}(e);return n>t+6e4?void Py.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void Py.error("Invalid sessionID in bootstrap",e)}}(e);return!ri(n)&&(t?this._pendingBootstrapSession={sessionId:e,sessionStartTimestamp:n}:this._setSessionId(e,(new Date).getTime(),n),!0)},t.destroy=function(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&Ih&&(Ih.removeEventListener(Qp,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&km._remove(e._primary_window_exists_storage_key)},Ml(Ih,Qp,this._beforeUnloadListener,{capture:!1})},t.checkAndGetSessionAndWindowId=function(e,t,n){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===n&&(n=!1),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),i=this._sessionId;if(n)this._lastCookieSyncTimestamp=r;else if(si(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>r||r-this._lastCookieSyncTimestamp>=1e3){var o,s;null==(o=(s=this._persistence).syncCookieProperties)||o.call(s),this._lastCookieSyncTimestamp=r}var a=this._getSessionId(),u=a[1],l=a[2],c=!ri(i)&&u!==i,d=this._freshestActivityTimestamp(),f=this._getWindowId(),h=this._pendingBootstrapSession,p=!!h&&(h.sessionStartTimestamp>r+6e4||r-h.sessionStartTimestamp>Ey),_=h?p:li(l)&&Math.abs(r-l)>Ey,v=!1,g=c,m=!u||!!h,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(r,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(r))||Py.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2],b||(m=!u||!!h)}if(m||b||_){g=!1;var S=h&&!p;u=S?h.sessionId:this._sessionIdGenerator(),f=this._windowIdGenerator(),Py.info("new session ID assigned",{sessionId:u,windowId:f,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),l=S?h.sessionStartTimestamp:r,this._pendingBootstrapSession=void 0,v=!0}else f||(f=this._windowIdGenerator(),v=!0),(g=g||u!==y)&&(Py.info("adopted cross-tab session id",{sessionId:u,windowId:f}),v=!0);var k=li(d)&&e&&!_?d:r,x=li(l)?l:(new Date).getTime();this._setWindowId(f),this._setSessionId(u,k,x),e||this._resetIdleTimer();var C={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_,crossTabAdoption:g};return v&&this._sessionIdChangedHandlers.forEach(function(e){return e(u,f,C)}),{sessionId:u,windowId:f,sessionStartTimestamp:x,changeReason:v?C:void 0,lastActivityTimestamp:d}},t._resetIdleTimer=function(){var e=this;this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(function(){if(!e._destroyed)if(e._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var t=e._sessionId;e.resetSessionId(),e._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}else e._resetIdleTimer()},1.1*this.sessionTimeoutMs))},a(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),Fy=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),Iy=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&ki(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(function(e){return ki(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver};function Ry(){return(Ry=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==Ah?void 0:Ah.userAgentData)&&t.getHighEntropyValues){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,t.getHighEntropyValues(["model"]);case 2:if(null!=(n=e.v)){e.n=3;break}i=void 0,e.n=4;break;case 3:i=n.model;case 4:return e.a(2,ii(r=i)&&r.length>0?r:void 0);case 5:return e.p=5,Sl.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}},e,null,[[1,5]])}))).apply(this,arguments)}var Ay="custom",My="i.posthog.com",Oy=/^\/static\//,Ly=["/s/","/e/","/i/"],Dy=function(){"use strict";function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(Oy.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}},t._urlKey=function(e){var t=Hh(e);return t?t.protocol+"//"+t.host+t.pathname:void 0},t._prepareEndpoint=function(e,t,n){if("ui"===e)return n;var r=n,i=this.instance.config.rewriteRequestPath;if(i){var o,s=(null==(o=Hh(n))?void 0:o.href)||n;r=i(new URL(s)).toString()}if(i&&"api"===e&&Ly.some(function(e){return 0===t.indexOf(e)})){var a=this._urlKey(r);if(a){var u,l=this.apiHost,c=this._ingestionEndpoints;(null==(u=c)?void 0:u.apiHost)===l&&c.rewriteRequestPath===i||(this._ingestionEndpoints=c={apiHost:l,rewriteRequestPath:i,urls:new Set}),c.urls.add(a)}}return r},t.isIngestionEndpoint=function(e){var t=this._ingestionEndpoints,n=this._urlKey(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)},t.endpointFor=function(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this._prepareEndpoint(e,t,this.uiHost+t);if("flags"===e)return this._prepareEndpoint(e,t,this.flagsApiHost+t);if("assets"===e){var n=this._staticAssetHostOverride(t);if(n)return this._prepareEndpoint(e,t,""+n+t)}if(this.region===Ay)return this._prepareEndpoint(e,t,this.apiHost+t);var r=My+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+r);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+r)}},a(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"flagsApiHost",get:function(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}},{key:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+My,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(this._regionCache[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ay),this._regionCache[this.apiHost]}}])}(),$y=kl("[PostHog ExternalIntegrations]"),qy={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Ny=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=dg(this._instance))||n(this._instance,e,function(e){if(e)return $y.error("failed to load script",e);t()})},t.startIfEnabledOrStop=function(){for(var e=this,t=function(){var t,i,o,s=r[n],a=s[0],u=s[1];!u||null!=(t=jh.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(qy[a],function(){var t;null==(t=jh.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)}),!u&&null!=(i=jh.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[a]&&(null==(o=jh.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[a])||o.stop())},n=0,r=Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{});r.length>n;n++){var i;t()}},e}(),By={},jy=0,Hy=function(){},zy='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Uy="Surveys module not available",Wy="sanitize_properties is deprecated. Use before_send instead",Vy="Invalid value for property_denylist config: ",Gy=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],Ky=["$feature_flag_called","$$heatmap","$snapshot"],Qy=function(e){return"$"===e.charAt(0)&&!Vr(Ky,e)},Yy=/^[A-Za-z0-9_-]{1,400}$/,Jy=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Zy=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,Xy=["token","distinct_id",Op],eb="posthog",tb=[].concat(Fy).sort()[Fy.length-1],nb=function(e){var t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},rb=function(e){var t;return d({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Al(null==Mh?void 0:Mh.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Hy,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Oh&&ii(null==Oh?void 0:Oh.search)&&-1!==Oh.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Ih||null==(t=Ih.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,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error:function(e){Sl.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Kp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Hy},function(e){return{rageclick:e&&e>="2026-05-30"?{content_ignorelist:g_,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:nb(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}}(e))},ib=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],ob=function(e){for(var t={},n=0,r=ib;r.length>n;n++){var i=r[n],o=i[0],s=i[1];ri(e[o])||(t[s]=e[o])}var a=Pl({},t,e),u=e.__preview_external_dependency_versioned_paths;return ri(u)||(ri(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),ii(u)&&ri(e.asset_host)&&(a.asset_host=u)),Xr(e.property_blacklist)&&(ri(e.property_denylist)?a.property_denylist=e.property_blacklist:Xr(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):Sl.error(Vy+e.property_denylist)),a},sb=function(){"use strict";return a(function(){this.__forceAllowLocalhost=!1},[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Sl.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),ab=(c=function(){"use strict";function e(){var t,n=this;this._botFilterWarned=!1,this._isPageUnloading=!1,this._isShutdown=!1,this.webPerformance=new sb,this._personProcessingSetOncePropertiesSent=!1,this.version=Jh.LIB_VERSION,this.__loadExternalDependency=void 0,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new Sh,this._extensions=[],this._extensionEventPropertyProducers=[],this._replayDebugPropertiesPaused=!1,this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._hasWarnedAboutMissingHistoryAutocapture=!1,this._isConsentTransition=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rb(),this.SentryIntegration=Mm,this.sentryIntegration=function(e){return function(e,t){var n=Am(e,t);return{name:Rm,processEvent:function(e){return n(e)}}}(n,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new ky(this),this.pageViewManager=new Om(this),this.rateLimiter=new vy(this),this.requestRouter=new Dy(this),this.consent=new xm(this),this.externalIntegrations=new Ny(this);var r=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:function(e,t,r){var i,o=ii(e)?((i={})[e]=t,i):e;n.setPersonProperties(o),null==r||r({})},set_once:function(e,t,r){var i,o=ii(e)?((i={})[e]=t,i):e;n.setPersonProperties(void 0,o),null==r||r({})}},this.on("eventCaptured",function(e){return Sl.info('send "'+(null==e?void 0:e.event)+'"',e)})}var t=e.prototype;return t._removeExtension=function(e){if(e){var t=this._extensions.indexOf(e);-1!==t&&this._extensions.splice(t,1)}},t._replaceExtension=function(e,t){return this._removeExtension(e),this._extensions.push(t),null==t.initialize||t.initialize(),t},t._inCookielessMode=function(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()},t._warnIfHistoryAutocaptureMissing=function(){if(!this._hasWarnedAboutMissingHistoryAutocapture&&this._originalUserConfig&&"capture_pageview"in this._originalUserConfig&&!d({},e.__defaultExtensionClasses,this.config.__extensionClasses).historyAutocapture){var t=this.config.capture_pageview;("history_change"===t||ti(t)&&(t.path||t.search||t.hash&&!this.config.disable_capture_url_hashes))&&(this._hasWarnedAboutMissingHistoryAutocapture=!0,Sl.warn("capture_pageview is set to capture history changes, but the history autocapture extension is not loaded, so only the first pageview of each page load is captured. With the slim bundle, pass __extensionClasses: { historyAutocapture: AnalyticsExtensions.historyAutocapture } from 'posthog-js/dist/extension-bundles', or set capture_pageview: true to capture page loads only."))}},t._warnIfVolatileIdentityWithoutStableId=function(){if(!(this._hasWarnedAboutVolatileIdentity||this.config.reuseAnonymousId||this.config.segment||this._inCookielessMode())){var e,t,n,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this._hasStableInitialDistinctId||(r?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._hasWarnedAboutVolatileIdentity=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+n)))}},t._syncCookielessIdentity=function(){var e=this.persistence;if(e&&!this._isConsentTransition)if(this._inCookielessMode())"on_reject"===this.config.cookieless_mode&&"$posthog_cookieless"!==this.get_distinct_id()&&(this._sync_opt_out_with_persistence(),this._enterCookielessMode());else if("$posthog_cookieless"===this.get_distinct_id()){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var n=this.config.get_device_id(xu());this.register({distinct_id:n,$device_id:n}),e.set_property(Pp,Vp)}this._sync_opt_out_with_persistence()}},t.init=function(t,n,r){if(r&&r!==eb){var i,o=null!==(i=By[r])&&void 0!==i?i:new e;return o._init(t,n,r),By[r]=o,By[eb][r]=o,o}return this._init(t,n,r)},t._init=function(e,t,n){var r,i,o,s=this;void 0===t&&(t={});var a,u=ii(e)?e.trim():"";if(!u)return Sl.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return u!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=rb(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var l=rb(t.defaults),c=ob(t),f=Pl({},l,c,{name:n,token:u});ti(l.rageclick)&&ti(c.rageclick)&&(f.rageclick=Pl({},l.rageclick,c.rageclick)),ti(l.session_recording)&&ti(c.session_recording)&&(f.session_recording=Pl({},l.session_recording,c.session_recording)),this.set_config(f),this.config.on_xhr_error&&Sl.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:yh;var h=this._is_persistence_disabled(),p=!this._inCookielessMode();if(this.persistence=new py(this.config,h,!0,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new py(d({},this.config,{persistence:"sessionStorage"}),h,!1,p),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!h&&km._is_supported()){var _=km._parse(this._sessionRegisteredPropertiesStorageKey);Xr(_)&&_.forEach(function(e){ii(e)&&s._sessionRegisteredPropKeys.add(e)})}else km._remove(this._sessionRegisteredPropertiesStorageKey);var v=d({},this.persistence.props),g=d({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new wy(function(e,t){return s._send_retriable_request(e,t)},this.config.request_queue_config),this._retryQueue=new Sy(this),this.__request_queue=[];var m=this._inCookielessMode();m||(this.sessionManager=new Ty(this),this.sessionPropsManager=new Cy(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(function(e,t,n){(null!=n&&n.activityTimeout||null!=n&&n.sessionPastMaximumLength||null!=n&&n.crossTabAdoption)&&s._clearSessionRegisteredProps()})),this._enrollFeatureFlags(),this.config.__preview_deferred_init_extensions?(Sl.info("Deferring extension initialization to improve startup performance"),this._extensionInitTimeout=setTimeout(function(){s._extensionInitTimeout=void 0,s._initExtensions(m)},0)):(Sl.info("Initializing extensions synchronously"),this._initExtensions(m)),Jh.DEBUG=Jh.DEBUG||this.config.debug,Jh.DEBUG&&Sl.info("Starting in debug mode",{this:this,config:t,thisC:d({},this.config),p:v,s:g}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=d({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(i=t.bootstrap)?void 0:i.distinctID;if(this._hasStableInitialDistinctId=!!y&&!oi(y),null!=(o=t.bootstrap)&&o.distinctID){var b=t.bootstrap.distinctID,w=this.get_distinct_id(),S=this.persistence.get_property(Pp);if(t.bootstrap.isIdentifiedID&&null!=w&&w!==b&&"anonymous"===S)this.identify(b);else if(t.bootstrap.isIdentifiedID&&null!=w&&w!==b&&"identified"===S)Sl.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var k=this.config.get_device_id(xu()),x=t.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(Pp,t.bootstrap.isIdentifiedID?Gp:Vp),this.register({distinct_id:b,$device_id:x})}}if(m)this.register_once({distinct_id:Mp,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(xu());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(Pp,Vp)}return Ml(Ih,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Ml(Ih,"pageshow",function(e){if(s._isPageUnloading=!1,!s._isShutdown){var t;if(e.persisted&&s.persistence){var n=s.persistence.get_property(Zh),r=s.persistence.get_property(Pp);s.persistence.load(),s._processCookieIdentityChange()||n===s.persistence.get_property("distinct_id")&&r===s.persistence.get_property("$user_state")||s._processIdentityChange()}null==(t=s._retryQueue)||t.resume()}}),t.segment?Im(this,function(){return s._loaded()}):this._loaded(),ei(this.config._onCapture)&&this.config._onCapture!==Hy&&(Sl.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return s.config._onCapture(e.event,e)})),this.config.ip&&Sl.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Ry.apply(this,arguments)}().then(function(e){var t;e&&s.register(((t={})[ep]=e,t))}).catch(Hy),this},t._isSharedExtension=function(e){var t=e;return ii(t.name)&&ei(t.setup)},t._enrollExtension=function(e,t){var n=this;this._isSharedExtension(e)?t.push(h(l().m(function t(){return l().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.setup(n._getBrowserClientAdapter());case 1:t.n=6;break;case 2:return t.p=2,Sl.error('Failed to set up extension "'+e.name+'"',t.v),t.p=3,t.n=4,null==e.dispose?void 0:e.dispose();case 4:t.n=6;break;case 5:t.p=5,Sl.error('Failed to dispose extension "'+e.name+'"',t.v);case 6:return t.a(2)}},t,null,[[3,5],[0,2]])}))):this._extensions.push(e)},t._enrollFeatureFlags=function(){var t,n,r,i,o,s,a=this,u=null!==(t=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)&&void 0!==t?t:null==(r=e.__defaultExtensionClasses)?void 0:r.featureFlags;if(u)if(this.featureFlags&&this.featureFlags instanceof u||(null==(s=this._featureFlagsReloadingUnsubscribe)||s.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),ei(this.featureFlags.onReloading)&&ei(this.featureFlags.setup)){if(!this._featureFlagsReloadingUnsubscribe){this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading(function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)});var c=this.featureFlags;h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,c.setup(a._getBrowserClientAdapter());case 1:e.n=6;break;case 2:e.p=2,Sl.error("Failed to set up feature flags",e.v),t=a._featureFlagsReloadingUnsubscribe,a._featureFlagsReloadingUnsubscribe=void 0;try{null==t||t()}catch(e){Sl.error("Failed to unsubscribe feature flag reloading",e)}return e.p=3,e.n=4,c.dispose();case 4:e.n=6;break;case 5:e.p=5,Sl.error("Failed to dispose feature flags",e.v);case 6:return e.a(2)}},e,null,[[3,5],[0,2]])}))()}}else null==(i=(o=this.featureFlags).initialize)||i.call(o)},t._initExtensions=function(t){var n,r,i,o,s,a,u,l,c=this,f=performance.now(),h=d({},e.__defaultExtensionClasses,this.config.__extensionClasses),p=[];h.exceptions&&this._extensions.push(this.exceptions=null!==(n=this.exceptions)&&void 0!==n?n:new h.exceptions(this)),h.historyAutocapture&&this._extensions.push(this.historyAutocapture=new h.historyAutocapture(this)),this._warnIfHistoryAutocaptureMissing(),h.tracingHeaders&&this._extensions.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this._extensions.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this._extensions.push(this.sessionRecording=new h.sessionRecording(this)),h.autocapture&&this._enrollExtension(this.autocapture=new h.autocapture(this),p),h.surveys&&this._enrollExtension(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new h.surveys(this),p),h.logs&&this._enrollExtension(this.logs=null!==(i=this.logs)&&void 0!==i?i:new h.logs(this),p),h.metrics&&this._extensions.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new h.metrics(this)),h.conversations&&this._extensions.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new h.conversations(this)),h.productTours&&this._extensions.push(this.productTours=new h.productTours(this)),h.heatmaps&&this._extensions.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this._extensions.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Em)),h.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this._extensions.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new h.experiments(this)),h.webMCP&&this._extensions.push(this.webMCP=null!==(l=this.webMCP)&&void 0!==l?l:new h.webMCP(this));var _=this._extensions.length>0||p.length>0;this.config.disable_scroll_properties||p.unshift(function(){c.scrollManager.startMeasuringScrollPosition()}),this._extensions.forEach(function(e){e.initialize&&p.push(function(){null==e.initialize||e.initialize()})}),p.push(function(){if(c._pendingRemoteConfig){var e=c._pendingRemoteConfig;c._pendingRemoteConfig=void 0,c._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})}}),this._processInitTaskQueue(p,f,_)},t._processInitTaskQueue=function(e,t,n){for(var r,i,o,s=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void(this._extensionInitTimeout=setTimeout(function(){s._extensionInitTimeout=void 0,s._processInitTaskQueue(e,t,n)},0));var a=e.shift();if(a)try{a()}catch(e){Sl.error("Error initializing extension:",e)}}var u=Math.round(performance.now()-t);n&&u>0?this.register_for_session(((r={})[Lp]=this.config.__preview_deferred_init_extensions?"deferred":"synchronous",r[Dp]=u,r)):ri(null==(i=this.sessionPersistence)?void 0:i.props.$sdk_debug_extensions_init_method)&&ri(null==(o=this.sessionPersistence)?void 0:o.props.$sdk_debug_extensions_init_time_ms)||(this.unregister_for_session(Lp),this.unregister_for_session(Dp)),this.config.__preview_deferred_init_extensions&&Sl.info("PostHog extensions initialized ("+u+"ms)")},t._onRemoteConfig=function(e){var t=this;if(!Mh||!Mh.body)return Sl.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t._onRemoteConfig(e)},500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(r.supportedCompression,yh)?yh:Vr(r.supportedCompression,bh)?bh:void 0),null!=(n=r.analytics)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Kp}),this._internalEventEmitter.emit("extensionsRemoteConfig",e),this._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})},t._loaded=function(){var e=this;try{this.config.loaded(this)}catch(e){Sl.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Oh&&Oh.hostname){var t=Oh.hostname,n=this.config.internal_or_test_user_hostname;("string"==typeof n?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(function(){(e.consent.isOptedIn()||e._inCookielessMode())&&e._captureInitialPageview()},1),this._remoteConfigLoader=new my(this),this._remoteConfigLoader.load()},t._start_queue_if_opted_in=function(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())},t._dom_loaded=function(){var e=this;this.is_capturing()&&xl(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()},t._handle_unload=function(){var e,t,n,r,i;this._isPageUnloading=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(Jp),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(Jp,null,{transport:"sendBeacon"})},t._send_request=function(e){by(this,e)},t._send_retriable_request=function(e,t){this._retryQueue?this._retryQueue.retriableRequest(e,t):this._send_request(t?d({},e,{transport:t}):e)},t._execute_array=function(e){var t=this;jy++;try{var n,r=[],i=[],o=[];xl(e,function(e){if(e)if(Xr(n=e[0]))o.push(e);else if(ei(e))try{e.call(t)}catch(t){Sl.error("Error executing queued PostHog call",e,t)}else Xr(e)&&"alias"===n?r.push(e):Xr(e)&&-1!==n.indexOf("capture")&&ei(t[n])?o.push(e):i.push(e)});var s=function(e,t){xl(e,function(e){try{if(Xr(e[0])){var n=t;Cl(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){Sl.error("Error executing queued PostHog call",e,t)}})};s(r,this),s(i,this),s(o,this)}finally{jy--}},t.push=function(t){if(jy>0&&Xr(t)&&ii(t[0])){var n=e.prototype[t[0]];ei(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedMetaIdentifier=function(e){var t,n=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return ii(n)&&e.pattern.test(n)?{value:n,delivered:!1}:ti(n)&&ii(n.value)&&e.pattern.test(n.value)?{value:n.value,delivered:!0===n.delivered}:void 0},t._storeMetaIdentifier=function(e,t,n){return t===(null==n?void 0:n.value)?{value:t,pending:!n.delivered}:(e.register(t,!1),{value:t,pending:!0})},t._readMetaCookie=function(e){if(this.config.save_campaign_params&&!this._inCookielessMode()){var t=rm(e.cookieName);return ii(t)&&e.pattern.test(t)?t:void 0}},t._updateFacebookClickId=function(e,t,n,r){if(this.persistence){var i=this._facebookClickIdChannel,o=this._getPersistedMetaIdentifier(i);if(!r){if(n)return ii(t)&&Jy.test(t)?this._storeMetaIdentifier(i,t,o):void i.unregister();var s=ii(e)&&Yy.test(e)?e:void 0,a=this._readMetaCookie(i);return a&&function(e,t,n){var r=e.split(".");if(t)return r[3]===t;if(!n)return!0;var i=n.value.split(".");return r[3]===i[3]||Number(r[2])>Number(i[2])}(a,s,o)?this._storeMetaIdentifier(i,a,o):s?(null==o?void 0:o.value.split(".")[3])===s?{value:o.value,pending:!o.delivered}:this._storeMetaIdentifier(i,"fb.1."+Date.now()+"."+s,o):o?{value:o.value,pending:!o.delivered}:void 0}i.unregister()}},t._updateFacebookBrowserId=function(e,t,n){if(this.persistence){var r=this._facebookBrowserIdChannel,i=this._getPersistedMetaIdentifier(r);if(!n){if(t)return ii(e)&&Zy.test(e)?this._storeMetaIdentifier(r,e,i):void r.unregister();var o=this._readMetaCookie(r);return o?this._storeMetaIdentifier(r,o,i):i?{value:i.value,pending:!i.delivered}:void 0}r.unregister()}},t._markMetaIdentifiersDelivered=function(e){var t=this;if(this.persistence){var n=function(e){var n=e.value,r=t._getPersistedMetaIdentifier(e.channel);return(null==r?void 0:r.value)===n&&!r.delivered},r=e.filter(n);r.length&&(this.persistence.refreshMetaIdentifiers(),r.filter(n).forEach(function(e){return e.channel.register(e.value,!0)}))}},t.capture=function(e,t,n){var r,i,o,s,a,u,l,c,f,h,p=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue)if(this.is_capturing())if(!ri(e)&&ii(e)){if(this._syncCookielessIdentity(),"$snapshot"!==e||!this._inCookielessMode()){var _=!this.config.opt_out_useragent_filter&&this._is_bot();if(_&&!this.config.__preview_capture_bot_pageviews)return this._botFilterWarned||(this._botFilterWarned=!0,console.warn("[PostHog.js] Events are being dropped because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture them, e.g. in end-to-end tests. Note that logs from `captureLog` are not subject to this filter.")),void Sl.info('Event "'+e+'" was not captured because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture it.');var v=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=v&&v.isRateLimited)Sl.critical("This capture call is ignored due to client rate limiting.");else{var g;null!=t&&t.$current_url&&!ii(null==t?void 0:t.$current_url)&&(Sl.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=n&&n._originatedFromCaptureException||Sl.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.persistence.syncCookieProperties(),this._processCookieIdentityChange(),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(g=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var m=new Date,y=(null==n?void 0:n.timestamp)||m,b=Bo(null==n?void 0:n.uuid,xu),w={uuid:b,event:e,properties:this._calculateEventProperties(e,t||{},y,b,!1,!0)},S=null==(r=this.featureFlags)||null==r.flagEventCapture?void 0:r.flagEventCapture(t);if(!S||(Cl(S.omit,function(e){delete w.properties[e]}),!1!==(null==S.resolved?void 0:S.resolved(w.properties)))){"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&_&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),v&&(w.properties.$lib_rate_limit_remaining_tokens=v.remainingTokens);var k="$feature_flag_called"===e&&!1===w.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=n&&n.$set&&!k&&(w.$set=null==n?void 0:n.$set);var x=ti(null==t?void 0:t.$set)?t.$set:void 0,C=Xr(null==t?void 0:t.$unset)?t.$unset:[],P=(null==n?void 0:n.$unset)||[],E=function(e){var t,r=!(null==n||!n.$set)&&e in n.$set;return{hasProvided:r||!!x&&e in x,provided:r?null==n||null==(t=n.$set)?void 0:t[e]:null==x?void 0:x[e],unset:-1!==C.indexOf(e)||-1!==P.indexOf(e)}};this.persistence.refreshMetaIdentifiersBeforeCapture();for(var T=E(np),F=E(ip),I=[{channel:this._facebookClickIdChannel,hasProvided:T.hasProvided,update:this._updateFacebookClickId(null==(i=g)?void 0:i.fbclid,T.provided,T.hasProvided,T.unset)},{channel:this._facebookBrowserIdChannel,hasProvided:F.hasProvided,update:this._updateFacebookBrowserId(F.provided,F.hasProvided,F.unset)}],R=0,A=I;A.length>R;R++){var M,O=A[R],L=O.update;L&&!0===w.properties.$process_person_profile&&L.pending&&!O.hasProvided&&!k&&(w.$set=d(((M={})[O.channel.property]=L.value,M),w.$set))}var D=null==n?void 0:n.$unset;D&&(w.$unset=D);var q=k?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==Xp,e===Zp);if(q&&(w.$set_once=q),null!=n&&n._noTruncate||(l=this.config.properties_string_max_length,c=w,f=function(e){return ii(e)?e.slice(0,l):e},h=new Set,w=function e(t,n){if(t!==Object(t))return f?f(t):t;if(!h.has(t)){var r;if(h.add(t),Xr(t))r=[],xl(t,function(t){r.push(e(t))});else{var i={};Cl(_i(t)?Il(t):t,function(t,n){h.has(t)||(i[n]=e(t,n))}),r=i}return r}}(c)),w.timestamp=y,ri(null==n?void 0:n.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=m),k&&(w.properties=function(e,t){void 0===t&&(t=[]);var n={},r=function(t){void 0!==e[t]&&(n[t]=e[t])};return qs.forEach(r),t.forEach(r),n}(w.properties,S?Xy.concat(S.keep):Xy)),e===dl||e===fl){var N,B=null==t?void 0:t[hl],j=null==t?void 0:t[_l];ic({id:B,current_iteration:j}),w.$set=d({},w.$set,((N={})[Nl({id:B,current_iteration:j},e===fl?"responded":"dismissed")]=!0,N))}else e===cl&&(w.$set=d({},w.$set,((o={}).$survey_last_seen_date=(new Date).toISOString(),o)));if("product tour shown"===e){var H,z=null==t?void 0:t.$product_tour_type;z&&(w.$set=d({},w.$set,((H={})["$product_tour_last_seen_date/"+z]=(new Date).toISOString(),H)))}var U=d({},w.properties.$set,w.$set);if(ni(U)||this.setPersonPropertiesForFlags(U),!ai(this.config.before_send)){var W=this._runBeforeSend(w,null==S?void 0:S.failed);if(!W)return;(w=W).uuid=Bo(w.uuid,xu)}this.sessionRecording&&!this.sessionRecording.isReplayOff&&!this._replayDebugPropertiesPaused&&Qy(e)&&(this._replayDebugPropertiesPaused=!0,setTimeout(function(){return p._replayDebugPropertiesPaused=!1},3e4));var V=[];I.forEach(function(e){var t,n,r,i=e.channel,o=e.update,s=null!==(t=null==(n=w.$set)?void 0:n[i.property])&&void 0!==t?t:ti(null==(r=w.properties)?void 0:r.$set)?w.properties.$set[i.property]:void 0;null!=o&&o.pending&&s===o.value&&V.push({channel:i,value:o.value})}),this._internalEventEmitter.emit("eventCaptured",w);var G,K,Q=null!==(s=null==n?void 0:n._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),Y="recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(Q),J=d({method:"POST",url:Q,data:w,compression:"best-available",preferSyncCompression:null==n?void 0:n.send_instantly,timestampMode:Y?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},Y&&null!=(a=w.properties)&&a.$session_id?{batchGroup:w.properties.$session_id+(w.properties.$window_id?"-"+w.properties.$window_id:"")}:{},null!=n&&n.transport?{transport:n.transport}:{},V.length?{fireCallbackOnDrop:!0,callback:function(e){e.statusCode>=200&&300>e.statusCode&&p._markMetaIdentifiersDelivered(V)}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?(!J.transport&&!J.callback&&ni(null!==(G=this.config.request_headers)&&void 0!==G?G:{})&&this._isPageUnloading&&(K="sendBeacon"),this._send_retriable_request(J,K)):this._requestQueue.enqueue(J),null==(u=this.featureFlags)||u.sendFlagCallsPendingCapture(),w}}}}else Sl.error("No event name provided to posthog.capture");else Sl.info('Event "'+e+'" was not captured because capturing is disabled (opted out or consent pending).');else Sl.uninitializedWarning("posthog.capture")},t._addCaptureHook=function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})},t.getExtension=function(e){var t;return null==(t=this._browserClientAdapter)?void 0:t.getExtension(e)},t._getBrowserClientAdapter=function(){var e;return null!==(e=this._browserClientAdapter)&&void 0!==e?e:this._browserClientAdapter=new cg(this)},t._registerExtensionEventProperties=function(e){var t=this;this._extensionEventPropertyProducers.push(e);var n=!0;return function(){if(n){n=!1;var r=t._extensionEventPropertyProducers.indexOf(e);-1!==r&&t._extensionEventPropertyProducers.splice(r,1)}}},t._processCookieIdentityChange=function(e){var t;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange()||(this._processIdentityChange(e),0))},t._processIdentityChange=function(e){var t,n,r;void 0===e&&(e=!0),this._cachedPersonProperties=null,"anonymous"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))&&(null==(r=this.sessionPersistence)||r.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags()},t.calculateEventProperties=function(e,t,n,r,i){return this._calculateEventProperties(e,t,n,r,i,!1)},t._calculateEventProperties=function(e,t,n,r,i,o){if(void 0===o&&(o=!1),n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this._syncCookielessIdentity(),o||(this.persistence.syncCookieProperties(),this._processCookieIdentityChange());var s=i?void 0:this.persistence.remove_event_timer(e),a=d({},t);if(a.token=this.config.token,a.$config_defaults="latest"===this.config.defaults?tb:this.config.defaults,this._inCookielessMode()&&(a[Op]=!0),"$snapshot"===e){var u=d({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ii(a.distinct_id)&&!ui(a.distinct_id)||oi(a.distinct_id))&&Sl.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,c,f=function(e,t,n,r){var i,o,s,a;if(void 0===r&&(r=!1),!Nh)return{};var u,l=e?[].concat(Hm,t||[]):[],c=xo(Nh),d=c[0],f=c[1],h=function(e){for(var t=0;To.length>t;t++){var n,r=To[t],i=r[1],o=r[2],s=e.match(r[0]);if(s)return[i,(null==(n=o&&e.match(o)||s)?void 0:n[1])||""]}return["",""]}(Nh),p=h[0],_=h[1],v=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},g={};ri(n)||(g.detectGoogleSearchApp=n);var m={},y=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,b=null==(o=navigator)?void 0:o.maxTouchPoints,w=null==Ih||null==(s=Ih.screen)?void 0:s.width,S=null==Ih||null==(a=Ih.screen)?void 0:a.height,k=null==Ih?void 0:Ih.devicePixelRatio;ri(y)||(m.userAgentDataPlatform=y),ri(b)||(m.maxTouchPoints=b),ri(w)||(m.screenWidth=w),ri(S)||(m.screenHeight=S),ri(k)||(m.devicePixelRatio=k);var x,C=Pl(Fl({$os:d,$os_version:f,$browser:bo(Nh,navigator.vendor,v,g),$webview_app:p,$webview_app_version:_,$device:Co(Nh),$device_type:Po(Nh,m),$timezone:Yh(),$timezone_offset:ey()}),{$current_url:Kh(r?Ho(null==Oh?void 0:Oh.href):null==Oh?void 0:Oh.href,l,Um),$host:null==Oh?void 0:Oh.host,$pathname:null==Oh?void 0:Oh.pathname,$raw_user_agent:Nh.length>1e3?Nh.substring(0,997)+"...":Nh,$browser_version:So(Nh,navigator.vendor,v,g),$browser_language:Qm(),$browser_language_prefix:(x=Qm(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==Ih?void 0:Ih.screen.height,$screen_width:null==Ih?void 0:Ih.screen.width,$viewport_height:null==Ih?void 0:Ih.innerHeight,$viewport_width:null==Ih?void 0:Ih.innerWidth,$lib:bl.LIB_NAME,$lib_version:bl.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return bl.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=bl.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime(),!0),_=h.windowId;a.$session_id=h.sessionId,a.$window_id=_}this.sessionPropsManager&&Pl(a,this.sessionPropsManager.getSessionProps());try{var v;if(this.sessionRecording){var g=this.sessionRecording.sdkDebugProperties,m=!this._replayDebugPropertiesPaused&&Qy(e);for(var y in g)(m||Vr(Gy,y))&&(a[y]=g[y])}l=null==(v=this._retryQueue)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Ay&&(a.$lib_custom_api_host=this.config.api_host),c="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),a=Pl(a,c),"$pageview"===e&&Mh&&(a.title=Mh.title),!ri(s)){var b=n.getTime()-s;a.$duration=parseFloat((b/1e3).toFixed(3))}Nh&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var w=this.persistence.properties(),S=this.sessionPersistence.properties(),k=a.$groups,x=w.$groups;ti(k)&&!ni(k)&&(a.$groups=d({},ti(x)?x:{},k)),Cl(["$referrer","$referring_domain"],function(e){e in w&&delete S[e]});var C={};if(this._extensionEventPropertyProducers.length>0)for(var P,E=p(this._extensionEventPropertyProducers.slice());!(P=E()).done;){var T=P.value;try{Pl(C,T())}catch(e){Sl.error("Failed to produce browser extension event properties",e)}}a=Pl({},f,w,S,d({},C,a)),l?a.$sdk_debug_retry_queue_size=l:delete a.$sdk_debug_retry_queue_size,a.$is_identified=this._isIdentified(),Xr(this.config.property_denylist)?Cl(this.config.property_denylist,function(e){delete a[e]}):Sl.error(Vy+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var F=this.config.sanitize_properties;F&&(Sl.error(Wy),a=F(a,e));var I=this._hasPersonProcessing();return a.$process_person_profile=I,I&&!i&&this._requirePersonProcessing("_calculate_event_properties"),a},t._calculate_set_once_properties=function(e,t,n){var r;if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!n)return e;var i=Pl({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),o=this.config.sanitize_properties;return o&&(Sl.error(Wy),i=o(i,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),ni(i)?void 0:i},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)},t.register_for_session=function(e){var t,n,r=this;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(n=this.sessionPersistence)||n.register(e),Object.keys(e).forEach(function(e){return r._sessionRegisteredPropKeys.add(e)}),this._persistSessionRegisteredPropKeys()},t.unregister=function(e){var t;null==(t=this.persistence)||t.unregister(e)},t.unregister_for_session=function(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this._sessionRegisteredPropKeys.delete(e),this._persistSessionRegisteredPropKeys()},t._register_single=function(e,t){var n;this.register(((n={})[e]=t,n))},t._clearSessionRegisteredProps=function(){var e=this;this._sessionRegisteredPropKeys.forEach(function(t){var n;null==(n=e.sessionPersistence)||n.unregister(t)}),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()},t._persistSessionRegisteredPropKeys=function(){var e;if(this._sessionRegisteredPropertiesStorageKey)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e._disabled||!km._is_supported())km._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach(function(e){return t.push(e)}),t.length>0?km._set(this._sessionRegisteredPropertiesStorageKey,t):km._remove(this._sessionRegisteredPropertiesStorageKey)}},t.getFeatureFlag=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlag(e,t)},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)},t.getFeatureFlagResult=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlagResult(e,t)},t.getAllFeatureFlags=function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]},t.isFeatureEnabled=function(e,t){var n,r;return null!==(n=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t))&&void 0!==n?n:null==t?void 0:t.defaultValue},t.reloadFeatureFlags=function(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()},t.updateFlags=function(e,t,n){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,n)},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,n)},t.getEarlyAccessFeatures=function(e,t,n){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,n)},t.on=function(e,t){return this._internalEventEmitter.on(e,t)},t.onFeatureFlags=function(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),function(){})},t.onSurveysLoaded=function(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Uy}),function(){})},t.onSessionId=function(e){var t,n;return null!==(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}},t.getSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Uy})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Uy})},t.onActiveMatchingSurveysChanged=function(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:Uy}),function(){})},t.renderSurvey=function(e,t){var n;null==(n=this.surveys)||n.renderSurvey(e,t)},t.displaySurvey=function(e,t){var n;void 0===t&&(t=sc),null==(n=this.surveys)||n.displaySurvey(e,t)},t.cancelPendingSurvey=function(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)},t.canRenderSurvey=function(e){var t,n;return null!==(t=null==(n=this.surveys)?void 0:n.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:Uy}},t.canRenderSurveyAsync=function(e,t){var n,r;return void 0===t&&(t=!1),null!==(n=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))&&void 0!==n?n:Promise.resolve({visible:!1,disabledReason:Uy})},t._validateIdentifyId=function(e){return!e||oi(e)?(Sl.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(Sl.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Sl.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)},t.identify=function(e,t,n){if(!this.__loaded||!this.persistence)return Sl.uninitializedWarning("posthog.identify");if(ui(e)&&(e=e.toString(),Sl.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){this._syncCookielessIdentity();var r=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,o=this._processCookieIdentityChange(!1),s=this.persistence._beginCookieSyncSuppression(),a=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property("__alias")&&(this.unregister(tp),this.register({distinct_id:e}));var l=(this.persistence.get_property("$user_state")||"anonymous")===Vp,c=e!==u,d=!c&&l;if(c&&l){var f,h=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:u};this.persistence.set_property(Pp,Gp),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$identify",h,{$set:t||{},$set_once:n||{}})&&(this._cachedPersonProperties=vg(e,t,n)),null==(f=this.featureFlags)||f.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(d){this.persistence.set_property(Pp,Gp);var p=t||{},_=n||{};this.setPersonPropertiesForFlags({$set:p,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:p,$set_once:_})&&(this._cachedPersonProperties=vg(e,t,n))}else(t||n)&&this.setPersonProperties(t,n);c||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Xf)):d&&(t||n)&&this.reloadFeatureFlags(),a=!0}finally{s&&this.persistence._endCookieSyncSuppression(a)}}},t.setPersonProperties=function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=vg(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}})&&(this._cachedPersonProperties=n)):Sl.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Xr(e)?e:[e]).filter(function(e){return ii(e)&&e.length>0});0!==n.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(n,!0),this.capture("$set",{$unset:n}),this._cachedPersonProperties=null)},t.group=function(e,t,n){var r,i,o;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var s=this.getGroups(),a=s[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:d({},s,(i={},i[e]=t,i))}),(a||n)&&this._hasPersonProcessing()){var u={$group_type:e,$group_key:t};n&&(u.$group_set=n),this.capture(Xp,u)}n&&this.setGroupPropertiesForFlags(((o={})[e]=n,o)),a&&!n&&this.reloadFeatureFlags()}else Sl.error("posthog.group requires a group type and group key")},t.resetGroups=function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()},t.setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),null==(n=this.featureFlags)||n.setPersonPropertiesForFlags(e,t)},t.resetPersonPropertiesForFlags=function(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(n=this.featureFlags)||n.setGroupPropertiesForFlags(e,t))},t.resetGroupPropertiesForFlags=function(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)},t.reset=function(e){var t=ci(e)?e:null==e?void 0:e.resetDeviceID,n=ci(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var r,i,o,s,a;if(void 0===t&&(t=!1),Sl.info("reset"),!this.__loaded)return Sl.uninitializedWarning("posthog.reset");var u=null==n?void 0:n.sessionID;this.config.bootstrap=n||(null==(r=this._originalUserConfig)?void 0:r.bootstrap)||{},null==(i=this.featureFlags)||null==i.updateConfig||i.updateConfig(this.config,this._shouldDisableFlags());var l=this.get_property(Xh),c=this.get_property(ep),f=this.get_property(vp);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var h=this.is_capturing();t||this.consent.reset(),t||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var p=null==(s=this.persistence)||null==s._beginCookieSyncSuppression?void 0:s._beginCookieSyncSuppression(),_=this._isConsentTransition;this._isConsentTransition=_||t;var v=!1;try{var g,m,y,b,w,S,k,x,C,P,E,T,F,I;if(null==(g=this.persistence)||g.clear(),null==(m=this.sessionPersistence)||m.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),ri(f)||null==(y=this.persistence)||y.register(((b={})[vp]=f,b)),null==(w=this.surveys)||w.reset(),null==(S=this.featureFlags)||S.reset(),null==(k=this.conversations)||k.reset(),null==(x=this.logs)||x.reset(),null==(C=this.metrics)||C.reset(),null==(P=this.persistence)||P.set_property(Pp,Vp),null==(E=this.sessionManager)||E.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Mp,$device_id:null},"");else{var R,A=this.config.get_device_id(xu());this.register_once({distinct_id:A,$device_id:e?A:l},""),e||ri(c)||this.register(((R={})[ep]=c,R))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(n.distinctID&&!this._inCookielessMode()&&(null==(I=this.persistence)||I.set_property(Pp,n.isIdentifiedID?Gp:Vp),this.register({distinct_id:n.distinctID})),null==(T=this.featureFlags)||T.initialize(),!(ai(u)||null!=(F=this.sessionManager)&&F.setBootstrapSessionId(u,!0))){var M=d({},n);delete M.sessionID,this.config.bootstrap=M}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,v=!0}finally{var O;this._isConsentTransition=_,p&&(null==(O=this.persistence)||null==O._endCookieSyncSuppression||O._endCookieSyncSuppression(v))}this._lastRemoteConfig&&(null==(a=this.conversations)||a.onRemoteConfig(this._lastRemoteConfig)),this.reloadFeatureFlags()},t.shutdown=function(){var e=h(l().m(function e(t){var n,r,i,o,s,a=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return Sl.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:for(this._isShutdown=!0,clearTimeout(this._extensionInitTimeout),this._extensionInitTimeout=void 0,n=this._featureFlagsReloadingUnsubscribe,this._featureFlagsReloadingUnsubscribe=void 0,r=0,i=[function(){var e;return null==(e=a.sessionRecording)?void 0:e.dispose()},function(){var e;return null==(e=a.logs)?void 0:e.flushLogs("sendBeacon")},function(){var e;return null==(e=a.metrics)?void 0:e.flush("sendBeacon")},function(){var e;return null==(e=a.metrics)?void 0:e.dispose()},function(){var e;return null==(e=a.logs)?void 0:e.dispose()},function(){var e;return null==(e=a.surveys)?void 0:e.dispose()},function(){var e;return null==(e=a.autocapture)?void 0:e.dispose()},function(){return null==n?void 0:n()},function(){var e;return null==(e=a._requestQueue)?void 0:e.unload()},function(){var e;return null==(e=a._retryQueue)?void 0:e.unload()},function(){var e;return null==(e=a.featureFlags)?void 0:e.destroy()},function(){var e;return null==(e=a.persistence)?void 0:e.destroy()},function(){var e;return null==(e=a.sessionPersistence)?void 0:e.destroy()}];i.length>r;r++){o=i[r];try{(s=o())&&ei(s.then)&&s.then(void 0,function(e){Sl.error("Error during shutdown",e)})}catch(e){Sl.error("Error during shutdown",e)}}case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.setIdentity=function(e,t){var n;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(n=this.conversations)||n._onIdentityChanged()},t.clearIdentity=function(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e._onIdentityCleared()},t.get_distinct_id=function(){return this.get_property("distinct_id")},t.getGroups=function(){return this.get_property("$groups")||{}},t.get_session_id=function(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""},t.get_session_replay_url=function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&n){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-o,0)}return r},t.alias=function(e,t){return e===this.get_property("$people_distinct_id")?(Sl.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(ri(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(tp,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Sl.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t=d({},this.config);if(ti(e)){var n,r,i,o,s,a,u,l,c,f,h,p,_,v;Pl(this.config,ob(e));var g=this._is_persistence_disabled();if(this.persistence){var m,y,b,w="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;w&&this.sessionPersistence!==this.persistence&&(null==(y=this.sessionPersistence)||y.remove(),null==(b=this.sessionPersistence)||b.destroy()),this.persistence.update_config(this.config,t,g),w?this.sessionPersistence=this.persistence:this.sessionPersistence===this.persistence?this.sessionPersistence=new py(d({},this.config,{persistence:"sessionStorage"}),g,!1):null==(m=this.sessionPersistence)||m.update_config(d({},this.config,{persistence:"sessionStorage"}),d({},t,{persistence:"sessionStorage"}),g)}var S=this._checkLocalStorageForDebug(this.config.debug);ci(S)&&(this.config.debug=S),ci(this.config.debug)&&(this.config.debug?(Jh.DEBUG=!0,lm._is_supported()&&lm._set("ph_debug",!0),Sl.info("set_config",{config:e,oldConfig:t,newConfig:d({},this.config)})):(Jh.DEBUG=!1,lm._is_supported()&&lm._remove("ph_debug"))),null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(i=this.exceptions)||i.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(s=this.webMCP)||s.startIfEnabled(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(u=this.tracingHeaders)||u.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(c=this.heatmaps)||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(f=this.historyAutocapture)||f.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(_=this.surveys)||_.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Im(this,Hy,!1)}},t._overrideSDKInfo=function(e,t){Jh.LIB_NAME=e,Jh.LIB_VERSION=t},t.startSessionRecording=function(e){var t,n,r,i,o,s=!0===e,a={sampling:s||!(null==e||!e.sampling),linked_flag:s||!(null==e||!e.linked_flag),url_trigger:s||!(null==e||!e.url_trigger),event_trigger:s||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(i=this.sessionRecording)||i.overrideTrigger("url")),a.event_trigger&&(null==(o=this.sessionRecording)||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})},t.stopSessionRecording=function(){this.set_config({disable_session_recording:!0})},t.sessionRecordingStarted=function(){var e;return!(null==(e=this.sessionRecording)||!e.started)},t.captureException=function(e,t){try{if(!this.exceptions)return;var n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(d({},n,t))}catch(e){return}},t.addExceptionStep=function(e,t){var n;null==(n=this.exceptions)||n.addExceptionStep(e,t)},t.captureLog=function(e){var t;null==(t=this.logs)||t.captureLog(e)},t.startExceptionAutocapture=function(e){this.set_config({capture_exceptions:null==e||e})},t.stopExceptionAutocapture=function(){this.set_config({capture_exceptions:!1})},t.loadToolbar=function(e){var t,n;return null!==(t=null==(n=this.toolbar)?void 0:n.loadToolbar(e))&&void 0!==t&&t},t.get_property=function(e){var t;return null==(t=this.persistence)?void 0:t.props[e]},t.getSessionProperty=function(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]},t.toString=function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:eb;return t!==eb&&(t="posthog."+t),t},t._isIdentified=function(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ni(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))},t._shouldCapturePageleave=function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview},t.createPersonProfile=function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})},t.setInternalOrTestUser=function(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})},t._requirePersonProcessing=function(e){return"never"===this.config.person_profiles?(Sl.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(Ap,!0),!0)},t._is_persistence_disabled=function(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)},t._sync_opt_out_with_persistence=function(){var e,t,n,r,i,o,s=this._is_persistence_disabled();return this.is_capturing()||(null==(i=this.logs)||i._onOptOut(),null==(o=this.heatmaps)||o.discardPending()),(null==(e=this.persistence)?void 0:e._disabled)!==s&&(null==(t=this.persistence)||t.set_disabled(s)),(null==(n=this.sessionPersistence)?void 0:n._disabled)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),this._persistSessionRegisteredPropKeys(),s},t.opt_in_capturing=function(t){var n,r,i,o,s;if("always"!==this.config.cookieless_mode){if(this._inCookielessMode()){var a,u,l,c,d,f;null==(a=this.sessionRecording)||a.dispose({discardBufferedEvents:!0}),this._reset(!0,!0),null==(u=this.sessionManager)||u.destroy(),null==(l=this.pageViewManager)||l.destroy(),this.sessionManager=new Ty(this),this.pageViewManager=new Om(this),this.persistence&&(this.sessionPropsManager=new Cy(this,this.sessionManager,this.persistence));var h,p=null!==(c=null==(d=this.config.__extensionClasses)?void 0:d.sessionRecording)&&void 0!==c?c:null==(f=e.__defaultExtensionClasses)?void 0:f.sessionRecording;p&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new p(this)),this._lastRemoteConfig&&(null==(h=this.sessionRecording)||null==h.onRemoteConfig||h.onRemoteConfig(this._lastRemoteConfig)))}var _,v,g=1===this.consent.consent;g?this._syncCookielessIdentity():null==(n=this.heatmaps)||n.discardPending(),this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(_=this.surveys)||_.loadIfEnabled(),null==(v=this.conversations)||v.loadIfEnabled()),!g&&(ri(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(i=null==t?void 0:t.captureEventName)&&void 0!==i?i:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),null==(o=this.persistence)||o.syncCookieProperties(),this._processCookieIdentityChange(),null==(s=this.featureFlags)||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this._captureInitialPageview()}else Sl.warn(zy)},t.opt_out_capturing=function(){"always"!==this.config.cookieless_mode?(this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&this._enterCookielessMode()):Sl.warn(zy)},t._enterCookielessMode=function(){var e,t,n,r=this.sessionRecording;null==r||r.dispose({discardBufferedEvents:!0}),null==(e=this.heatmaps)||e.discardPending(),"$posthog_cookieless"!==this.get_distinct_id()&&this._reset(!0,!0),this.register({distinct_id:Mp,$device_id:null}),this._removeExtension(r),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in()},t.has_opted_in_capturing=function(){return this.consent.isOptedIn()},t.has_opted_out_capturing=function(){return this.consent.isOptedOut()},t.get_explicit_consent_status=function(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"},t.is_capturing=function(){return!this._isConsentTransition&&("always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))},t.clear_opt_in_out_capturing=function(){this.consent.reset(),this._sync_opt_out_with_persistence()},t._is_bot=function(){return Ah?Iy(Ah,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Mh&&("visible"===Mh.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(Yp,{title:Mh.title},{send_instantly:!0}),this._visibilityStateListener&&(Mh.removeEventListener(ih,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Ml(Mh,ih,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Ih||Ih.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Ih||Ih.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}))},t._shouldDisableFlags=function(){var e=this._originalUserConfig||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Sl.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,n,r,i){var o=t in e&&!ai(e[t]),s=n in e&&!ai(e[n]);return o?e[t]:!!s&&(i&&i.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n])}(e,"advanced_disable_flags","advanced_disable_decide",0,Sl)},t._runBeforeSend=function(e,t){var n;if(ai(this.config.before_send))return e;for(var r,i=Object.keys(null!==(n=e.properties)&&void 0!==n?n:{}).filter(fi),o=e,s=p(Xr(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(r=s()).done;){var a=r.value;try{if(o=a(o),ai(o)){var u="Event '"+e.event+"' was rejected in beforeSend function";return di(e.event)?Sl.warn(u+". This can cause unexpected behavior."):Sl.info(u),null}o.properties&&!ni(o.properties)||Sl.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(n){return Sl.error("Error in beforeSend function for event '"+e.event+"':",n),null==t||t(),null}}for(var l,c=p(i);!(l=c()).done;){var d=l.value;if(o.properties&&ai(o.properties[d]))return Sl.warn("Event '"+e.event+"' had its '"+d+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null}return o},t.getPageViewId=function(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId},t.captureTraceFeedback=function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})},t.captureTraceMetric=function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})},t._checkLocalStorageForDebug=function(e){var t=ci(e)&&!e,n=lm._is_supported()&&"true"===lm._get("ph_debug");return!t&&(!!n||e)},a(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"flagsEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"_facebookClickIdChannel",get:function(){var e=this;return{property:np,persistenceKey:rp,cookieName:"_fbc",pattern:Jy,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[rp]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(rp)}}}},{key:"_facebookBrowserIdChannel",get:function(){var e=this;return{property:ip,persistenceKey:op,cookieName:"_fbp",pattern:Zy,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[op]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(op)}}}},{key:"logger",get:function(){var t,n;return null!==(t=null==(n=this.logs)?void 0:n.logger)&&void 0!==t?t:e._noopLogger}}])}(),c.__defaultExtensionClasses={},c._noopLogger=function(){var e=function(){};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}}(),c);!function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Tl(e.prototype[t[n]])}(ab,["identify"]);var ub=["[data-ph-capture-value]"],lb=function(){"use strict";function e(e){this._instance=e}return e.prototype.refresh=function(e){var t,n=this._instance.config,r=ti(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance._shouldDisableFlags(),e.url_allowlist=null==r?void 0:r.url_allowlist,e.url_ignorelist=null==r?void 0:r.url_ignorelist,e.dom_event_allowlist=null==r?void 0:r.dom_event_allowlist,e.element_allowlist=null==r?void 0:r.element_allowlist,e.css_selector_allowlist=null==r?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=null==r?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=null==r?void 0:r.element_attribute_ignorelist,e.capture_copied_text=null==r?void 0:r.capture_copied_text,e.capture_value_css_selector_allowlist=null!==(t=null==r?void 0:r.capture_value_css_selector_allowlist)&&void 0!==t?t:ub},e}(),cb=function(e){"use strict";function t(t){var n=e.call(this,new lb(t))||this;return n.instance=t,n}return r(t,e),t}(ev),db=kl("[ExceptionAutocapture]"),fb=function(){"use strict";function e(e){var t,n=this;this._startCapturing=function(){var e;if(Ih&&n.isEnabled&&null!=(e=jh.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=jh.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=jh.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=jh.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!n._unwrapOnError&&n._config.capture_unhandled_errors&&(n._unwrapOnError=t(n.captureException.bind(n))),!n._unwrapUnhandledRejection&&n._config.capture_unhandled_rejections&&(n._unwrapUnhandledRejection=r(n.captureException.bind(n))),!n._unwrapConsoleError&&n._config.capture_console_errors&&(n._unwrapConsoleError=i(n.captureException.bind(n)))}catch(e){db.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[up]),this._rateLimiter=new Ci(d({},function(e){var t,n,r,i;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(n=e.exceptionRateLimiterRefillRate)&&void 0!==n?n:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(r=null!==(i=e.exceptionRateLimiterBucketSize)&&void 0!==i?i:e.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,_logger:db})),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}var t=e.prototype;return t._requiredConfig=function(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ti(e)?t=d({},t,e):(ri(e)?this._remoteEnabled:e)&&(t=d({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(db.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=dg(this._instance))||n(this._instance,"exception-autocapture",function(t){if(t)return db.error("failed to load script",t);e()})},t._stopCapturing=function(){var e,t,n;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(n=this._unwrapConsoleError)||n.call(this),this._unwrapConsoleError=void 0},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"autocaptureExceptions"in n&&(this._remoteEnabled=!!n.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register(((t={})[up]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){try{var t,n,r,i=null!==(t=null==e||null==(n=e.$exception_list)||null==(n=n[0])?void 0:n.type)&&void 0!==t?t:"Exception";if(this._rateLimiter.consumeRateLimit(i))return void db.info("Skipping exception capture because of client rate limiting.",{exception:i});null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}catch(e){}},a(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),hb=function(){"use strict";function e(e){this._isFlushingPageview=!1,this._instance=e,this._lastLocation=this._getCurrentLocation()}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){this.isEnabled&&(Sl.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())},t.startIfEnabledOrStop=function(){this.stop(),this._lastLocation=this._getCurrentLocation(),this.startIfEnabled()},t.stop=function(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,this._hashchangeListener&&this._hashchangeListener(),this._hashchangeListener=void 0,Sl.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Ih&&Ih.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Ih&&(null==(t=Ih.history[e])||!t.__posthog_wrapped__)){var n=this;qg(Ih.history,e,function(t){return function(r,i,o){var s;n._isUrlChanging(o)&&n._flushPendingPageview(),t.call(this,r,i,o),n._capturePageview(e,!n._isFlushingPageview&&"popstate"!==(null==Ih||null==(s=Ih.event)?void 0:s.type))}})}},t._getCurrentLocation=function(){var e=null==Ih?void 0:Ih.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}},t._getCaptureOptions=function(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:ti(e)?e:{}},t._shouldCaptureHashChanges=function(e){return void 0===e&&(e=this._getCaptureOptions()),!!e.hash&&!this._instance.config.disable_capture_url_hashes},t._hasLocationChanged=function(e){var t=this._getCaptureOptions(),n=this._lastLocation;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this._shouldCaptureHashChanges(t)&&e.hash!==n.hash))},t._capturePageview=function(e,t){var n=this;void 0===t&&(t=!1);try{t||this._flushPendingPageview();var r=this._getCurrentLocation();if(!r)return;if(this._hasLocationChanged(r)){var i=function(){return n._instance.capture(Yp,{navigation_type:e})};t?(this._pendingPageview=i,Promise.resolve().then(function(){return n._flushPendingPageview()})):i()}this._lastLocation=r}catch(t){Sl.error("Error capturing "+e+" pageview",t)}},t._isUrlChanging=function(e){var t,n;return!(ai(e)||!Ih)&&(null==(t=Hh(String(e)))?void 0:t.href)!==(null==(n=Ih.location)?void 0:n.href)},t._flushPendingPageview=function(){var e=this._pendingPageview;if(e){this._pendingPageview=void 0,this._isFlushingPageview=!0;try{e()}catch(e){Sl.error("Error capturing deferred pageview",e)}finally{this._isFlushingPageview=!1}this._lastLocation=this._getCurrentLocation()}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};Ml(Ih,"popstate",t),this._popstateListener=function(){Ih&&Ih.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};Ml(Ih,"hashchange",t),this._hashchangeListener=function(){Ih&&Ih.removeEventListener("hashchange",t)}}},a(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),pb=kl("[TracingHeaders]"),_b=function(){"use strict";function e(e){var t=this;this._instance=e,this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._patchedHostnames=void 0,this._traceparentTargetsForPatch=[],this._startCapturing=function(){var e,n,r=t._syncForPatch(),i=r.hostnames;i||r.traceparentTargets?(i||Xr(t._hostnamesForPatch)||(t._hostnamesForPatch=[]),t._patchedHostnames!==t._hostnamesForPatch&&(t._stopCapturing(),t._patchedHostnames=t._hostnamesForPatch),ri(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=jh.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(t._hostnamesForPatch,function(){return t._instance.get_distinct_id()},t._instance.sessionManager,t._traceparentTargetsForPatch)),ri(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=jh.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(t._hostnamesForPatch,function(){return t._instance.get_distinct_id()},t._instance.sessionManager,t._traceparentTargetsForPatch))):t._stopCapturing()}}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=dg(this._instance))||n(this._instance,"tracing-headers",function(t){if(t)return pb.error("failed to load script",t);e()})},t._getConfiguredHostnames=function(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers},t._syncHostnamesForPatch=function(){var e,t=this._getConfiguredHostnames();return Xr(t)?(Xr(this._hostnamesForPatch)?(e=this._hostnamesForPatch).splice.apply(e,[0,this._hostnamesForPatch.length].concat(t)):this._hostnamesForPatch=[].concat(t),t.length>0?this._hostnamesForPatch:void 0):!Xr(this._hostnamesForPatch)||(this._hostnamesForPatch.splice(0),t)?(this._hostnamesForPatch=t||void 0,this._hostnamesForPatch):void 0},t._syncTraceparentTargetsForPatch=function(){var e,t=this._instance.config.trace_propagation_targets,n=Xr(t)?t.filter(function(e){return ii(e)&&!!e}):[];return(e=this._traceparentTargetsForPatch).splice.apply(e,[0,this._traceparentTargetsForPatch.length].concat(n)),n.length>0?this._traceparentTargetsForPatch:void 0},t._syncForPatch=function(){return{hostnames:this._syncHostnamesForPatch(),traceparentTargets:this._syncTraceparentTargetsForPatch()}},t._stopCapturing=function(){var e,t;null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0},t.startIfEnabledOrStop=function(){var e=this._syncForPatch();e.hostnames||e.traceparentTargets?this._loadScript(this._startCapturing):this._stopCapturing()},e}(),vb=kl("[Web Vitals]"),gb=9e5,mb=["CLS","FCP","INP","LCP"],yb=["INP","LCP"],bb=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],wb=function(){"use strict";function e(e){var t,n=this;this._instance=e,this._enabledServerSide=!1,this._initialized=!1,this._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(e){void 0===e&&(e=!1),clearTimeout(n._delayedFlushTimer),n._delayedFlushTimer=void 0,0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",d({$current_url:n._buffer.url},n._buffer.metrics.reduce(function(e,t){var n;return d({},e,((n={})["$web_vitals_"+t.name+"_event"]=d({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))},{})),e?{transport:"sendBeacon",send_instantly:!0}:void 0),n._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=function(e){var t;if(n._buffer=n._buffer||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ai(null==e?void 0:e.name)||ai(null==e?void 0:e.value))vb.error("Invalid metric received",e);else{var r="string"==typeof e.navigationURL?e.navigationURL:void 0,i=n._maskedURL(r);if(!ri(i)){var o=ui(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+i;if(!n._maxAllowedValue||n._maxAllowedValue>e.value){n._buffer.navigationKey!==o&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),ri(n._buffer.navigationKey)&&(n._buffer.navigationKey=o,n._buffer.url=i),n._buffer.firstMetricTimestamp=ri(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var s=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=d({},e,r?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete a.entries,ti(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var u,l={},c=p(bb);!(u=c()).done;){var f=u.value,h="url"===f&&"string"==typeof e.attribution[f]?n._maskedURL(e.attribution[f]):e.attribution[f];ri(h)||(l[f]=h)}a.attribution=l}else delete a.attribution;ri(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),n._buffer.metrics.push(a),n._buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()}else vb.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,r,i,o=!1,s=jh.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,u=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&ri(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!ri(u)){var l=u.withoutAttribution,c=n.attributionMetrics;o=!ri(l),e=c.indexOf("LCP")>-1?u.onLCP:(null==l?void 0:l.onLCP)||u.onLCP,t=c.indexOf("CLS")>-1?u.onCLS:(null==l?void 0:l.onCLS)||u.onCLS,r=c.indexOf("FCP")>-1?u.onFCP:(null==l?void 0:l.onFCP)||u.onFCP,i=c.indexOf("INP")>-1?u.onINP:(null==l?void 0:l.onINP)||u.onINP}if(e&&t&&r&&i){var f={reportSoftNavs:n.useSoftNavs},h=o&&n.attributionMetrics.indexOf("INP")>-1?d({},f,{includeProcessedEventEntries:!1}):f;n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n),f),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n),f),n.allowedMetrics.indexOf("FCP")>-1&&r(n._addToBuffer.bind(n),f),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n),h);var p=null==Ih?void 0:Ih.document;Ml(p,ih,function(){"hidden"===(null==p?void 0:p.visibilityState)&&n._flushToCapture(!0)}),Ml(Ih,"pagehide",function(){return n._flushToCapture(!0)}),n._initialized=!0}else vb.error("web vitals callbacks not loaded - not starting")}},this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[dp]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(vb.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n,r,i=ti(t.capturePerformance)&&!!t.capturePerformance.web_vitals,o=ti(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[dp]=i,n)),this._instance.persistence.register(((r={})[_p]=o,r))),this._enabledServerSide=i,this.startIfEnabled()}}},t._loadScript=function(e){var t,n=jh.__PosthogExtensions__,r=this._callbackFlavor,i=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor;null!=i&&i[r]||"web-vitals"===r&&ri(i)&&null!=n&&n.postHogWebVitalsCallbacks?e():null==(t=dg(this._instance))||t(this._instance,r,function(t){t?vb.error("failed to load script",t):e()})},t._maskedURL=function(e){var t=e||(null==Ih?void 0:Ih.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?Ho(t):t;return Kh(n,this._instance.config.mask_personal_data_properties?[].concat(Hm,this._instance.config.custom_personal_data_properties||[]):[],Um)}vb.error("Could not determine current URL")},a(e,[{key:"_perfConfig",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=ti(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return ai(n)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||mb:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(ti(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=ti(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return ci(e)?e?mb:[]:Xr(e)?e:yb}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e;return null!==(e=ti(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0)&&void 0!==e&&e}},{key:"_maxAllowedValue",get:function(){var e=ti(this._perfConfig)&&ui(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:gb;return e>0&&6e4>=e?gb:e}},{key:"isEnabled",get:function(){var e=null==Oh?void 0:Oh.protocol;if("http:"!==e&&"https:"!==e)return vb.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ti(this._perfConfig)?this._perfConfig.web_vitals:ci(this._perfConfig)?this._perfConfig:void 0;return ci(t)?t:this._enabledServerSide}},{key:"_callbackFlavor",get:function(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}}])}(),Sb="disabled",kb="lazy_loading";function xb(e){return"ph_replay_pending_buffer_"+JSON.stringify([e.persistence_name||e.token,e.token])}var Cb=kl("[SessionRecording]"),Pb=[$p,qp,Np,Bp,jp,Hp,zp,Up,Wp],Eb=function(){"use strict";function e(e){var t,n=this;if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=Sb,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._selectMaskingFn=void 0,this._documentWasEverVisible=function(){var e;if(null==Mh||!Mh.visibilityState||"visible"===Mh.visibilityState)return!0;var t=null==Ih||null==(e=Ih.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(function(e){return"visible"===e.name})}(),this._onVisibilityChange=function(){var e;"visible"===(null==Mh?void 0:Mh.visibilityState)&&(n._documentWasEverVisible=!0,null==(e=n._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Cb.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._config.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');var r=this._instance.get_property(kp);ii(r)&&"!"===r[0]&&(null==(t=this._persistence)||t.unregister(kp)),null!=Mh&&Mh.addEventListener&&Ml(Mh,"visibilitychange",this._onVisibilityChange)}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t.dispose=function(e){var t=(void 0===e?{}:e).discardBufferedEvents,n=void 0!==t&&t;this._sessionRecordingDisposed=!0,null==Mh||null==Mh.removeEventListener||Mh.removeEventListener("visibilitychange",this._onVisibilityChange),n?this._discardRecording(!0):this.stopRecording()},t.startIfEnabledOrStop=function(e){if(!this._sessionRecordingDisposed){var t;if(this._lazyLoadedSessionRecording)if(this._selectMaskingFn!==(null==(t=this._config.session_recording)?void 0:t.selectMaskingFn))km._remove(xb(this._config)),this._lazyLoadedSessionRecording.discard({discardProducerEvents:!0}),this._selectMaskingFn=void 0;else if(this._lazyLoadedSessionRecording.isStarted&&this._isRecordingEnabled)return void(this._checkSelectMaskingSupport()||this._discardRecording(!0));var n=!ri(Object.assign)&&!ri(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Cb.info("starting")):(this._recordingStatus=Sb,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,r=this;if(this._isRecordingEnabled)if("awaiting_config"!==this._recordingStatus&&"missing_config"!==this._recordingStatus&&(this._recordingStatus=kb),null!=jh&&null!=(t=jh.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=jh.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var i,o=this._instance.sessionManager;null==(i=dg(this._instance))||i(this._instance,this._scriptName,function(t){if(!r._sessionRecordingDisposed&&r._isRecordingEnabled&&r._instance.sessionManager===o){var n;if(t)return r._instance.register_for_session(((n={})[$p]=!0,n)),Cb.error("could not load recorder",t);r._onScriptLoaded(e)}else r._recordingStatus=Sb})}},t.stopRecording=function(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()},t._discardRecording=function(e){var t,n,r;void 0===e&&(e=!1),e&&(this._selectMaskingFn||null!=(t=this._config.session_recording)&&t.selectMaskingFn)&&km._remove(xb(this._config)),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=void 0,null==(r=this._lazyLoadedSessionRecording)||r.discard({discardProducerEvents:e}),this._selectMaskingFn=void 0},t._resetSampling=function(){var e,t;null==(e=this._persistence)||e.unregister(kp),null==(t=this._persistence)||t.unregister(gp)},t._validateSampleRate=function(e,t){if(ai(e))return null;var n,r=ui(e)?e:parseFloat(e);return"number"!=typeof(n=r)||!Number.isFinite(n)||0>n||n>1?(Cb.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r},t._persistRemoteConfig=function(e){var t=this;if(this._persistence){var n,r,i=this._persistence,o=function(){var n,r,o=!1===e.sessionRecording?void 0:e.sessionRecording,s=t._validateSampleRate(null==(n=t._config.session_recording)?void 0:n.sampleRate,"session_recording.sampleRate"),a=t._validateSampleRate(null==o?void 0:o.sampleRate,"remote config sampleRate"),u=null!=s?s:a;ai(u)&&t._resetSampling();var l=null==o?void 0:o.minimumDurationMilliseconds;i.register(((r={})[vp]=d({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:d({capturePerformance:e.capturePerformance},null==o?void 0:o.networkPayloadCapture),canvasRecording:{enabled:null==o?void 0:o.recordCanvas,fps:null==o?void 0:o.canvasFps,quality:null==o?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:ri(l)?null:l,endpoint:null==o?void 0:o.endpoint,triggerMatchType:null==o?void 0:o.triggerMatchType,masking:null==o?void 0:o.masking,urlTriggers:null==o?void 0:o.urlTriggers,version:null==o?void 0:o.version,triggerGroups:null==o?void 0:o.triggerGroups}),r))};o(),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(o)}},t.onRemoteConfig=function(e){var t=e.ok?e.config:void 0;if(t&&"sessionRecording"in t){if(!1===t.sessionRecording)return this._persistRemoteConfig(t),void this._discardRecording();this._persistRemoteConfig(t),this.startIfEnabledOrStop()}else{var n;"awaiting_config"===this._recordingStatus&&(this._recordingStatus="missing_config",this._instance.register_for_session(((n={})[qp]=!0,n)),Cb.warn("config refresh failed, recording will not start until page reload")),this.startIfEnabledOrStop()}},t.log=function(e,t){var n;void 0===t&&(t="log"),null!=(n=this._lazyLoadedSessionRecording)&&n.log?this._lazyLoadedSessionRecording.log(e,t):Cb.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(vp);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Cb.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!ai(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._checkSelectMaskingSupport=function(){var e,t,n;return null==(e=this._config.session_recording)||!e.selectMaskingFn||!(!0!==(null==(t=jh.__PosthogExtensions__)||null==(t=t.rrweb)||null==(t=t.record)?void 0:t.supportsSelectMasking)||!0!==(null==(n=jh.__PosthogExtensions__)||null==(n=n.initSessionRecording)?void 0:n.supportsSelectMasking)||this._lazyLoadedSessionRecording&&!0!==this._lazyLoadedSessionRecording.supportsSelectMasking)||(this._recordingStatus=Sb,Cb.error("Session recording has not started: the recorder does not support selectMaskingFn."),!1)},t._onScriptLoaded=function(e){var t,n,r,i,o;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var s,a;if(null==(t=jh.__PosthogExtensions__)||!t.initSessionRecording)return Cb.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((s={},s[$p]=!0,s));if(this._checkSelectMaskingSupport())if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(a=jh.__PosthogExtensions__)?void 0:a.initSessionRecording(this._instance,this._documentWasEverVisible),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this._checkSelectMaskingSupport()){if(!this._isRemoteConfigFresh()){if("missing_config"===this._recordingStatus||"awaiting_config"===this._recordingStatus)return;return this._recordingStatus="awaiting_config",Cb.info("persisted remote config is stale, requesting fresh config before starting"),void new my(this._instance).load()}this._recordingStatus=kb,null==(n=(r=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(r,this._documentWasEverVisible);var u=null==(i=this._config.session_recording)?void 0:i.selectMaskingFn;this._lazyLoadedSessionRecording.start(e),this._selectMaskingFn=u,this._lazyLoadedSessionRecording.isStarted&&u!==(null==(o=this._config.session_recording)?void 0:o.selectMaskingFn)&&this.startIfEnabledOrStop()}else this._discardRecording(!0)}else this._recordingStatus=Sb},t.onRRwebEmit=function(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)},t.overrideLinkedFlag=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[yp]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[mp]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideSampling()},t.overrideTrigger=function(e){var t,n,r;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})["url"===e?bp:wp]=!0,n)),null==(r=this._lazyLoadedSessionRecording)||r.overrideTrigger(e)},t.tryAddCustomEvent=function(e,t){var n;return!(null==(n=this._lazyLoadedSessionRecording)||!n.tryAddCustomEvent(e,t))},t.flushBeforeIdentityReset=function(){var e;null==(e=this._lazyLoadedSessionRecording)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()},a(e,[{key:"_config",get:function(){return this._instance.config}},{key:"_persistence",get:function(){return this._instance.persistence}},{key:"started",get:function(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}},{key:"status",get:function(){var e,t;return this.isReplayOff?Sb:"awaiting_config"===this._recordingStatus||"missing_config"===this._recordingStatus?this._recordingStatus:null!==(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)&&void 0!==e?e:this._recordingStatus}},{key:"_isRecordingEnabled",get:function(){var e,t=!(null==(e=this._instance.get_property(vp))||!e.enabled),n=!this._config.disable_session_recording,r=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Ih&&t&&n&&!r}},{key:"isReplayOff",get:function(){var e;return!!this._config.disable_session_recording||this._instance.consent.isOptedOut()||!1===(null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.enabled)}},{key:"_scriptName",get:function(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property("$session_recording_remote_config"))||null==(e=e.scriptConfig)?void 0:e.script)||"lazy-recorder"}},{key:"sdkDebugProperties",get:function(){var e;if(this.isReplayOff)return{$recording_status:Sb};for(var t={},n=0,r=Pb;r.length>n;n++){var i,o=r[n],s=null==(i=this._instance.sessionPersistence)?void 0:i.get_property(o);ri(s)||(t[o]=s)}return d({},t,(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}}])}(),Tb=kl("[Heatmaps]");function Fb(e){return ti(e)&&"clientX"in e&&"clientY"in e&&ui(e.clientX)&&ui(e.clientY)}var Ib,Rb=function(){"use strict";function e(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._mouseMoveCapturing=!1,this._consentChangedAt=0,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[ap]),this.rageclicks=new U_(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Tb.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("heatmaps"in n){var r=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[ap]=r,t)),this._enabledServerSide=r,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t.discardPending=function(){this._consentChangedAt=Date.now(),clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=void 0,this.getAndClearBuffer()},t._onDeadClick=function(e){Fb(e.originalEvent)&&e.timestamp>this._consentChangedAt&&this._onClick(e.originalEvent,"deadclick")},t._onVisibilityChange=function(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Mh)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Ih&&Mh&&(this._flushHandler=this._flush.bind(this),Ml(Ih,Qp,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Ih?void 0:Ih.event))},Ml(Mh,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Ih?void 0:Ih.event))},Ml(Mh,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Tm(this.instance,Pm,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Ml(Mh,ih,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Ih&&Mh&&(this._flushHandler&&Ih.removeEventListener(Qp,this._flushHandler),this._onClickHandler&&Mh.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Mh.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Mh.removeEventListener(ih,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=void 0,null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)},t._getProperties=function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&t_(r)&&!n_(r,"body");){if(r===n)return!1;var i=void 0;try{var o,s,a;i=null==(o=null!==(s=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==s?s:Ih)?void 0:o.getComputedStyle(r).position}catch(e){return!1}if(Vr(t,i))return!0;r=p_(r)}return!1}(c_(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}},t._onClick=function(e,t){var n;if(void 0===t&&(t="click"),!e_(e.target)&&Fb(e)&&this.instance.is_capturing()){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&P_(c_(e),this.instance.config.rageclick)&&this._capture(d({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!e_(e.target)&&Fb(e)&&(ri(this._mouseMoveTimeout)&&(this._mouseMoveCapturing=this.instance.is_capturing()),clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._mouseMoveTimeout=void 0,t._mouseMoveCapturing&&t.instance.is_capturing()&&t._capture(t._getProperties(e,"mousemove"))},500))},t._capture=function(e){if(Ih){var t=this._config.disable_capture_url_hashes?Ho(Ih.location.href):Ih.location.href,n=Kh(t,this._config.mask_personal_data_properties?[].concat(Hm,this._config.custom_personal_data_properties||[]):[],Um);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}},t._flush=function(){this._buffer&&!ni(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},a(e,[{key:"_config",get:function(){return this.instance.config}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return ti(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return ai(this._config.capture_heatmaps)?ai(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),Ab=kl("[Product Tours]"),Mb=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(hp))},Ob=function(){"use strict";function e(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("productTours"in n){var r,i;if(this._persistence&&this._persistence.register(((t={})[hp]=!!n.productTours,t)),!Mb(this._instance))return!this._productTourManager&&ai(null==(r=this._persistence)?void 0:r.props.ph_product_tours)||Ab.info("product tours disabled; stopping and clearing cached tours"),null==(i=this._productTourManager)||i.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}},t.loadIfEnabled=function(){var e=this;!this._productTourManager&&Mb(this._instance)&&this._loadScript(function(){return e._startProductTours()})},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=dg(this._instance))||n(this._instance,"product-tours",function(t){t?Ab.error("Could not load product tours script",t):e()})},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=jh.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=jh.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Xr(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[Cp];if(Xr(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:function(t){var i;if(Mb(n._instance)){var o=t.statusCode;if(200!==o||!t.json){var s="Product Tours API could not be loaded, status: "+o;return 0===o?t.error||Ab.warn(s):Ab.error(s),void e([],{isLoaded:!1,error:s})}var a=Xr(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,r&&r.register(((i={})[Cp]=a,i)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){ai(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)},t.showProductTour=function(e){var t;null==(t=this._productTourManager)||t.showTourById(e)},t.previewTour=function(e){var t=this;this._productTourManager?this._productTourManager.previewTour(e):this._loadScript(function(){var n;t._startProductTours(),null==(n=t._productTourManager)||n.previewTour(e)})},t.dismissProductTour=function(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")},t.nextStep=function(){var e;null==(e=this._productTourManager)||e.nextStep()},t.previousStep=function(){var e;null==(e=this._productTourManager)||e.previousStep()},t.clearCache=function(){var e;this._cachedTours=null,null==(e=this._persistence)||e.unregister(Cp)},t.resetTour=function(e){var t;null==(t=this._productTourManager)||t.resetTour(e)},t.resetAllTours=function(){var e;null==(e=this._productTourManager)||e.resetAllTours()},t.cancelPendingTour=function(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)},a(e,[{key:"_persistence",get:function(){return this._instance.persistence}}])}(),Lb=kl("[SiteApps]"),Db="Error while initializing PostHog app with config id ",$b=function(){"use strict";function e(e){this._instance=e,this._siteAppElementPatchCount=0,this._bufferedInvocations=[],this.apps={}}var r=e.prototype;return r._eventCollector=function(e,t){if(t){var n=this.globalsForEvent(t);this._bufferedInvocations.push(n),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}},r.initialize=function(){var e=this;if(this._instance.config.opt_in_site_apps&&!this.isEnabled&&Lb.critical("opt_in_site_apps is ignored: require_subresource_integrity disables site apps"),this.isEnabled){var t=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=function(){t(),e._bufferedInvocations=[],e._stopBuffering=void 0}}},r.globalsForEvent=function(e){var r,i,o,s,a,u,l;if(!e)throw new Error("Event payload is required");for(var c={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{},p=0,_=Object.entries(h);_.length>p;p++){var v=_[p],g=v[0];c[g]={id:f[g],type:g,properties:v[1]}}var m=e.$set_once,y=e.$set;return{event:d({},n(e,t),{properties:d({},e.properties,y?{$set:d({},null!==(r=null==(i=e.properties)?void 0:i.$set)&&void 0!==r?r:{},y)}:{},m?{$set_once:d({},null!==(o=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==o?o:{},m)}:{}),elements_chain:null!==(a=null==(u=e.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=e.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}},r._prepareElementForSiteApp=function(e){var t,n=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===n&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Lb.error("prepare_external_dependency_stylesheet returned null"),null):"script"===n&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Lb.error("prepare_external_dependency_script returned null"),null):e},r._patchSiteAppElementInsertionMethods=function(){var e,t,n,r,i,o,s,a,u=this;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return function(){};var l=null==Mh?void 0:Mh.defaultView,c=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!c)return function(){};if(this._siteAppElementPatchCount++,this._restoreSiteAppElementPatches)return this._releaseSiteAppElementPatches();var d=[],f=this,h=new WeakSet,p=function(e,t,n){if(null!=e&&e[t]){var r=e[t];e[t]=n(r),d.push(function(){e[t]=r})}},_=function(e){if(h.has(e))return e;var t=f._prepareElementForSiteApp(e);return t&&h.add(t),t},v=function(e){return e.map(function(e){return"string"==typeof e?e:_(e)}).filter(function(e){return!si(e)})};return p(c,"appendChild",function(e){return function(t){var n=_(t);return n?e.call(this,n):t}}),p(c,"insertBefore",function(e){return function(t,n){var r=_(t);return r?e.call(this,r,n):t}}),p(c,"replaceChild",function(e){return function(t,n){var r=_(t);return r?e.call(this,r,n):n}}),[null==(t=l.Element)?void 0:t.prototype,null==(n=l.Document)?void 0:n.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(function(e){p(e,"append",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"prepend",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}})}),[null==(i=l.Element)?void 0:i.prototype,null==(o=l.CharacterData)?void 0:o.prototype,null==(s=l.DocumentType)?void 0:s.prototype].forEach(function(e){p(e,"before",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"after",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"replaceWith",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=v(n);return n.length&&!i.length?void 0:e.apply(this,i)}})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",function(e){return function(t,n){var r=_(n);return r?e.call(this,t,r):null}}),this._restoreSiteAppElementPatches=function(){d.forEach(function(e){return e()}),u._restoreSiteAppElementPatches=void 0},this._releaseSiteAppElementPatches()},r._releaseSiteAppElementPatches=function(){var e=this,t=!1;return function(){t||(t=!0,e._siteAppElementPatchCount--,0===e._siteAppElementPatchCount&&(null==e._restoreSiteAppElementPatches||e._restoreSiteAppElementPatches()))}},r._runWithPreparedSiteAppElements=function(e,t){void 0===t&&(t=!0);var n=this._patchSiteAppElementInsertionMethods();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}},r.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(Lb.info("Processing "+t._bufferedInvocations.length+" events for site app with id "+e.id),t._bufferedInvocations.forEach(function(e){return t._runWithPreparedSiteAppElements(function(){return null==n.processEvent?void 0:n.processEvent(e)})}),n.processedBuffer=!0),Object.values(t.apps).every(function(e){return e.processedBuffer||e.errored})&&(null==t._stopBuffering||t._stopBuffering())},i=!1,o=function(t){n.errored=!t,n.loaded=!0,Lb.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),i&&r()};try{var s=this._runWithPreparedSiteAppElements(function(n){return e.init({posthog:t._instance,callback:function(e){n(),o(e)}})},!1).processEvent;s&&(n.processEvent=s),i=!0}catch(t){Lb.error(Db+e.id,t),o(!1)}if(i&&n.loaded)try{r()}catch(t){Lb.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}},r._setupSiteApps=function(){for(var e,t=this.siteAppLoaders||[],n=p(t);!(e=n()).done;){var r=e.value;this.apps[r.id]={id:r.id,loaded:!1,errored:!1,processedBuffer:!1}}for(var i,o=p(t);!(i=o()).done;)this.setupSiteApp(i.value)},r._onCapturedEvent=function(e){var t=this;if(0!==Object.keys(this.apps).length)for(var n=this.globalsForEvent(e),r=function(){var r=o[i];try{t._runWithPreparedSiteAppElements(function(){return null==r.processEvent?void 0:r.processEvent(n)})}catch(t){Lb.error("Error while processing event "+e.event+" for site app "+r.id,t)}},i=0,o=Object.values(this.apps);o.length>i;i++)r()},r.onRemoteConfig=function(e){var t,n,r,i=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",function(e){return i._onCapturedEvent(e)})):void Lb.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this._stopBuffering)||n.call(this),e.ok){var o=e.config;if(null!=(r=o.siteApps)&&r.length)if(this.isEnabled)for(var s,a=function(){var e,t=s.value,n=t.id,r=t.url;jh["__$$ph_site_app_"+n]=i._instance,null==(e=jh.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,function(e){if(e)return Lb.error(Db+n,e)})},u=p(o.siteApps);!(s=u()).done;)a();else Lb.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},a(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps&&!this._instance.config.require_subresource_integrity}},{key:"siteAppLoaders",get:function(){var e;return null==(e=jh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),qb=function(){return null!=Ih&&Ih.location?Qh(Ih.location.hash,"__posthog")||Qh(location.hash,"state"):null}(),Nb="_postHogToolbarParams",Bb=kl("[Toolbar]"),jb=function(){"use strict";function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){jh.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=jh.ph_toolbar_state)&&void 0!==e?e:0},t.initialize=function(){return this.maybeLoadToolbar()},t.maybeLoadToolbar=function(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),Ol(this.instance.config))return!1;if(!Ih||!Mh)return!1;e=null!=e?e:Ih.location,n=null!=n?n:Ih.history;try{if(!t){try{Ih.localStorage.setItem("test","test"),Ih.localStorage.removeItem("test")}catch(e){return!1}t=null==Ih?void 0:Ih.localStorage}var r,i=qb||Qh(e.hash,"__posthog")||Qh(e.hash,"state"),o=i?zo(function(){return JSON.parse(atob(decodeURIComponent(i)))})||zo(function(){return JSON.parse(decodeURIComponent(i))}):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(Nb)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}},t._callLoadToolbar=function(e){var t=jh.ph_load_toolbar||jh.ph_load_editor;!ai(t)&&ei(t)?t(e,this.instance):Bb.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Mh||!Mh.getElementById("__POSTHOG_TOOLBAR__"));if(!Ih||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=d({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Ih.localStorage.setItem(Nb,JSON.stringify(d({},i,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(i);else if(0===this._getToolbarState()){var o;this._setToolbarState(1),null==(o=dg(this.instance))||o(this.instance,"toolbar",function(e){if(e)return Bb.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(i)}),Ml(Ih,"turbolinks:load",function(){t._setToolbarState(0),t.loadToolbar(i)})}return!0},t._loadEditor=function(e){return this.loadToolbar(e)},t.maybeLoadEditor=function(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)},e}(),Hb=kl("[FeatureFlags]"),zb=kl("[FeatureFlags]",{debugEnabled:!0}),Ub="\" failed. Feature flags didn't load in time.",Wb=[502,504],Vb=["click","keydown","wheel","touchstart","pointerdown"],Gb="connection_error",Kb=function(e,t){var n=Object.keys(t||{}).filter(function(e){var n;return null==t||null==(n=t[e])?void 0:n.failed});if(!n.length)return e||{};var r=d({},e);return n.forEach(function(e){return delete r[e]}),r},Qb=function(e,t){var n=d({},e);return t.forEach(function(e){var t;null!=(t=n[e])&&t.failed&&delete n[e]}),n},Yb=function(e,t){return!(null==t||!t.partialResponse)||!!e.errorsWhileComputingFlags},Jb=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Zb=function(e){for(var t,n={},r=p(El(e||{}));!(t=r()).done;){var i=t.value,o=i[1];o&&(n[i[0]]=o)}return n},Xb=function(e,t){var n=e.flags;return n?d({},e,{featureFlags:Object.fromEntries(Object.keys(n).filter(function(e){return!n[e].failed}).map(function(e){var t;return[e,null!==(t=n[e].variant)&&void 0!==t?t:n[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(n).filter(function(e){return!n[e].failed&&n[e].enabled}).filter(function(e){var t;return!ri(null==(t=n[e].metadata)?void 0:t.payload)}).map(function(e){var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)},ew={version:2},tw=function(e,t){return e.distinctId===t.distinctId&&e.sessionId===t.sessionId&&function(e,t){var n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(function(n){return e[n]===t[n]})}(e.groups,t.groups)},nw=function(){"use strict";function e(e){var t=this;this.name="featureFlags",this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=Hb,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._reloadingHandlers=[],this._pendingReloads=new Set,this._activeReloads=new Set,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._requestGeneration=0,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._firingFeatureFlagsCallbacks=!1,this._flagCallsPendingCapture=new Map,this._sendingFlagCallsPendingCapture=!1,this._flagsLoadedFromRemote=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._hadUserInteraction=!1,this._loggedResponseWithoutTypedValues=!1,this._flagEventCaptures=new WeakMap,this._flagEventCaptureThrows=new Map,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n,r=t._refreshIntervalMs,i=null!==(e=t._dueRefreshIntervalMs)&&void 0!==e?e:r;ri(r)||ri(i)||t._config.remoteRequestsDisabled||!t._document||"hidden"===t._document.visibilityState||Date.now()-(null!==(n=t._lastRefreshAt)&&void 0!==n?n:0)<i||(t._dueRefreshIntervalMs=t._hadUserInteraction||!t._config.idleRefreshBackoff?r:Math.min(2*i,36e5),t._hadUserInteraction=!1,t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onUserInteraction=function(){t._hadUserInteraction&&t._dueRefreshIntervalMs===t._refreshIntervalMs||t._resumeConfiguredInterval()},this._onVisibilityChange=function(){var e;"visible"===(null==(e=t._document)?void 0:e.visibilityState)&&t._resumeConfiguredInterval()},this._configSource=e}var t=e.prototype;return t._onConfigUpdated=function(){this._client&&this._syncAutomaticRefresh()},t.setup=function(e){var t=this;try{this._window=typeof window>"u"?void 0:window,this._document=typeof document>"u"?void 0:document}catch(e){this._window=void 0,this._document=void 0}return this._initializingClient=e,this._logger=e.logger.createLogger("[FeatureFlags]"),Ph(e.kv.initialize(),function(){t._initializingClient===e&&(t._initializingClient=void 0,t._client=e,t._finishSetup(e))})},t._finishSetup=function(e){var t,n=this;if(this._client===e)return this._window&&Ml(this._window,"online",this._onOnline),this._syncAutomaticRefresh(),this._dynamicProperties=e.registerDynamicEventProperties(function(){return n._isCacheStale()?n._baseEventProperties:n._eventPropertiesWithFlagValues}),this._crossTabPersistenceUnsubscribe=null==(t=this._crossTabPersistence)?void 0:t.onCrossTabFeatureFlagChange(function(){n._clearBootstrapState(),n._rebuildEventProperties(),n._fireFeatureFlagsCallbacks()}),this._rebuildEventProperties(),this.initialize()},t._resumeConfiguredInterval=function(){this._hadUserInteraction=!0,this._dueRefreshIntervalMs=this._refreshIntervalMs,this._refreshIfDue()},t._syncAutomaticRefresh=function(){var e,t=this,n=this._config.refreshIntervalMs,r=!this._config.remoteRequestsDisabled&&this._document&&!ri(n)&&n>0?n:void 0;this._config.idleRefreshBackoff||(this._dueRefreshIntervalMs=r),r!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),ri(r)||(this._refreshIntervalMs=r,this._dueRefreshIntervalMs=r,this._scheduleNextRefresh(),null!=(e=this._document)&&e.addEventListener&&(Ml(this._document,ih,this._onVisibilityChange),xl(Vb,function(e){Ml(t._document,e,t._onUserInteraction,{capture:!0})}))))},t._scheduleNextRefresh=function(){ri(this._refreshIntervalMs)||(ri(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){var e,t=this;ri(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==(e=this._document)||null==e.removeEventListener||e.removeEventListener(ih,this._onVisibilityChange),xl(Vb,function(e){var n;null==(n=t._document)||null==n.removeEventListener||n.removeEventListener(e,t._onUserInteraction,{capture:!0})})),this._refreshIntervalMs=void 0,this._dueRefreshIntervalMs=void 0,this._hadUserInteraction=!1,this._lastRefreshAt=void 0},t.destroy=function(){this._dispose()},t.dispose=function(){this._dispose()},t._dispose=function(){var e,t,n;this._stopAutomaticRefresh(),this._requestGeneration++,this._additionalReloadRequested=!1,this._initializingClient=void 0,this._settleReloads(this._pendingReloads,"cancelled"),this._settleReloads(this._activeReloads,"cancelled"),this._client&&(this._clearDebouncer(),null==(e=this._dynamicProperties)||e.dispose(),this._dynamicProperties=void 0,null==(t=this._crossTabPersistenceUnsubscribe)||t.call(this),this._crossTabPersistenceUnsubscribe=void 0,this._reloadingHandlers=[],null==(n=this._window)||n.removeEventListener("online",this._onOnline),this._client=void 0)},t._prop=function(e){var t;return this._bootstrapState&&e in this._bootstrapState?this._bootstrapState[e]:null==(t=this._client)?void 0:t.kv.get(e)},t._clearBootstrapState=function(){return!!this._bootstrapState&&(this._bootstrapState=void 0,!0)},t._fallBackToPersistedFlags=function(){var e;return!ri(null==(e=this._client)?void 0:e.kv.get("$enabled_feature_flags"))&&this._clearBootstrapState()},t._set=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.set(e)})},t._markCrossTabFeatureFlagSnapshot=function(e,t,n){var r;if(this._crossTabPersistence&&e.$enabled_feature_flags){var i=this._prop("$enabled_feature_flags")||{},o=e.$enabled_feature_flags||{},s=t.flags||t.featureFlags,a=t.flags?Object.entries(t.flags).filter(function(e){var t=e[1];return!(null!=t&&t.failed)}).map(function(e){return e[0]}):[],u=!!t.errorsWhileComputingFlags&&!!t.flags,l=u||n&&t.flags?a:n&&!Xr(s)?Object.keys(s||{}):Array.from(new Set([].concat(Object.keys(i),Object.keys(o)))),c=this._prop("$feature_flag_payloads")||{},d=e.$feature_flag_payloads||{},f=u||n?l:Array.from(new Set([].concat(Object.keys(c),Object.keys(d)))),h=!u&&!n,p=!!h||l,_=!!h||f,v=((r={})[Uf]=p,r[Yf]=p,r[th]=_,r);e.$feature_flag_details&&(v[Wf]=p);for(var g=0,m=[Kf,Gf,Qf];m.length>g;g++){var y=m[g];ri(e[y])||(v[y]=!0)}this._crossTabPersistence.markCrossTabFeatureFlagChanges(v)}},t._remove=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.remove(e)})},t._persist=function(e){try{e()}catch(e){this._logger.error("Failed to update feature flag persistence",e)}},t._rebuildEventProperties=function(){for(var e={},t=this._prop(Wf),n=0,r=[Kf,nh];r.length>n;n++){var i=r[n],o=this._prop(i);ri(o)||(e[i]=o)}var s=this._prop(Uf);s&&(e[Uf]=s.filter(function(e){var n;return!(null!=t&&null!=(n=t[e])&&n.failed)}));var a=this._prop(th);a&&(e[th]=Kb(a,t)),this._baseEventProperties=e;var u=d({},e),l=Kb(this._prop(Yf),t);if(l)for(var c=0,f=Object.entries(l);f.length>c;c++){var h=f[c];u["$feature/"+h[0]]=h[1]}this._eventPropertiesWithFlagValues=u},t._isCacheStale=function(){var e=this._config.cacheTtlMs;if(!e||0>=e)return!1;var t=this._prop(Gf);return"number"!=typeof t||Date.now()-t>e},t._checkAndTriggerStaleRefresh=function(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,this._logger.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)},t._getValidEvaluationEnvironments=function(){var e=this,t=this._config.evaluationContexts;return null!=t&&t.length?t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]},t._getValidFlagKeys=function(){var e=this,t=this._config.flagKeys;if(!ri(t))return t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid flag key found:",t,"Expected non-empty string"),n})},t.initialize=function(){var e,t,n=this._config,r=null!==(e=null==(t=n.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(r).length){var i,o,s=null!==(i=null==(o=n.bootstrap)?void 0:o.featureFlagPayloads)&&void 0!==i?i:{},a=Object.keys(r).filter(function(e){return!ri(r[e])}).reduce(function(e,t){return e[t]=r[t],e},{}),u=Object.keys(s).filter(function(e){return a[e]}).reduce(function(e,t){return e[t]=n.encodeBootstrapPayloads?JSON.stringify(s[t]):s[t],e},{});return this._receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u},void 0,{persist:!1})}},t.updateFlags=function(e,t,n){for(var r=null!=n&&n.merge?Kb(this._prop(Yf),this._prop(Wf)):{},i=null!=n&&n.merge?Kb(this._prop(th),this._prop(Wf)):{},o=d({},r,e),s=d({},i,t),a={},u=0,l=Object.entries(o);l.length>u;u++){var c=l[u],f=c[0],h=c[1];a[f]={key:f,enabled:Ls(h),variant:Ds(h),reason:void 0,metadata:ri(null==s?void 0:s[f])?void 0:{id:0,version:void 0,description:void 0,payload:s[f]}}}this._receivedFeatureFlags({flags:a})},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._flagsWithDetails(),t=this._responseFormat.publicDetail;return t?Object.fromEntries(Object.entries(e).map(function(e){return[e[0],t(e[1])]})):e},t._flagsWithDetails=function(){var e=this._prop(Wf),t=this._prop(nh),n=this._prop(rh);if(!n&&!t)return e||{};for(var r,i=Pl({},e||{}),o=p([].concat(new Set([].concat(Object.keys(n||{}),Object.keys(t||{})))));!(r=o()).done;){var s,a,u=r.value,l=i[u],c=null==t?void 0:t[u],f=ri(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,h=ri(c)?null==l?void 0:l.variant:"string"==typeof c?c:void 0,_=null==n?void 0:n[u],v=d({},l,{enabled:f,variant:f?null!=h?h:null==l?void 0:l.variant:void 0});f!==(null==l?void 0:l.enabled)&&(v.original_enabled=null==l?void 0:l.enabled),h!==(null==l?void 0:l.variant)&&(v.original_variant=null==l?void 0:l.variant),_&&(v.metadata=d({},null==l?void 0:l.metadata,{payload:_,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),i[u]=v}return this._override_warning||(this._logger.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i},t.getAllFeatureFlags=function(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(function(n){var r=e[n];return{key:n,enabled:Ls(r),variant:Ds(r),payload:Os(t[n])}})},t.getFlagVariants=function(){var e=Kb(this._prop(Yf),this._prop(Wf)),t=this._prop(nh);if(!t)return e||{};for(var n=Pl({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this._override_warning||(this._logger.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n},t.getFlagPayloads=function(){var e=Kb(this._prop(th),this._prop(Wf)),t=this._prop(rh);if(!t)return e||{};for(var n=Pl({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this._override_warning||(this._logger.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this._override_warning=!0),n},t.reloadFeatureFlags=function(){var e=this;this._reloadingDisabled||this._config.featureFlagsDisabled||this._hasStatusZeroCircuitBreakerTripped()||(this._firingFeatureFlagsCallbacks&&this._logger.warn("reloadFeatureFlags() was called inside an onFeatureFlags callback. This callback also runs when flags change in other tabs, so this can cause a request loop."),this._requestInFlight&&(this._additionalReloadRequested=!0),this._reloadDebouncer||(this._reloadDebouncer=setTimeout(function(){e._callFlagsEndpoint()},5),this._reloadingHandlers.slice().forEach(function(t){try{t()}catch(t){e._logger.error("Error while running feature flags reloading callback",t)}})))},t.reloadFeatureFlagsAsync=function(){var e=this;return!this._client||this._reloadingDisabled||this._config.featureFlagsDisabled||this._config.remoteRequestsDisabled||this._hasStatusZeroCircuitBreakerTripped()?Promise.resolve({status:"skipped"}):new Promise(function(t){e._pendingReloads.add(t),e.reloadFeatureFlags()})},t._settleReloads=function(e,t){e.forEach(function(e){return e({status:t})}),e.clear()},t._clearDebouncer=function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0},t.onReloading=function(e){var t=this;return this._reloadingHandlers.push(e),function(){t._reloadingHandlers=t._reloadingHandlers.filter(function(t){return t!==e})}},t.ensureFlagsLoaded=function(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()},t.setAnonymousDistinctId=function(e){this.$anon_distinct_id=e},t.setReloadingPaused=function(e){this._reloadingDisabled=e},t.resetFlagCallReported=function(){this._remove(Xf),this._flagCallsPendingCapture=new Map,this._flagEventCaptureThrows=new Map},t.sendFlagCallsPendingCapture=function(){var e;if(0!==this._flagCallsPendingCapture.size&&!this._sendingFlagCallsPendingCapture&&null!=(e=this._client)&&e.canCapture&&!this._client.isRateLimited){this._sendingFlagCallsPendingCapture=!0;try{for(var t=this.getFlagVariants(),n=0,r=Array.from(this._flagCallsPendingCapture.keys());r.length>n;n++){var i,o=r[n],s=this._flagCallsPendingCapture.get(o);if(s){var a=null==(i=this._configVersion2FlagEvents(o,t[o]))?void 0:i.calledKey;if(s.value!==String(t[o])||s.calledKey&&s.calledKey!==a||!tw(s.context,this._flagCallContext()))this._flagCallsPendingCapture.delete(o);else if(this.getFeatureFlagResult(o),this._flagCallsPendingCapture.has(o))break}}}finally{this._sendingFlagCallsPendingCapture=!1}}},t._callFlagsEndpoint=function(e){var t,n=this;this._clearDebouncer();var r=this._client;if(!r||this._config.remoteRequestsDisabled||this._hasStatusZeroCircuitBreakerTripped())this._settleReloads(this._pendingReloads,"skipped");else if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i={token:r.projectToken,distinct_id:r.distinctId,groups:r.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:d({},r.initialPersonProperties,this._prop("$stored_person_properties")||{},{$lib:r.library.name,$lib_version:r.library.version}),group_properties:this._prop(Jf),timezone:Yh()};ri(r.deviceId)||(i.$device_id=r.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(i.disable_flags=!0);var o=this._getValidEvaluationEnvironments();o.length&&(i.evaluation_contexts=o);var s=this._getValidFlagKeys();ri(s)||(i.flag_keys=s);var a=this._config.onlyEvaluateSurveyFeatureFlags,u="/flags/?v="+this._responseFormat.version+(a?"&only_evaluate_survey_feature_flags=true":""),l=this._requestGeneration,c=this._pendingReloads;this._pendingReloads=new Set,this._activeReloads=c,this._requestInFlight=!0;var f=function(){n._additionalReloadRequested&&(n._additionalReloadRequested=!1,n._callFlagsEndpoint())},h=function(e){var t;n._requestInFlight=!1,l===n._requestGeneration?(n._set(((t={})[Vf]=[Gb],t)),n._logger.error("Feature flag request failed",e),n._fallBackToPersistedFlags()&&n._fireFeatureFlagsCallbacks(!0),n._settleReloads(c,"error"),f()):f()},p=null!==(t=this._config.requestMaxRetries)&&void 0!==t?t:1,_=function(){if(l!==n._requestGeneration||!n._client||n._config.remoteRequestsDisabled)return n._requestInFlight=!1,n._settleReloads(c,"skipped"),void f();try{r.sendRequest(u,{target:"flags",method:"POST",body:i,compression:n._config.compression,sentAt:"body",timeoutMs:n._config.requestTimeoutMs}).then(function(e){if(function(e){return Wb.includes(e.statusCode)||function(e){return 0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name}(e)}(e)&&p>0&&l===n._requestGeneration)return p--,void setTimeout(_,500);!function(e){var t,r,o=n._readFlagsResponse(e.json),s=200!==e.statusCode;if(n._requestInFlight=!1,l===n._requestGeneration)if(n._trackStatusZeroReachability(e.statusCode),s||n._additionalReloadRequested||(n.$anon_distinct_id=void 0),!i.disable_flags||n._additionalReloadRequested){n._flagsLoadedFromRemote=!s;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?Gb:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),o.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var d=!(null==(t=o.quotaLimited)||!t.includes("feature_flags"));d&&u.push("quota_limited"),n._set(((r={})[Vf]=u,r)),d?n._logger.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||n._receivedFeatureFlags(o,s,{partialResponse:a}),n._settleReloads(c,i.disable_flags?"skipped":u.length||!o.flags&&!o.featureFlags?"error":"loaded"),f()}else n._settleReloads(c,"skipped");else f()}(e)}).catch(h)}catch(e){h(e)}};_()}},t._readFlagsResponse=function(e){var t=null!=e?e:{},n=this._responseFormat.read;if(!n)return t;var r=n(t),i=r.body;return r.withoutTypedValues&&!this._loggedResponseWithoutTypedValues&&(this._loggedResponseWithoutTypedValues=!0,this._logger.info("The /flags response has no typed flag values. Its flags are read as before.")),i},t._hasStatusZeroCircuitBreakerTripped=function(){return Uh(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=Wh(e,this._consecutiveStatusZeroFailures,3,function(){return t._logger.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")})},t._flagsNotLoaded=function(e){var t;return!(this._hasLoadedFlags||this.getFlags().length||null!=(t=this.getFeatureFlagDetails(e))&&t.failed)},t.getFeatureFlag=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._flagsNotLoaded(e))this._logger.warn('getFeatureFlag for key "'+e+Ub);else if(!this._checkAndTriggerStaleRefresh()){var r=this.getFeatureFlagResult(e,t);return null!==(n=null==r?void 0:r.variant)&&void 0!==n?n:null==r?void 0:r.enabled}},t.getFeatureFlagDetails=function(e){var t=this._flagsWithDetails()[e],n=this._responseFormat.publicDetail;return t&&n?n(t):t},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.getFeatureFlagResult(e,{send_event:!1}))?void 0:t.payload},t.getFeatureFlagResult=function(e,t){var n,r=this;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._flagsNotLoaded(e))this._logger.warn('getFeatureFlagResult for key "'+e+Ub);else if(!this._checkAndTriggerStaleRefresh()){var i,o=null==(n=this._prop(Wf))||null==(n=n[e])?void 0:n.failed,s=o?void 0:this._prop(Yf),a=o?void 0:this._prop(th),u=this._prop(nh),l=!!u&&{}.hasOwnProperty.call(u,e),c=l||!!s&&e in s,f=l?u[e]:null==s?void 0:s[e],h=this._prop(rh),p=h&&{}.hasOwnProperty.call(h,e)?h[e]:null==a?void 0:a[e],_=String(f),v=this._prop("$feature_flag_request_id")||void 0,g=this._prop("$feature_flag_evaluated_at")||void 0,m=this._prop("$flag_call_reported")||{};if(this._config.deduplicateCallsPerSession){var y,b=null==(y=this._client)||null==(y=y.session)?void 0:y.sessionId,w=this._prop(eh);b&&b!==w&&(m={},i=b)}if(!t.send_event&&"send_event"in t){var S;i&&this._set(((S={})[Xf]=m,S[eh]=i,S))}else{var k,x,C,P,E,T,F,I,R=!(null!=(k=this._client)&&k.canCapture),A=!(R||null!=(x=this._client)&&x.isRateLimited),M=this._configVersion2FlagEvents(e,f),O=M?M.calledKey:_,L=null==M?void 0:M.exposureKey,D=function(){return r._holdFlagCall(e,_,null==M?void 0:M.calledKey)};if(A)this._flagCallsPendingCapture.delete(e);else R&&Object.keys(m).length>0&&this._set(((I={})[Xf]=m={},I)),null!=(T=m[e])&&T.includes(O)&&(!L||null!=(F=m[e])&&F.includes(L))||D();var q=!(null!=(C=m[e])&&C.includes(O)),N=!(!L||null!=(P=m[e])&&P.includes(L));if(A&&M&&(q||N)){var B;i&&this._set(((B={})[Xf]=m,B[eh]=i,B));var j=M.build(this._flagCalledProperties(e,f,p,v,g)),H=q?this._captureFlagEventOnce(e,O,j.called,D):void 0;N&&j.exposure&&this._captureFlagEventOnce(e,L,j.exposure,D,H)}else if(A&&q){var z,U;Xr(m[e])?m[e].push(_):m[e]=[_],this._set(d(((z={})[Xf]=m,z),i?((U={})[eh]=i,U):{}));var W=this._flagCalledProperties(e,f,p,v,g);this._captureFeatureFlagCalled(W)||(this._unmarkFlagCallReported(e,_),D())}else i&&this._set(((E={})[Xf]=m,E[eh]=i,E))}if(c)return{key:e,enabled:!!f,variant:"string"==typeof f?f:void 0,payload:Os(p)}}},t._flagCalledProperties=function(e,t,n,r,i){var o,s,a,u,l,c,d,f,h,p,_,v,g,m=this._flagsWithDetails()[e],y=[].concat(null!==(o=this._prop("$feature_flag_errors"))&&void 0!==o?o:[]);ri(t)&&y.push(null!=m&&m.failed?"evaluation_failed":"flag_missing");var b={$feature_flag:e,$feature_flag_response:t,$feature_flag_payload:null!=n?n:null,$feature_flag_request_id:r,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:null!==(s=null==(a=this._config.bootstrap)||null==(a=a.featureFlags)?void 0:a[e])&&void 0!==s?s:null,$feature_flag_bootstrapped_payload:null!==(u=null==(l=this._config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])&&void 0!==u?u:null,$used_bootstrap_value:!this._flagsLoadedFromRemote};ri(null==m||null==(c=m.metadata)?void 0:c.has_experiment)||(b.$feature_flag_has_experiment=m.metadata.has_experiment),ri(null==m||null==(d=m.metadata)?void 0:d.version)||(b.$feature_flag_version=m.metadata.version);var w=null!==(f=null==m||null==(h=m.reason)?void 0:h.description)&&void 0!==f?f:null==m||null==(p=m.reason)?void 0:p.code;return w&&(b.$feature_flag_reason=w),null!=m&&null!=(_=m.metadata)&&_.id&&(b.$feature_flag_id=m.metadata.id),ri(null==m?void 0:m.original_variant)&&ri(null==m?void 0:m.original_enabled)||(b.$feature_flag_original_response=ri(m.original_variant)?m.original_enabled:m.original_variant),null!=m&&null!=(v=m.metadata)&&v.original_payload&&(b.$feature_flag_original_payload=null==m||null==(g=m.metadata)?void 0:g.original_payload),y.length&&(b.$feature_flag_error=y.join(",")),b},t._configVersion2FlagEvents=function(e,t){var n,r,i,o=this._responseFormat.flagEvents,s=this._prop(nh);if(!(!o||ti(s)&&Jr.call(s,e)))return o({key:e,response:t,groups:null!==(n=null==(r=this._client)?void 0:r.groups)&&void 0!==n?n:{},record:null==(i=this._prop(Wf))?void 0:i[e]})},t._captureFlagEventOnce=function(e,t,n,r,i){var o,s,a,u,l,c=this._prop("$flag_call_reported")||{},f=e+t,h=this._flagEventCaptureThrows.get(f)||0;if(!(null!=(o=c[e])&&o.includes(t)||h>1)){this._set(((a={})[Xf]=d({},c,((s={})[e]=[].concat(c[e]||[],[t]).slice(-10),s)),a));var p,_,v=!1,g=!1;this._flagEventCaptures.set(n.properties,d({},n.capture,{failed:function(){v=!0},resolved:function(e){return _=e.$session_id,p=JSON.stringify([e.distinct_id,e.$groups,_,e.$process_person_profile]),!(g=!!i&&p!==i)}}));var m=!1;try{var y,b;(m=!1!==(null==(y=this._client)?void 0:y.capture(n.event,n.properties))&&!(null==(b=this._client)||!b.canCapture))||r()}catch(e){v=!0,this._logger.error("Failed to capture "+n.event,e)}v&&this._flagEventCaptureThrows.set(f,h+1);var w=m&&!v&&!g;return w||this._unmarkFlagCallReported(e,t),this._config.deduplicateCallsPerSession&&_&&_!==this._prop("$flag_call_reported_session_id")&&this._set(((l={})[Xf]=w?((u={})[e]=[t],u):{},l[eh]=_,l)),p}},t.flagEventCapture=function(e){return e?this._flagEventCaptures.get(e):void 0},t._captureFeatureFlagCalled=function(e){try{var t;return!1!==(null==(t=this._client)?void 0:t.capture("$feature_flag_called",e))}catch(e){return this._logger.error("Failed to capture feature flag call",e),!0}},t._holdFlagCall=function(e,t,n){this._flagCallsPendingCapture.set(e,{value:t,calledKey:n,context:this._flagCallContext()})},t._flagCallContext=function(){var e,t,n;return{distinctId:null==(e=this._client)?void 0:e.distinctId,groups:d({},null==(t=this._client)?void 0:t.groups),sessionId:this._config.deduplicateCallsPerSession?null==(n=this._client)||null==(n=n.session)?void 0:n.sessionId:void 0}},t._unmarkFlagCallReported=function(e,t){var n,r=this._prop("$flag_call_reported")||{},i=r[e];Xr(i)&&i.includes(t)&&(r[e]=i.filter(function(e){return e!==t}),this._set(((n={})[Xf]=r,n)))},t.getRemoteConfigPayload=function(e,t){this._getRemoteConfigPayload(e,t)},t._getRemoteConfigPayload=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a,u,c,d,f,h;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},(o=this._getValidEvaluationEnvironments()).length&&(i.evaluation_contexts=o),s=this._getValidFlagKeys(),ri(s)||(i.flag_keys=s),e.p=2,e.n=3,r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs});case 3:if(f=u=e.v.json,d=null==f){e.n=4;break}d=null==(u=u.featureFlagPayloads);case 4:if(!d){e.n=5;break}h=void 0,e.n=6;break;case 5:h=u[t];case 6:if(c=h){e.n=7;break}c=void 0;case 7:a=c,e.n=9;break;case 8:return e.p=8,this._logger.error("Remote config feature flag request failed",e.v),e.a(2);case 9:try{n(a)}catch(e){this._logger.error("Remote config feature flag callback failed",e)}case 10:return e.a(2)}},e,this,[[2,8]])}));return function(t,n){return e.apply(this,arguments)}}(),t.isFeatureEnabled=function(e,t){if(void 0===t&&(t={}),t.fresh&&!this._flagsLoadedFromRemote)return t.defaultValue;if(this._flagsNotLoaded(e))return this._logger.warn('isFeatureEnabled for key "'+e+Ub),t.defaultValue;var n=this.getFeatureFlag(e,t);return ri(n)?t.defaultValue:!!n},t.addFeatureFlagsHandler=function(e){this.featureFlagEventHandlers.push(e)},t.removeFeatureFlagsHandler=function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})},t.receivedFeatureFlags=function(e,t,n){this._receivedFeatureFlags(e,t,n)},t._receivedFeatureFlags=function(e,t,n){if(this._client){var r;this._hasLoadedFlags=!0,!1!==(null==n?void 0:n.persist)&&Yb(e,n)&&null!=(r=this._crossTabPersistence)&&null!=r.reconcileFeatureFlagsBeforeMerge&&r.reconcileFeatureFlagsBeforeMerge()&&this._clearBootstrapState();var i=this.getFlagVariants(),o=!e.flags&&Xr(e.featureFlags),s=function(e,t,n,r,i,o){var s,a,u;void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o=Hb);var l=Xb(e,o),c=l.flags,f=l.featureFlags,h=l.featureFlagPayloads;if(f){var p=e.requestId,_=e.evaluatedAt;if(Xr(f)){var v;o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var g={};if(f)for(var m=0;f.length>m;m++)g[f[m]]=!0;return(v={})[Uf]=f,v[Yf]=g,v[Wf]=Qb(r,f),v[th]=Kb(n,r),v[Qf]=!1,v}var y=f,b=h,w=c;if(Yb(e,i)){var S=Object.keys(y),k=b||{};y=d({},t,y),b=d({},n,k),(null!=i&&i.partialResponse||c)&&S.forEach(function(e){var t;e in k||null==(t=b)||delete t[e]}),w=c?d({},r,Object.fromEntries(Object.entries(c).filter(function(e){return!(e[1].failed&&(n=e[0],{}.hasOwnProperty.call(t,n)&&!ri(t[n])));var n}))):Qb(r,S)}return d(((s={})[Uf]=Object.keys(Zb(y)),s[Yf]=y||{},s[th]=b||{},s[Wf]=w||{},s[Qf]=!0===e.minimalFlagCalledEvents,s),p?((a={})[Kf]=p,a):{},_?((u={})[Gf]=_,u):{})}}(e,i,o?this._prop("$feature_flag_payloads")||{}:this.getFlagPayloads(),o?this._prop("$feature_flag_details")||{}:this._flagsWithDetails(),n,this._logger);if(s)if(!1===(null==n?void 0:n.persist)){var a=!ri(this._client.kv.get(Yf));this._bootstrapState=s,a||this._set(s)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(s,e,!(null==n||!n.partialResponse)),this._set(s);else t&&this._fallBackToPersistedFlags();t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}},t.override=function(e,t){void 0===t&&(t=!1),this._logger.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})},t.overrideFeatureFlags=function(e){this._overrideFeatureFlags(e)},t._overrideFeatureFlags=function(e){if(this._client){if(!1===e)return this._remove([nh,rh]),this._fireFeatureFlagsCallbacks(),void zb.info("All overrides cleared");var t,n;if(Xr(e))return this._set(((t={})[nh]=Jb(e),t)),this._fireFeatureFlagsCallbacks(),void zb.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;this._override_warning=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r);var o={},s=i.flags,a=i.payloads;return s&&(o[nh]=Xr(s)?Jb(s):s),a&&(o[rh]=a),Object.keys(o).length&&this._set(o),!1===s&&!1===a?this._remove([nh,rh]):!1===s?this._remove(nh):!1===a&&this._remove(rh),this._fireFeatureFlagsCallbacks(),!1===s?zb.info("Flag overrides cleared"):s&&zb.info("Flag overrides set",{flags:s}),void(!1===a?zb.info("Payload overrides cleared"):a&&zb.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[nh]=e,n)),this._fireFeatureFlagsCallbacks(),void zb.info("Flag overrides set",{flags:e});this._logger.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this._logger.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")},t.onFeatureFlags=function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;try{e(r,i)}catch(e){this._logger.error("Error while running feature flags callback",e)}}return function(){return t.removeFeatureFlagsHandler(e)}},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var r,i,o,s,a,u,l,c,f,h,p=(this._prop("$early_access_features")||[]).find(function(t){return t.flagKey===e}),_=((r={})["$feature_enrollment/"+e]=t,r),v={$feature_flag:e,$feature_enrollment:t,$set:_};p&&(v.$early_access_feature_name=p.name),n&&(v.$feature_enrollment_stage=n);var g=d({},this.getFlagVariants(),((i={})[e]=t,i)),m=d({},this._prop(Wf)),y=null==(o=m[e])?void 0:o.failed,b=d({},this._prop(th));y&&(delete m[e],delete b[e]),null==(s=this._crossTabPersistence)||s.markCrossTabFeatureFlagChanges(d(((a={})[Uf]=[e],a[Yf]=[e],a),y?((u={})[Wf]=[e],u[th]=[e],u):{},((l={})[Zf]=Object.keys(_),l))),this._set(d(((c={})[Uf]=Object.keys(Zb(g)),c[Yf]=g,c),y?((f={})[Wf]=m,f[th]=b,f):{},((h={})[Zf]=d({},this._prop("$stored_person_properties")||{},_),h))),this._fireFeatureFlagsCallbacks();try{var w;null==(w=this._client)||w.capture("$feature_enrollment_update",v)}catch(e){this._logger.error("Failed to capture early access feature enrollment",e)}},t.getEarlyAccessFeatures=function(e,t,n){void 0===t&&(t=!1);var r=this._prop(zf);!r||t?this._getEarlyAccessFeatures(e,n):e(r)},t._getEarlyAccessFeatures=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i=n?"&"+n.map(function(e){return"stage="+e}).join("&"):"",e.p=2,e.n=3,r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});case 3:if((a=e.v).json){e.n=4;break}return e.a(2);case 4:this._set(((s={})[zf]=o=a.json.earlyAccessFeatures,s)),e.n=6;break;case 5:return e.p=5,this._logger.error("Early access feature request failed",e.v),e.a(2);case 6:try{t(o)}catch(e){this._logger.error("Early access feature callback failed",e)}case 7:return e.a(2)}},e,this,[[2,5]])}));return function(t,n){return e.apply(this,arguments)}}(),t._prepareFeatureFlagsForCallbacks=function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}},t._fireFeatureFlagsCallbacks=function(e){var t=this;this._rebuildEventProperties();var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants,o=this._firingFeatureFlagsCallbacks;this._firingFeatureFlagsCallbacks=!0,this.featureFlagEventHandlers.forEach(function(n){try{n(r,i,{errorsLoading:e})}catch(e){t._logger.error("Error while running feature flags callback",e)}}),this._firingFeatureFlagsCallbacks=o},t.setPersonPropertiesForFlags=function(e,t){void 0===t&&(t=!0),this._setPersonPropertiesForFlags(e,t)},t._setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=this._prop("$stored_person_properties")||{},i=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),o=null==e?void 0:e.$set_once,s={};if(o)for(var a in o)({}).hasOwnProperty.call(o,a)&&(a in r||(s[a]=o[a]));this._set(((n={})[Zf]=d({},r,s,i),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=d({},this._prop("$stored_person_properties")||{});e.forEach(function(e){delete r[e]}),this._set(((n={})[Zf]=r,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(Zf),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var r=this._prop("$stored_group_properties")||{},i=d({},r),o=0,s=Object.keys(e);s.length>o;o++){var a=s[o];i[a]=d({},r[a],e[a])}this._set(((n={})[Jf]=i,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._prop("$stored_group_properties")||{};this._set(((n={})[Jf]=d({},r,((t={})[e]={},t)),n))}else this._remove(Jf)},t.reset=function(){this._requestGeneration++,this._settleReloads(this._pendingReloads,"cancelled"),this._settleReloads(this._activeReloads,"cancelled"),this._additionalReloadRequested=!1,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._bootstrapState=void 0,this._hasLoadedFlags=!1,this._reloadingDisabled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1,this._consecutiveStatusZeroFailures=0,this._flagCallsPendingCapture=new Map,this._flagEventCaptureThrows=new Map},a(e,[{key:"_responseFormat",get:function(){return ew}},{key:"_crossTabPersistence",get:function(){}},{key:"_config",get:function(){return this._configSource.get()}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),rw=function(e){return ti(e)&&"value"in e?e:void 0},iw=function(e){return ii(e)?e:ui(e)||ti(e)||!0===e},ow="$experiment_exposure",sw="experiment_split",aw="experiment",uw=((f={targeting_match:["targeted_release","percentage_rollout"]})[sw]=[aw],f.rollout_miss=["percentage_rollout",aw],f.experiment_paused=[aw],f.holdout=[aw],f),lw="$feature_flag_config_version",cw="$feature_flag_reason_code",dw="$feature_flag_rule_id",fw="$feature_flag_rule_type",hw="$feature_flag_variant_key",pw="$feature_flag_experiment_id",_w="$feature_flag_forced_variant",vw=[lw,cw,dw,fw,hw],gw=[].concat(vw,["$feature_flag_reason",_w,pw]),mw=[lw,cw,fw,"$experiment_exposure_source",pw,_w],yw=["$feature_flag_id","$feature_flag_version","$feature_flag_request_id","$feature_flag_evaluated_at"],bw=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ww=function(e){return ii(e)?e:void 0},Sw={},kw=function(e){return ui(e)&&e%1==0},xw=[["key",ii],["failed",ci]],Cw=[["code",ii],["condition_index",kw],["description",ii]],Pw=[["id",kw],["version",kw],["description",ii],["has_experiment",ci],["config_version",kw],["rule_type",ii],["rule_id",ii],["variant_key",ii],["forced_variant",ci],["experiment_id",kw]],Ew=function(e,t){if(!ai(e)){if(!ti(e))throw Sw;for(var n,r={},i=p(t);!(n=i()).done;){var o=n.value,s=o[0],a=o[1],u=e[s];if(!ai(u)){if(!a(u))throw Sw;r[s]=u}}return r}},Tw=function(e,t){var n=Ew(t,xw),r=null==t?void 0:t.value;if(!n||!(si(r)||ci(r)||ii(r)||ti(r)||ui(r)&&isFinite(r)))throw Sw;var i=t.metadata,o=Ew(i,Pw),s=!0===n.failed,a=s?null:r,u=ui(a)||ti(a),l=iw(a);return{key:e,enabled:!1!==l,variant:ii(l)?l:null,value:a,reason:Ew(t.reason,Cw),metadata:o||u?d({},o,{payload:s?null:u?JSON.stringify(a):null==i?void 0:i.payload,experiment_id:void 0}):void 0,failed:s||void 0}},Fw=["config_version","rule_type","rule_id","variant_key","forced_variant"],Iw={version:4,read:function(e){var t=ti(e)?e.flags:void 0,n=!1;if(!ti(t)){var r=ti(e)?e.featureFlags:void 0;return{body:e,withoutTypedValues:ti(r)&&Object.keys(r).length>0}}return{body:d({},e,{flags:Object.fromEntries(Object.keys(t).map(function(e){var r=t[e];if(ti(r)&&!("value"in r))return n=!0,[e,r];try{return[e,Tw(e,r)]}catch(t){return[e,{key:e,enabled:!1}]}}))}),withoutTypedValues:n}},publicDetail:function(e){if(!rw(e))return e;var t=d({},e);if(delete t.value,ti(t.metadata))for(var n=t.metadata=d({},t.metadata),r=0,i=Fw;i.length>r;r++)delete n[i[r]];return t},flagEvents:function(e){var t,n=e.key,r=e.response,i=e.record,o=function(e){var t,n=rw(e),r=null==n?void 0:n.metadata;if(n&&2===(null==r?void 0:r.config_version)){var i,o,s,a=ww(null==(t=n.reason)?void 0:t.code)||void 0,u=a&&Jr.call(uw,a)?uw[a]:void 0,l=ww(r.rule_id),c=ww(r.rule_type);return!n.failed&&u&&l&&bw.test(l)&&c&&-1!==u.indexOf(c)&&(a!==sw?(i=l,o=c):ii(r.variant_key)&&(i=l,o=c,s=r.variant_key)),{reasonCode:a,ruleId:i,ruleType:o,variantKey:s}}}(i),s=rw(i);if(o&&s&&(s.failed?ri(r):iw(s.value)===r)){var a=o.reasonCode,u=o.ruleId,l=o.ruleType,c=o.variantKey,f=Object.keys(e.groups).sort().map(function(t){return[t,e.groups[t]]}),h=((t={})[lw]=2,t);a&&(h[cw]=a),u&&(h[dw]=u,h[fw]=l);var p=ii(c);return p&&(h[hw]=c),{calledKey:JSON.stringify([r,f,2,a||null,u||null,l||null,p?c:null]),exposureKey:p?JSON.stringify([ow,f,2,u,c]):void 0,build:function(e){var t=d({},e,h);delete t.$feature_flag_reason;var i={event:"$feature_flag_called",properties:t,capture:{omit:gw.filter(function(e){return!(e in t)}),keep:vw}};if(!p)return{called:i,exposure:void 0};for(var o={},s=0,a=yw;a.length>s;s++){var l=a[s];ri(t[l])||(o[l]=t[l])}return o.$feature_flag=n,o.$feature_flag_response=r,o[hw]=c,o[dw]=u,o.locally_evaluated=!1,{called:i,exposure:{event:ow,properties:o,capture:{omit:mw,keep:[]}}}}}}}},Rw=kl("[FeatureFlags]"),Aw=function(){"use strict";function e(e,t){void 0===t&&(t=!1),this._loggedEvaluationEnvironmentsDeprecation=!1,this.update(e,t)}var t=e.prototype;return t.update=function(e,t){this._snapshot=function(e,t){var n,r,i,o,s,a,u,l;return{bootstrap:{featureFlags:null!==(n=null==(r=e.bootstrap)?void 0:r.featureFlags)&&void 0!==n?n:void 0,featureFlagPayloads:null!==(i=null==(o=e.bootstrap)?void 0:o.featureFlagPayloads)&&void 0!==i?i:void 0},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(s=e.remote_config_refresh_interval_ms)&&void 0!==s?s:3e5,idleRefreshBackoff:ri(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!==(a=e.feature_flag_request_max_retries)&&void 0!==a?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(u=null!==(l=e.evaluation_contexts)&&void 0!==l?l:e.evaluation_environments)&&void 0!==u?u:[],flagKeys:Xr(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(Rw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),ri(e.flag_keys)||Xr(e.flag_keys)||Rw.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),Mw=function(e){"use strict";function t(t){var n,r=new Aw(t.config,t._shouldDisableFlags());return(n=e.call(this,r)||this).name=tv,n._instance=t,n._mutableConfigSource=r,n}return r(t,e),t.prototype.updateConfig=function(e,t){this._mutableConfigSource.update(e,t),this._onConfigUpdated()},a(t,[{key:"_crossTabPersistence",get:function(){return this._instance.persistence}},{key:"_responseFormat",get:function(){return Iw}}])}(nw),Ow="Refusing to render web experiment since the viewer is a likely bot",Lw={ADD_ATTR:function(e,t){return"target"===e&&"a"===t||"form"===e&&/^(button|fieldset|input|output|select|textarea)$/.test(t)},ADD_URI_SAFE_ATTR:["form"]},Dw={icontains:function(e,t){return t.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return-1===t.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return Gl(t,e)},not_regex:function(e,t){return!Gl(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},$w=function(){"use strict";function e(t){var n=this;this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),n.getWebExperiments(function(t){e._logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,t.forEach(function(t){if(t.feature_flag_key){var r;n._flagToExperiments&&(e._logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=n._flagToExperiments)||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);ii(i)&&t.variants[i]&&n._applyVariantForFlag(t,i)}else if(t.variants)for(var o in t.variants){var s=t.variants[o];e._matchesTestVariant(s,n._instance)&&n._applyTransforms(t.name,o,s.transforms)}})},t)},this._instance.onFeatureFlags(function(e){n.onFeatureFlags(e)})}var t=e.prototype;return t.initialize=function(){},t.onFeatureFlags=function(t){var n=this;if(this._is_bot())e._logInfo(Ow);else if(!this._config.disable_web_experiments){if(ai(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e._logInfo("applying feature flags",t),t.forEach(function(e){var t;if(n._flagToExperiments&&null!=(t=n._flagToExperiments)&&t.has(e)){var r,i=n._instance.getFeatureFlag(e),o=null==(r=n._flagToExperiments)?void 0:r.get(e);i&&null!=o&&o.variants[i]&&n._applyVariantForFlag(o,i)}})}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var r=Gh(null==n?void 0:n.search,"__experiment_id"),i=Gh(null==n?void 0:n.search,"__experiment_variant");r&&i&&(e._logInfo("previewing web experiments "+r+" && "+i),this.getWebExperiments(function(e){t._showPreviewWebExperiment(parseInt(r),i,e)},!1,!0))}},t.loadIfEnabled=function(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()},t.getWebExperiments=function(e,t,n){if(this._config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._config.token),method:"GET",timestampMode:"query",callback:function(t){return e(200===t.statusCode&&t.json&&t.json.experiments||[])}})},t._showPreviewWebExperiment=function(t,n,r){var i=r.filter(function(e){return e.id===t});i&&i.length>0&&(e._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this._applyTransforms(i[0].name,n,i[0].variants[n].transforms))},t._applyVariantForFlag=function(t,n){var r=t.variants[n];e._matchUrlConditions(r,this._instance)?this._applyTransforms(t.name,n,r.transforms):e._logInfo("skipping variant "+n+" of experiment "+t.name+" because this page does not match its url conditions")},e._matchesTestVariant=function(t,n){return!ai(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var r;if(ai(t.conditions)||ai(null==(r=t.conditions)?void 0:r.url))return!0;var i=e.getWindowLocation();if(i){var o,s,a,u=Bd(n,i.href);return null==(o=t.conditions)||!o.url||Dw[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,u)}return!1},e.getWindowLocation=function(){return null==Ih?void 0:Ih.location},e._matchUTMConditions=function(e){var t;if(ai(e.conditions)||ai(null==(t=e.conditions)?void 0:t.utm))return!0;var n=Vm();if(n.utm_source){var r,i,o,s,a,u,l,c,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_campaign)==n.utm_campaign,f=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_source)==n.utm_source,h=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==n.utm_medium,p=null==(l=e.conditions)||null==(l=l.utm)||!l.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==n.utm_term;return d&&h&&p&&f}return!1},e._logInfo=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];Sl.info("[WebExperiments] "+e,n)},e._logWarn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];Sl.warn("[WebExperiments] "+e,n)},e._sanitizeLinkTargets=function(t){("http://www.w3.org/1999/xhtml"===t.namespaceURI&&"template"===t.localName?t.content:t).querySelectorAll("a[target], template").forEach(function(t){var n;if("template"!==t.localName)if("http://www.w3.org/1999/xhtml"===t.namespaceURI&&"_blank"===(null==(n=t.getAttribute("target"))?void 0:n.toLowerCase())){var r=(t.getAttribute("rel")||"").split(/\s+/).filter(function(e){return e&&!/^(opener|noopener)$/i.test(e)});r.push("noopener"),t.setAttribute("rel",r.join(" "))}else t.removeAttribute("target");else"http://www.w3.org/1999/xhtml"===t.namespaceURI&&e._sanitizeLinkTargets(t)})},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo(Ow):"control"!==n?r.forEach(function(r){if(r.selector){var i;e._logInfo("applying transform of variant "+n+" for experiment "+t+" ",r);var o=null==(i=document)?void 0:i.querySelectorAll(r.selector);if(null==o||!o.length)return void e._logWarn("no element on this page matches selector "+r.selector+" of variant "+n+" for experiment "+t);var s=new Map;null==o||o.forEach(function(t){if("script"!==t.localName.toLowerCase()){var n=t;if(r.html){var i,o="http://www.w3.org/1998/Math/MathML"===t.namespaceURI&&"annotation-xml"===t.localName&&(null==(i=t.getAttribute("encoding"))?void 0:i.toLowerCase())||"",a=JSON.stringify([t.namespaceURI,t.localName,o]),u=s.get(a);if(ai(u)){var l=null!=Ib?Ib:Ib=Od(),c=t.ownerDocument.implementation.createHTMLDocument(""),f=c.createElementNS(t.namespaceURI,t.localName);o&&f.setAttribute("encoding",o);var h=c.createRange();h.selectNodeContents(f);var p="http://www.w3.org/2000/svg"===t.namespaceURI&&/^(foreignObject|desc|title)$/.test(t.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(o)?"http://www.w3.org/1999/xhtml":t.namespaceURI,_=h.createContextualFragment(r.html);"http://www.w3.org/1998/Math/MathML"===t.namespaceURI&&/^(mi|mo|mn|ms|mtext)$/.test(t.localName)?(f.appendChild(_),l.sanitize(f,d({},Lw,{NAMESPACE:p||void 0,IN_PLACE:!0}))):("http://www.w3.org/1999/xhtml"===f.namespaceURI&&"template"===f.localName?f.content:f).appendChild(l.sanitize(_,d({},Lw,{NAMESPACE:p||void 0,RETURN_DOM_FRAGMENT:!0}))),e._sanitizeLinkTargets(f),s.set(a,u=f.innerHTML)}n.innerHTML=u}r.css&&n.setAttribute("style",r.css)}})}}):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return Ah&&this._instance?Iy(Ah,this._config.custom_blocked_useragents):void 0},a(e,[{key:"_config",get:function(){return this._instance.config}}])}(),qw=kl("[Conversations]"),Nw="Conversations not available yet.",Bw=function(){"use strict";function e(e){this._instance=e,this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._loadFailed=!1,this._resetGeneration=0,this._pendingPanelAction=null,this._theme=null}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){if(this._instance.config.disable_conversations)this._pendingPanelAction=null;else if(this._remoteConfigSuccessful=e.ok,e.ok){var t=e.config.conversations;ai(t)?this._pendingPanelAction=null:(ci(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this._isConversationsEnabled||(this._pendingPanelAction=null),this.loadIfEnabled())}},t.reset=function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._resetGeneration++,this._isConversationsEnabled=void 0,this._remoteConfig=null,this._remoteConfigSuccessful=void 0,this._loadFailed=!1,this._pendingPanelAction=null},t.loadIfEnabled=function(){var e=this;if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||Ol(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==jh?void 0:jh.__PosthogExtensions__;if(t&&!ri(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var n=t.initConversations;if(n)return this._completeInitialization(n),void(this._isInitializing=!1);var r=dg(this._instance);if(!r)return void this._handleLoadError(Or);var i=this._resetGeneration;r(this._instance,"conversations",function(n){if(i!==e._resetGeneration)return e._isInitializing=!1,void e.loadIfEnabled();n||!t.initConversations?e._handleLoadError("Could not load conversations script",n):e._completeInitialization(t.initConversations),e._isInitializing=!1})}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else qw.error("Conversations enabled but missing token in remote config.")}},t._completeInitialization=function(e){if(this._remoteConfig){try{this._conversationsManager=e(this._remoteConfig,this._instance),this._loadFailed=!1,qw.info("Conversations loaded successfully")}catch(e){return void this._handleLoadError("Error completing conversations initialization",e)}this._theme&&this._conversationsManager.setTheme(this._theme),this._applyPendingPanelAction()}else qw.error("Cannot complete initialization: remote config is null")},t._applyPendingPanelAction=function(){var e=this._pendingPanelAction;this._pendingPanelAction=null,this._conversationsManager&&e&&("open"===e?this._conversationsManager.open():this._conversationsManager.close())},t._handleLoadError=function(e,t){qw.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():qw.warn("Conversations not loaded yet.")},t.hide=function(){"open"===this._pendingPanelAction&&(this._pendingPanelAction=null),this._conversationsManager&&this._conversationsManager.hide()},t.open=function(){this._conversationsManager?(this._pendingPanelAction=null,this._conversationsManager.open()):this._pendingPanelAction="open"},t.close=function(){this._conversationsManager?(this._pendingPanelAction=null,this._conversationsManager.close()):this._pendingPanelAction="close"},t.setTheme=function(e){var t,n;this._theme=d({},this._theme,e,{dark:d({},null==(t=this._theme)?void 0:t.dark,null==e?void 0:e.dark)}),null==(n=this._conversationsManager)||n.setTheme(e)},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!si(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ol(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":ri(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?ai(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=jh&&jh.__PosthogExtensions__?this._isInitializing?"initializing":this._loadFailed?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"},t.isVisible=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e},t.sendMessage=function(){var e=h(l().m(function e(t,n,r){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.sendMessage(t,n,r))}},e,this)}));return function(t,n,r){return e.apply(this,arguments)}}(),t.getMessages=function(){var e=h(l().m(function e(t,n){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getMessages(t,n))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t.markAsRead=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.markAsRead(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.getTickets=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getTickets(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.requestRestoreLink=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.requestRestoreLink(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromToken=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromToken(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromUrlToken=function(){var e=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return qw.warn(Nw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromUrlToken())}},e,this)}));return function(){return e.apply(this,arguments)}}(),t.getCurrentTicketId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null},t.getWidgetSessionId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null},t._onIdentityChanged=function(){var e;null==(e=this._conversationsManager)||e.setIdentity()},t._onIdentityCleared=function(){var e;null==(e=this._conversationsManager)||e.clearIdentity()},e}();function jw(e,t){var n,r,i,o,s,a,u,l=null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:3e3,c=null!==(r=null==e?void 0:e.maxBufferSize)&&void 0!==r?r:100,f=null!=t&&t.consoleCapture?void 0:null!==(i=null==e?void 0:e.maxLogsPerInterval)&&void 0!==i?i:1e3,h=ri(f)?Math.max(c,2048):Math.max(c,f),p=d({},function(){var e="",t="";try{var n,r=null==(n="u">typeof globalThis?globalThis:"u">typeof window?window:void 0)||null==(n=n.navigator)?void 0:n.userAgent;if(r){var i=xo(r);e=i[0],t=i[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(Wa,e)?Wa[e]:e}(e);return d({},n?{"os.name":n}:{},t?{"os.version":t}:{})}(e,t)}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(o=null!==(s=null==p?void 0:p["service.name"])&&void 0!==s?s:null==e?void 0:e.serviceName)&&void 0!==o?o:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==p?void 0:p["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(u=null==p?void 0:p["deployment.environment"])&&void 0!==u?u:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:l,maxBufferSize:c,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:f,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Hw=["debug","log","warn","error","info"],zw="console",Uw="__posthogHandledLogsRequestError",Ww=function(e,t){var n=e instanceof Error?e:new Error(t);return n[Uw]=!0,n},Vw=function(e){return!!e&&"object"==typeof e&&!0===e[Uw]},Gw=function(e){"use strict";function t(t){var n=e.call(this,{get:function(){var e;return null==t||null==(e=t.config)?void 0:e.logs},captureHintKey:pp,get remoteConfigWillArrive(){var e;return!(null!=t._shouldDisableFlags&&t._shouldDisableFlags()&&(null==(e=jh._POSTHOG_REMOTE_CONFIG)||null==(e=e[t.config.token])||!e.config))}},function(){return function(e){var t,n={};if(n.distinctId=e.get_distinct_id(),e.sessionManager){var r=e.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,o=r.sessionStartTimestamp,s=r.lastActivityTimestamp;n.sessionId=r.sessionId,n.windowId=i,ai(o)||(n.sessionStartTimestamp=o),ai(s)||(n.lastActivityTimestamp=s)}if(null!=jh&&null!=(t=jh.location)&&t.href&&(n.currentUrl=e.config.disable_capture_url_hashes?Ho(jh.location.href):jh.location.href),e.featureFlags){var a=e.featureFlags.getFlags();a&&a.length>0&&(n.activeFeatureFlags=a)}return n}(t)})||this;return n._instance=t,n.name=nv,n._listenForReconnect(),n}return r(t,e),t.prototype._getConsoleLoader=function(){var e=this,t=kl("[logs]"),n=null==jh?void 0:jh.__PosthogExtensions__;if(n){var r=dg(this._instance);if(r)return function(t){r(e._instance,"logs",function(e){var r=n.logs;t(e,null!=r&&r.initializeLogs?{initialize:function(e){return r.initializeLogs(e)},replay:function(e,t){return null==r.replayConsoleBuffer?void 0:r.replayConsoleBuffer(e,t)}}:void 0)})};t.error(Or)}else t.error("PostHog Extensions not found.")},a(t,[{key:"_isRequestReady",get:function(){return this._instance.__loaded}}])}(function(){"use strict";function e(e,t){var n,r=this;this._configSource=e,this._getSdkContext=t,this.name="logs",this._isLogsEnabled=!1,this._isLoaded=!1,this._isLoading=!1,this._logger=kl("[logs]"),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._setupStarted=!1,this._disposed=!1,this._consoleBuffer=[],this._consoleRecorderUnpatchers=[],this._isRecordingConsole=!1,this._isRecordingConsoleEntry=!1,this._listeningForReconnect=!1,this._onReconnect=function(){var e,t;r._disposed||(r._consecutiveStatusZeroFailures=0,null==(e=r._core)||e.onReconnect(),null==(t=r._consoleCore)||t.onReconnect())},this._isLogsEnabled=!(null==(n=e.get())||!n.captureConsoleLogs)}var t=e.prototype;return t._getConsoleLoader=function(){},t._listenForReconnect=function(){if(!this._listeningForReconnect){try{this._window=typeof window>"u"?void 0:window}catch(e){this._window=void 0}this._window&&(Ml(this._window,"online",this._onReconnect),this._listeningForReconnect=!0)}},t._buildCore=function(e,t,n,r){var i=this;this._listenForReconnect();var o=jw(this._configSource.get(),n);return[new tu(this._createHost(e,t),o,this._coreLogger,function(){return i._getSdkContext()},function(e){return e()},void 0,r),o]},t._getCore=function(){var e=this,t=this._configSource.get();if(!this._core||this._resolvedFrom!==t){var n;null==(n=this._core)||n.reset(),this._resolvedFrom=t;var r=this._buildCore(function(){return e._queue},function(t){e._queue=t});this._core=r[0],this._resolvedConfig=r[1]}return this._core},t._getConsoleCore=function(){var e=this,t=this._configSource.get();if(!this._consoleCore||this._consoleResolvedFrom!==t){var n;null==(n=this._consoleCore)||n.reset(),this._consoleResolvedFrom=t;var r=this._buildCore(function(){return e._consoleQueue},function(t){e._consoleQueue=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},zw);this._consoleCore=r[0],this._consoleResolvedConfig=r[1]}return this._consoleCore},t.setup=function(e){var t=this;if(!this._disposed&&!this._setupStarted)return this._setupStarted=!0,this._client=e,this._logger=e.logger.createLogger("[logs]"),Ph(e.kv.initialize(),function(){t._disposed||t._finishSetup(e)})},t._finishSetup=function(e){var t,n=this;this._listenForReconnect(),null!=(t=this._configSource.get())&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),(this._isLogsEnabled||this._configSource.remoteConfigWillArrive&&e.kv.get(this._configSource.captureHintKey))&&this._startConsoleRecorder();var r=!1,i=e.onRemoteConfig(function(e){var t;r=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),n.onRemoteConfig(e)});this._disposed?i.dispose():(this._remoteConfigSubscription=i,r||this.loadIfEnabled())},t.dispose=function(){var e,t,n,r,i,o,s;this._disposed||(this._disposed=!0,this._stopConsoleRecorder(),null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._client=void 0,this._isLoading=!1,null==(t=this._window)||t.removeEventListener("online",this._onReconnect),null==(n=this._consoleLogsDispose)||n.call(this),this._consoleLogsDispose=void 0,null==(r=this._core)||r.clearQueue(),null==(i=this._consoleCore)||i.clearQueue(),null==(o=this._core)||o.reset(),null==(s=this._consoleCore)||s.reset())},t.onRemoteConfig=function(e){var t,n;if(!this._disposed){var r=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;ai(r)?this._stopRecorderStartedByPersistedHint():(null==(n=this._client)||n.kv.set(this._configSource.captureHintKey,!!r),r?(this._isLogsEnabled=!0,this._isLoaded||this._startConsoleRecorder(),this.loadIfEnabled()):this._stopRecorderStartedByPersistedHint())}},t.reset=function(){var e,t,n,r;this._stopConsoleRecorder(),null==(e=this._core)||e.clearQueue(),this._queue=[],null==(t=this._core)||t.reset(),null==(n=this._consoleCore)||n.clearQueue(),this._consoleQueue=[],null==(r=this._consoleCore)||r.reset(),this._consecutiveStatusZeroFailures=0},t.captureLog=function(e){!this._disposed&&this._client&&this._getCore().captureLog(e)},t.captureConsoleLog=function(e){!this._disposed&&this._client&&this._getConsoleCore().captureLog(e)},t.captureBufferedConsoleLog=function(e,t,n){!this._disposed&&this._client&&this._getConsoleCore().captureLog(e,{context:t,occurredAtMs:n})},t._onOptOut=function(){var e;this._stopConsoleRecorder(),null==(e=this._consoleCore)||e.clearQueue(),this._consoleQueue=[]},t._stopRecorderStartedByPersistedHint=function(){this._isLogsEnabled||this._stopConsoleRecorder()},t._startConsoleRecorder=function(){var e,t=this;if(!this._isRecordingConsole&&null!=(e=this._window)&&e.console){var n=jw(this._configSource.get()).maxBufferSize,r=!0;this._consoleRecorderUnpatchers.push(function(){r=!1});for(var i=function(){var e,i=s[o];try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(t._window.console[i])}catch(e){return 1}e&&t._consoleRecorderUnpatchers.push(qg(t._window.console,i,function(o){var s=function(){for(var e=arguments.length,s=new Array(e),a=0;e>a;a++)s[a]=arguments[a];try{r&&t._recordConsoleEntry(i,s,n)}catch(e){}return o.apply(t._window.console,s)};return s.__rrweb_original__=e,s}))},o=0,s=Hw;s.length>o;o++)if(i())continue;this._isRecordingConsole=!0,this._consoleRecorderTimeout=setTimeout(function(){t._stopConsoleRecorder()},3e4)}},t._recordConsoleEntry=function(e,t,n){var r;if(this._isRecordingConsole&&!this._isRecordingConsoleEntry&&0!==t.length)if(null!=(r=this._client)&&r.canCapture){if(n>this._consoleBuffer.length){this._isRecordingConsoleEntry=!0;try{this._consoleBuffer.push({level:e,args:t,occurredAtMs:Date.now(),context:this._getSdkContext()})}finally{this._isRecordingConsoleEntry=!1}}}else this._stopConsoleRecorder()},t._stopConsoleRecorder=function(){if(this._consoleBuffer=[],this._isRecordingConsole){this._isRecordingConsole=!1,this._consoleRecorderTimeout&&(clearTimeout(this._consoleRecorderTimeout),this._consoleRecorderTimeout=void 0);for(var e,t=p(this._consoleRecorderUnpatchers);!(e=t()).done;)(0,e.value)();this._consoleRecorderUnpatchers=[]}},t._takeConsoleBuffer=function(){var e=this._consoleBuffer;return this._stopConsoleRecorder(),e},t.flushLogs=function(e){var t=this;this._client&&(e?this._flushViaTransport(e):(this._core&&this._core.flush().catch(function(e){return t._logFlushError(e)}),this._consoleCore&&this._consoleCore.flush().catch(function(e){return t._logFlushError(e)})))},t.flush=function(){var e=h(l().m(function e(){var t,n,r,i,o=this;return l().w(function(e){for(;;)switch(e.n){case 0:return r=null==(t=this._core)?void 0:t.flush().catch(function(e){return o._logFlushError(e)}),i=null==(n=this._consoleCore)?void 0:n.flush().catch(function(e){return o._logFlushError(e)}),e.n=1,r;case 1:return e.n=2,i;case 2:return e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._logFlushError=function(e){Vw(e)||this._logger.error("PostHog logs flush failed:",e)},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._isLogsEnabled&&!this._isLoaded&&!this._isLoading){var t=this._getConsoleLoader();if(t){this._isLoading=!0;try{t(function(t,n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled)if(t||!n)e._logger.error("Could not load logs script",t),e._stopConsoleRecorder();else{var r=e._takeConsoleBuffer();e._consoleLogsDispose=n.initialize(e._client),e._isLoaded=!0,r.length>0&&n.replay(e._client,r)}})}catch(e){throw this._isLoading=!1,e}}else this._stopConsoleRecorder()}},t._createHost=function(e,t){var n=this,r=this._client;return{get isDisabled(){return!1},get optedOut(){return!r.canCapture},getPersistedProperty:function(t){return t===Br.LogsQueue?e():void 0},setPersistedProperty:function(e,n){e===Br.LogsQueue&&t(null!=n?n:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return r.library.name},getLibraryVersion:function(){return r.library.version}}},t._sendLogsBatch=function(e){var t=this;return new Promise(function(n){if(Uh(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:Ww(void 0,"logs endpoint is unreachable, dropping batch")});else{var r=!1,i=function(e){r||(r=!0,clearTimeout(o),n(e))},o=setTimeout(function(){t._logger.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:Ww(void 0,"logs request timed out")})},9e4),s=t._isRequestReady;t._client.sendRequest("/i/v1/logs",{method:"POST",query:{token:t._client.projectToken},body:e,compression:"best-available",timeoutMs:6e4}).then(function(e){var n,r=e.statusCode;t._trackEndpointReachability(r,s),r>=200&&300>r?i({kind:"ok"}):413===r?i({kind:"too-large"}):0!==r&&408!==r&&429!==r&&500>r?i({kind:"fatal",error:new Error("logs request failed with status "+r)}):0===r?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:Ww(e.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(n=e.error)&&void 0!==n?n:new Error("logs request failed with status "+r)})},function(e){i({kind:"retry-later",error:e})})}})},t._trackEndpointReachability=function(e,t){var n=this;(0!==e||t)&&(this._consecutiveStatusZeroFailures=Wh(e,this._consecutiveStatusZeroFailures,3,function(){return n._logger.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")}))},t._flushViaTransport=function(e){var t=this;this._queue.length>0&&this._drainQueueViaTransport(e,this._queue,this._resolvedConfig,this._client.library.name,function(e){t._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,zw,function(e){t._consoleQueue=e})},t._drainQueueViaTransport=function(e,t,n,r,i){var o=this;if(0!==t.length){var s=t.map(function(e){return e.record});i([]);var a=Ja(s,Ya(n,this._client.library.name,this._client.library.version),r,this._client.library.version);this._client.sendRequest("/i/v1/logs",{method:"POST",query:{token:this._client.projectToken},body:a,compression:"best-available",transport:e,timeoutMs:6e4}).catch(function(e){return o._logFlushError(e)})}},a(e,[{key:"_coreLogger",get:function(){var e=this;return d({},this._logger,{error:function(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.some(Vw)||(t=e._logger).error.apply(t,r)}})}},{key:"_isRequestReady",get:function(){return!0}},{key:"logger",get:function(){var e=this;return this._capture_logger||(this._capture_logger={trace:function(t,n){return e.captureLog({body:t,level:"trace",attributes:n})},debug:function(t,n){return e.captureLog({body:t,level:"debug",attributes:n})},info:function(t,n){return e.captureLog({body:t,level:"info",attributes:n})},warn:function(t,n){return e.captureLog({body:t,level:"warn",attributes:n})},error:function(t,n){return e.captureLog({body:t,level:"error",attributes:n})},fatal:function(t,n){return e.captureLog({body:t,level:"fatal",attributes:n})}}),this._capture_logger}}])}()),Kw=kl("[NetworkMetrics]"),Qw={"http:":80,"https:":443},Yw=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),Jw=function(e){return ii(e)&&0===e.toLowerCase().indexOf("text/event-stream")},Zw=function(e){try{return e()}catch(e){return}},Xw=function(e,t){var n,r=String(t);return{method:String(e).toUpperCase(),url:(null==(n=Hh(r))?void 0:n.href)||r}},eS=function(e,t,n,r,i,o,s){void 0===s&&(s=!1);try{var a,u=i();if(!u)return;var l=n||void 0,c=ng()-r,f=Hh(t.url);if(f&&"http:"!==f.protocol&&"https:"!==f.protocol)return;var h={url:(null==f?void 0:f.href)||t.url,method:t.method},p=ei(u.name)?u.name(h):ii(u.name)?u.name:"http.client.request.duration";if(!p)return;var _=s&&!l?void 0:function(e,t){return e?400>e?void 0:String(e):(null==t?void 0:t.name)||"_OTHER"}(l,o),v=d({},d({"http.request.method":m=Yw.has(g=h.method)?g:"_OTHER"},"_OTHER"===m&&g!==m?{"http.request.method_original":g}:{}),f?function(e){return{"server.address":e.hostname.startsWith("[")&&e.hostname.endsWith("]")?e.hostname.slice(1,-1):e.hostname,"server.port":Number(e.port)||Qw[e.protocol],"url.scheme":e.protocol.slice(0,-1),"url.template":(t=e.pathname,t.split("/").map(function(e){return function(e){return/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e)}(e)?":id":e}).join("/"))};var t}(f):{},l?{"http.response.status_code":l}:{},_?{"error.type":_}:{},null==u.attributes?void 0:u.attributes(h,{status:l,durationMs:c}));null==(a=e.metrics)||a.histogram(p,c,{unit:"ms",attributes:v})}catch(e){Kw.error("Failed to record network metric",e)}var g,m},tS=function(){},nS=function(e){var t=!0,n=function(){return t?function(e){var t,n=null==(t=e.config.metrics)?void 0:t.network;return!0===n?{}:n||void 0}(e):void 0},r=function(e,t){return ei(null==Ih?void 0:Ih.fetch)?qg(Ih,"fetch",function(n){return function(){for(var r=ng(),i=arguments.length,o=new Array(i),s=0;i>s;s++)o[s]=arguments[s];var a=n.apply(this,o);if(!t())return a;try{var u,l,c,d=o[0],f=o[1],h=Xw(null!==(u=null!==(l=null==f?void 0:f.method)&&void 0!==l?l:null==d?void 0:d.method)&&void 0!==u?u:"GET",null!==(c=null==d?void 0:d.url)&&void 0!==c?c:d);return a.then(function(n){return Jw(Zw(function(){var e;return null==n||null==(e=n.headers)?void 0:e.get("content-type")}))||eS(e,h,null==n?void 0:n.status,r,t,void 0,!0),n},function(n){throw eS(e,h,void 0,r,t,n),n})}catch(e){return Kw.error("Failed to observe fetch",e),a}}}):tS}(e,n),i=function(e,t){var n,r=null==Ih||null==(n=Ih.XMLHttpRequest)?void 0:n.prototype;if(!r)return tS;var i=new WeakMap,o=qg(r,"open",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];try{(function(e){return $v.has(e)})(this)||i.set(this,Xw(n[0],n[1]))}catch(e){Kw.error("Failed to observe XHR open",e)}return e.apply(this,n)}}),s=qg(r,"send",function(n){return function(){var r,o,s=this;try{var a=i.get(this);if(a&&t()){var u=ng(),l=function(){return Jw(Zw(function(){return s.getResponseHeader("content-type")}))},c=!1;r=function(){s.removeEventListener("loadend",r),s.removeEventListener("readystatechange",o),c||l()||eS(e,a,s.status,u,t)},Ml(this,"readystatechange",o=function(){2===s.readyState&&(c=l())}),Ml(this,"loadend",r)}}catch(e){Kw.error("Failed to observe XHR send",e)}try{for(var d=arguments.length,f=new Array(d),h=0;d>h;h++)f[h]=arguments[h];return n.apply(this,f)}catch(e){throw r&&this.removeEventListener("loadend",r),o&&this.removeEventListener("readystatechange",o),e}}});return function(){o(),s()}}(e,n);return function(){t=!1,r(),i()}},rS=function(){"use strict";function e(e){var t=this;this._instance=e,this._logger=kl("[metrics]"),this._disposed=!1,this._visibilityListening=!1,this._onVisibilityChange=function(){"hidden"===(null==Mh?void 0:Mh.visibilityState)&&t.flush()}}var t=e.prototype;return t.initialize=function(){this.onConfigChange(),this._disposed||this._visibilityListening||null==Mh||!Mh.addEventListener||(Ml(Mh,"visibilitychange",this._onVisibilityChange),this._visibilityListening=!0)},t.onConfigChange=function(){var e;if(!this._disposed){var t=!(null==(e=this._instance.config.metrics)||!e.network);t&&!this._stopNetworkMetrics?this._stopNetworkMetrics=nS(this._instance):!t&&this._stopNetworkMetrics&&(this._stopNetworkMetrics(),this._stopNetworkMetrics=void 0)}},t._getCore=function(){var e;if(!this._disposed){var t=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;if(!this._core||this._resolvedFrom!==t){var n;null==(n=this._core)||n.reset(),this._resolvedFrom=t;var r=function(e){var t,n,r,i,o,s=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==s?void 0:s["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(n=null==s?void 0:s["service.version"])&&void 0!==n?n:null==e?void 0:e.serviceVersion,environment:null!==(r=null==s?void 0:s["deployment.environment"])&&void 0!==r?r:null==e?void 0:e.environment,resourceAttributes:s,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i:1e4,maxSeriesPerFlush:null!==(o=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==o?o:1e3}}(t);ri(null==t?void 0:t.flushIntervalMs)&&(r.flushIntervalMs=6e4),this._core=new lu(this._createHost(),r,this._logger)}return this._core}},t.count=function(e,t,n){var r;void 0===t&&(t=1),null==(r=this._getCore())||r.count(e,t,n)},t.gauge=function(e,t,n){var r;null==(r=this._getCore())||r.gauge(e,t,n)},t.histogram=function(e,t,n){var r;null==(r=this._getCore())||r.histogram(e,t,n)},t.flush=function(e){var t=this;if(!this._core)return Promise.resolve();if(e){var n=this._core.drainWindow();return n&&this._sendMetricsBatch(n,e),Promise.resolve()}return this._core.flush().catch(function(e){return t._logger.error("PostHog metrics flush failed:",e)})},t.reset=function(){var e;null==(e=this._core)||e.reset()},t.dispose=function(){var e,t;this._disposed=!0,null==Mh||null==Mh.removeEventListener||Mh.removeEventListener("visibilitychange",this._onVisibilityChange),this._visibilityListening=!1,null==(e=this._stopNetworkMetrics)||e.call(this),this._stopNetworkMetrics=void 0,null==(t=this._core)||t.reset()},t._createHost=function(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},_sendMetricsBatch:function(e){return t._sendMetricsBatch(e)},getLibraryId:function(){return Jh.LIB_NAME},getLibraryVersion:function(){return Jh.LIB_VERSION}}},t._sendMetricsBatch=function(e,t){var n=this;return new Promise(function(r){var i=!1,o=function(e){i||(i=!0,clearTimeout(s),r(e))},s=setTimeout(function(){return o({kind:"retry-later",error:new Error("metrics request timed out")})},9e4);n._instance._send_request(d({method:"POST",url:n._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},"hidden"===(null==Mh?void 0:Mh.visibilityState)&&{preferSyncCompression:!0},{fireCallbackOnDrop:!0,callback:function(e){var t,n=e.statusCode;o(n>=200&&300>n?{kind:"ok"}:413===n?{kind:"too-large"}:0!==n&&408!==n&&429!==n&&500>n?{kind:"fatal",error:new Error("metrics request failed with status "+n)}:{kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:new Error("metrics request failed with status "+n)})}}))})},t._metricsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)},e}(),iS=new WeakMap,oS=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),sS={maxStringLength:2048,truncationSuffix:"..."},aS={maxStringLength:2048,truncationSuffix:"..."};function uS(e){if(e)return!0===e?{intent:!0,model:!0}:{intent:!1!==e.intent,model:!1!==e.model}}function lS(e,t){return{}.hasOwnProperty.call(e,t)}function cS(e,t){var n=Object.create(e);return t&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),n}function dS(e,t,n){if(void 0===n&&(n=!1),ii(e)){var r=e.trim();if(r)return(n?Ia(r,sS):r).slice(0,t)}}function fS(e){try{return ti(e)&&!0===e.isError}catch(e){return!1}}function hS(e){return Ia(e||"Unknown error",aS).slice(0,2048)}function pS(e,t){try{return hS(t?function(e){try{if(!ti(e)||!Xr(e.content))return;return e.content.filter(function(e){return ti(e)&&"text"===e.type&&ii(e.text)}).map(function(e){return e.text}).join(" ").trim()||void 0}catch(e){return}}(e):ti(e)&&ii(e.message)?e.message:ii(e)?e:String(e))}catch(e){return"Unknown error"}}function _S(e,t,n){return t.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:e.buildProperties(t.error,{handled:!0}).$exception_list.map(function(e){return d({},e,{value:hS(e.value)})})}function vS(e,t){if(t)return"Error";try{if(!ti(e))return"Error";var n=ii(e.name)?e.name.trim():"",r=e.constructor;return n&&"Error"!==n||!ei(r)||"Error"===r.name||(n=r.name),(n||"Error").slice(0,256)}catch(e){return"Error"}}function gS(e,t){return{message:pS(e,t),type:vS(e,t)}}if(ab.__defaultExtensionClasses=d({},{featureFlags:Mw,sessionRecording:Eb,autocapture:cb,historyAutocapture:hb,heatmaps:Rb,deadClicksAutocapture:Tm,webVitalsAutocapture:wb,exceptionObserver:fb,exceptions:xg,productTours:Ob,siteApps:$b,surveys:hg,tracingHeaders:_b,toolbar:jb,experiments:$w,conversations:Bw,logs:Gw,metrics:rS,webMCP:function(){"use strict";function e(e){this._instance=e,this._isPatched=!1}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this._instance.config.capture_webmcp&&!this._isPatched){var e=null==Mh?void 0:Mh.modelContext;if(e&&ei(e.registerTool)){var t=iS.get(e);if(t)return t.instances.add(this._instance),void(this._isPatched=!0);var n={instances:new Set([this._instance])},r=e.registerTool,i=this;qg(e,"registerTool",function(e){var t=e;return function(e){for(var r=e,o=arguments.length,s=new Array(o>1?o-1:0),a=1;o>a;a++)s[a-1]=arguments[a];try{r=i._wrapTool(e,n)}catch(n){return t.call.apply(t,[this,e].concat(s))}return t.call.apply(t,[this,r].concat(s))}}),e.registerTool!==r&&(iS.set(e,n),this._isPatched=!0)}}},t._wrapTool=function(e,t){if(!e||!ei(e.execute))return e;var n=e.execute,r=this,i=function(e,t){var n={intent:!1,model:!1},r=e.inputSchema;if(!function(e){return!!ri(e)||ti(e)&&Object.keys(e).every(function(e){return oS.has(e)||e.startsWith("x-")})&&!0!==e.additionalProperties&&!ti(e.additionalProperties)&&(!e.type||"object"===e.type)&&(!e.properties||ti(e.properties))&&(!e.required||Xr(e.required))}(r))return{tool:cS(e),injected:n};var i=(null==r?void 0:r.properties)||{},o=function(e){return lS(i,e)||Xr(null==r?void 0:r.required)&&r.required.includes(e)};if(n.intent=t.intent&&!o("context"),n.model=t.model&&!o("llm_model"),!n.intent&&!n.model)return{tool:cS(e),injected:n};var s=d({},i),a=Xr(null==r?void 0:r.required)?[].concat(r.required):[];return n.intent&&(s.context={type:"string",description:'Explain why this tool is called and how it supports the user\'s goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".'},a.includes("context")||a.push("context")),n.model&&(s.llm_model={type:"string",description:'The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the site developer\'s analytics.'},a.includes("llm_model")||a.push("llm_model")),{tool:cS(e,d({},r,{type:(null==r?void 0:r.type)||"object",properties:s,required:a})),injected:n}}(e,function(e){for(var t,n={intent:!1,model:!1},r=p(e.instances);!(t=r()).done;){var i=uS(t.value.config.capture_webmcp);n.intent||(n.intent=!0===(null==i?void 0:i.intent)),n.model||(n.model=!0===(null==i?void 0:i.model))}return n}(t)),o=i.tool,s=i.injected;return Object.defineProperty(o,"execute",{configurable:!0,enumerable:!0,writable:!0,value:function(){for(var i=new Date,a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];var c,f,h=function(e,t){if(!ti(e))return{};try{var n=t.intent?dS(e.context,2048,!0):void 0,r=t.model?dS(e.llm_model,256):void 0;return d({},n&&"{}"!==n?{intent:n}:{},r&&"unknown"!==r.toLowerCase()?{model:r}:{})}catch(e){return{}}}(u[0],s),p=function(e,t){var n=e[0];if(!ti(n))return e;try{var r=t.intent&&lS(n,"context"),i=t.model&&lS(n,"llm_model");if(!r&&!i)return e;var o=d({},n);return r&&delete o.context,i&&delete o.llm_model,[o].concat(e.slice(1))}catch(t){return e}}(u,s);try{c=n.apply(this===o?e:this,p)}catch(e){throw r._captureToolCall(t,o,i,{error:e,errorResult:!1},h),e}if((f=c)&&"function"==typeof f.then)return Promise.resolve(c).then(function(e){var n=fS(e)?{error:e,errorResult:!0}:void 0;return r._captureToolCall(t,o,i,n,h),e},function(e){throw r._captureToolCall(t,o,i,{error:e,errorResult:!1},h),e});var _=fS(c)?{error:c,errorResult:!0}:void 0;return r._captureToolCall(t,o,i,_,h),c}}),o},t._captureToolCall=function(e,t,n,r,i){for(var o,s,a=Date.now()-n.getTime(),u=p(e.instances);!(s=u()).done;){var l,c=s.value,f=uS(c.config.capture_webmcp);if(f){r&&!o&&(o=gS(r.error,r.errorResult));try{c.capture("$mcp_tool_call",d({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:null==Oh?void 0:Oh.hostname,$mcp_duration_ms:a,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{},f.intent&&i.intent?{$mcp_intent:i.intent,$mcp_intent_source:"context_parameter"}:{},f.model&&i.model?{$mcp_llm_model:i.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch(e){continue}if(r&&o&&c.exceptions&&null!=(l=c.exceptionObserver)&&l.isEnabled)try{var h={$exception_list:_S(c.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:null==Oh?void 0:Oh.hostname};c.exceptionObserver.captureException(h)}catch(e){}}}},e}()}),function(){Jh.SDK_DIST_CHANNEL="cdn";var e=jh.posthog;if(!e||Xr(e._i)||!ei(e.init)){var t=By[eb]=new ab;if(e){var n=[];Cl(e._i,function(r){if(r&&Xr(r)){var i=t.init(r[0],r[1],r[2]),o=e[r[2]]||e;i.__loaded&&-1===n.indexOf(o)&&(n.push(o),i._execute_array.call(i.people,o.people),i._execute_array(o))}});var r=e.people;if(!t.__loaded&&Xr(e)){var i=t.init,o=!0;t.init=function(n,s,a){var u=i.call(t,n,s,a);return o&&u===t&&u.__loaded&&(o=!1,t.init=i,u._execute_array.call(u.people,r),u._execute_array(e)),u}}}t.__SV=1,jh.posthog=t,function(){function e(){e.done||(e.done=!0,yy=!1,Cl(By,function(e){e._dom_loaded()}))}null!=Mh&&Mh.addEventListener?"complete"===Mh.readyState?e():Ml(Mh,"DOMContentLoaded",e,{capture:!1}):Ih&&Sl.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var mS="undefined"!=typeof performance?performance:{};mS.now=mS.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=mS)}}()}();
1
+ !function(){var e=["retriesPerformedSoFar"],t=["$set_once","$set"];function n(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}function s(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=Object.create((r&&r.prototype instanceof a?r:a).prototype);return c(u,"_invoke",function(n,r,i){var o,a,u,l=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,a=0,u=e,f.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!d&&l&&!i&&c.length>t;t++){var i,o=c[t],h=f.p,p=o[2];n>3?(i=p===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):h>=o[0]&&((i=2>n&&o[1]>h)?(a=0,f.v=r,f.n=o[1]):p>h&&(i=3>n||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,a=0))}if(i||n>1)return s;throw d=!0,r}return function(i,c,p){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,p),a=c,u=p;(t=2>a?e:u)||!d;){o||(a?3>a?(a>1&&(f.n=-1),h(a,u)):f.n=u:f.v=u);try{if(l=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,2>a&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),2>a&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(d=0>f.n)?u:n.call(r,f))!==s)break}catch(t){o=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,i,o),!0),u}var s={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),h=d.prototype=a.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=d,c(h,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,i,"GeneratorFunction"),c(h),c(h,i,"Generator"),c(h,r,function(){return this}),c(h,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function c(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}c=function(e,t,n,r){function o(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},c(e,t,n,r)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(null,arguments)}function f(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){f(o,r,i,s,a,"next",e)}function a(e){f(o,r,i,s,a,"throw",e)}s(void 0)})}}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return e.length>r?{done:!1,value:e[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}!function(s,u,c,f){var _,v,g,m,y,b,w,S,k,x,C,P,E,T,F,I=function(e,t){return function(){return t||(e((t={exports:{}}).exports,t),e=null),t.exports}},R=I(function(e,t){var n=function(e){return e&&e.Math===Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}),A=I(function(e,t){t.exports=function(e){try{return!!e()}catch(e){return!0}}}),M=I(function(e,t){t.exports=!A()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),O=I(function(e,t){t.exports=!A()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}),L=I(function(e,t){var n=O(),r=function(){}.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}}),D=I(function(e){var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t}),q=I(function(e,t){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}}),N=I(function(e,t){var n=O(),r=Function.prototype,i=r.call,o=n&&r.bind.bind(i,i);t.exports=n?o:function(e){return function(){return i.apply(e,arguments)}}}),B=I(function(e,t){var n=N(),r=n({}.toString),i=n("".slice);t.exports=function(e){return i(r(e),8,-1)}}),j=I(function(e,t){var n=N(),r=A(),i=B(),o=Object,s=n("".split);t.exports=r(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?s(e,""):o(e)}:o}),H=I(function(e,t){t.exports=function(e){return null==e}}),z=I(function(e,t){var n=H(),r=TypeError;t.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}}),U=I(function(e,t){var n=j(),r=z();t.exports=function(e){return n(r(e))}}),W=I(function(e,t){var n="object"==typeof document&&document.all;t.exports=void 0===n&&void 0!==n?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}}),V=I(function(e,t){var n=W();t.exports=function(e){return"object"==typeof e?null!==e:n(e)}}),G=I(function(e,t){var n=R(),r=W();t.exports=function(e,t){return 2>arguments.length?r(i=n[e])?i:void 0:n[e]&&n[e][t];var i}}),K=I(function(e,t){t.exports=N()({}.isPrototypeOf)}),Q=I(function(e,t){var n=R().navigator,r=n&&n.userAgent;t.exports=r?String(r):""}),Y=I(function(e,t){var n,r,i=R(),o=Q(),s=i.process,a=i.Deno,u=s&&s.versions||a&&a.version,l=u&&u.v8;l&&(r=(n=l.split("."))[0]>0&&4>n[0]?1:+(n[0]+n[1])),!r&&o&&((n=o.match(/Edge\/(\d+)/))&&74>n[1]||(n=o.match(/Chrome\/(\d+)/))&&(r=+n[1])),t.exports=r}),J=I(function(e,t){var n=Y(),r=A(),i=R().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&41>n})}),Z=I(function(e,t){t.exports=J()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),X=I(function(e,t){var n=G(),r=W(),i=K(),o=Z(),s=Object;t.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&i(t.prototype,s(e))}}),ee=I(function(e,t){var n=String;t.exports=function(e){try{return n(e)}catch(e){return"Object"}}}),te=I(function(e,t){var n=W(),r=ee(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a function")}}),ne=I(function(e,t){var n=te(),r=H();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}}),re=I(function(e,t){var n=L(),r=W(),i=V(),o=TypeError;t.exports=function(e,t){var s,a;if("string"===t&&r(s=e.toString)&&!i(a=n(s,e)))return a;if(r(s=e.valueOf)&&!i(a=n(s,e)))return a;if("string"!==t&&r(s=e.toString)&&!i(a=n(s,e)))return a;throw new o("Can't convert object to primitive value")}}),ie=I(function(e,t){t.exports=!1}),oe=I(function(e,t){var n=R(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}}),se=I(function(e,t){var n=ie(),r=R(),i=oe(),o="__core-js_shared__",s=t.exports=r[o]||i(o,{});(s.versions||(s.versions=[])).push({version:"3.49.0",mode:n?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),ae=I(function(e,t){var n=se();t.exports=function(e,t){return n[e]||(n[e]=t||{})}}),ue=I(function(e,t){var n=z(),r=Object;t.exports=function(e){return r(n(e))}}),le=I(function(e,t){var n=N(),r=ue(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}}),ce=I(function(e,t){var n=N(),r=0,i=Math.random(),o=n(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+i,36)}}),de=I(function(e,t){var n=R(),r=ae(),i=le(),o=ce(),s=J(),a=Z(),u=n.Symbol,l=r("wks"),c=a?u.for||u:u&&u.withoutSetter||o;t.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:c("Symbol."+e)),l[e]}}),fe=I(function(e,t){var n=L(),r=V(),i=X(),o=ne(),s=re(),a=de(),u=TypeError,l=a("toPrimitive");t.exports=function(e,t){if(!r(e)||i(e))return e;var a,c=o(e,l);if(c){if(void 0===t&&(t="default"),a=n(c,e,t),!r(a)||i(a))return a;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}}),he=I(function(e,t){var n=fe(),r=X();t.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}}),pe=I(function(e,t){var n=R(),r=V(),i=n.document,o=r(i)&&r(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}}),_e=I(function(e,t){var n=M(),r=A(),i=pe();t.exports=!n&&!r(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),ve=I(function(e){var t=M(),n=L(),r=D(),i=q(),o=U(),s=he(),a=le(),u=_e(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=o(e),t=s(t),u)try{return l(e,t)}catch(e){}if(a(e,t))return i(!n(r.f,e,t),e[t])}}),ge=I(function(e,t){var n=M(),r=A();t.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),me=I(function(e,t){var n=V(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not an object")}}),ye=I(function(e){var t=M(),n=_e(),r=ge(),i=me(),o=he(),s=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",d="writable";e.f=t?r?function(e,t,n){if(i(e),t=o(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=u(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:c in n?n[c]:r[c],enumerable:l in n?n[l]:r[l],writable:!1})}return a(e,t,n)}:a:function(e,t,r){if(i(e),t=o(t),i(r),n)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new s("Accessors not supported");return"value"in r&&(e[t]=r.value),e}}),be=I(function(e,t){var n=M(),r=ye(),i=q();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}}),we=I(function(e,t){var n=M(),r=le(),i=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,s=r(i,"name");t.exports={EXISTS:s,PROPER:s&&"something"===function(){}.name,CONFIGURABLE:s&&(!n||n&&o(i,"name").configurable)}}),Se=I(function(e,t){var n=N(),r=W(),i=se(),o=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),t.exports=i.inspectSource}),ke=I(function(e,t){var n=R(),r=W(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))}),xe=I(function(e,t){var n=ae(),r=ce(),i=n("keys");t.exports=function(e){return i[e]||(i[e]=r(e))}}),Ce=I(function(e,t){t.exports={}}),Pe=I(function(e,t){var n,r,i,o=ke(),s=R(),a=V(),u=be(),l=le(),c=se(),d=xe(),f=Ce(),h="Object already initialized",p=s.TypeError;if(o||c.state){var _=c.state||(c.state=new(0,s.WeakMap));_.get=_.get,_.has=_.has,_.set=_.set,n=function(e,t){if(_.has(e))throw new p(h);return t.facade=e,_.set(e,t),t},r=function(e){return _.get(e)||{}},i=function(e){return _.has(e)}}else{var v=d("state");f[v]=!0,n=function(e,t){if(l(e,v))throw new p(h);return t.facade=e,u(e,v,t),t},r=function(e){return l(e,v)?e[v]:{}},i=function(e){return l(e,v)}}t.exports={set:n,get:r,has:i,enforce:function(e){return i(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=r(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}),Ee=I(function(e,t){var n=N(),r=A(),i=W(),o=le(),s=M(),a=we().CONFIGURABLE,u=Se(),l=Pe(),c=l.enforce,d=l.get,f=String,h=Object.defineProperty,p=n("".slice),_=n("".replace),v=n([].join),g=s&&!r(function(){return 8!==h(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=t.exports=function(e,t,n){"Symbol("===p(f(t),0,7)&&(t="["+_(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||a&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&o(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=c(e);return o(r,"source")||(r.source=v(m,"string"==typeof t?t:"")),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||u(this)},"toString")}),Te=I(function(e,t){var n=W(),r=ye(),i=Ee(),o=oe();t.exports=function(e,t,s,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:t;if(n(s)&&i(s,l,a),a.global)u?e[t]=s:o(t,s);else{try{a.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=s:r.f(e,t,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}}),Fe=I(function(e,t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}}),Ie=I(function(e,t){var n=Fe();t.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}}),Re=I(function(e,t){var n=Ie(),r=Math.max,i=Math.min;t.exports=function(e,t){var o=n(e);return 0>o?r(o+t,0):i(o,t)}}),Ae=I(function(e,t){var n=Ie(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}}),Me=I(function(e,t){var n=Ae();t.exports=function(e){return n(e.length)}}),Oe=I(function(e,t){var n=U(),r=Re(),i=Me(),o=function(e){return function(t,o,s){var a=n(t),u=i(a);if(0===u)return!e&&-1;var l,c=r(s,u);if(e&&o!=o){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((e||c in a)&&a[c]===o)return e||c||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}}),Le=I(function(e,t){var n=N(),r=le(),i=U(),o=Oe().indexOf,s=Ce(),a=n([].push);t.exports=function(e,t){var n,u=i(e),l=0,c=[];for(n in u)!r(s,n)&&r(u,n)&&a(c,n);for(;t.length>l;)r(u,n=t[l++])&&(~o(c,n)||a(c,n));return c}}),De=I(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),$e=I(function(e){var t=Le(),n=De().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}}),qe=I(function(e){e.f=Object.getOwnPropertySymbols}),Ne=I(function(e,t){var n=G(),r=N(),i=$e(),o=qe(),s=me(),a=r([].concat);t.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=o.f;return n?a(t,n(e)):t}}),Be=I(function(e,t){var n=le(),r=Ne(),i=ve(),o=ye();t.exports=function(e,t,s){for(var a=r(t),u=o.f,l=i.f,c=0;a.length>c;c++){var d=a[c];n(e,d)||s&&n(s,d)||u(e,d,l(t,d))}}}),je=I(function(e,t){var n=A(),r=W(),i=/#|\.prototype\./,o=function(e,t){var i=a[s(e)];return i===l||i!==u&&(r(t)?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=o.data={},u=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o}),He=I(function(e,t){var n=R(),r=ve().f,i=be(),o=Te(),s=oe(),a=Be(),u=je();t.exports=function(e,t){var l,c,d,f,h,p=e.target,_=e.global,v=e.stat;if(l=_?n:v?n[p]||s(p,{}):n[p]&&n[p].prototype)for(c in t){if(f=t[c],d=e.dontCallGetSet?(h=r(l,c))&&h.value:l[c],!u(_?c:p+(v?".":"#")+c,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;a(f,d)}(e.sham||d&&d.sham)&&i(f,"sham",!0),o(l,c,f,e)}}}),ze=I(function(e,t){t.exports=!A()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),Ue=I(function(e,t){var n=le(),r=W(),i=ue(),o=xe(),s=ze(),a=o("IE_PROTO"),u=Object,l=u.prototype;t.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(n(t,a))return t[a];var o=t.constructor;return r(o)&&t instanceof o?o.prototype:t instanceof u?l:null}}),We=I(function(e,t){var n=Le(),r=De();t.exports=Object.keys||function(e){return n(e,r)}}),Ve=I(function(e,t){var n=M(),r=A(),i=N(),o=Ue(),s=We(),a=U(),u=i(D().f),l=i([].push),c=n&&r(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),d=function(e){return function(t){for(var r,i=a(t),d=s(i),f=c&&null===o(i),h=d.length,p=0,_=[];h>p;)r=d[p++],n&&!(f?r in i:u(i,r))||l(_,e?[r,i[r]]:i[r]);return _}};t.exports={entries:d(!0),values:d(!1)}}),Ge=I(function(){var $=He(),e=Ve().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}),Ke=I(function(e,t){t.exports=R()}),Qe=I(function(e,t){Ge(),t.exports=Ke().Object.entries}),Ye=I(function(e,t){t.exports=Qe()}),Je=I(function(e,t){t.exports=Ye()}),Ze=I(function(e,t){t.exports=Je()}),Xe=I(function(e,t){t.exports=Ze()}),et=I(function(e){var t=M(),n=ge(),r=ye(),i=me(),o=U(),s=We();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),u=s(t),l=u.length,c=0;l>c;)r.f(e,n=u[c++],a[n]);return e}}),tt=I(function(e,t){t.exports=G()("document","documentElement")}),nt=I(function(e,t){var n,r=me(),i=et(),o=De(),s=Ce(),a=tt(),u=pe(),l=xe(),c="prototype",d="script",f=l("IE_PROTO"),h=function(){},p=function(e){return"<"+d+">"+e+"</"+d+">"},_=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;v="undefined"!=typeof document?document.domain&&n?_(n):(t=u("iframe"),r="java"+d+":",t.style.display="none",a.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):_(n);for(var i=o.length;i--;)delete v[c][o[i]];return v()};s[f]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(h[c]=r(e),n=new h,h[c]=null,n[f]=e):n=v(),void 0===t?n:i.f(n,t)}}),rt=I(function(e,t){var n=de(),r=nt(),i=ye().f,o=n("unscopables"),s=Array.prototype;void 0===s[o]&&i(s,o,{configurable:!0,value:r(null)}),t.exports=function(e){s[o][e]=!0}}),it=I(function(e,t){t.exports={}}),ot=I(function(e,t){var n,r,i,o=A(),s=W(),a=V(),u=nt(),l=Ue(),c=Te(),d=de(),f=ie(),h=d("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(r=l(l(i)))!==Object.prototype&&(n=r):p=!0),!a(n)||o(function(){var e={};return n[h].call(e)!==e})?n={}:f&&(n=u(n)),s(n[h])||c(n,h,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}}),st=I(function(e,t){var n=ye().f,r=le(),i=de()("toStringTag");t.exports=function(e,t,o){e&&!o&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}}),at=I(function(e,t){var n=ot().IteratorPrototype,r=nt(),i=q(),o=st(),s=it(),a=function(){return this};t.exports=function(e,t,u,l){var c=t+" Iterator";return e.prototype=r(n,{next:i(+!l,u)}),o(e,c,!1,!0),s[c]=a,e}}),ut=I(function(e,t){var n=N(),r=te();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}}),lt=I(function(e,t){var n=V();t.exports=function(e){return n(e)||null===e}}),ct=I(function(e,t){var n=lt(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i("Can't set "+r(e)+" as a prototype")}}),dt=I(function(e,t){var n=ut(),r=V(),i=z(),o=ct();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=n(Object.prototype,"__proto__","set"))(s,[]),t=s instanceof Array}catch(e){}return function(n,s){return i(n),o(s),r(n)?(t?e(n,s):n.__proto__=s,n):n}}():void 0)}),ft=I(function(e,t){var $=He(),n=L(),r=ie(),i=we(),o=W(),s=at(),a=Ue(),u=dt(),l=st(),c=be(),d=Te(),f=de(),h=it(),p=ot(),_=i.PROPER,v=i.CONFIGURABLE,g=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",w="values",S="entries",k=function(){return this};t.exports=function(e,t,i,f,p,x,C){s(i,t,f);var P,E,T,F=function(e){if(e===p&&O)return O;if(!m&&e&&e in A)return A[e];switch(e){case b:case w:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},I=t+" Iterator",R=!1,A=e.prototype,M=A[y]||A["@@iterator"]||p&&A[p],O=!m&&M||F(p),L="Array"===t&&A.entries||M;if(L&&(P=a(L.call(new e)))!==Object.prototype&&P.next&&(r||a(P)===g||(u?u(P,g):o(P[y])||d(P,y,k)),l(P,I,!0,!0),r&&(h[I]=k)),_&&p===w&&M&&M.name!==w&&(!r&&v?c(A,"name",w):(R=!0,O=function(){return n(M,this)})),p)if(E={values:F(w),keys:x?O:F(b),entries:F(S)},C)for(T in E)(m||R||!(T in A))&&d(A,T,E[T]);else $({target:t,proto:!0,forced:m||R},E);return r&&!C||A[y]===O||d(A,y,O,{name:p}),h[t]=O,E}}),ht=I(function(e,t){t.exports=function(e,t){return{value:e,done:t}}}),pt=I(function(e,t){var n=U(),r=rt(),i=it(),o=Pe(),s=ye().f,a=ft(),u=ht(),l=ie(),c=M(),d="Array Iterator",f=o.set,h=o.getterFor(d);t.exports=a(Array,"Array",function(e,t){f(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=h(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,u(void 0,!0);switch(e.kind){case"keys":return u(n,!1);case"values":return u(t[n],!1)}return u([n,t[n]],!1)},"values");var p=i.Arguments=i.Array;if(r("keys"),r("values"),r("entries"),!l&&c&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch(e){}}),_t=I(function(e,t){var n=B(),r=N();t.exports=function(e){if("Function"===n(e))return r(e)}}),vt=I(function(e,t){var n=_t(),r=te(),i=O(),o=n(n.bind);t.exports=function(e,t){return r(e),void 0===t?e:i?o(e,t):function(){return e.apply(t,arguments)}}}),gt=I(function(e,t){var n=de(),r=it(),i=n("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}}),mt=I(function(e,t){var n={};n[de()("toStringTag")]="z",t.exports="[object z]"===String(n)}),yt=I(function(e,t){var n=mt(),r=W(),i=B(),o=de()("toStringTag"),s=Object,a="Arguments"===i(function(){return arguments}());t.exports=n?i:function(e){var t,n,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:a?i(t):"Object"===(u=i(t))&&r(t.callee)?"Arguments":u}}),bt=I(function(e,t){var n=yt(),r=ne(),i=H(),o=it(),s=de()("iterator");t.exports=function(e){if(!i(e))return r(e,s)||r(e,"@@iterator")||o[n(e)]}}),wt=I(function(e,t){var n=L(),r=te(),i=me(),o=ee(),s=bt(),a=TypeError;t.exports=function(e,t){var u=2>arguments.length?s(e):t;if(r(u))return i(n(u,e));throw new a(o(e)+" is not iterable")}}),St=I(function(e,t){var n=L(),r=me(),i=ne();t.exports=function(e,t,o){var s,a;r(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw o;return o}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw o;if(a)throw s;return r(s),o}}),kt=I(function(e,t){var n=vt(),r=L(),i=me(),o=ee(),s=gt(),a=Me(),u=K(),l=wt(),c=bt(),d=St(),f=TypeError,h=function(e,t){this.stopped=e,this.result=t},p=h.prototype;t.exports=function(e,t,_){var v,g,m,y,b,w,S,k=!(!_||!_.AS_ENTRIES),x=!(!_||!_.IS_RECORD),C=!(!_||!_.IS_ITERATOR),P=!(!_||!_.INTERRUPTED),E=n(t,_&&_.that),T=function(e){var t=v;return v=void 0,t&&d(t,"normal"),new h(!0,e)},F=function(e){return k?(i(e),P?E(e[0],e[1],T):E(e[0],e[1])):P?E(e,T):E(e)};if(x)v=e.iterator;else if(C)v=e;else{if(!(g=c(e)))throw new f(o(e)+" is not iterable");if(s(g)){for(m=0,y=a(e);y>m;m++)if((b=F(e[m]))&&u(p,b))return b;return new h(!1)}v=l(e,g)}for(w=x?e.next:v.next;!(S=r(w,v)).done;){var I=S.value;try{b=F(I)}catch(e){if(!v)throw e;d(v,"throw",e)}if("object"==typeof b&&b&&u(p,b))return b}return new h(!1)}}),xt=I(function(e,t){var n=M(),r=ye(),i=q();t.exports=function(e,t,o){n?r.f(e,t,i(0,o)):e[t]=o}}),Ct=I(function(){var $=He(),e=kt(),t=xt();$({target:"Object",stat:!0},{fromEntries:function(n){var r={};return e(n,function(e,n){t(r,e,n)},{AS_ENTRIES:!0}),r}})}),Pt=I(function(e,t){pt(),Ct(),t.exports=Ke().Object.fromEntries}),Et=I(function(e,t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),Tt=I(function(e,t){var n=pe()("span").classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r}),Ft=I(function(){var e=R(),t=Et(),n=Tt(),r=pt(),i=be(),o=st(),s=de()("iterator"),a=r.values,u=function(e,n){if(e){if(e[s]!==a)try{i(e,s,a)}catch(t){e[s]=a}if(o(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{i(e,u,r[u])}catch(t){e[u]=r[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);u(n,"DOMTokenList")}),It=I(function(e,t){var n=Pt();Ft(),t.exports=n}),Rt=I(function(e,t){t.exports=It()}),At=I(function(e,t){t.exports=Rt()}),Mt=I(function(e,t){t.exports=At()}),Ot=I(function(e,t){var n=V(),r=be();t.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}}),Lt=I(function(e,t){var n=N(),r=Error,i=n("".replace),o=String(new r("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,a=s.test(o);t.exports=function(e,t){if(a&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=i(e,s,"");return e}}),Dt=I(function(e,t){var n=A(),r=q();t.exports=!n(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)})}),$t=I(function(e,t){var n=be(),r=Lt(),i=Dt(),o=Error.captureStackTrace;t.exports=function(e,t,s,a){i&&(o?o(e,t):n(e,"stack",r(s,a)))}}),qt=I(function(e,t){var n=yt(),r=String;t.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}}),Nt=I(function(e,t){var n=qt();t.exports=function(e,t){return void 0===e?2>arguments.length?"":t:n(e)}}),Bt=I(function(){var $=He(),e=K(),t=Ue(),n=dt(),r=Be(),i=nt(),o=be(),s=q(),a=Ot(),u=$t(),l=kt(),c=Nt(),d=de()("toStringTag"),f=Error,h=[].push,p=function(r,s){var v,g=e(_,this);n?v=n(new f,g?t(this):_):(v=g?this:i(_),o(v,d,"Error")),void 0!==s&&o(v,"message",c(s)),u(v,p,v.stack,1),arguments.length>2&&a(v,arguments[2]);var m=[];return l(r,h,{that:m}),o(v,"errors",m),v};n?n(p,f):r(p,f,{name:!0});var _=p.prototype=i(f.prototype,{constructor:s(1,p),message:s(1,""),name:s(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:p})}),jt=I(function(){Bt()}),Ht=I(function(e,t){var n=mt(),r=yt();t.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}}),zt=I(function(){var e=mt(),t=Te(),n=Ht();e||t(Object.prototype,"toString",n,{unsafe:!0})}),Ut=I(function(e,t){var n=R(),r=Q(),i=B(),o=function(e){return r.slice(0,e.length)===e};t.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}),Wt=I(function(e,t){t.exports="NODE"===Ut()}),Vt=I(function(e,t){var n=Ee(),r=ye();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}}),Gt=I(function(e,t){var n=G(),r=Vt(),i=de(),o=M(),s=i("species");t.exports=function(e){var t=n(e);o&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}}),Kt=I(function(e,t){var n=K(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}}),Qt=I(function(e,t){var n=N(),r=A(),i=W(),o=yt(),s=G(),a=Se(),u=function(){},l=s("Reflect","construct"),c=/^\s*(?:class|function)\b/,d=n(c.exec),f=!c.test(u),h=function(e){if(!i(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},p=function(e){if(!i(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!d(c,a(e))}catch(e){return!0}};p.sham=!0,t.exports=!l||r(function(){var e;return h(h.call)||!h(Object)||!h(function(){e=!0})||e})?p:h}),Yt=I(function(e,t){var n=Qt(),r=ee(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a constructor")}}),Jt=I(function(e,t){var n=me(),r=Yt(),i=H(),o=de()("species");t.exports=function(e,t){var s,a=n(e).constructor;return void 0===a||i(s=n(a)[o])?t:r(s)}}),Zt=I(function(e,t){var n=O(),r=Function.prototype,i=r.apply,o=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(i):function(){return o.apply(i,arguments)})}),Xt=I(function(e,t){t.exports=N()([].slice)}),en=I(function(e,t){var n=TypeError;t.exports=function(e,t){if(t>e)throw new n("Not enough arguments");return e}}),tn=I(function(e,t){var n=Q();t.exports=/ipad|iphone|ipod/i.test(n)&&/applewebkit/i.test(n)}),nn=I(function(e,t){var n,r,i,o,s=R(),a=Zt(),u=vt(),l=W(),c=le(),d=A(),f=tt(),h=Xt(),p=pe(),_=en(),v=tn(),g=Wt(),m=s.setImmediate,y=s.clearImmediate,b=s.process,w=s.Dispatch,S=s.Function,k=s.MessageChannel,x=s.String,C=0,P={},E="onreadystatechange";d(function(){n=s.location});var T=function(e){if(c(P,e)){var t=P[e];delete P[e],t()}},F=function(e){return function(){T(e)}},I=function(e){T(e.data)},M=function(e){s.postMessage(x(e),n.protocol+"//"+n.host)};m&&y||(m=function(e){_(arguments.length,1);var t=l(e)?e:S(e),n=h(arguments,1);return P[++C]=function(){a(t,void 0,n)},r(C),C},y=function(e){delete P[e]},g?r=function(e){b.nextTick(F(e))}:w&&w.now?r=function(e){w.now(F(e))}:k&&!v?(o=(i=new k).port2,i.port1.onmessage=I,r=u(o.postMessage,o)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!d(M)?(r=M,s.addEventListener("message",I,!1)):r=E in p("script")?function(e){f.appendChild(p("script"))[E]=function(){f.removeChild(this),T(e)}}:function(e){setTimeout(F(e),0)}),t.exports={set:m,clear:y}}),rn=I(function(e,t){var n=R(),r=M(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(n,e);return t&&t.value}}),on=I(function(e,t){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=n}),sn=I(function(e,t){var n=Q();t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble}),an=I(function(e,t){var n=Q();t.exports=/web0s(?!.*chrome)/i.test(n)}),un=I(function(e,t){var n,r,i,o,s,a=R(),u=rn(),l=vt(),c=nn().set,d=on(),f=tn(),h=sn(),p=an(),_=Wt(),v=a.MutationObserver||a.WebKitMutationObserver,g=a.document,m=a.process,y=a.Promise,b=u("queueMicrotask");if(!b){var w=new d,S=function(){var e,t;for(_&&(e=m.domain)&&e.exit();t=w.get();)try{t()}catch(e){throw w.head&&n(),e}e&&e.enter()};f||_||p||!v||!g?!h&&y&&y.resolve?((o=y.resolve(void 0)).constructor=y,s=l(o.then,o),n=function(){s(S)}):_?n=function(){m.nextTick(S)}:(c=l(c,a),n=function(){c(S)}):(r=!0,i=g.createTextNode(""),new v(S).observe(i,{characterData:!0}),n=function(){i.data=r=!r}),b=function(e){w.head||n(),w.add(e)}}t.exports=b}),ln=I(function(e,t){t.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}}),cn=I(function(e,t){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}}),dn=I(function(e,t){t.exports=R().Promise}),fn=I(function(e,t){var n=R(),r=dn(),i=W(),o=je(),s=Se(),a=de(),u=Ut(),l=ie(),c=Y(),d=r&&r.prototype,f=a("species"),h=!1,p=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:o("Promise",function(){var e=s(r),t=e!==String(r);if(!t&&66===c)return!0;if(l&&(!d.catch||!d.finally))return!0;if(!c||51>c||!/native code/.test(e)){var n=new r(function(e){e(1)}),i=function(e){e(function(){},function(){})};if((n.constructor={})[f]=i,!(h=n.then(function(){})instanceof i))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)}),REJECTION_EVENT:p,SUBCLASSING:h}}),hn=I(function(e,t){var n=te(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw new r("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}}),pn=I(function(){var e,t,n,r,$=He(),i=ie(),o=Wt(),s=R(),a=Ke(),u=L(),l=Te(),c=dt(),d=st(),f=Gt(),h=te(),p=W(),_=V(),v=Kt(),g=Jt(),m=nn().set,y=un(),b=ln(),w=cn(),S=on(),k=Pe(),x=dn(),C=fn(),P=hn(),E="Promise",T=C.CONSTRUCTOR,F=C.REJECTION_EVENT,I=C.SUBCLASSING,A=k.getterFor(E),M=k.set,O=x&&x.prototype,D=x,q=O,N=s.TypeError,B=s.document,j=s.process,H=P.f,z=H,U=!!(B&&B.createEvent&&s.dispatchEvent),G="unhandledrejection",K=function(e){var t;return!(!_(e)||!p(t=e.then))&&t},Q=function(e,t){var n,r,i,o=t.value,s=1===t.state,a=s?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&ee(t),t.rejection=1),!0===a?n=o:(d&&d.enter(),n=a(o),d&&(d.exit(),i=!0)),n===e.promise?c(new N("Promise-chain cycle")):(r=K(n))?u(r,n,l,c):l(n)):c(o)}catch(e){d&&!i&&d.exit(),c(e)}},Y=function(e,t){e.notified||(e.notified=!0,y(function(){for(var n,r=e.reactions;n=r.get();)Q(n,e);e.notified=!1,t&&!e.rejection&&Z(e)}))},J=function(e,t,n){var r,i;U?((r=B.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),s.dispatchEvent(r)):r={promise:t,reason:n},!F&&(i=s["on"+e])?i(r):e===G&&b("Unhandled promise rejection",n)},Z=function(e){u(m,s,function(){var t,n=e.facade,r=e.value;if(X(e)&&(t=w(function(){o?j.emit("unhandledRejection",r,n):J(G,n,r)}),e.rejection=o||X(e)?2:1,t.error))throw t.value})},X=function(e){return 1!==e.rejection&&!e.parent},ee=function(e){u(m,s,function(){var t=e.facade;o?j.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)})},ne=function(e,t,n){return function(r){e(t,r,n)}},re=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Y(e,!0))},oe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new N("Promise can't be resolved itself");var r=K(t);r?y(function(){var n={done:!1};try{u(r,t,ne(oe,n,e),ne(re,n,e))}catch(t){re(n,t,e)}}):(e.value=t,e.state=1,Y(e,!1))}catch(t){re({done:!1},t,e)}}};if(T&&(D=function(t){v(this,q),h(t),u(e,this);var n=A(this);try{t(ne(oe,n),ne(re,n))}catch(e){re(n,e)}},(e=function(e){M(this,{type:E,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:null})}).prototype=l(q=D.prototype,"then",function(e,t){var n=A(this),r=H(g(this,D));return n.parent=!0,r.ok=!p(e)||e,r.fail=p(t)&&t,r.domain=o?j.domain:void 0,0===n.state?n.reactions.add(r):y(function(){Q(r,n)}),r.promise}),t=function(){var t=new e,n=A(t);this.promise=t,this.resolve=ne(oe,n),this.reject=ne(re,n)},P.f=H=function(e){return e===D||e===n?new t(e):z(e)},!i&&p(x)&&O!==Object.prototype)){r=O.then,I||l(O,"then",function(e,t){var n=this;return new D(function(e,t){u(r,n,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}c&&c(O,q)}$({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:D}),n=a.Promise,d(D,E,!1,!0),f(E)}),_n=I(function(e,t){var n=de()("iterator"),r=!1;try{var i=0,o={next:function(){return{done:!!i++}},return:function(){r=!0}};o[n]=function(){return this},Array.from(o,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!r)return!1}catch(e){return!1}var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}}),vn=I(function(e,t){var n=dn(),r=_n();t.exports=fn().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})}),gn=I(function(){var $=He(),e=L(),t=te(),n=hn(),r=cn(),i=kt();$({target:"Promise",stat:!0,forced:vn()},{all:function(o){var s=this,a=n.f(s),u=a.resolve,l=a.reject,c=r(function(){var n=t(s.resolve),r=[],a=0,c=1;i(o,function(t){var i=a++,o=!1;c++,e(n,s,t).then(function(e){o||(o=!0,r[i]=e,--c||u(r))},l)}),--c||u(r)});return c.error&&l(c.value),a.promise}})}),mn=I(function(){var $=He(),e=ie(),t=fn().CONSTRUCTOR,n=dn(),r=G(),i=W(),o=Te(),s=n&&n.prototype;if($({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(e){return this.then(void 0,e)}}),!e&&i(n)){var a=r("Promise").prototype.catch;s.catch!==a&&o(s,"catch",a,{unsafe:!0})}}),yn=I(function(){var $=He(),e=L(),t=te(),n=hn(),r=cn(),i=kt();$({target:"Promise",stat:!0,forced:vn()},{race:function(o){var s=this,a=n.f(s),u=a.reject,l=r(function(){var n=t(s.resolve);i(o,function(t){e(n,s,t).then(a.resolve,u)})});return l.error&&u(l.value),a.promise}})}),bn=I(function(){var $=He(),e=hn();$({target:"Promise",stat:!0,forced:fn().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}),wn=I(function(e,t){var n=me(),r=V(),i=hn();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var o=i.f(e);return(0,o.resolve)(t),o.promise}}),Sn=I(function(){var $=He(),e=G(),t=ie(),n=dn(),r=fn().CONSTRUCTOR,i=wn(),o=e("Promise"),s=t&&!r;$({target:"Promise",stat:!0,forced:t||r},{resolve:function(e){return i(s&&this===o?n:this,e)}})}),kn=I(function(){pn(),gn(),mn(),yn(),bn(),Sn()}),xn=I(function(){var $=He(),e=L(),t=te(),n=hn(),r=cn(),i=kt();$({target:"Promise",stat:!0,forced:vn()},{allSettled:function(o){var s=this,a=n.f(s),u=a.resolve,l=a.reject,c=r(function(){var n=t(s.resolve),r=[],a=0,l=1;i(o,function(t){var i=a++,o=!1;l++,e(n,s,t).then(function(e){o||(o=!0,r[i]={status:"fulfilled",value:e},--l||u(r))},function(e){o||(o=!0,r[i]={status:"rejected",reason:e},--l||u(r))})}),--l||u(r)});return c.error&&l(c.value),a.promise}})}),Cn=I(function(){var $=He(),e=L(),t=te(),n=G(),r=hn(),i=cn(),o=kt(),s=vn(),a="No one promise resolved";$({target:"Promise",stat:!0,forced:s},{any:function(s){var u=this,l=n("AggregateError"),c=r.f(u),d=c.resolve,f=c.reject,h=i(function(){var n=t(u.resolve),r=[],i=0,c=1,h=!1;o(s,function(t){var o=i++,s=!1;c++,e(n,u,t).then(function(e){s||h||(h=!0,d(e))},function(e){s||h||(s=!0,r[o]=e,--c||f(new l(r,a)))})}),--c||f(new l(r,a))});return h.error&&f(h.value),c.promise}})}),Pn=I(function(){var $=He(),e=R(),t=Zt(),n=Xt(),r=hn(),i=te(),o=cn(),s=e.Promise,a=!1;$({target:"Promise",stat:!0,forced:!s||!s.try||o(function(){s.try(function(e){a=8===e},8)}).error||!a},{try:function(e){var s=arguments.length>1?n(arguments,1):[],a=r.f(this),u=o(function(){return t(i(e),void 0,s)});return(u.error?a.reject:a.resolve)(u.value),a.promise}})}),En=I(function(){var $=He(),e=hn();$({target:"Promise",stat:!0},{withResolvers:function(){var t=e.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})}),Tn=I(function(){var $=He(),e=ie(),t=dn(),n=A(),r=G(),i=W(),o=Jt(),s=wn(),a=Te(),u=t&&t.prototype;if($({target:"Promise",proto:!0,real:!0,forced:!!t&&n(function(){u.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=o(this,r("Promise")),n=i(e);return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}}),!e&&i(t)){var l=r("Promise").prototype.finally;u.finally!==l&&a(u,"finally",l,{unsafe:!0})}}),Fn=I(function(e,t){var n=N(),r=Ie(),i=qt(),o=z(),s=n("".charAt),a=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,n){var l,c,d=i(o(t)),f=r(n),h=d.length;return 0>f||f>=h?e?"":void 0:55296>(l=a(d,f))||l>56319||f+1===h||56320>(c=a(d,f+1))||c>57343?e?s(d,f):l:e?u(d,f,f+2):c-56320+(l-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}}),In=I(function(){var e=Fn().charAt,t=qt(),n=Pe(),r=ft(),i=ht(),o="String Iterator",s=n.set,a=n.getterFor(o);r(String,"String",function(e){s(this,{type:o,string:t(e),index:0})},function(){var t,n=a(this),r=n.string,o=n.index;return r.length>o?(t=e(r,o),n.index+=t.length,i(t,!1)):i(void 0,!0)})}),Rn=I(function(e,t){jt(),pt(),zt(),kn(),xn(),Cn(),Pn(),En(),Tn(),In(),t.exports=Ke().Promise}),An=I(function(e,t){var n=Rn();Ft(),t.exports=n}),Mn=I(function(){Pn()}),On=I(function(){En()}),Ln=I(function(e,t){var n=An();Mn(),On(),t.exports=n}),Dn=I(function(){jt()}),$n=I(function(){xn()}),qn=I(function(){Cn()}),Nn=I(function(e,t){var n=Ln();Dn(),$n(),qn(),t.exports=n}),Bn=I(function(e,t){t.exports=Nn()}),jn=I(function(){He()({target:"Math",stat:!0},{trunc:Fe()})}),Hn=I(function(e,t){jn(),t.exports=Ke().Math.trunc}),zn=I(function(e,t){t.exports=Hn()}),Un=I(function(e,t){t.exports=zn()}),Wn=I(function(e,t){t.exports=Un()}),Vn=I(function(e,t){t.exports=Wn()}),Gn=I(function(e,t){var n=V(),r=Math.floor;t.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&r(e)===e}}),Kn=I(function(){He()({target:"Number",stat:!0},{isInteger:Gn()})}),Qn=I(function(e,t){Kn(),t.exports=Ke().Number.isInteger}),Yn=I(function(e,t){t.exports=Qn()}),Jn=I(function(e,t){t.exports=Yn()}),Zn=I(function(e,t){t.exports=Jn()}),Xn=I(function(e,t){t.exports=Zn()});Xe(),Mt(),Bn(),Vn(),Xn();var er={},tr=[],nr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rr=Array.isArray;function ir(e,t){for(var n in t)e[n]=t[n];return e}function or(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function sr(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?_.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return ar(e,s,r,i,null)}function ar(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++g:i,__i:-1,__u:0};return null==i&&null!=v.vnode&&v.vnode(o),o}function ur(e){return e.children}function lr(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var n;e.__k.length>t;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?$(e):null}function cr(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=ir({},t);o.__v=t.__v+1,v.vnode&&v.vnode(o),wr(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?$(t):n,!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,kr(r,o,i),t.__e=t.__=null,o.__e!=n&&dr(o)}}function dr(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),dr(e)}function fr(e){(!e.__d&&(e.__d=!0)&&m.push(e)&&!hr.__r++||y!=v.debounceRendering)&&((y=v.debounceRendering)||b)(hr)}function hr(){try{for(var e,t=1;m.length;)m.length>t&&m.sort(w),e=m.shift(),t=m.length,cr(e)}finally{m.length=hr.__r=0}}function pr(e,t,n,r,i,o,s,a,u,l,c){var d,f,h,p,_,v,g,m=r&&r.__k||tr,y=t.length;for(u=_r(n,t,m,u,y),d=0;y>d;d++)null!=(h=n.__k[d])&&(f=-1!=h.__i&&m[h.__i]||er,h.__i=d,v=wr(e,h,f,i,o,s,a,u,l,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Pr(f.ref,null,h),c.push(h.ref,h.__c||p,h)),null==_&&null!=p&&(_=p),(g=!!(4&h.__u))||f.__k===h.__k?(u=vr(h,u,e,g),g&&f.__e&&(f.__e=null)):"function"==typeof h.type&&void 0!==v?u=v:p&&(u=p.nextSibling),h.__u&=-7);return n.__e=_,u}function _r(e,t,n,r,i){var o,s,a,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(i),o=0;i>o;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[o]=ar(null,s,null,null,null):rr(s)?s=e.__k[o]=ar(ur,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=ar(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,u=o+f,s.__=e,s.__b=e.__b+1,a=null,-1!=(l=s.__i=gr(s,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?f--:c>i&&f++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,s.__u|=4))):e.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==r&&(r=$(a)),Er(a,a));return r}function vr(e,t,n,r){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&i.length>o;o++)i[o]&&(i[o].__=e,t=vr(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=$(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function gr(e,t,n,r){var i,o,s,a=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==a||c&&a==l.key&&u==l.type)return n;if(r>(c?1:0))for(i=n-1,o=n+1;i>=0||t.length>o;)if(null!=(l=t[s=0>i?o++:i--])&&!(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function mr(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||nr.test(t)?n:n+"px"}function yr(e,t,n,r,i){var o,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||mr(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||mr(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(C,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n[x]=r[x]:(n[x]=P,e.addEventListener(t,o?T:E,o)):e.removeEventListener(t,o?T:E,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function br(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[k])t[k]=P++;else if(n[x]>t[k])return;return n(v.event?v.event(t):t)}}}function wr(e,t,n,r,i,o,s,a,u,l){var c,d,f,h,p,_,g,m,y,b,$,w,S,k,x,C,P=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=v.__b)&&c(t);e:if("function"==typeof P){d=s.length;try{if(y=t.props,b=P.prototype&&P.prototype.render,$=(c=P.contextType)&&r[c.__c],w=c?$?$.props.value:c.__:r,n.__c?m=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new P(y,w):(t.__c=f=new lr(y,w),f.constructor=P,f.render=Tr),$&&$.sub(f),f.state||(f.state={}),f.__n=r,h=f.__d=!0,f.__h=[],f._sb=[]),b&&null==f.__s&&(f.__s=f.state),b&&null!=P.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=ir({},f.__s)),ir(f.__s,P.getDerivedStateFromProps(y,f.__s))),p=f.props,_=f.state,f.__v=t,h)b&&null==P.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),b&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(b&&null==P.getDerivedStateFromProps&&y!==p&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,w),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,w)){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),tr.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,w),b&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(p,_,g)})}if(f.context=w,f.props=y,f.__P=e,f.__e=!1,S=v.__r,k=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),tr.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++k);f.state=f.__s,null!=f.getChildContext&&(r=ir(ir({},r),f.getChildContext())),b&&!h&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(p,_)),x=null!=c&&c.type===ur&&null==c.key?xr(c.props.children):c,a=pr(e,rr(x)?x:[x],t,n,r,i,o,s,a,u,l),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),m&&(f.__E=f.__=null)}catch(e){if(s.length=d,t.__v=null,u||null!=o)if(e.then){for(t.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),t.__e=a}else{if(null!=o)for(C=o.length;C--;)or(o[C]);Sr(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||Sr(t);v.__e(e,t,n)}}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Cr(n.__e,t,n,r,i,o,s,u,l);return(c=v.diffed)&&c(t),128&t.__u?void 0:a}function Sr(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Sr))}function kr(e,t,n){for(var r=0;n.length>r;r++)Pr(n[r],n[++r],n[++r]);v.__c&&v.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){v.__e(e,t.__v)}})}function xr(e){return"object"!=typeof e||null==e||e.__b>0?e:rr(e)?e.map(xr):void 0!==e.constructor?null:ir({},e)}function Cr(e,t,n,r,i,o,s,a,u){var l,c,d,f,h,p,g,m=n.props||er,y=t.props,b=t.type;if("svg"==b?i="http://www.w3.org/2000/svg":"math"==b?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;o.length>l;l++)if((h=o[l])&&"setAttribute"in h==!!b&&(b?h.localName==b:3==h.nodeType)){e=h,o[l]=null;break}if(null==e){if(null==b)return document.createTextNode(y);e=document.createElementNS(i,b,y.is&&y),a&&(v.__m&&v.__m(t,o),a=!1),o=null}if(null==b)m===y||a&&e.data==y||(e.data=y);else{if(o="textarea"==b&&null!=y.defaultValue?null:o&&_.call(e.childNodes),!a&&null!=o)for(m={},l=0;e.attributes.length>l;l++)m[(h=e.attributes[l]).name]=h.value;for(l in m)h=m[l],"dangerouslySetInnerHTML"==l?d=h:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||yr(e,l,null,h,i);for(l in y)h=y[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?p=h:"checked"==l?g=h:a&&"function"!=typeof h||m[l]===h||yr(e,l,h,m[l],i);if(c)a||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),pr("template"==t.type?e.content:e,rr(f)?f:[f],t,n,r,"foreignObject"==b?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:n.__k&&$(n,0),a,u),null!=o)for(l=o.length;l--;)or(o[l]);a&&"textarea"!=b||(l="value","progress"==b&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[l]||"progress"==b&&!p||"option"==b&&p!=m[l])&&yr(e,l,p,m[l],i),l="checked",null!=g&&g!=e[l]&&yr(e,l,g,m[l],i))}return e}function Pr(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){v.__e(e,n)}}function Er(e,t,n){var r,i;if(v.unmount&&v.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Pr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){v.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;r.length>i;i++)r[i]&&Er(r[i],t,n||"function"!=typeof e.type);n||or(e.__e),e.__c=e.__=e.__e=void 0}function Tr(e,t,n){return this.constructor(e,n)}function Fr(e,t,n){var r,i,o,s;t==document&&(t=document.documentElement),v.__&&v.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],s=[],wr(t,e=(!r&&n||t).__k=sr(ur,null,[e]),i||er,er,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?_.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),kr(o,e,s),e.props.children=null}_=tr.slice,v={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},g=0,lr.prototype.setState=function(e,t){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ir({},this.state);"function"==typeof e&&(e=e(ir({},n),this.props)),e&&ir(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),fr(this))},lr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),fr(this))},lr.prototype.render=ur,m=[],b="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,w=function(e,t){return e.__v.__b-t.__v.__b},hr.__r=0,S=Math.random().toString(8),k="__d"+S,x="__a"+S,C=/(PointerCapture)$|Capture$/i,P=0,E=br(!1),T=br(!0),F=0;var Ir=0;function Rr(e,t,n,r,i,o){t||(t={});var s,a,u=t;if("ref"in u)for(a in u={},t)"ref"==a?s=t[a]:u[a]=t[a];var l={type:e,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ir,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return v.vnode&&v.vnode(l),l}var Ar="$surveys",Mr="$surveys_loaded_at",Or="PostHog loadExternalDependency extension not found.",Lr="$surveys_activated",Dr="$surveys_activated_session",$r="$surveys_activated_timestamps",qr="featureFlagsCommon";function Nr(e){var t,n=e.client,r=e.config;if(n&&r.uiHost){var i=null==(t=n.session)?void 0:t.sessionId;if(i)return r.uiHost+"/project/"+n.projectToken+"/replay/"+i}}var Br=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),jr=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Hr="min_length",zr="max_length",Ur=["$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"],Wr=["token"];function Vr(e,t){return-1!==e.indexOf(t)}var Gr=function(e){return e.trim()},Kr=function(e){return e.replace(/^\$/,"")};function Qr(e){var t,n=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return"[Circular]";n.push(t)}return t}}))&&void 0!==t?t:"null"}var Yr=Object.prototype,Jr=Yr.hasOwnProperty,Zr=Yr.toString,Xr=Array.isArray||function(e){return"[object Array]"===Zr.call(e)},ei=function(e){return"function"==typeof e},ti=function(e){return e===Object(e)&&!Xr(e)},ni=function(e){if(ti(e)){for(var t in e)if(Jr.call(e,t))return!1;return!0}return!1},ri=function(e){return void 0===e},ii=function(e){return"[object String]"==Zr.call(e)},oi=function(e){return ii(e)&&0===e.trim().length},si=function(e){return null===e},ai=function(e){return ri(e)||si(e)},ui=function(e){return"[object Number]"==Zr.call(e)&&e==e},li=function(e){return ui(e)&&e>0},ci=function(e){return"[object Boolean]"===Zr.call(e)},di=function(e){return Vr(Ur,e)},fi=function(e){return Vr(Wr,e)};function hi(e){return null===e||"object"!=typeof e}function pi(e,t){return{}.toString.call(e)==="[object "+t+"]"}function _i(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return gi(e,Error)}}function vi(e){return"u">typeof Event&&gi(e,Event)}function gi(e,t){try{return e instanceof t}catch(e){return!1}}var mi=[!0,"true",1,"1","yes"],yi=function(e){return Vr(mi,e)},bi=[!1,"false",0,"0","no"],wi=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","lightpanda","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"],Si=new Map,ki=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=function(e,t){for(var n="",r=0;t.length>r;r++){var i=t[r];n+=i.length+":"+i}return e.length+":"+e+"|"+t.length+":"+n}(e,t),r=Si.get(n);if(void 0!==r)return r;var i=e.toLowerCase(),o=wi.concat(t).some(function(e){return-1!==i.indexOf(e.toLowerCase())});return 256>Si.size||Si.clear(),Si.set(n,o),o};function xi(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),ui(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),xi(null!=i?i:n,t,n,r))}var Ci=function(){"use strict";function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=xi(e.bucketSize,0,100,e._logger),this._refillRate=xi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=xi(e.refillInterval,0,864e5,e._logger)}var t=e.prototype;return t._applyRefill=function(e,t){var n=Math.floor((t-e.lastAccess)/this._refillInterval);n>0&&(e.tokens=Math.min(e.tokens+n*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+n*this._refillInterval)},t.consumeRateLimit=function(e){var t,n=Date.now(),r=String(e),i=this._buckets[r];return i?this._applyRefill(i,n):this._buckets[r]=i={tokens:this._bucketSize,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===i.tokens)},t.stop=function(){this._buckets={}},e}(),Pi="Mobile",Ei="Android",Ti="Tablet",Fi="Android Tablet",Ii="iPad",Ri="Apple Watch",Ai="Safari",Mi="BlackBerry",Oi="Samsung Internet",Li="Chrome",Di="Chrome iOS",$i="Internet Explorer",qi="Internet Explorer Mobile",Ni="Opera",Bi="Microsoft Edge",ji="Firefox",Hi="Firefox iOS",zi="Nintendo",Ui="PlayStation",Wi="Xbox",Vi="Android Mobile",Gi="Mobile Safari",Ki="Windows",Qi="Windows Phone",Yi="Nokia",Ji="Ouya",Zi="Generic tablet",Xi="Konqueror",eo="Oculus Browser",to="Vivaldi",no="Yandex",ro="Whale",io="DuckDuckGo",oo="Pale Moon",so="Waterfox",ao="Brave",uo="Claude",lo="Codex",co="ChatGPT",fo="Google Search App",ho=new RegExp("Version/(\\d+(\\.\\d+)?)"),po=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),_o=new RegExp(Wi,"i"),vo=new RegExp("PlayStation \\w+","i"),go=new RegExp("Nintendo \\w+","i"),mo=new RegExp("BlackBerry|PlayBook|BB10","i"),yo={"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"},bo=function(e,t,n,r){t=t||"";var i=function(e){return null!=e&&e.brave?ao:null}(n);return i||(null!=r&&r.detectGoogleSearchApp&&Vr(e,"GSA/")?fo:Vr(e," OPR/")&&Vr(e,"Mini")?"Opera Mini":Vr(e," OPR/")?Ni:mo.test(e)?Mi:Vr(e,"IEMobile")||Vr(e,"WPDesktop")?qi:Vr(e,"OculusBrowser")?eo:Vr(e,"SamsungBrowser")?Oi:Vr(e,"Edge")||Vr(e,"Edg/")?Bi:Vr(e,"Vivaldi/")?to:Vr(e,"YaBrowser/")?no:Vr(e,"Whale/")?ro:Vr(e,"DuckDuckGo/")||Vr(e,"Ddg/")?io:Vr(e,"Claude/")?uo:Vr(e,"Codex/")?lo:Vr(e,"ChatGPT/")?co:Vr(e,"FBIOS")?"Facebook Mobile":Vr(e,"UCWEB")||Vr(e,"UCBrowser")?"UC Browser":Vr(e,"CriOS")?Di:Vr(e,"CrMo")||Vr(e,Li)?Li:Vr(e,Ei)&&Vr(e,Ai)?Vi:Vr(e,"FxiOS")?Hi:Vr(e.toLowerCase(),Xi.toLowerCase())?Xi:Vr(e,"Brave/")?ao:function(e,t){return t&&Vr(t,"Apple")||function(e){return Vr(e,Ai)&&!Vr(e,Li)&&!Vr(e,Ei)}(e)}(e,t)?Vr(e,Pi)?Gi:Ai:Vr(e,"PaleMoon/")?oo:Vr(e,"Waterfox/")?so:Vr(e,ji)?ji:Vr(e,"MSIE")||Vr(e,"Trident/")?$i:Vr(e,"Gecko")?ji:"")},wo=((s={})[qi]=[new RegExp("rv:(\\d+(\\.\\d+)?)")],s[Bi]=[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],s[Li]=[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],s[Di]=[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],s["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],s[Ai]=[ho],s[Gi]=[ho],s[Ni]=[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],s[ji]=[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],s[Hi]=[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],s[Xi]=[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],s[Mi]=[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),ho],s[Vi]=[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],s[Oi]=[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],s[eo]=[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],s[to]=[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],s[no]=[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],s[ro]=[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],s[ao]=[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],s[uo]=[po],s[lo]=[po],s[co]=[po],s[io]=[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],s[oo]=[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],s[so]=[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],s[fo]=[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],s[$i]=[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],s.Mozilla=[new RegExp("rv:(\\d+(\\.\\d+)?)")],s),So=function(e,t,n,r){var i=wo[bo(e,t,n,r)];if(ri(i))return null;for(var o=0;i.length>o;o++){var s=e.match(i[o]);if(s)return parseFloat(s[s.length-2])}return null},ko=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),function(e){return[Wi,e&&e[1]||""]}],[new RegExp(zi,"i"),[zi,""]],[new RegExp(Ui,"i"),[Ui,""]],[mo,[Mi,""]],[new RegExp(Ki,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Qi,""];if(new RegExp(Pi).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=yo[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Ki,r]}return[Ki,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=ri(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),function(e){return e&&e[2]?[Ei,[e[2],e[3],e[4]||"0"].join(".")]:[Ei,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],xo=function(e){for(var t=0;ko.length>t;t++){var n=ko[t],r=n[1],i=n[0].exec(e),o=i&&(ei(r)?r(i,e):r);if(o)return o}return["",""]},Co=function(e){return go.test(e)?zi:vo.test(e)?Ui:_o.test(e)?Wi:new RegExp(Ji,"i").test(e)?Ji:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Qi:/iPad/.test(e)?Ii:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ri:mo.test(e)?Mi:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Yi,"i").test(e)?Yi:/(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(Pi).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)?Ei:Fi:new RegExp("(pda|Mobile)","i").test(e)?"Generic mobile":new RegExp(Ti,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Zi:""},Po=function(e,t){var n,r,i,o,s=Co(e);return s===Ii||s===Fi||"Kobo"===s||"Kindle Fire"===s||s===Zi?Ti:s===zi||s===Wi||s===Ui||s===Ji?"Console":s===Ri?"Wearable":s?Pi:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(n=null==t?void 0:t.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==t?void 0:t.screenWidth)&&void 0!==r?r:0,null!==(i=null==t?void 0:t.screenHeight)&&void 0!==i?i:0)/(null!==(o=null==t?void 0:t.devicePixelRatio)&&void 0!==o?o:1)?Pi:Ti:"Desktop"},Eo=/\bFBAV\/(\d+(?:\.\d+)*)/i,To=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Eo],[/\bFBAN\/EMA\b/i,"Facebook Lite",Eo],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Eo],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Fo="[Truncated]",Io="[Unserializable]";function Ro(e){for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{var i=e.charCodeAt(n+1);56320>i||i>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}function Ao(e,t){if(!t)return e;var n=[];try{n=Object.keys(t)}catch(e){n=[]}for(var r,i=p(n);!(r=i()).done;){var o=r.value,s=void 0;try{s=t[o]}catch(e){s=Io}Object.defineProperty(e,o,{value:s,enumerable:!0,writable:!0,configurable:!0})}return e}Date,Date;var Mo,Oo,Lo,Do,$o=3e5,qo=function(){"use strict";function e(){this._until=0,this._installedAt=0}var t=e.prototype;return t.record=function(e){if("too-large"!==e.kind)if("retry-later"===e.kind){if(e.retryAfterMs){var t=this.isOpen(),n=Date.now(),r=Math.min(e.retryAfterMs,$o);if(!t)return this._installedAt=n,void(this._until=n+r);this._until=Math.max(this._until,Math.min(n+r,this._installedAt+$o))}}else this.reset()},t.remainingMs=function(){var e=Date.now();if(this._installedAt-5e3>e)return this.reset(),0;var t=Math.min($o,Math.max(0,this._until-e));return 0===t&&this.reset(),t},t.isOpen=function(){return this.remainingMs()>0},t.reset=function(){this._until=0,this._installedAt=0},e}(),No=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Bo(e,t){return"string"==typeof(n=e)&&No.test(n)?e:t();var n}function jo(e,t){var n=new Error(t);try{Object.defineProperty(n,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return n}function Ho(e){return e?e.split("#")[0]:e}function zo(e){try{return e()}catch(e){return}}function Uo(e,t){var n=setTimeout(e,t);return null!=n&&n.unref&&(null==n||n.unref()),n}function Wo(e,t,n){return Vo.apply(this,arguments)}function Vo(){return(Vo=h(l().m(function e(t,n,r){var i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.race([t,new Promise(function(e,t){i=Uo(function(){try{null==r||r(),e()}catch(e){t(e)}},n)})]);case 1:return e.a(2,e.v);case 2:return e.p=2,clearTimeout(i),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))).apply(this,arguments)}function Go(e){var t=globalThis._posthogChunkIds,n=globalThis._debugIds;if(t||n){var r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Do&&Ko(t,r,Oo)&&Ko(n,i,Lo))return Do;Oo=t?d({},t):void 0,Lo=n?d({},n):void 0,Do={},null!=Mo||(Mo={});var o=function(t,n){for(var r,i=p(t);!(r=i()).done;){var o,s=r.value,a=n[s];if(a){var u=null==(o=Mo)?void 0:o[s];if(u)Do[u]=a;else for(var l=e(s),c=l.length-1;c>=0;c--){var d,f=null==(d=l[c])?void 0:d.filename;if(f){Do[f]=a,Mo[s]=f;break}}}}};return n&&o(i,n),t&&o(r,t),Do}}function Ko(e,t,n){return e&&n?t.length===Object.keys(n).length&&t.every(function(t){return e[t]===n[t]}):e===n}var Qo=function(){"use strict";function e(e,t,n){void 0===n&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}var t=e.prototype;return t.buildFromUnknown=function(e,t){void 0===t&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),o=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}},t.modifyFrames=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:n=p(t);case 1:if((r=n()).done){e.n=4;break}if(!((i=r.value).stacktrace&&i.stacktrace.frames&&Xr(i.stacktrace.frames))){e.n=3;break}return e.n=2,this.applyModifiers(i.stacktrace.frames);case 2:i.stacktrace.frames=e.v;case 3:e.n=1;break;case 4:return e.a(2,t)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.coerceFallback=function(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}},t.parseStacktrace=function(e,t){var n,r,i,o=this;if(null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return d({},e,{cause:r,stack:i,errors:null==(n=e.errors)?void 0:n.map(function(e){return o.parseStacktrace(e,t)})})},t.applyChunkIds=function(e,t){return e.map(function(e){return e.filename&&t&&(e.chunk_id=t[e.filename]),e})},t.applyCoercers=function(e,t){for(var n,r=p(this.coercers);!(n=r()).done;){var i=n.value;if(i.match(e))return i.coerce(e,t)}return this.coerceFallback(t)},t.applyModifiers=function(){var e=h(l().m(function e(t){var n,r,i,o;return l().w(function(e){for(;;)switch(e.n){case 0:n=t,r=p(this.modifiers);case 1:if((i=r()).done){e.n=4;break}return o=i.value,e.n=2,o(n);case 2:n=e.v;case 3:e.n=1;break;case 4:return e.a(2,n)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.convertToExceptionList=function(e,t){var n=[],r=function(e,i,o){var s=n.length,a=void 0===i?d({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:s}):{type:"chained",source:o,synthetic:e.synthetic,exception_id:s,parent_id:i},u={type:e.type,value:e.value,mechanism:a};e.stack&&(u.stacktrace={type:"raw",frames:e.stack}),n.push(u),e.cause&&r(e.cause,s,"cause");for(var l,c=p(null!==(f=e.errors)&&void 0!==f?f:[]);!(l=c()).done;){var f;r(l.value,s,"member")}};return r(e),n},t.buildParsingContext=function(e){var t;return{chunkIdMap:Go(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.getAggregateErrors=function(e){try{if(_i(e))for(var t=Object.getPrototypeOf(e),n=0;t&&100>n;n++){var r,i=null==(r=Object.getOwnPropertyDescriptor(t,"constructor"))?void 0:r.value;if("function"==typeof i&&"AggregateError"===i.name){var o=e.errors;return Xr(o)?o:void 0}t=Object.getPrototypeOf(t)}}catch(e){}},t.buildCoercingContext=function(e,t,n){var r=this;void 0===n&&(n=0);var i=0,o=0,s=!1,a=new Set,u=[],l={},c=function(e,t,n){void 0===n&&(n=0);var c=f(t,n),h=c.apply;if(c.apply=function(t){u.push(e);try{return h(t)}finally{u.pop()}},n>4||n>0&&-1!==u.indexOf(e))return r.coerceFallback(c);var p="object"==typeof e&&null!==e||"function"==typeof e;if(!(0===n&&i>=50||p&&a.has(e))){p&&a.add(e),0===n&&i++;var _,v,g=r.getAggregateErrors(e);s||(s=!!g);try{if(!(_=r.applyCoercers(e,c)))throw l}catch(e){if(e===l)return void(0===n&&i--);if(!s)throw e;_=r.coerceFallback(c)}if(!g||i>=50)return _;try{v=g.length}catch(e){return _}if(!Number.isInteger(v)||0>v||v>4294967295)return _;for(var m=[],y=0;50>i&&1e3>o&&v>y;y++){o++;var b=void 0;try{b=c.next(g[y])}catch(e){i++,b=r.coerceFallback(f(t+1))}b&&m.push(b)}return d({},_,{errors:m})}},f=function(n,r){return void 0===r&&(r=0),d({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:0==n?e:{},apply:function(e){var t=c(e,n,r+1);if(!t)throw l;return t},next:function(e){return c(e,n+1)}})},h=f(n);return d({},h,{apply:function(e){var t;return null!==(t=c(e,n))&&void 0!==t?t:r.coerceFallback(h)}})},e}(),Yo=/^([a-z][a-z0-9.+-]+):/i,Jo=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Zo(e){if(!e||"<anonymous>"===e)return!1;var t=Yo.exec(e);return!t||Jo.includes(t[1].toLowerCase())}function Xo(e,t,n,r,i){var o={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:Zo(t)};return ri(r)||(o.lineno=r),ri(i)||(o.colno=i),o}var es=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ts=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ns=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,rs=/\((\S*)(?::(\d+))(?::(\d+))\)/,is=function(e,t){var n=ts.exec(e);if(n)return Xo(t,n[1],"?",+n[2],+n[3]);var r=ns.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var i=rs.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var o=es(r[1]||"?",r[2]);return Xo(t,o[1],o[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},os=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ss=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,as=function(e,t){var n=os.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=ss.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],o=n[1]||"?",s=es(o,i);return Xo(t,i=s[1],o=s[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},us=/\(error: (.*)\)/;function ls(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function cs(e){for(var t=1;10>=t;t++){var n=e.length-2*t;if(0>n)break;for(var r=!0,i=0;t>i;i++)if(!ls(e[n+i],e[n+t+i])){r=!1;break}if(r){for(var o=0;t>o;o++)e[n+o]=e[n+t+o];return e.length=n+t,{start:n,length:t}}}}function ds(e,t){var n=t.start+t.length,r=hs(e,t);r&&e.splice(n+r===e.length?n:t.start,r)}function fs(e,t){for(var n=t.start;n>0&&ls(e[n-1],e[n-1+t.length]);)n--;return t.start-n}function hs(e,t){for(var n=t.start+t.length,r=n;e.length>r&&ls(e[r],e[r-t.length]);)r++;return r-n}function ps(e,t){for(var n,r=t[0],i=e.length-(r?fs(e,r):0),o=p(t);!(n=o()).done;)i-=hs(e,n.value);return i}function _s(e,t,n){for(var r=0;e.length>r;r++){var i=e[(t+r)%e.length],o=e[(n+r)%e.length];if(i!==o)return o>i}return!1}var vs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return this.isDOMException(e)||this.isDOMError(e)},t.coerce=function(e,t){var n=ii(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}},t.getType=function(e){return this.isDOMError(e)?"DOMError":"DOMException"},t.getValue=function(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t},t.isDOMException=function(e){return pi(e,"DOMException")},t.isDOMError=function(e){return pi(e,"DOMError")},e}(),gs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return _i(e)},t.coerce=function(e,t){var n,r=this.getStack(e),i=void 0===r?null==(n=t.syntheticException)?void 0:n.stack:void 0,o=!!i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:i,cause:e.cause?t.next(e.cause):void 0,synthetic:o}},t.getType=function(e){return e.name||e.constructor.name},t.getMessage=function(e,t){var n=e.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)},t.getStack=function(e){try{var t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;var n=e.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(e){return}},e}(),ms=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return!!pi(e,"ErrorEvent")&&(null!=e.error||this._hasUsableMessage(e))},t.coerce=function(e,t){var n;if(null!=e.error)return t.apply(e.error);var r=t.apply(e.message);return d({},r,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:r.stack,synthetic:!0})},t._hasUsableMessage=function(e){return ii(e.message)&&e.message.length>0},t._buildLocationStack=function(e){var t,n,r=e,i=null!==(t=r.lineno)&&void 0!==t?t:0,o=null!==(n=r.colno)&&void 0!==n?n:0;if(ii(r.filename)&&0!==r.filename.length&&0!==i)return"Error\n at "+r.filename+":"+i+":"+o},e}(),ys=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,bs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"string"==typeof e},t.coerce=function(e,t){var n,r=this.getInfos(e),i=r[0],o=r[1];return{type:null!=i?i:"Error",value:null!=o?o:e,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},t.getInfos=function(e){var t="Error",n=e,r=e.match(ys);return r&&(t=r[1],n=r[2]),[t,n]},e}(),ws=["fatal","error","warning","log","info","debug"];function Ss(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r="",i=0,o=n;o.length>i;i++){var s=o[i],a=r?r+", "+s:s;if(a.length>t)break;r=a}return r}var ks=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"object"==typeof e&&null!==e},t.coerce=function(e,t){var n,r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null!==(n=this.getStack(e))&&void 0!==n?n:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}},t.getType=function(e){if(vi(e))return e.constructor.name;var t="name"in e?e.name:void 0;return ii(t)&&!oi(t)?t:"Error"},t.getValue=function(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 n=this.getObjectClassName(e);return(n&&"Object"!==n?"'"+n+"'":"Object")+" captured as exception with keys: "+Ss(e)},t.isSeverityLevel=function(e){return ii(e)&&!oi(e)&&ws.indexOf(e)>=0},t.getStack=function(e){try{return ii(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ii(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}},t.getErrorPropertyFromObject=function(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(_i(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),xs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return vi(e)},t.coerce=function(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Ss(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Cs=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return hi(e)},t.coerce=function(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Ps=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return pi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!vi(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}},t.coerce=function(e,t){var n,r=this.getUnhandledRejectionReason(e);return hi(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(r)},t.getUnhandledRejectionReason=function(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e},e}(),Es="$message",Ts="$timestamp",Fs=new Set([Es,Ts]),Is={enabled:!0,max_bytes:32768};function Rs(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Is.enabled,max_bytes:Ms(e.max_bytes,Is.max_bytes)}:d({},Is)}var As=function(){"use strict";function e(e){this._entries=[],this._totalBytes=0,this._config=Rs(e)}var t=e.prototype;return t.setConfig=function(e){this._config=Rs(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=Qr(e)}catch(e){return}try{var n=JSON.parse(t);if(!ti(n))return;var r=n,i=r[Es],o=r[Ts];if(!ii(i)||0===i.trim().length)return;if(!ii(o)&&!ui(o))return;return{step:r,json:t}}catch(e){return}}(e);if(t){var n=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)"%"===t[r]?(n+=1,r+=2):n+=1;return n}(t.json);n>this._config.max_bytes||(this._entries.push({step:t.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}},t.getAttachable=function(){return this._entries.map(function(e){return e.step})},t.clear=function(){this._entries=[],this._totalBytes=0},t.size=function(){return this._entries.length},t._trimToMaxBytes=function(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}},e}();function Ms(e,t){if(!ui(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var Os=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Ls(e){return"string"==typeof e||e}function Ds(e){return"string"==typeof e?e:void 0}var $s,qs=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain"].concat(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],["$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"]),Ns="NativeGzipValidationError",Bs=function(e){return e.length>=2&&31===e[0]&&139===e[1]},js=function(e,t){return e===jr.GZipJS||t===jr.GZipJS||"gzip"===t},Hs=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},zs=function(e){for(var t=function(){if($s)return $s;$s=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;$s[e]=t>>>0}return $s}(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0},Us=function(e){throw jo(Ns,"Native gzip produced invalid output: "+e)},Ws=0,Vs=!1,Gs=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a;return l().w(function(e){for(;;)switch(e.n){case 0:return 18>t.size&&Us("too-short"),s=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return r=new s(e.v),Bs(r)&&8===r[2]||Us("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:i=new a(e.v),o=n.length>>>0,i.getUint32(4,!0)!==o&&Us("invalid-size"),(Vs||3>Ws)&&(i.getUint32(0,!0)!==zs(n)&&(Vs=!0,Us("invalid-crc")),Ws++);case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function Ks(e,t,n){return Qs.apply(this,arguments)}function Qs(){return Qs=h(l().m(function e(t,n,r){var i,o,s,a,u,c,d;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return void 0===n&&(n=!0),e.p=1,i=(new TextEncoder).encode(t),o=new globalThis.CompressionStream("gzip"),s=o.writable.getWriter(),a=s.write(i).then(function(){return s.close()}).catch(function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,s.abort(t);case 1:e.n=3;break;case 2:e.p=2;case 3:throw t;case 4:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}()),u=new Response(o.readable).blob(),e.n=2,Promise.all([u,a]);case 2:return c=e.v[0],e.n=3,Gs(c,i);case 3:return e.a(2,c);case 4:if(e.p=4,d=e.v,null==r||!r.rethrow){e.n=5;break}throw d;case 5:return n&&console.error("Failed to gzip compress data",d),e.a(2,null)}},e,null,[[1,4]])})),Qs.apply(this,arguments)}var Ys="[redacted]",Js=/^[A-Za-z0-9+/\n\r]+=*$/,Zs=/^[A-Za-z0-9_-]+={0,2}$/,Xs=/[-_]/,ea=/^data:[^,\s]*;base64,/i,ta=/^[A-Za-z0-9+/_-]+={0,2}$/,na=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,ra=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,ia=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,oa=/[\s<>"]/,sa=function(){return new RegExp(ia.source,"i")}(),aa=/[a-z][a-z0-9+.-]{0,63}:\/\//i,ua=function(){return new RegExp("^"+aa.source,"i")}(),la=function(){return new RegExp(aa.source,"gi")}(),ca=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,da=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,fa=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,ha=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,pa=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,_a=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,va=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,ga=/\d+/g,ma=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,ya=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function ba(e){return function(e){return ra.test(e)}(e)||ca.test(e)||da.test(e)}function wa(e){return e.split("&",129).length>128}function Sa(e,t,n){return ba(e)||t.includes(";")&&function(e){return e.split(";").some(function(e){return ba(e.split("=",1)[0])})}(t)?Ys:sa.test(t)?n?Ta(t,{allowNestedUrls:!1,stripPunctuation:!0}):Ys:t}function ka(e,t){for(var n,r=new URLSearchParams,i=!1,o=!1,s=p(new URLSearchParams(e));!(n=s()).done;){var a=n.value,u=a[0],l=a[1],c=Fa(u),d=Fa(l);i||(i=c!==u||d!==l);var f=Sa(c,d,t);i||(i=f!==d),o=ba(c)||f!==d,r.append(c,f)}return{changed:i,lastFieldSensitive:o,serialized:r.toString()}}function xa(e,t){if(!e.includes("="))return{value:Ca(e,t),lastFieldSensitive:!1};var n=ka(e,t);return{value:n.changed?n.serialized:e,lastFieldSensitive:n.lastFieldSensitive}}function Ca(e,t){return t?Ta(e,{allowNestedUrls:!1,stripPunctuation:!0}):sa.test(e)?Ys:e}function Pa(e,t,n){return"#"===e?!t.fragment&&(t.fragment=!0):"?"===e&&(t.fragment?"="!==n&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function Ea(e,t){var n;if(e.length>8192&&ua.test(e))return Ys;var r,i=t.stripPunctuation?function(e){for(var t=e.length;t>0&&".,;:!?)]}'".includes(e[t-1]);)t--;return{address:e.slice(0,t),suffix:e.slice(t)}}(e):{address:e,suffix:""},o=i.address,s=i.suffix;try{r=new URL(o)}catch(e){return Ys+s}var a=r.search.slice(1),u=""!==r.hash,l=function(e){var t=e.slice(1),n=t.indexOf("?");return 0>n?{head:t,tail:null}:{head:t.slice(0,n),tail:t.slice(n+1)}}(r.hash);if(wa(a)||wa(l.head)||wa(null!==(n=l.tail)&&void 0!==n?n:""))return Ys+s;var c=!1;(r.username||r.password)&&(r.username=Ys,r.password="",c=!0);var d=ka(a,t.allowNestedUrls);d.changed&&(r.search=d.serialized,c=!0);var f,h=xa(l.head,t.allowNestedUrls),p=null===l.tail?null:(f=l.tail,h.lastFieldSensitive?{value:""===f?"":Ys,lastFieldSensitive:!0}:xa(f,t.allowNestedUrls)),_=null===p?h.value:h.value+"?"+p.value;_!==r.hash.slice(1)&&(r.hash=_,c=!0);var v=u?null!=p?p:h:d;return(c?Fa(r.toString()):o)+(v.lastFieldSensitive?"":s)}function Ta(e,t){return e.replace(ia,function(n){return function(e,t){var n=function(e){if(!e.includes("://"))return[];for(var t=[].concat(e.matchAll(la)).map(function(e){return e.index}),n=[],r={query:!1,fragment:!1,fragmentQuery:!1},i=0,o=!1,s="",a=0;e.length>a&&t.length>i;a++){t[i]===a&&(a>0&&"="!==s&&n.push(a),i++);var u=e[a];Pa(u,r,s)?(s=u,o=!0):o&&"=&".includes(u)&&(s=u)}return n}(e);if(0===n.length)return Ea(e,t);for(var r,i="",o=0,s=p(n);!(r=s()).done;){var a=r.value;i+=Ea(e.slice(o,a),d({},t,{stripPunctuation:!1})),o=a}return i+Ea(e.slice(o),t)}(n,d({},t,{stripPunctuation:t.stripPunctuation&&n.length!==e.length}))})}function Fa(e){return e.replace(na,Ys)}function Ia(e,t){return function(e){return e.length>=10240&&(Js.test(e)||function(e){var t,n=ea.exec(e);if(!n)return!1;try{t=decodeURIComponent(e.slice(n[0].length))}catch(e){return!1}return ta.test(t.replace(/[\r\n]/g,""))}(e)||Xs.test(e)&&Zs.test(e))}(e)?"[binary data redacted - not supported by PostHog MCP analytics]":function(e,t,n){var r=4*n.maxStringLength;if(e.length>r){var i=t(e.slice(0,function(e,t){for(var n=t;n>0&&!oa.test(e[n-1]);)n--;return n}(e,r)));if(i.length>=2*n.maxStringLength)return i+n.truncationSuffix}return t(e)}(e,function(e){return function(e){return Ta(e,{allowNestedUrls:!0,stripPunctuation:!0})}(function(e){var t=e.replace(fa," ");return t=function(e){for(var t="",n=0,r=La(e,0);null!==r;r=La(e,r[1]))t+=e.slice(n,r[0])+Da(e.slice(r[0],r[1])),n=r[1];return t+e.slice(n)}(t=(t=(t=t.replace(ha,Ys)).replace(pa,Ys)).replace(_a,"$1"+Ys)),(t=(t=t.replace(va,Ys)).replace(ma,"$1"+Ys)).replace(ya,"$1"+Ys)}(Fa(e)))},t)}function Ra(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;if(0>i||i>9)return!1;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function Aa(e,t){var n=e.charCodeAt(t);return n>=48&&57>=n}function Ma(e,t){var n=e.charCodeAt(t);return Aa(e,t)||95===n||n>=65&&90>=n||n>=97&&122>=n}function Oa(e,t){for(var n=t;Aa(e,n);)n++;return n}function La(e,t){for(var n=t;e.length>n;n++)if(Aa(e,n)&&!Ma(e,n-1)){for(var r=0,i=-1,o=n;;){var s=Oa(e,o);if(13>(r+=s-o)||Ma(e,s)||(i=s),o=s+1,!" ./-".includes(e.charAt(s))||!Aa(e,o))break}if(i>=0)return[n,i];n=o-1}return null}function Da(e){for(var t=[],n=ga.exec(e);null!==n;n=ga.exec(e))t.push({digits:n[0],start:n.index,end:n.index+n[0].length});for(var r="",i=0,o=0;t.length>o;){for(var s="",a=-1,u=o;t.length>u&&19>=(s+=t[u].digits).length;u++)s.length>=13&&Ra(s)&&(a=u);0>a?o++:(r+=e.slice(i,t[o].start)+Ys,i=t[a].end,o=a+1)}return r+e.slice(i)}var $a={}.propertyIsEnumerable;function qa(e,t){try{return ja(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function Na(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:Fo};if(n.remainingNodes--,ci(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),r=BigInt("9223372036854775808");return e>=r||-r>e?(null==t||t.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}(e,t);if("number"==typeof e){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};var i=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if("string"==typeof e)return{stringValue:Ro(e)};if("function"==typeof e)return{stringValue:"[Function]"};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(n.ancestors.has(e))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Fo};if(e instanceof Date){var o=e.getTime(),s=Number.isFinite(o)?e.toISOString():String(e);return{stringValue:"string"==typeof s?Ro(s):String(s)}}n.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return Na(a.call(e),t,n,r+1)}catch(e){}return Xr(e)?{arrayValue:{values:Ba(e,t,n,r+1)}}:{kvlistValue:{values:ja(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:Ro(String(e))}}function Ba(e,t,n,r){for(var i=[],o=Math.min(e.length,1e3),s=0;o>s&&n.remainingNodes>0;s++)try{var a=s in e?e[s]:void 0;if(ai(a))continue;i.push(Na(a,t,n,r))}catch(e){i.push({stringValue:Io})}return e.length>s&&i.push({stringValue:Fo}),i}function ja(e,t,n,r){var i=[];for(var o in e)if($a.call(e,o)){if(!o){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||0>=n.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var s=e[o];if(si(s)||ri(s))continue;i.push({key:Ro(o),value:Na(s,t,n,r)})}catch(e){i.push({key:Ro(o),value:{stringValue:Io}})}}return i}function Ha(e,t,n){return d({},Ao({},e.resourceAttributes),{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}var za=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Ua(e,t){for(var n=Ao({},e),r={},i=0,o=za;o.length>i;i++){var s=o[i];({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s])}return[].concat(qa(n,t),qa(r,t))}var Wa={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"};var Va={text:"INFO",number:9},Ga={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:Va,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function Ka(e){try{return Ro(String(e))}catch(e){return Io}}function Qa(e,t,n,r){var i,o=Ga[e.level||"info"]||Va,s=o.text,a=o.number,u=(void 0===(i=ui(r)?r:void 0)&&(i=Date.now()),String(i)+"000000"),l={};t.distinctId&&(l.posthogDistinctId=t.distinctId),t.sessionId&&(l.sessionId=t.sessionId),t.windowId&&(l["window.id"]=t.windowId),ai(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),ai(t.lastActivityTimestamp)||(l.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(l["url.full"]=t.currentUrl),t.screenName&&(l["screen.name"]=t.screenName),t.appState&&(l["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(l.feature_flags=t.activeFeatureFlags);var c=d({},l),f=e.attributes;if(f){var h=[];try{h=Object.keys(f)}catch(e){h=[]}for(var _,v=p(h);!(_=v()).done;){var g=_.value,m=void 0;try{m=f[g]}catch(e){m=Io}Object.defineProperty(c,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var y={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:a,severityText:s,body:{stringValue:Ka(e.body)},attributes:qa(c,n)};return e.trace_id&&(y.traceId=e.trace_id),e.span_id&&(y.spanId=e.span_id),ri(e.trace_flags)||(y.flags=e.trace_flags),y}function Ya(e,t,n){return Ha(e,t,n)}function Ja(e,t,n,r){return{resourceLogs:[{resource:{attributes:Ua(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Za=function(){"use strict";function e(e){this._onFire=e,this._firesAt=0}var t=e.prototype;return t.arm=function(e){var t=this;this.clear(),this._firesAt=Date.now()+e,this._timer=Uo(function(){t._timer=void 0,t._onFire()},e)},t.armNoEarlierThan=function(e){this._timer&&Date.now()+e<=this._firesAt||this.arm(e)},t.clear=function(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)},a(e,[{key:"pending",get:function(){return!!this._timer}}])}();function Xa(){return.75+.5*Math.random()}function eu(e,t,n,r){var i=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===r?i:Math.min(i,Math.max(r,e)))*n)}var tu=function(){"use strict";function e(e,t,n,r,i,o,s,a){var u,l=this;void 0===o&&(o=function(){return Promise.resolve()}),void 0===a&&(a=function(){return!1}),this._instance=e,this._config=t,this._logger=n,this._getContext=r,this._onReady=i,this._waitForStoragePersist=o,this._scopeName=s,this._isConsentWithdrawn=a,this._flushTimer=new Za(function(){return l._flushInBackground()}),this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._backgroundFlushPromise=null,this._retryAfter=new qo,this._consecutiveFlushFailures=0,this._flushJitter=1,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!==(u=t.maxQueueSize)&&void 0!==u?u:t.maxBufferSize,t.maxBufferSize),this._flushIntervalMs=t.flushIntervalMs,this._maxBatchRecordsPerPost=t.maxBatchRecordsPerPost,this._rateCapWindowMs=t.rateCapWindowMs,this._maxLogsPerInterval=t.maxLogsPerInterval}var t=e.prototype;return t.clearQueue=function(){this._queueGeneration++,this._instance.setPersistedProperty(Br.LogsQueue,[])},t.reset=function(){this._flushTimer.clear(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.reset(),this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.isOpen()?this._hasQueuedRecords()&&this._armFlushTimer():this._flushInBackground()},t.captureLog=function(e,t){var n,r=this;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var i=this._runBeforeSend(e);if(null!==i)if(i.body){if(this._checkRateLimit()){var o={record:Qa(i,null!==(n=null==t?void 0:t.context)&&void 0!==n?n:this._getContext(),this._logger,null==t?void 0:t.occurredAtMs)};this._onReady(function(){return r._enqueue(o)})}}else this._logger.info("Log was rejected in beforeSend function")}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=p(Xr(t)?t:[t]);!(n=i()).done;){var o=n.value;try{var s=o(r);if(!s)return this._logger.info("Log was rejected in beforeSend function"),null;r=s}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}}return r},t._checkRateLimit=function(){if(void 0===this._maxLogsPerInterval)return!0;var e=Date.now(),t=e-this._intervalWindowStart;return this._rateCapWindowMs>t&&t>=0||(this._intervalWindowStart=e,this._intervalLogCount=0,this._droppedWarned=!1),this._maxLogsPerInterval>this._intervalLogCount?(this._intervalLogCount++,!0):(this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+this._maxLogsPerInterval+" logs per "+this._rateCapWindowMs+"ms"),this._droppedWarned=!0),!1)},t.flush=function(){var e=h(l().m(function e(){var t=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(!this._instance.isDisabled){e.n=1;break}return e.a(2);case 1:if(!this._flushPromise){e.n=2;break}return e.a(2,this._flushPromise);case 2:return this._flushPromise=this._flushInner().finally(function(){t._flushPromise=null}),e.a(2,this._flushPromise)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._flushInner=function(){var e=h(l().m(function e(){var t,n,r,i,o,s,a,u,c,d,f,h;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),!this._discardQueueIfConsentWithdrawn()){e.n=1;break}return e.a(2);case 1:if(0!==(n=null!==(t=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==t?t:[]).length){e.n=2;break}return e.a(2);case 2:r=n.length,i=0;case 3:if(0>=n.length||i>=r){e.n=11;break}if(!this._discardQueueIfConsentWithdrawn()){e.n=4;break}return e.a(2);case 4:return a=this._queueGeneration,this._evictedSinceAdvance=0,u=Math.min(n.length,this._maxBatchRecordsPerPost),c=n.slice(0,u),d=c.map(function(e){return e.record}),f=Ja(d,this._buildResourceAttributes(),null!==(o=this._scopeName)&&void 0!==o?o:this._instance.getLibraryId(),this._instance.getLibraryVersion()),e.n=5,this._instance._sendLogsBatch(f);case 5:if(h=e.v,this._queueGeneration===a){e.n=6;break}return e.a(2);case 6:if("too-large"!==h.kind||1>=c.length){e.n=7;break}return this._maxBatchRecordsPerPost=Math.max(1,Math.floor(c.length/2)),this._logger.warn("Logs batch of size "+c.length+" was too large for the ingestion endpoint, reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,3);case 7:if(this._retryAfter.record(h),this._flushTimer.pending&&this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs())),"retry-later"!==h.kind){e.n=8;break}throw h.error;case 8:return"too-large"===h.kind?this._logger.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===h.kind&&this._config.maxBatchRecordsPerPost>this._maxBatchRecordsPerPost&&(this._maxBatchRecordsPerPost=Math.min(this._config.maxBatchRecordsPerPost,this._maxBatchRecordsPerPost+1)),e.n=9,this._persistQueueAdvance(c.length);case 9:if(n=null!==(s=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==s?s:[],i+=c.length,"fatal"!==h.kind){e.n=10;break}throw h.error;case 10:e.n=3;break;case 11:return e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._discardQueueIfConsentWithdrawn=function(){return!!this._isConsentWithdrawn()&&(this._hasQueuedRecords()&&this.clearQueue(),!0)},t._persistQueueAdvance=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return r=Math.max(0,t-this._evictedSinceAdvance),i=null!==(n=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(Br.LogsQueue,i.slice(r)),e.n=1,this._waitForStoragePersist();case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t._buildResourceAttributes=function(){return Ya(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion())},t._enqueue=function(e){var t;if(!this._instance.optedOut){var n=null!==(t=this._instance.getPersistedProperty(Br.LogsQueue))&&void 0!==t?t:[];this._maxQueueSize>n.length||(n.shift(),this._evictedSinceAdvance++,this._logger.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(Br.LogsQueue,n),this._maxBufferSize>n.length||this._retryAfter.isOpen()?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs()))},t._nextFlushDelay=function(){return Math.max(eu(this._flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(Br.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=h(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),n=this.flush().catch(function(){}),void 0!==t){e.n=2;break}return e.n=1,n;case 1:return e.a(2,void 0);case 2:return e.n=3,Wo(n,t);case 3:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=h(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:return n=this.flush(),e.n=1,Wo(n,t,function(){n.catch(function(){})});case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushInBackground=function(){var e=this;if(this._backgroundFlushPromise)return this._backgroundFlushPromise;var t=this.flush().then(function(){e._consecutiveFlushFailures=0,e._flushJitter=1},function(t){e._consecutiveFlushFailures++,e._flushJitter=Xa(),e._logger.error("PostHog logs flush failed:",t)}).finally(function(){e._backgroundFlushPromise===t&&(e._backgroundFlushPromise=null),!e._instance.isDisabled&&e._hasQueuedRecords()&&e._flushTimer.armNoEarlierThan(e._nextFlushDelay())});return this._backgroundFlushPromise=t,t},t._flushInBackground=function(){this.flushInBackground()},a(e,[{key:"throttled",get:function(){return this._retryAfter.isOpen()}}])}(),nu=/^[0-9a-f]+$/;function ru(e,t,n){return"string"==typeof e&&e.length===t&&e!==n&&nu.test(e)}var iu=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;var ou="00",su=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function au(e){return String(e)+"000000"}function uu(e,t,n,r){var i="";return r&&(i=Object.keys(r).sort().map(function(e){return JSON.stringify(e)+":"+JSON.stringify(r[e])}).join(",")),e+"\0"+t+"\0"+(null!=n?n:"")+"\0"+i}var lu=function(){"use strict";function e(e,t,n){var r=this;this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushTimer=new Za(function(){return r.flush().catch(function(e){r._logger.error("Metrics flush failed:",e)})}),this._flushPromise=null,this._queuedFlush=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._boundsByHistogram=new Map,this._boundsConflictWarned=new Set,this._boundsCapWarned=!1,this._retryAfter=new qo,this._consecutiveFlushFailures=0,this._flushJitter=1,this._generation=0}var t=e.prototype;return t.count=function(e,t,n){void 0===t&&(t=1),this._capture({name:e,type:"count",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.gauge=function(e,t,n){this._capture({name:e,type:"gauge",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.histogram=function(e,t,n){this._capture({name:e,type:"histogram",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes,bounds:Xr(null==n?void 0:n.bounds)?n.bounds.slice():null==n?void 0:n.bounds})},t.flush=function(){var e=this,t=this._flushPromise,n=function(){var n=h(l().m(function n(){return l().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=1;break}return n.n=1,t.catch(function(){});case 1:return n.n=2,e._doFlush();case 2:return n.a(2)}},n)}));return function(){return n.apply(this,arguments)}}()().finally(function(){e._flushPromise===n&&(e._flushPromise=null)});return this._flushPromise=n,n},t.flushCoalesced=function(){var e,t,n=this;return this._isBackingOff()?null!==(e=this._flushPromise)&&void 0!==e?e:Promise.resolve():(this._queuedFlush||(this._queuedFlush=(null!==(t=this._flushPromise)&&void 0!==t?t:Promise.resolve()).catch(function(){}).then(function(){return n._queuedFlush=null,n._isBackingOff()?void 0:n.flush()})),this._queuedFlush)},t._isBackingOff=function(){return this._consecutiveFlushFailures>0||this._retryAfter.remainingMs()>0},t.drainWindow=function(){if(0===this._series.size)return null;var e=this._series;return this._startWindow(),this._buildPayload(e)},t.reset=function(){this._generation++,this._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=1,this._flushTimer.clear(),this._flushPromise=null,this._queuedFlush=null,this._startWindow(),this._boundsByHistogram=new Map,this._boundsCapWarned=!1},t._startWindow=function(){this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._boundsConflictWarned=new Set},t._capture=function(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this._runBeforeSend(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type||"gauge"===t.type||"histogram"===t.type)if("count"===t.type&&0>t.value)this._logger.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=t.attributes?d({},t.attributes):void 0,r=uu(t.type,t.name,t.unit,n)}catch(e){return void this._logger.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,o=this._series.get(r);if((o||this._admitNewSeries())&&("histogram"!==t.type||(i=this._histogramBounds(t.name,t.unit,t.bounds)))){o||(o={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now(),hist:i&&du(i)},this._series.set(r,o));var s=this._typeByName.get(t.name);void 0===s?this._typeByName.set(t.name,t.type):s===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+s+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(o,t.value);var a=this._activeTraceContext();a&&(o.exemplar=d({},a,{value:t.value,timeMs:Date.now()})),this._armFlushTimer()}}else this._logger.warn("Dropping metric '"+t.name+"': unknown type '"+String(t.type)+"'");else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}},t._activeTraceContext=function(){try{var e,t,n=(r=null==(e=(t=this._instance).getActiveSpan)||null==(e=e.call(t))?void 0:e.traceparent(),o=function(e){if("string"==typeof e){var t=iu.exec(e.trim());if(t){var n=t[1],r=t[2],i=t[3],o=t[4];if("ff"!==n&&("00"!==n||!t[5])&&function(e){return ru(e,32,"00000000000000000000000000000000")}(r)&&function(e){return ru(e,16,"0000000000000000")}(i))return{version:n,traceId:r,spanId:i,flags:o}}}}(r),o&&{traceId:o.traceId,spanId:o.spanId,flags:(i=o.flags,1&parseInt(i,16)?"01":ou)});if(n&&"01"===n.flags)return{traceId:n.traceId,spanId:n.spanId}}catch(e){}var r,i,o},t._admitNewSeries=function(){return this._config.maxSeriesPerFlush>this._series.size||(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn("Metric series cap reached ("+this._config.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)},t._histogramBounds=function(e,t,n){if(void 0===n||function(e){if(!Xr(e)||0===e.length)return!1;for(var t=0;e.length>t;t++)if(!Number.isFinite(e[t])||t>0&&e[t-1]>=e[t])return!1;return!0}(n)){var r=uu("histogram",e,t,void 0),i=this._boundsByHistogram.get(r);if(i)return this._warnOnBoundsConflict(e,r,i,n),i;if(this._boundsByHistogram.size>=this._config.maxSeriesPerFlush){if(this._boundsCapWarned||(this._boundsCapWarned=!0,this._logger.warn("Histogram bounds limit reached ("+this._config.maxSeriesPerFlush+" distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.")),n&&!cu(n,su))return;return su}var o=n?n.slice():su;return this._boundsByHistogram.set(r,o),o}this._logger.warn("Dropping histogram '"+e+"': bounds must be a non-empty array of finite, strictly increasing numbers")},t._warnOnBoundsConflict=function(e,t,n,r){cu(n,null!=r?r:su)||this._boundsConflictWarned.has(t)||(this._boundsConflictWarned.add(t),this._logger.warn("Histogram '"+e+"' already uses the bounds ["+n.join(", ")+"]; samples that pass different bounds are recorded in those buckets."))},t._fold=function(e,t){var n;switch(e.type){case"count":e.total=(null!==(n=e.total)&&void 0!==n?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,r.bounds)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=p(Xr(t)?t:[t]);!(n=i()).done;){var o=n.value;try{var s=o(r);if(!s)return this._logger.info("Metric was rejected in beforeSend function"),null;r=s}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}}return r},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())},t._nextFlushDelay=function(){return Math.max(eu(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._doFlush=function(){var e=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),0!==this._series.size){e.n=1;break}return e.a(2);case 1:return t=this._series,this._startWindow(),n=this._generation,e.n=2,this._instance._sendMetricsBatch(this._buildPayload(t));case 2:if(r=e.v,n===this._generation){e.n=3;break}return e.a(2);case 3:this._retryAfter.record(r),"retry-later"===r.kind?(this._consecutiveFlushFailures++,this._flushJitter=Xa()):(this._consecutiveFlushFailures=0,this._flushJitter=1),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),e.n="ok"===(i=r.kind)?4:"retry-later"===i?5:"too-large"===i?6:"fatal"===i?7:8;break;case 4:case 8:return e.a(2);case 5:return this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay()),e.a(2);case 6:return this._logger.warn("Metrics batch exceeded the server size limit and was dropped"),e.a(2);case 7:return this._logger.error("Failed to send metrics batch:",r.error),e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._buildPayload=function(e){return t=this._buildMetrics(e),n=function(e,t,n){return Ha(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ua(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i},t._buildMetrics=function(e){for(var t,n=au(Date.now()),r=new Map,i=p(e.values());!(t=i()).done;){var o,s=t.value,a=uu(s.type,s.name,s.unit,void 0),u=r.get(a);u||(u=d({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},r.set(a,u));var l=qa(null!==(o=s.attributes)&&void 0!==o?o:{},this._logger),c=au(s.windowStartMs),f=fu(s.exemplar);if("count"===s.type){var h,_=d({attributes:l,startTimeUnixNano:c,timeUnixNano:n,asDouble:null!==(h=s.total)&&void 0!==h?h:0},f);u.sum.dataPoints.push(_)}else if("gauge"===s.type){var v,g=d({attributes:l,timeUnixNano:n,asDouble:null!==(v=s.last)&&void 0!==v?v:0},f);u.gauge.dataPoints.push(g)}else{var m=s.hist,y=d({attributes:l,startTimeUnixNano:c,timeUnixNano:n,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},f);u.histogram.dataPoints.push(y)}}return Array.from(r.values())},t._mergeWindowBack=function(e){for(var t,n,r,i=p(e);!(r=i()).done;){var o,s=r.value,a=s[0],u=s[1],l=this._series.get(a);if(l)switch(l.windowStartMs=Math.min(l.windowStartMs,u.windowStartMs),l.exemplar=null!==(o=l.exemplar)&&void 0!==o?o:u.exemplar,l.type){case"count":l.total=(null!==(t=l.total)&&void 0!==t?t:0)+(null!==(n=u.total)&&void 0!==n?n:0);break;case"gauge":break;case"histogram":var c=l.hist,d=u.hist;c.count+=d.count,c.sum+=d.sum,c.min=Math.min(c.min,d.min),c.max=Math.max(c.max,d.max);for(var f=0;c.bucketCounts.length>f;f++)c.bucketCounts[f]+=d.bucketCounts[f]}else this._admitNewSeries()&&this._series.set(a,u)}},e}();function cu(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function du(e){return{bounds:e,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(e.length+1).fill(0)}}function fu(e){return e?{exemplars:[{filteredAttributes:[],timeUnixNano:au(e.timeMs),asDouble:e.value,traceId:e.traceId,spanId:e.spanId}]}:{}}function hu(e,t){var n;if(e)return null==(n=e.find(function(e){return e.type===t}))?void 0:n.value}var pu,_u,vu,gu,mu,yu,bu=function(){"use strict";function e(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}e.fromFieldsV7=function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/256,o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)};var t=e.prototype;return t.toString=function(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e},t.clone=function(){return new e(this.bytes.slice(0))},t.equals=function(e){return 0===this.compareTo(e)},t.compareTo=function(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0},e}(),wu=function(){"use strict";function e(){this._timestamp=0,this._counter=0,this._random=new ku}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!ri(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(ri(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e=function(){var e=Date.now();return ui(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0}();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return bu.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())},t._resetCounter=function(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())},e}(),Su=function(e){if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e},ku=function(){"use strict";function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._buffer.length>this._cursor||((null!=pu?pu:pu="u">typeof window&&!ri(window.crypto)&&crypto.getRandomValues?function(e){try{return crypto.getRandomValues(e)}catch(t){return Su(e)}}:Su)(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),xu=function(){return Cu().toString()},Cu=function(){return(_u||(_u=new wu)).generate()},Pu=0,Eu=[],Tu=v,Fu=Tu.__b,Iu=Tu.__r,Ru=Tu.diffed,Au=Tu.__c,Mu=Tu.unmount,Ou=Tu.__;function Lu(e,t){Tu.__h&&Tu.__h(gu,e,Pu||t),Pu=0;var n=gu.__H||(gu.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Du(e){return Pu=1,function(e,t){var n=Lu(vu++,2);if(n.t=e,!n.__c&&(n.__=[Gu(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=gu,!gu.__f)){var r=function(e,t,r){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==e;if(n.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),i){var a=i.call(this,e,t,r);return o?a||s:a}return!o||s};gu.__f=!0;var i=gu.shouldComponentUpdate,o=gu.componentWillUpdate;gu.componentWillUpdate=function(e,t,n){if(this.__e){var s=i;i=void 0,r(e,t,n),i=s}o&&o.call(this,e,t,n)},gu.shouldComponentUpdate=r}return n.__N||n.__}(Gu,e)}function $u(e,t){var n=Lu(vu++,3);!Tu.__s&&Vu(n.__H,t)&&(n.__=e,n.u=t,gu.__H.__h.push(n))}function qu(e){return Pu=5,Nu(function(){return{current:e}},[])}function Nu(e,t){var n=Lu(vu++,7);return Vu(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Bu(e){var t,n=gu.context[e.__c],r=Lu(vu++,9);return r.c=e,n?(null!==(t=r.__)&&void 0!==t||(r.__=!0,n.sub(gu)),n.props.value):e.__}function ju(){for(var e;e=Eu.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Uu),t.__h.some(Wu),t.__h=[]}catch(n){t.__h=[],Tu.__e(n,e.__v)}}}Tu.__b=function(e){gu=null,Fu&&Fu(e)},Tu.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ou&&Ou(e,t)},Tu.__r=function(e){Iu&&Iu(e),vu=0;var t=(gu=e.__c).__H;t&&(mu===gu?(t.__h=[],gu.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&ju(),vu=0)),mu=gu},Tu.diffed=function(e){Ru&&Ru(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Eu.push(t)&&yu===Tu.requestAnimationFrame||((yu=Tu.requestAnimationFrame)||zu)(ju)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),mu=gu=null},Tu.__c=function(e,t){t.some(function(e){try{e.__h.some(Uu),e.__h=e.__h.filter(function(e){return!e.__||Wu(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Tu.__e(n,e.__v)}}),Au&&Au(e,t)},Tu.unmount=function(e){Mu&&Mu(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Uu(e)}catch(e){t=e}}),n.__H=void 0,t&&Tu.__e(t,n.__v))};var Hu="function"==typeof requestAnimationFrame;function zu(e){var t,n=function(){clearTimeout(r),Hu&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Hu&&(t=requestAnimationFrame(n))}function Uu(e){var t=gu,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),gu=t}function Wu(e){var t=gu;e.__c=e.__(),gu=t}function Vu(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Gu(e,t){return"function"==typeof t?t(e):t}var Ku="events",Qu="cancelEvents",Yu="tab",Ju="left",Zu="center",Xu="right",el="next_to_trigger",tl="popover",nl="widget",rl="external_survey",il="open",ol="multiple_choice",sl="single_choice",al="rating",ul="end",ll="always",cl="survey shown",dl="survey dismissed",fl="survey sent",hl="$survey_id",pl="$survey_name",_l="$survey_iteration",vl="$survey_iteration_start_date",gl="$survey_language",ml="popover",yl="0.14.1",bl={DEBUG:!1,LIB_VERSION:yl,LIB_NAME:"browser-common",JS_SDK_VERSION:yl},wl=function(e,t){var n=(void 0===t?{}:t).debugEnabled,r={_log:function(t){var r;try{r=typeof window>"u"?void 0:window}catch(e){return}for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;i>s;s++)o[s-1]=arguments[s];r&&(bl.DEBUG||r.POSTHOG_DEBUG||n)&&!ri(r.console)&&r.console&&("__rrweb_original__"in r.console[t]?r.console[t].__rrweb_original__:r.console[t]).apply(void 0,[e].concat(o))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["debug"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["error"].concat(t))},critical:function(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];(t=console).error.apply(t,[e].concat(r))},uninitializedWarning:function(e){r.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return wl(e+" "+t,n)}};return r},Sl=wl("[PostHog.js]"),kl=function(e,t){return Sl.createLogger(e,t)};function xl(e,t){Xr(e)&&e.forEach(t)}function Cl(e,t){if(!ai(e))if(Xr(e))e.forEach(t);else if(function(e){return e instanceof FormData}(e))e.forEach(function(e,n){return t(e,n)});else for(var n in e)Jr.call(e,n)&&t(e[n],n)}var Pl=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i=0,o=n;o.length>i;i++){var s=o[i];for(var a in s)void 0!==s[a]&&(e[a]=s[a])}return e};function El(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Tl=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Sl.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Sl.critical(e)}}},Fl=function(e){var t={};return Cl(e,function(e,n){(ii(e)&&e.length>0||ui(e))&&(t[n]=e)}),t};function Il(e){for(var t=d({},e),n=0,r=["name","message","stack","cause","errors"];r.length>n;n++){var i=r[n];try{i in e&&(t[i]=e[i])}catch(e){}}return t}var Rl=["herokuapp.com","vercel.app","netlify.app"];function Al(e){var t=null==e?void 0:e.hostname;if(!ii(t))return!1;for(var n=t.split(".").slice(-2).join("."),r=0,i=Rl;i.length>r;r++)if(n===i[r])return!1;return!0}function Ml(e,t,n,r){var i=null!=r?r:{},o=i.capture,s=i.passive;null==e||e.addEventListener(t,n,{capture:void 0!==o&&o,passive:void 0===s||s})}function Ol(e){return"ph_toolbar_internal"===e.name}function Ll(e){return"$survey_response_"+e}function Dl(e,t){if(!t)return null;var n=e[Ll(t)];return Xr(n)?[].concat(n):n}function $l(e){var t,n=e.event,r=e.survey,i=e.responses,o=void 0===i?{}:i,s=e.submissionId,a=e.completed,u=e.surveyLanguage,l=e.questionSnapshots;return d({},!ri(s)&&{$survey_submission_id:s},"sent"===n?!ri(a)&&{$survey_completed:a}:{$survey_partially_completed:ql(o)},u&&((t={}).$survey_language=u,t),function(e,t,n){void 0===e&&(e={});var r={};return t.questions.forEach(function(t){if(!ri(t.originalQuestionIndex)){var n,i=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,o=Dl(e,t.id);ri(o)||(r[i]=o)}}),d({$survey_questions:t.questions.map(function(t){var r,i;return{id:t.id,question:null!==(r=null==n?void 0:n[null!==(i=t.id)&&void 0!==i?i:""])&&void 0!==r?r:t.question,response:Dl(e,t.id)}})},e,r)}(o,r,l))}function ql(e){return void 0===e&&(e={}),Object.values(e).some(function(e){return!ai(e)})}function Nl(e,t){var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n}function Bl(e){return"string"==typeof e&&e.trim()?e.trim():null}function jl(e){return e.toLowerCase()}function Hl(e,t,n){if(!e||!t)return null;var r=jl(t),i=Object.keys(e).find(function(e){return jl(e)===r});if(i)return null==n||n.debug("Found exact translation match: "+i),i;if(r.includes("-")){var o=r.split("-")[0],s=Object.keys(e).find(function(e){return jl(e)===o});if(s)return null==n||n.debug("Found base language translation match: "+s+" (from "+t+")"),s}return null}var zl=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ul(e,t,n){var r,i=Hl(e.translations,t,n),o=d({},e),s=!1;if(i){var a,u=null==(a=e.translations)?void 0:a[i];if(u)if(null==n||n.info("Applying survey-level translation for language: "+i),ri(u.name)||(o.name=u.name,s=!0),o.appearance){for(var l=d({},o.appearance),c=0,f=zl;f.length>c;c++){var h=f[c],p=u[h];ri(p)||(l[h]=p,s=!0)}o.appearance=l}else(function(e){return zl.some(function(t){return!ri(e[t])})})(u)&&(s=!0)}var _=e.questions.map(function(e){return function(e,t,n){var r,i=Hl(e.translations,t,n);if(!i)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(r=e.translations)?void 0:r[i];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var s=d({},e),a=!1;return ri(o.question)||(s.question=o.question,a=!0),ri(o.description)||(s.description=o.description,a=!0),ri(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!ri(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!ri(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!ri(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(e){return Xr(e.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:e,matchedKey:a?i:null,hasChanges:a}}(e,t,n)}),v=_.map(function(e){return e.question}),g=_.some(function(e){return e.hasChanges}),m=null;return i||(m=(null==(r=_.find(function(e){return e.matchedKey}))?void 0:r.matchedKey)||null),g&&(o.questions=v,s=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:s?i||m:null}}function Wl(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Vl(e){var t;return Wl(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Gl=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}},Kl=function(e){return e.toLowerCase()},Ql={exact:function(e,t){return t.some(function(t){return e.some(function(e){return t===e})})},is_not:function(e,t){return t.every(function(t){return e.every(function(e){return t!==e})})},regex:function(e,t){return t.some(function(t){return e.some(function(e){return Gl(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!Gl(t,e)})})},icontains:function(e,t){return t.map(Kl).some(function(t){return e.map(Kl).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(Kl).every(function(t){return e.map(Kl).every(function(e){return!t.includes(e)})})},gt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n>parseFloat(e)})})},lt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n<parseFloat(e)})})}};function Yl(e,t){return!e||Object.entries(e).every(function(e){var n=e[1],r=null==t?void 0:t[e[0]];if(null==r)return!1;var i=Ql[n.operator];return!!i&&i(n.values.map(String),[String(r)])})}var Jl=function(e){for(var t=[].concat(e),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=[t[r],t[n]];t[n]=i[0],t[r]=i[1]}return t},Zl=kl("[Surveys]"),Xl="PostHog is not capturing, so a survey response cannot be recorded";function ec(e){return!(!e.start_date||e.end_date)}function tc(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var nc=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},rc=function(e){return nc("seenSurvey_",e)},ic=function(e){try{var t=rc(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Zl.error("Failed to persist survey seen state",e)}},oc=[tl,nl,"api"],sc={ignoreConditions:!1,ignoreDelay:!1,displayType:ml};function ac(e,t){this.v=e,this.k=t}function uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function lc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cc(e){var t,n;function r(t,n){try{var o=e[t](n),s=o.value,a=s instanceof ac;Promise.resolve(a?s.v:s).then(function(n){if(a){var u="return"===t&&s.k?t:"next";if(!s.k||n.done)return r(u,n);n=e[u](n).value}i(!!o.done,n)},function(e){r("throw",e)})}catch(e){i(2,e)}}function i(e,i){2===e?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};n?n=n.next=a:(t=n=a,r(e,i))})},"function"!=typeof e.return&&(this.return=void 0)}cc.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},cc.prototype.next=function(e){return this._invoke("next",e)},cc.prototype.throw=function(e){return this._invoke("throw",e)},cc.prototype.return=function(e){return this._invoke("return",e)};var dc=Object.entries,fc=Object.keys,hc=Object.setPrototypeOf,pc=Object.isFrozen,_c=Object.getPrototypeOf,vc=Object.getOwnPropertyDescriptor,gc=Object.freeze,mc=Object.seal,yc=Object.create,bc="undefined"!=typeof Reflect&&Reflect,wc=bc.apply,Sc=bc.construct;gc||(gc=function(e){return e}),mc||(mc=function(e){return e}),wc||(wc=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];return e.apply(t,r)}),Sc||(Sc=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var s=new(e.bind.apply(e,r));return n&&i(s,n.prototype),s}(e,n)});var kc=Kc([].forEach),xc=Kc([].lastIndexOf),Cc=Kc([].pop),Pc=Kc([].push),Ec=Kc([].slice),Tc=Kc([].splice),Fc=Array.isArray,Ic=Qc(Set),Rc=Kc(Set.prototype.add),Ac=Kc(Set.prototype.has),Mc=Kc("".toLowerCase),Oc=Kc("".toString),Lc=Kc("".match),Dc=Kc("".replace),$c=Kc("".indexOf),qc=Kc("".trim),Nc=Kc((0).toString),Bc=Kc(Boolean.prototype.toString),jc="undefined"==typeof BigInt?null:Kc(BigInt.prototype.toString),Hc="undefined"==typeof Symbol?null:Kc(Symbol.prototype.toString),zc=Kc({}.hasOwnProperty),Uc=Kc({}.toString),Wc=/t/.test,Vc=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),wc(Wc,e,[t])},Gc=Qc(TypeError);function Kc(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];return wc(e,t,r)}}function Qc(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return Sc(e,n)}}function Yc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mc;if(hc&&hc(e,null),!Fc(t))return e;for(var r=t.length;r--;){var i=t[r];if("string"==typeof i){var o=n(i);o!==i&&(pc(t)||(t[r]=o),i=o)}e[i]=!0}return e}function Jc(e){for(var t=0;e.length>t;t++)zc(e,t)||(e[t]=null);return e}function Zc(e){for(var t,n=yc(null),r=p(dc(e));!(t=r()).done;){var i=lc(t.value,2),o=i[0],s=i[1];zc(e,o)&&(n[o]=Fc(s)?Jc(s):s&&"object"==typeof s&&s.constructor===Object?Zc(s):s)}return n}function Xc(e){for(var t=yc(null),n=fc(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}function ed(e,t){for(;null!==e;){var n=vc(e,t);if(n){if(n.get)return Kc(n.get);if("function"==typeof n.value)return Kc(n.value)}e=_c(e)}return function(){return null}}var td,nd=gc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),rd=gc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),id=gc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),od=gc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),sd=gc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ad=gc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ud=gc(["#text"]),ld=gc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),cd=gc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dd=gc(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fd=gc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hd=mc(/{{[\w\W]*|^[\w\W]*}}/g),pd=mc(/<%[\w\W]*|^[\w\W]*%>/g),_d=mc(/\${[\w\W]*/g),vd=mc(/{{|}}|\${|<%|%>|&lt;%|%&gt;/),gd=mc(/^data-[\-\w.\u00B7-\uFFFF]+$/),md=mc(/^aria-[\-\w]+$/),yd=mc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bd=mc(/^(?:\w+script|data):/i),wd=mc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sd=mc(/^html$/i),kd=mc(/^[a-z][.\w]*(-[.\w]+)+$/i),xd=mc(/<[/\w!]/g),Cd=mc(/<[/\w]/g),Pd=mc(/<\/no(script|embed|frames)/i),Ed=mc(/\/>/i),Td=mc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Fd=mc(/^[\r\n\t ]+/),Id=gc(Yc({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Rd=function(){return"undefined"==typeof window?null:window},Ad=function(e,t,n,r){return zc(e,t)&&Fc(e[t])?Yc(r.base?Xc(r.base):{},e[t],r.transform):n},Md=function(e,t,n){var r=zc(e,t)?e[t]:void 0;return r&&"object"==typeof r?Zc(r):n},Od=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rd(),n=function(t){return e(t)};if(n.version="3.4.18",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;var r,i=t.document,o=i,s=o.currentScript,a=t.HTMLTemplateElement,u=t.Node,l=t.NodeFilter,c=t.DOMParser,d=t.trustedTypes,f=t.Element.prototype,h=ed(f,"cloneNode"),p=ed(f,"remove"),_=ed(f,"removeAttributeNode"),v=ed(f,"nextSibling"),g=ed(f,"childNodes"),m=ed(f,"parentNode"),y=ed(f,"shadowRoot"),b=ed(f,"attributes"),w=u&&u.prototype?ed(u.prototype,"nodeType"):null,S=u&&u.prototype?ed(u.prototype,"nodeName"):null,k=u&&u.prototype?ed(u.prototype,"ownerDocument"):null,x=function(e){return w?w(e):e.nodeType},C=function(e){return S?S(e):e.nodeName},P=function(e){for(;null!==e;){var t=vc(e,"namespaceURI");if(t)return t.get?Kc(t.get):null;e=_c(e)}return null}(f),E=function(e){return P?P(e):e.namespaceURI};if("function"==typeof a){var T=i.createElement("template");T.content&&T.content.ownerDocument&&(i=T.content.ownerDocument)}var F,I="",R=!1,A=0,M=function(){if(A>0)throw Gc('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},O=function(e){M(),A++;try{return r.createHTML(e)}finally{A--}},L=function(e){return r&&ye?O(e):e},D=i.implementation,q=i.createNodeIterator,N=i.createDocumentFragment,B=i.getElementsByTagName,j=o.importNode,H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof dc&&"function"==typeof m&&D&&void 0!==D.createHTMLDocument;var z=hd,U=pd,W=_d,V=gd,G=md,K=bd,Q=wd,Y=kd,J=yd,Z=null,X=Yc({},[].concat(nd,rd,id,sd,ud)),ee=null,te=Yc({},[].concat(ld,cd,dd,fd)),ne=null,re=null,ie=null,oe=Object.seal(yc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),se=!0,ae=!0,ue=!1,le=!0,ce=!1,de=!0,fe=!1,he=!1,pe=null,_e=null,ve=!1,ge=!1,me=!1,ye=!1,be=!0,we=!1,Se="user-content-",ke=!0,xe=!1,Ce=null,Pe=!1,Ee=null,Te=Yc({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Fe=null,Ie=Yc({},["audio","video","img","source","image","track"]),Re=null,Ae=Yc({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Oe="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml",De=Le,$e=!1,qe=null,Ne=Yc({},[Me,Oe,Le],Oc),Be=gc(Yc({},["mi","mo","mn","ms","mtext"])),je=null,He=gc(Yc({},["annotation-xml"])),ze=null,Ue=gc(yc(null)),We=Yc({},["title","style","font","a","script"]),Ve=null,Ge=["application/xhtml+xml","text/html"],Ke=null,Qe=null,Ye=i.createElement("form"),Je=function(e){return e instanceof RegExp||e instanceof Function},Ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e&&"object"==typeof e||(e={}),e=Zc(e),Ve=-1===Ge.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Z=Ad(e,"ALLOWED_TAGS",X,{transform:Ke="application/xhtml+xml"===Ve?Oc:Mc}),ee=Ad(e,"ALLOWED_ATTR",te,{transform:Ke}),qe=Ad(e,"ALLOWED_NAMESPACES",Ne,{transform:Oc}),Re=Ad(e,"ADD_URI_SAFE_ATTR",Ae,{transform:Ke,base:Ae}),Fe=Ad(e,"ADD_DATA_URI_TAGS",Ie,{transform:Ke,base:Ie}),Ee=Ad(e,"FORBID_CONTENTS",Te,{transform:Ke}),re=Ad(e,"FORBID_TAGS",yc(null),{transform:Ke}),ie=Ad(e,"FORBID_ATTR",yc(null),{transform:Ke}),Pe=!!zc(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?Zc(e.USE_PROFILES):e.USE_PROFILES),se=!1!==e.ALLOW_ARIA_ATTR,ae=!1!==e.ALLOW_DATA_ATTR,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,le=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ce=e.SAFE_FOR_TEMPLATES||!1,de=!1!==e.SAFE_FOR_XML,fe=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,me=e.RETURN_DOM_FRAGMENT||!1,ye=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,be=!1!==e.SANITIZE_DOM,we=e.SANITIZE_NAMED_PROPS||!1,ke=!1!==e.KEEP_CONTENT,xe=e.IN_PLACE||!1,J=function(e){if(!e)return!1;try{return Vc(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:yd,De="string"==typeof e.NAMESPACE?e.NAMESPACE:Le,je=Md(e,"MATHML_TEXT_INTEGRATION_POINTS",Be),ze=Md(e,"HTML_INTEGRATION_POINTS",He);var t=Md(e,"CUSTOM_ELEMENT_HANDLING",Ue);if(ne=yc(null),zc(t,"tagNameCheck")&&Je(t.tagNameCheck)&&(ne.tagNameCheck=t.tagNameCheck),zc(t,"attributeNameCheck")&&Je(t.attributeNameCheck)&&(ne.attributeNameCheck=t.attributeNameCheck),zc(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(ne.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),mc(ne),ce&&(ae=!1),me&&(ge=!0),Pe&&((zc(e,"ALLOWED_TAGS")||zc(e,"ALLOWED_ATTR"))&&"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),Z=Yc({},ud),ee=yc(null),!0===Pe.html&&(Yc(Z,nd),Yc(ee,ld)),!0===Pe.svg&&(Yc(Z,rd),Yc(ee,cd),Yc(ee,fd)),!0===Pe.svgFilters&&(Yc(Z,id),Yc(ee,cd),Yc(ee,fd)),!0===Pe.mathMl&&(Yc(Z,sd),Yc(ee,dd),Yc(ee,fd))),oe.tagCheck=null,oe.attributeCheck=null,zc(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?oe.tagCheck=e.ADD_TAGS:Fc(e.ADD_TAGS)&&(Z===X&&(Z=Xc(Z)),Yc(Z,e.ADD_TAGS,Ke))),zc(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?oe.attributeCheck=e.ADD_ATTR:Fc(e.ADD_ATTR)&&(ee===te&&(ee=Xc(ee)),Yc(ee,e.ADD_ATTR,Ke))),zc(e,"ADD_FORBID_CONTENTS")&&Fc(e.ADD_FORBID_CONTENTS)&&(Ee===Te&&(Ee=Xc(Ee)),Yc(Ee,e.ADD_FORBID_CONTENTS,Ke)),ke&&(Z["#text"]=!0),fe&&Yc(Z,["html","head","body"]),Z.table&&(Z.tbody=!0,delete re.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Gc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Gc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');var n=r;r=e.TRUSTED_TYPES_POLICY;try{I=O("")}catch(e){throw r=n,e}}else null===e.TRUSTED_TYPES_POLICY?(r=void 0,I=""):(void 0===r&&(R||(F=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(d,s),R=!0),r=F),r&&"string"==typeof I&&(I=O("")));Qe=gc(e)},Xe=Yc({},[].concat(rd,id,od)),et=Yc({},[].concat(sd,ad)),tt=function(e){Pc(n.removed,{element:e});try{m(e).removeChild(e)}catch(t){if(p(e),!m(e))throw Gc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},nt=function(e,t,n){try{_(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},rt=function(e){at(e);var t=g(e);t&&kc(Ec(t),function(e){try{p(e)}catch(e){}}),1===x(e)&&ot(e,!1)},it=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch(e){r=null}if(Pc(n.removed,{attribute:r||null,from:t}),r)nt(t,r,e);else try{t.removeAttribute(e)}catch(e){}if("is"===e)if(ge||me)try{tt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ot=function(e,t){var n=b(e);if(n)for(var r=n.length-1;r>=0;--r){var i=n[r],o=i&&i.name;"string"!=typeof o||t&&ee[Ke(o)]||nt(e,i,o)}},st=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[e];r.length>0;){var i=r.pop();if(!1!==t(i)){if(n&&1===x(i)){var o=y(i);mt(o)&&r.push(o)}var s=g(i);if(s)for(var a=s.length-1;a>=0;--a)r.push(s[a])}}},at=function(e){st(e,function(e){1===x(e)&&ot(e,!0)})},ut=function(e){var t=[];return st(e,function(e){t.push(e)},!0),t},lt=function(e,t){var r=!1;return kc(n.removed,function(t){t.element&&(r=r||t.element===e,at(t.element))}),function(e,t){var n=Ic();kc(ut(e),function(e){1===x(e)&&Rc(n,e)}),kc(t,function(e){1!==x(e)||Ac(n,e)||ot(e,!0)})}(e,t),r},ct=function(e,t){return!!de&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},dt=function(e){var t=null,n=null;if(ve)e="<remove></remove>"+e;else{var o=Lc(e,Fd);n=o&&o[0]}"application/xhtml+xml"===Ve&&De===Le&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var s=r?O(e):e;if(De===Le)try{t=(new c).parseFromString(s,Ve)}catch(e){}if(!t||!t.documentElement){t=D.createDocument(De,"template",null);try{t.documentElement.innerHTML=$e?I:s}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),De===Le?B.call(t,fe?"html":"body")[0]:fe?t.documentElement:a},ft=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=k?k(e):e.ownerDocument;return q.call(n||e,e,(t?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ht=function(e){return e=Dc(e,z," "),e=Dc(e,U," "),Dc(e,W," ")},pt=function(e){var t;_t(e);var n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&kc(n,function(e){mt(e.content)&&pt(e.content)})},_t=function(e){e.normalize();for(var t=ft(e,!0),n=t.nextNode();n;)n.data=ht(n.data),n=t.nextNode()},vt=function(e){var t=S?S(e):null;return"string"==typeof t&&"form"===Ke(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==b(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.removeAttributeNode||"function"!=typeof e.getAttributeNode||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==w(e)||e.childNodes!==g(e))},gt=function(e){if(!w||"object"!=typeof e||null===e)return null;try{var t=w(e);return"number"==typeof t?t:null}catch(e){return null}},mt=function(e){return 11===gt(e)},yt=function(e){return null!==gt(e)};function bt(e,t,r){0!==e.length&&kc(e,function(e){e.call(n,t,r,Qe)})}var wt=function(e,t){if(e instanceof RegExp)return Vc(e,t);if(e instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];return Boolean(e.apply(void 0,[t].concat(r)))}return!1},St=function(e,t,n,r){return 0===e.length?t:t===n||t===r?Xc(t):t},kt=function(e,t){return e!==t&&null===m(e)&&(xe&&at(e),!0)},xt=function(e,t){if(Ce&&Rc(Ce,e),bt(H.beforeSanitizeElements,e,null),kt(e,t))return!0;if(vt(e))return tt(e),!0;var r=Ke(C(e)),i=x(e);if(Z=St(H.uponSanitizeElement,Z,X,pe),bt(H.uponSanitizeElement,e,{tagName:r,allowedTags:Z}),kt(e,t))return!0;if(function(e,t,n){return!!(de&&1===n&&e.hasChildNodes()&&!yt(e.firstElementChild)&&Vc(xd,e.textContent)&&Vc(xd,e.innerHTML))||!!(de&&Id[t]&&1===n&&E(e)===Le&&(yt(e.firstElementChild)||"string"==typeof e.textContent&&Vc(xd,e.textContent)))||7===n||!(!de||8!==n||!Vc(Cd,e.data))}(e,r,i))return tt(e),!0;if(re[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!Z[r]){var o=function(e,t,n){if(!re[t]&&Et(t)&&wt(ne.tagNameCheck,t))return!1;if(ke&&!Ee[t]&&!Ee[Mc(t)]){var r=m(e),i=g(e);if(i&&r)for(var o=i.length-1;o>=0;--o){var s=e===n?h(i[o],!0):i[o];r.insertBefore(s,v(e))}}return tt(e),!0}(e,r,t);return!(!1!==o||(bt(H.afterSanitizeElements,e,null),!kt(e,t)))||o}if(1===i&&!function(e){var t=E(e),n=Mc(C(e)),r=m(e),i=De,o="template";return r&&1===x(r)&&(i=E(r),o=Mc(C(r))),!!qe[t]&&(t===Oe?function(e,t,n){return t===Le?"svg"===e:t===Me?"svg"===e&&("annotation-xml"===n||je[n]):Boolean(Xe[e])}(n,i,o):t===Me?function(e,t,n){return t===Le?"math"===e:t===Oe?"math"===e&&ze[n]:Boolean(et[e])}(n,i,o):t===Le?function(e,t,n){return!(t===Oe&&!ze[n])&&!(t===Me&&!je[n])&&!et[e]&&(We[e]||!Xe[e])}(n,i,o):"application/xhtml+xml"===Ve)}(e))return tt(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&Vc(Pd,e.innerHTML))return tt(e),!0;if(ce&&3===i){var s=e.textContent,a=ht(s);s!==a&&(Pc(n.removed,{element:e.cloneNode()}),e.textContent=a)}return bt(H.afterSanitizeElements,e,null),kt(e,t)},Ct=function(e,t,n){if(ie[t])return!1;if(ct(t,e))return!1;if(be&&("id"===t||"name"===t)&&(n in i||n in Ye))return!1;var r=ee[t]||oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e);if(ae&&Vc(V,t))return!0;if(se&&Vc(G,t))return!0;if(!r)return Et(e)&&wt(ne.tagNameCheck,e)&&wt(ne.attributeNameCheck,t,e)||"is"===t&&ne.allowCustomizedBuiltInElements&&wt(ne.tagNameCheck,n);if(Re[t])return!0;var o=Dc(n,Q,"");return!(!Vc(J,o)&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==$c(n,"data:")||!Fe[e])&&(!ue||Vc(K,o))&&n)},Pt=Yc({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Et=function(e){return!Pt[Mc(e)]&&Vc(Y,e)},Tt=function(e,t,n,i){if(r&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!n)switch(d.getAttributeType(e,t)){case"TrustedHTML":return O(i);case"TrustedScriptURL":return function(e){M(),A++;try{return r.createScriptURL(e)}finally{A--}}(i)}return i},Ft=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!vt(e)||(tt(e),!1)}catch(n){return it(t,e),!1}},It=function(e,t){return!(!de||!Vc(Td,t))||"attributename"===Mc(e)&&-1!==$c(t,"href")},Rt=function(e,t){xt(e,t),function(e,t){if(bt(H.beforeSanitizeAttributes,e,null),!kt(e,t)){var r=e.attributes;if(r&&!vt(e)){for(var i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee=St(H.uponSanitizeAttribute,ee,te,_e),forceKeepAttr:void 0},o=r.length,s=Ke(C(e));o--;){var a=r[o],u=a.name,l=a.namespaceURI,c=a.value,d=Ke(u),f=c,h="value"===u?f:qc(f),p=!1;i.attrName=d,i.attrValue=h,i.keepAttr=!0,i.forceKeepAttr=void 0,bt(H.uponSanitizeAttribute,e,i),h=i.attrValue,!we||"id"!==d&&"name"!==d||0===$c(h,Se)||(it(u,e,a),h=Se+h,p=!0),It(u,h)?it(u,e,a):i.forceKeepAttr||(!i.keepAttr||!le&&Vc(Ed,h)?it(u,e,a):(ce&&(h=ht(h)),Ct(s,d,h)?(h=Tt(s,d,l,h))!==f&&Ft(e,u,l,h)&&p&&Cc(n.removed):it(u,e,a)))}bt(H.afterSanitizeAttributes,e,null),kt(e,t)}}}(e,t),mt(e.content)&&At(e.content)},At=function(e){var t=null,n=ft(e);for(bt(H.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(bt(H.uponSanitizeShadowNode,t,null),Rt(t,e),1===x(t)){var r=y(t);mt(r)&&(Mt(r),At(r))}ce&&_t(e),bt(H.afterSanitizeShadowDOM,e,null)},Mt=function(e){for(var t=[{node:e,shadow:null}];t.length>0;){var n=t.pop();if(n.shadow)At(n.shadow);else{var r=n.node,i=1===x(r),o=g(r);if(o)for(var s=o.length-1;s>=0;--s)t.push({node:o[s],shadow:null});if(i){var a=S?S(r):null;if("string"==typeof a&&"template"===Ke(a)){var u=r.content;mt(u)&&t.push({node:u,shadow:null})}}if(i){var l=y(r);mt(l)&&t.push({node:null,shadow:l},{node:l,shadow:null})}}}};return n.sanitize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,a=null;if(($e=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!yt(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return Nc(e);case"boolean":return Bc(e);case"bigint":return jc?jc(e):"0";case"symbol":return Hc?Hc(e):"Symbol()";case"undefined":default:return Uc(e);case"function":case"object":if(null===e)return Uc(e);var t=e,n=ed(t,"toString");if("function"==typeof n){var r=n(t);return"string"==typeof r?r:Uc(r)}return Uc(e)}}(e)))throw Gc("dirty is not a string, aborting");if(!n.isSupported)return e;he?(Z=pe,ee=_e):Ze(t),n.removed=[];var u=xe&&"string"!=typeof e&&yt(e),l=[],c=Ce;if(u){de&&st(e,function(e){var t=x(e);if(7===t||8===t&&Vc(Cd,e.data)){try{p(e)}catch(e){}return!1}if(1===t){var n=e,r=Ke(C(e));try{n.hasAttribute&&n.hasAttribute("patchsrc")&&n.removeAttribute("patchsrc"),n.hasAttribute&&n.hasAttribute("for")&&ct("for",r)&&n.removeAttribute("for")}catch(e){}}return!0});var d=C(e);if("string"==typeof d){var f=Ke(d);if(!Z[f]||re[f])throw rt(e),Gc("root node is forbidden and cannot be sanitized in-place")}if(vt(e))throw rt(e),Gc("root node is clobbered and cannot be sanitized in-place");l=ut(e),Ce=Ic()}else if(yt(e))1===(i=(r=dt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),Mt(r);else{if(!ge&&!ce&&!fe&&-1===e.indexOf("<"))return L(e);if(!(r=dt(e)))return ge?null:ye?I:""}r&&ve&&tt(r.firstChild);var h=u?e:r;try{u&&Mt(e);for(var _=ft(h);s=_.nextNode();)Rt(s,h);u&&function(e,t){for(var n,r=Ce,i=null,o=function(){return i||(i=Ic(),kc(t,function(e){Rc(i,e)})),i},s=function(){var t=ut(e),n=[e],i=!1;if(kc(t,function(e){11===x(e)?Pc(n,e):i||Ac(r,e)||(i=Ac(o(),e))}),!i)return{v:void 0};if(a>=8)throw Gc("the tree kept changing during in-place sanitization; refusing to return it");kc(n,function(t,n){!function(e,t,n,r){for(var i,o=ft(e);i=o.nextNode();)Ac(r,i)&&!Ac(Ce,i)&&(t&&bt(H.uponSanitizeShadowNode,i,null),Rt(i,n))}(t,n>0,e,o())})},a=0;;a++)if(n=s())return n.v}(e,l)}catch(t){throw u&&(rt(e),lt(e,l)),t}finally{Ce=c}if(u){if(lt(e,l))throw Gc("a node selected for removal could not be safely returned; refusing to sanitize in place");return ce&&pt(e),e}if(ge){if(ce&&pt(r),me)for(a=N.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ee.shadowroot||ee.shadowrootmode)&&(a=j.call(o,a,!0)),a}var v=function(){return fe?r.outerHTML:r.innerHTML},g=v();return ce&&Vc(vd,g)&&(_t(r),g=v()),fe&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Vc(Sd,r.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+g),L(g)},n.setConfig=function(){Ze(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),he=!0,pe=Z,_e=ee},n.clearConfig=function(){Qe=null,he=!1,pe=null,_e=null,r=F,I=""},n.isValidAttribute=function(e,t,n){Qe||Ze({});var r=Ke(e),i=Ke(t);return("string"!=typeof n||!(It(t,n)||!le&&Vc(Ed,n)))&&Ct(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&zc(H,e)&&Pc(H[e],t)},n.removeHook=function(e,t){if(zc(H,e)){if(void 0!==t){var n=xc(H[e],t);return-1===n?void 0:Tc(H[e],n,1)[0]}return Cc(H[e])}},n.removeHooks=function(e){zc(H,e)&&(H[e]=[])},n.removeAllHooks=function(){H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Ld=["a","abbr","acronym","area","article","aside","b","bdi","bdo","blockquote","br","caption","center","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","ins","kbd","li","map","mark","nav","ol","p","pre","q","rp","rt","rtc","ruby","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","time","tr","tt","u","ul","var","wbr"],Dd=["style","lang","title","width","height"],$d=["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],qd={a:["href","hreflang","target","rel"],bdo:["dir"],blockquote:["cite"],col:["align","char","charoff","span"],colgroup:["align","char","charoff","span"],del:["cite","datetime"],hr:["align","size","width"],img:["align","alt","height","src","width"],ins:["cite","datetime"],ol:["start","type"],q:["cite"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:$d,tfoot:["align","char","charoff","valign"],th:$d,thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"]};function Nd(e){for(var t=(null!=td?td:td=Od()).sanitize(e,{ALLOWED_TAGS:Ld,ALLOWED_ATTR:[],ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1,ALLOWED_NAMESPACES:["http://www.w3.org/1999/xhtml"],ADD_ATTR:function(e,t){return-1!==Dd.indexOf(e)||{}.hasOwnProperty.call(qd,t)&&-1!==(qd[t]||[]).indexOf(e)},RETURN_DOM_FRAGMENT:!0}),n=t.querySelectorAll("a"),r=0;n.length>r;r++)n.item(r).relList.add("noopener");var i=document.createElement("div");return i.appendChild(t),i.innerHTML}function Bd(e,t){var n,r=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!ei(r))return t;try{var i=r(t);return ii(i)&&i?i:t}catch(e){return Sl.error("Error in get_current_url, falling back to window.location.href",e),t}}function jd(e){var t,n=null==(t=typeof window>"u"?void 0:window)||null==(t=t.location)?void 0:t.href;return ri(n)?void 0:Bd(e,n)}var Hd=kl("[Stylesheet Loader]"),zd="#020617",Ud={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Xu,widgetType:Yu,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:zd,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Wd=[Zu,Ju,Xu];function Vd(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Gd(e){var t;void 0===e&&(e=Ud.backgroundColor),"#"===e[0]&&(t=Vd(e)),e.startsWith("rgb")&&(t=e);var n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(n&&(t=Vd(n)),!t)return zd;var r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),s=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?zd:"white"}return zd}var Kd=function(e,t,n){var r=pf(e),i=document.querySelector("."+r);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};var o=document.createElement("div");(function(e,t,n){var r,i=d({},Ud,n),o=e.style,s=!Wd.includes(i.position)||t===nl&&(null==n?void 0:n.widgetType)===Yu;o.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),o.setProperty("--ph-survey-box-padding",i.boxPadding),o.setProperty("--ph-survey-max-width",i.maxWidth),o.setProperty("--ph-survey-z-index",i.zIndex),o.setProperty("--ph-survey-border-color",i.borderColor),s?(o.setProperty("--ph-survey-border-radius",i.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",i.backgroundColor),o.setProperty("--ph-survey-box-shadow",i.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Gd(i.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Gd(i.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Gd(i.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r=o,"white"===Gd(i.backgroundColor)?r.setProperty("--ph-logo-mono","1"):r.removeProperty("--ph-logo-mono"),o.setProperty("--ph-widget-color",i.widgetColor),o.setProperty("--ph-widget-text-color",Gd(i.widgetColor)),o.setProperty("--ph-widget-z-index",i.zIndex);var a=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),u=a||i.inputBackground;a||"white"!==i.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==n?void 0:n.inputTextColor)||Gd(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,e.type,e.appearance),o.className=r;var s=o.attachShadow({mode:"open"}),a=function(e){var t=function(e,t,n){var r=e.createElement("style");r.innerText=t;var i=function(e){var t;return ei(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return i&&(r=i(r)),r||(Hd.error("prepare_external_dependency_stylesheet returned null"),null)}(document,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null==e?void 0:e.config.prepareStylesheet);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(a){var u=s.querySelector("style");u&&s.removeChild(u),s.appendChild(a)}return(n||document.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},Qd=function(e){try{var t=rc(e);localStorage.getItem(t)||localStorage.setItem(t,"true")}catch(e){Zl.error("Failed to persist survey seen state",e)}},Yd=function(e){var t,n,r,i,o,s=e.responses,a=e.survey,u=e.surveySubmissionId,l=e.posthog,c=e.isSurveyCompleted,f=e.properties,h=e.surveyLanguage,p=e.questionSnapshots;l?null!=(t=l.client)&&t.canCapture&&(Qd(a),c&&hf(a),null==(n=l.client)||n.capture(fl,d(((r={})[pl]=a.name,r[hl]=a.id,r[_l]=a.current_iteration,r[vl]=a.current_iteration_start_date,r.sessionRecordingUrl=Nr(l),r),$l(d({event:"sent",survey:a,responses:s,submissionId:u,completed:c},!ri(h)&&{surveyLanguage:h},!ri(p)&&{questionSnapshots:p})),f,{$set:(i={},i[Nl(a,"responded")]=!0,i)})),c&&(window.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:a.id}})),null==(o=l.client)||null==(o=o.getExtension(qr))||o.reloadFeatureFlags())):Zl.error("[survey sent] event not captured, PostHog instance not found.")},Jd=function(e,t,n,r){var i;return d(((i={})[pl]=t.name,i[hl]=t.id,i[_l]=t.current_iteration,i[vl]=t.current_iteration_start_date,i.sessionRecordingUrl=Nr(r),i),$l(d({event:e,survey:t},!ri(null==n?void 0:n.responses)&&{responses:n.responses},!ri(null==n?void 0:n.surveySubmissionId)&&{submissionId:n.surveySubmissionId},!ri(null==n?void 0:n.surveyLanguage)&&{surveyLanguage:n.surveyLanguage},!ri(null==n?void 0:n.questionSnapshots)&&{questionSnapshots:n.questionSnapshots})))},Zd=function(e,t,n,r){var i,o,s;if(t){if(!n){var a=df(e),u=a?a.surveyLanguage:r,l=d({},Jd("dismissed",e,a,t),u&&((i={})[gl]=u,i),{$set:(o={},o[Nl(e,"dismissed")]=!0,o)});hf(e),Qd(e),null==(s=t.client)||s.capture(dl,l),window.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Zl.error("[survey dismissed] event not captured, PostHog instance not found.")},Xd=function(e,t){var n,r;if(t){if(null!=(n=t.client)&&n.canCapture){var i=function(e){return nc("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(i))return}catch(e){return}var o=df(e);if(o){try{localStorage.setItem(i,"true")}catch(e){}null==(r=t.client)||r.capture("survey abandoned",Jd("abandoned",e,o,t),{delivery:"unload"})}}}else Zl.error("[survey abandoned] event not captured, PostHog instance not found.")},ef=function(e){var t=e.map(function(e){return e.id});return t.every(function(e){return!!e})?t:void 0},tf=function(e,t){var n,r,i;return function(e){return e.questions.some(function(e){var t;return!(null==(t=e.branching)||!t.type)})}(e)?e.questions:t?null!==(n=function(e,t){if(!t||t.length!==e.questions.length)return null;for(var n,r=new Map(e.questions.map(function(e){return[e.id,e]})),i=[],o=p(t);!(n=o()).done;){var s=r.get(n.value);if(!s)return null;i.push(s)}return i}(e,t.questionOrder))&&void 0!==n?n:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?(r=e.questions,i=Jl(e.questions),r.length===i.length&&r.every(function(e,t){return e===i[t]})?i.reverse():i):e.questions},nf=function(e){return Vl(e)||ff(e)},rf=function(){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,fr(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),t.children}return e.__c="__cC"+F++,e.__={isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},onPreviewBack:function(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null},e.Provider=e.__l=(e.Consumer=function(e,t){return e.children(t)}).contextType=e,e}(),of=function(){return Bu(rf)},sf=function(e){var t=e.children,n=e.style;return function(e,t,n){var r,i,o,s,a=ir({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&null!=s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?_.call(arguments,2):n),ar(e.type,a,r||e.key,i||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:Nd(t)},style:n}:{children:t,style:n})};function af(e,t){var n,r,i;if(null==(n=e.conditions)||!n.url)return!0;var o,s=null!==(r=jd(t))&&void 0!==r?r:"u">typeof window?window.location.href:void 0;return!!s&&Ql[o=null==(i=e.conditions)?void 0:i.urlMatchType,null!=o?o:"icontains"]([e.conditions.url],[s])}var uf=function(e){return nc("inProgressSurvey_",e)},lf={},cf=function(e,t){var n=uf(e);try{localStorage.setItem(n,JSON.stringify(t)),delete lf[n]}catch(e){Zl.error("Error setting in-progress survey state in localStorage",e),lf[n]=t}},df=function(e){var t=uf(e),n=lf[t];if(n)return n;try{var r=localStorage.getItem(t);if(r)return JSON.parse(r)}catch(e){Zl.error("Error getting in-progress survey state from localStorage",e)}return null},ff=function(e){var t=df(e);return!ai(null==t?void 0:t.surveySubmissionId)},hf=function(e){var t=uf(e);delete lf[t];try{localStorage.removeItem(t)}catch(e){Zl.error("Error clearing in-progress survey state from localStorage",e)}};function pf(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function _f(e,t,n){if(void 0===t&&(t=Xu),e===rl)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ju:return{left:"30px"};case Zu:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===nl&&n===Yu?"60px":"30px"}}}var vf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),gf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),mf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),yf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),bf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Rr("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),wf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rr("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Sf=Rr("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Rr("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),kf=Rr("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Rr("g",{"clip-path":"url(#ph-survey-logo-clip)",style:"opacity: calc(1 - var(--ph-logo-mono, 0))",children:[Rr("path",{fill:"currentColor",d:"M51.66 25.22A1.9 1.9 0 0 0 50 23.33l-.34-.04c-1-.13-1.94-.6-2.65-1.33L33.28 7.75V28H49a2.66 2.66 0 0 0 2.67-2.67zM39.2 23.54h-.09a1.78 1.78 0 1 1 .1 0"}),Rr("path",{fill:"url(#ph-survey-logo-paint0)",d:"M21.96 2.67v4.96l11.3 11.6h.02V7.75L26.63.85a2.8 2.8 0 0 0-2-.85 2.67 2.67 0 0 0-2.67 2.67"}),Rr("path",{fill:"url(#ph-survey-logo-paint1)",d:"M21.96 7.63v11.05L31.03 28h2.25v-8.75z"}),Rr("path",{fill:"url(#ph-survey-logo-paint2)",d:"M21.96 28h9.07l-9.07-9.32z"}),Rr("path",{fill:"url(#ph-survey-logo-paint3)",d:"M10.74 2.66v4.5l11.22 11.52V7.63L15.3.8a2.66 2.66 0 0 0-4.56 1.86"}),Rr("path",{fill:"url(#ph-survey-logo-paint4)",d:"M10.74 28h8.96l-8.96-9.32z"}),Rr("path",{fill:"url(#ph-survey-logo-paint5)",d:"M10.74 7.16v11.52L19.7 28h2.26v-9.32z"}),Rr("path",{fill:"url(#ph-survey-logo-paint6)",d:"M10.74 7.16 4.54.8A2.66 2.66 0 0 0 0 2.66V7.5l10.74 11.18z"}),Rr("path",{fill:"url(#ph-survey-logo-paint7)",d:"M9.19 28h1.55v-9.32L0 7.5v10.73z"}),Rr("path",{fill:"url(#ph-survey-logo-paint8)",d:"M0 25.41A2.6 2.6 0 0 0 2.58 28H9.2L0 18.23z"})]}),Rr("path",{"clip-path":"url(#ph-survey-logo-clip)",fill:"currentColor",style:"opacity: var(--ph-logo-mono, 0)",d:"m50.02 23.34-.34-.04c-1-.13-1.95-.6-2.66-1.33L35.58 10.11a.5.5 0 0 0-.86.35V27.5c0 .28.22.5.5.5H49c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.66-1.9m-10.81.2a1.78 1.78 0 1 1 0-3.56 1.78 1.78 0 0 1 0 3.57M0 25.41A2.6 2.6 0 0 0 2.59 28h5.22a.5.5 0 0 0 .37-.84L.87 19.13a.5.5 0 0 0-.87.34zm18.81 1.74a.5.5 0 0 1-.36.85h-7.09a.5.5 0 0 1-.37-.17L8.94 25.5.13 15.82A.5.5 0 0 1 0 15.5V8.75a.5.5 0 0 1 .86-.34zM0 2.68C0 .28 2.92-.91 4.59.82l25.6 26.33a.5.5 0 0 1-.36.85h-7.76a.5.5 0 0 1-.37-.17l-2.1-2.33L.28 5.3A1 1 0 0 1 0 4.6zm10.74 0c0-2.4 2.92-3.59 4.59-1.87L32.5 18.48l.5.51v7.3a.5.5 0 0 1-.86.35l-1.12-1.14L11.3 5.23a2 2 0 0 1-.57-1.4zM33 7.46v7.8a.5.5 0 0 1-.85.36l-9.61-9.89a2 2 0 0 1-.57-1.4V2.69c0-2.4 2.92-3.59 4.59-1.86z"}),Rr("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),Rr("defs",{children:[Rr("linearGradient",{id:"ph-survey-logo-paint0",x1:"21.96",x2:"33.28",y1:"9.62",y2:"9.62",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ffd849"}),Rr("stop",{offset:".96","stop-color":"#fbae01"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint1",x1:"21.96",x2:"33.28",y1:"17.81",y2:"17.81",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ffb700"}),Rr("stop",{offset:"1","stop-color":"#f9aa01"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint2",x1:"21.96",x2:"31.03",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ff9500"}),Rr("stop",{offset:"1","stop-color":"#f8aa00"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint3",x1:"10.74",x2:"21.96",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ff651e"}),Rr("stop",{offset:"1","stop-color":"#e4400a"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint4",x1:"10.74",x2:"19.7",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#c42c00"}),Rr("stop",{offset:"1","stop-color":"#d63600"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint5",x1:"10.74",x2:"21.96",y1:"17.58",y2:"17.58",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#ef3c00"}),Rr("stop",{offset:"1","stop-color":"#d63601"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint6",x1:"0",x2:"10.74",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#3f80ff"}),Rr("stop",{offset:"1","stop-color":"#084fe0"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint7",x1:"0",x2:"10.74",y1:"17.75",y2:"17.75",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#0255ff"}),Rr("stop",{offset:"1","stop-color":"#0145d2"})]}),Rr("linearGradient",{id:"ph-survey-logo-paint8",x1:"0",x2:"9.19",y1:"23.11",y2:"23.11",gradientUnits:"userSpaceOnUse",children:[Rr("stop",{"stop-color":"#0041c6"}),Rr("stop",{offset:"1","stop-color":"#0045d0"})]}),Rr("clipPath",{id:"ph-survey-logo-clip",children:Rr("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})]})]});function xf(e){var t=e.urlParams,n=t?Object.entries(t).map(function(e){var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)}).join("&"):"";return Rr("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",kf]})}function Cf(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,o=e.link,s=e.onPreviewSubmit,a=e.skipSubmitButton,u=e.canGoBack,l=e.onBack,c=Bu(rf).isPreviewMode,d=!!u&&!!l,f=!a&&Rr("button",{className:"form-submit",disabled:n,type:"button",onClick:function(){var e;o&&(null==(e=window)||e.open(o)),c?null==s||s():i()},children:t});return Rr("div",{className:"bottom-section",children:[d?Rr("div",{className:"form-buttons form-buttons-with-back",children:[Rr("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:r.backButtonText||"Back"}),f]}):f,!r.whiteLabel&&Rr(xf,{urlParams:{utm_source:"survey-footer"}})]})}function Pf(e){var t=e.question,n=e.forceDisableHtml;return Rr("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Rr(t.type===il?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&sf({component:sr("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function Ef(e){var t,n,r;return Rr("button",{className:"form-cancel",onClick:e.onClick,disabled:Bu(rf).isPreviewMode,"aria-label":"Close survey",type:"button",children:(t={fill:"black"},n=(void 0===t?{}:t).fill,r=void 0===n?"currentColor":n,Rr("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Rr("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Rr("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]}))})}function Tf(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=Bu(rf).isPopup;return $u(function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),s())};return Ml(window,"keydown",e),function(){window.removeEventListener("keydown",e)}},[s]),Rr("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&Rr(Ef,{onClick:function(){return s()}}),Rr("h3",{className:"thank-you-message-header",children:t}),n&&sf({component:sr("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&Rr(Cf,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})}function Ff(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onStart,a=Bu(rf),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return Rr("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==o.hideCancelButton&&Rr(Ef,{onClick:function(){return l()}}),t&&Rr("h3",{className:"intro-screen-header",children:t}),n&&sf({component:sr("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!i&&"text"!==r}),Rr(Cf,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:s,onPreviewSubmit:function(){return u(null)}})]})}var If=function(e){return Xr(e)&&e.every(function(e){return ii(e)})};function Rf(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=e.onPreviewSubmit,s=e.displayQuestionIndex,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=of().isPreviewMode,d=qu(null),f=Du(function(){return ii(a)?a:""}),h=f[0],_=f[1],v=null==r?void 0:r.disableAutofocus;$u(function(){v||setTimeout(function(){var e;c||null==(e=d.current)||e.focus()},100)},[c,v]);var g="surveyQuestion"+s,m=Nu(function(){return function(e,t,n){var r,i,o=e.trim();if(!n&&""===o)return"This field is required";if(""===o)return!1;if(t&&t.length>0)for(var s,a=p(t);!(s=a()).done;){var u=s.value;switch(u.type){case Hr:if(void 0!==u.value&&u.value>o.length)return null!==(r=u.errorMessage)&&void 0!==r?r:"Please enter at least "+u.value+" characters";break;case zr:if(void 0!==u.value&&o.length>u.value)return null!==(i=u.errorMessage)&&void 0!==i?i:"Please enter no more than "+u.value+" characters"}}return!1}(h,t.validation,t.optional)},[h,t.validation,t.optional]),y=hu(t.validation,Hr),b=hu(t.validation,zr),w=Nu(function(){return function(e,t){var n=1===e?void 0:e;return n&&t?"Enter "+n+"-"+t+" characters":n?"Enter at least "+n+" "+(1===n?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(y,b)},[y,b]),S=function(){m||i(h.trim())},k=function(){m||o(h.trim())};return Rr(ur,{children:[Rr("div",{className:"question-container",children:[Rr(Pf,{question:t,forceDisableHtml:n,htmlFor:g}),Rr("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput:function(e){_(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||m||(e.preventDefault(),c?k():S())},value:h}),w&&Rr("div",{className:"validation-hint",children:w})]}),Rr(Cf,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:S,onPreviewSubmit:k,canGoBack:u,onBack:l})]})}function Af(e){var t=e.question,n=e.appearance,r=e.onSubmit,i=e.onPreviewSubmit,o=e.canGoBack,s=e.onBack;return Rr(ur,{children:[Rr("div",{className:"question-container",children:Rr(Pf,{question:t,forceDisableHtml:e.forceDisableHtml})}),Rr(Cf,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:function(){return r("link clicked")},onPreviewSubmit:function(){return i("link clicked")},canGoBack:o,onBack:s})]})}function Mf(e){var t,n=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,o=e.appearance,s=e.onSubmit,a=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,c=e.onBack,d=n.scale,f=10===n.scale?0:1,h=Du(function(){return ui(u)?u:Xr(u)&&u.length>0&&ui(parseInt(u[0]))?parseInt(u[0]):ii(u)&&ui(parseInt(u))?parseInt(u):null}),p=h[0],_=h[1],v="emoji"===n.display&&2===n.scale,g=of().isPreviewMode,m=function(e){return g?a(e):s(e)};return Rr(ur,{children:[Rr("div",{className:"question-container",children:[Rr(Pf,{question:n,forceDisableHtml:r}),Rr("div",{className:"rating-section",children:[Rr("div",{className:"rating-options",children:["emoji"===n.display&&Rr("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Nf[n.scale])?void 0:t.map(function(e,t){return Rr("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-rating-"+t+" "+(t+1===p?"rating-active":""),value:t+1,type:"button",onClick:function(){var e=t+1;_(e),n.skipSubmitButton&&m(e)},children:e},t)})}),"number"===n.display&&Rr("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-f+1)+", minmax(0, 1fr))"},children:Bf(n.scale).map(function(e,t){return Rr(Of,{displayQuestionIndex:i,active:p===e,appearance:o,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)})})]}),!v&&Rr("div",{className:"rating-text",children:[Rr("div",{children:n.lowerBoundLabel}),Rr("div",{children:n.upperBoundLabel})]})]})]}),Rr(Cf,{text:n.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:si(p)&&!n.optional,appearance:o,onSubmit:function(){return s(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function Of(e){var t=e.num,n=e.setActiveNumber;return Rr("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick:function(){n(t)},children:t})}function Lf(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=qu(null),f=Nu(function(){return function(e){var t;if(!e.shuffleOptions)return e.choices;var n,r,i=[].concat(e.choices),o=e.hasOpenChoice&&null!==(t=i.pop())&&void 0!==t?t:null,s=(n=i,(r=Jl(i)).length>1&&n.every(function(e,t){return e===r[t]})?r.reverse():r);return si(o)||s.push(o),s}(t)},[t]),h=Du(function(){return function(e,t){return ii(e)||If(e)?e:t===sl?null:[]}(a,t.type)}),p=h[0],_=h[1],v=Du(function(){return function(e,t){if(ii(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(If(e)){var n=e.find(function(e){return!t.includes(e)});if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}}(a,f)}),g=v[0],m=v[1],y=of().isPreviewMode,b=t.type===sl,w=t.type===ol,S=t.skipSubmitButton&&b&&!t.hasOpenChoice,k=function(e,t){if(t){var n=!g.isSelected;return m(function(e){return d({},e,{isSelected:n,inputValue:n?e.inputValue:""})}),b&&_(""),void(n&&setTimeout(function(){var e;return null==(e=c.current)?void 0:e.focus()},75))}if(b)return _(e),m(function(e){return d({},e,{isSelected:!1,inputValue:""})}),void(S&&(o(e),y&&s(e)));w&&Xr(p)&&(p.includes(e)?_(p.filter(function(t){return t!==e})):_([].concat(p,[e])))},x=function(e){e.stopPropagation();var t=e.currentTarget.value;m(function(e){return d({},e,{inputValue:t})}),b&&_(t)},C=function(e){e.stopPropagation(),"Enter"!==e.key||P()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),m(function(e){return d({},e,{isSelected:!1,inputValue:""})}),b&&_(null))},P=function(){return!(t.optional||!si(p)&&(!Xr(p)||g.isSelected||0!==p.length)&&(!g.isSelected||""!==g.inputValue.trim()))},E=function(){g.isSelected&&w?Xr(p)&&(y?s([].concat(p,[g.inputValue])):o([].concat(p,[g.inputValue]))):y?s(p):o(p)};return Rr(ur,{children:[Rr("div",{className:"question-container",children:[Rr(Pf,{question:t,forceDisableHtml:n}),Rr("fieldset",{className:"multiple-choice-options limit-height",children:[Rr("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),f.map(function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,o="surveyQuestion"+r+"Choice"+n,s=o+"Open",a=i?g.isSelected:b?p===e:Xr(p)&&p.includes(e);return Rr("label",{className:i?"choice-option-open":"",children:[Rr("div",{className:"response-choice",children:[Rr("input",{type:b?"radio":"checkbox",name:o,checked:a,onChange:function(){return k(e,i)},id:o,"aria-controls":s}),Rr("span",{children:i?e+":":e})]}),i&&Rr("input",{type:"text",ref:c,id:s,name:"question"+r+"Open",value:g.inputValue,onKeyDown:C,onInput:x,onClick:function(t){g.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)})]})]}),Rr(Cf,{text:t.buttonText||"Submit",submitDisabled:P(),appearance:i,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:S,canGoBack:u,onBack:l})]})}var Df=[1,2,3,4,5],$f=[1,2,3,4,5,6,7],qf=[0,1,2,3,4,5,6,7,8,9,10],Nf={2:[wf,Sf],3:[mf,gf,vf],5:[yf,mf,gf,vf,bf]};function Bf(e){switch(e){case 5:default:return Df;case 7:return $f;case 10:return qf}}var jf=kl("[Surveys]");function Hf(e,t,n){var r,i=e.questions[t],o=t+1;if(null==(r=i.branching)||!r.type)return t===e.questions.length-1?ul:o;if(i.branching.type===ul)return ul;if("specific_question"===i.branching.type){if(Number.isInteger(i.branching.index))return i.branching.index}else if("response_based"===i.branching.type){if(i.type===sl){var s,a=i.choices.indexOf(""+n);if(-1===a&&i.hasOpenChoice&&(a=i.choices.length-1),null!=(s=i.branching)&&null!=(s=s.responseValues)&&s.hasOwnProperty(a)){var u=i.branching.responseValues[a];if(Number.isInteger(u))return u;if(u===ul)return ul}}else if(i.type===al){var l;if(i.optional&&ai(n))return o===e.questions.length?ul:o;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];if(Number.isInteger(d))return d;if(d===ul)return ul}}return o}return jf.warn("Falling back to next question index due to unexpected branching type"),o}var zf="$early_access_features",Uf="$active_feature_flags",Wf="$feature_flag_details",Vf="$feature_flag_errors",Gf="$feature_flag_evaluated_at",Kf="$feature_flag_request_id",Qf="$minimal_flag_called_events",Yf="$enabled_feature_flags",Jf="$stored_group_properties",Zf="$stored_person_properties",Xf="$flag_call_reported",eh="$flag_call_reported_session_id",th="$feature_flag_payloads",nh="$override_feature_flags",rh="$override_feature_flag_payloads",ih="visibilitychange",oh="$autocapture_disabled_server_side",sh=kl("[SurveyTranslations]");function ah(e,t){var n=function(e){var t;return function(e,t){var n=e.storedPersonProperties,r=e.locale,i=Bl(e.overrideLanguage);if(i)return null==t||t.info("Using override display language: "+i),i;var o=function(e){return e&&"object"==typeof e&&"language"in e?Bl(e.language):null}(n);if(o)return null==t||t.info("Using person property language: "+o),o;var s=Bl(r);return s?(null==t||t.info("Using detected locale: "+s),s):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.overrideLanguage,storedPersonProperties:null==(t=e.client)?void 0:t.kv.get(Zf),locale:"u">typeof navigator?navigator.language||navigator.userLanguage:void 0},sh)}(t);if(!n)return sh.info("No user language detected"),{survey:e,language:null};var r=Ul(e,n,sh);return{survey:r.survey,language:r.matchedKey}}var uh="ph:show_survey_widget",lh="PHWidgetSurveyClickListener";function ch(e,t){try{var n=e.getBoundingClientRect(),r=window.innerHeight,i=window.innerWidth,o=n.left+n.width/2-t/2;o+t>i-20&&(o=i-t-20),20>o&&(o=20);var s=r-n.bottom,a=250>s&&n.top>s;return{position:"fixed",top:a?"auto":n.bottom+12+"px",left:o+"px",right:"auto",bottom:a?r-n.top+12+"px":"auto",zIndex:Ud.zIndex}}catch(e){return Zl.warn("Failed to calculate trigger position:",e),null}}var dh=function(){"use strict";function e(e){var t,n,r=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTabWidgets=new Map,this._renderedTargets=new Map,this._prefillHandledSurveys=new Set,this._disposed=!1,this._currentLanguage=null,this._surveyIsRendered=!1,this._languageChangeListener=null,this._unsubscribeFeatureFlags=null,this._surveyPopupProps=null,this._loggedFeatureFlagsDisabledWarning=!1,this.handlePageUnload=function(){var e,t=null==(e=r._host.client)?void 0:e.kv.get(Ar);if(t)for(var n,i=p(t);!(n=i()).done;){var o=n.value;ff(o)&&Xd(o,r._host)}},this.handlePopoverSurvey=function(e,t,n){var i,o,s,a,u,l,c=(void 0===n?{}:n).resumeDelayFromActivation,f=void 0!==c&&c;if(null!=(i=r._host.client)&&i.canCapture){var h=r._translateSurveyForRendering(e),p=h.survey,_=h.language;r._currentLanguage=_,r._surveyPopupProps=null,r._displayOptions=t;var v=r._applyDisplayOverrides(p,t);r._clearSurveyTimeout(v.id);var g=null!=t?t:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&r._handleInitialResponses(v,y,m,_);if(!b||null!=(o=v.appearance)&&o.displayThankYouMessage){r._addSurveyToFocus(v);var w={};if((null==(s=v.appearance)?void 0:s.position)===el&&null!=(a=v.appearance)&&a.widgetSelector){var S,k=document.querySelector(v.appearance.widgetSelector);k&&(w=ch(k,parseInt((null==(S=v.appearance)?void 0:S.maxWidth)||Ud.maxWidth))||{})}var x=(null==(u=v.appearance)?void 0:u.surveyPopupDelaySeconds)||0,C=Kd(v,r._host).shadow;r._renderedTargets.set(C,C.host);var P={posthog:r._host,survey:v,removeSurveyFromFocus:r._removeSurveyFromFocus,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:_};if(r._surveyPopupProps=P,0>=x)return r._surveyIsRendered=!0,Fr(Rr(_h,d({},P)),C);var E=function(){var n;if(null==(n=r._host.client)||!n.canCapture||!r._shouldDisplaySurvey(v))return Zl.info("Survey "+v.id+" no longer eligible when its display delay elapsed; not displaying"),r._removeSurveyFromFocus(v);!function(){r._surveyIsRendered=!0;var n=r._translateSurveyForRendering(e),i=n.survey,o=n.language;r._currentLanguage=o;var s=r._applyDisplayOverrides(i,t),a=d({},P,{survey:s,surveyLanguage:o});r._surveyPopupProps=a,Fr(Rr(_h,d({},a,{survey:d({},s,{appearance:d({},s.appearance,{surveyPopupDelaySeconds:0})})})),C)}()},T=f?null==(l=r._host.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(v.id):void 0,F=ui(T)?Math.max(0,Date.now()-T):0,I=Math.max(0,1e3*x-F);if(0>=I)return E();var R=window.setTimeout(function(){r._surveyTimeouts.delete(v.id),E()},I);r._surveyTimeouts.set(v.id,R)}}},this._handleWidget=function(e){var t,n=r._translateSurveyForRendering(e),i=n.survey,o=n.language,s=Kd(i,r._host),a=s.shadow,u=s.isNewlyCreated;r._renderedTargets.set(a,a.host),(null==(t=e.appearance)?void 0:t.widgetType)===Yu&&r._renderedTabWidgets.set(e.id,e),u&&Fr(Rr(gh,{posthog:r._host,survey:i,surveyLanguage:o},e.id),a)},this._detachWidgetSelectorListener=function(e){var t=r._widgetSelectorListeners.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(lh),r._widgetSelectorListeners.delete(e),Zl.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){r._isWidgetSurveyOpen(e)||(r._removeSurveyFromDom(e),r._detachWidgetSelectorListener(e.id))},this._removeTabWidget=function(e){r._isWidgetSurveyOpen(e)||(r._removeSurveyFromDom(e),r._renderedTabWidgets.delete(e.id))},this._isWidgetSurveyOpen=function(e){try{var t;return!(null==(t=document.querySelector(pf(e,!0)))||null==(t=t.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,t){var n=document.querySelector(t),i=r._widgetSelectorListeners.get(e.id);if(n){if(r._handleWidget(e),i){if(n===i.element)return;Zl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),r._detachWidgetSelectorListener(e.id)}if(!n.hasAttribute(lh)){var o=function(t){var n,r;t.stopPropagation();var i=(null==(n=e.appearance)?void 0:n.position)===el?ch(t.currentTarget,parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||Ud.maxWidth)):{};window.dispatchEvent(new CustomEvent(uh,{detail:{surveyId:e.id,position:i}}))};Ml(n,"click",o),n.setAttribute(lh,"true"),r._widgetSelectorListeners.set(e.id,{element:n,listener:o,survey:e}),Zl.info("Attached click listener for feedback button survey "+e.id)}}else i&&r._removeWidgetSelectorListener(e)},this.renderPopover=function(e){var t;if(null!=(t=r._host.client)&&t.canCapture){var n=r._translateSurveyForRendering(e),i=n.survey,o=n.language,s=Kd(i,r._host).shadow;r._renderedTargets.set(s,s.host),Fr(Rr(_h,{posthog:r._host,survey:i,removeSurveyFromFocus:r._removeSurveyFromFocus,surveyLanguage:o}),s)}},this.renderSurvey=function(e,t,n){var i;if(null!=(i=r._host.client)&&i.canCapture){var o=r._translateSurveyForRendering(e),s=o.survey,a=o.language,u=!1;r._host.config.prefillFromUrl&&(u=r._handleUrlPrefill(s,a,n)),Fr(Rr(_h,{posthog:r._host,survey:s,removeSurveyFromFocus:r._removeSurveyFromFocus,isPopup:!1,properties:n,isSurveyCompleted:u,surveyLanguage:a}),t)}},this.getActiveMatchingSurveys=function(e,t){var n;void 0===t&&(t=!1),null==(n=r._host.surveys)||n.getSurveys(function(t){e(t.filter(function(e){return r._shouldDisplaySurvey(e)}))},t)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),r.getActiveMatchingSurveys(function(e){for(var t,n=null==(t=r._host.client)?void 0:t.canCapture,i=e.filter(function(e){return n&&(e.type===tl||e.type===nl)}),o=new Set(i.map(function(e){return e.id})),s=0,a=Array.from(r._surveyTimeouts.keys());a.length>s;s++){var u=a[s];o.has(u)||r.cancelSurvey(u)}var l=r._sortSurveysByAppearanceDelay(i),c=new Set,d=new Set;l.forEach(function(e){if(e.type===nl){var t,n,i,o;if((null==(t=e.appearance)?void 0:t.widgetType)===Yu)return d.add(e.id),void r._handleWidget(e);"selector"===(null==(n=e.appearance)?void 0:n.widgetType)&&null!=(i=e.appearance)&&i.widgetSelector&&(c.add(e.id),r._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector))}si(r._surveyInFocus)&&e.type===tl&&r.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),r._widgetSelectorListeners.forEach(function(e){var t=e.survey;c.has(t.id)||r._removeWidgetSelectorListener(t)}),r._renderedTabWidgets.forEach(function(e,t){d.has(t)||r._removeTabWidget(e)})},e)},this._addSurveyToFocus=function(e){si(r._surveyInFocus)||Zl.error("Survey "+r._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),r._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){r._surveyInFocus!==e.id&&Zl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),r._clearSurveyTimeout(e.id),r._surveyInFocus=null,r._currentLanguage=null,r._surveyIsRendered=!1,r._surveyPopupProps=null,r._displayOptions=void 0,r._removeSurveyFromDom(e)},this._host=e,this._surveyInFocus=null,this._languageChangeListener=function(){return r._onLanguageChange()},Ml(window,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=null!==(t=null==(n=e.client)||null==(n=n.getExtension("featureFlagsCommon"))?void 0:n.onFeatureFlags(function(){return r._onLanguageChange()}))&&void 0!==t?t:null}var t=e.prototype;return t._onLanguageChange=function(){var e,t=this;if(!si(this._surveyInFocus)){var n=null==(e=this._host.client)||null==(e=e.kv.get(Ar))?void 0:e.find(function(e){return e.id===t._surveyInFocus});if(n){var r=this._translateSurveyForRendering(n),i=r.survey,o=r.language;if(o!==this._currentLanguage&&(this._currentLanguage=o,this._surveyIsRendered)){var s=this._applyDisplayOverrides(i,this._displayOptions),a=Kd(s,this._host).shadow;Fr(Rr(_h,d({},this._surveyPopupProps,{posthog:this._host,survey:s,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:o})),a)}}}},t._applyDisplayOverrides=function(e,t){return null!=t&&t.position||null!=t&&t.selector?d({},e,{appearance:d({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e},t._clearSurveyTimeout=function(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))},t.cancelSurvey=function(e){this._surveyTimeouts.has(e)&&(Zl.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null,this._currentLanguage=null,this._surveyIsRendered=!1,this._surveyPopupProps=null,this._displayOptions=void 0))},t.startAutomaticDisplay=function(){if(!this._disposed&&!this._automaticDisplayDispose&&!1!==this._host.config.automaticDisplay){this._automaticDisplayDispose=function(){};var e=function(e){var t;e.callSurveysAndEvaluateDisplayLogic(!0);var n=function(){ri(t)&&(t=setInterval(function(){e.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},r=function(){ri(t)||(clearInterval(t),t=void 0)};n();var i=function(){document.hidden?r():(e.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ml(document,"visibilitychange",i),function(){r(),document.removeEventListener("visibilitychange",i)}}(this);this._disposed?e():this._automaticDisplayDispose=e}},t.clearInMemoryInProgressSurveyState=function(){!function(){for(var e=0,t=Object.keys(lf);t.length>e;e++)delete lf[t[e]]}()},t.dispose=function(){var e,t=this;this._disposed=!0,null==(e=this._automaticDisplayDispose)||e.call(this),this._automaticDisplayDispose=void 0,this._languageChangeListener&&(window.removeEventListener("languagechange",this._languageChangeListener),this._languageChangeListener=null),this._unsubscribeFeatureFlags&&(this._unsubscribeFeatureFlags(),this._unsubscribeFeatureFlags=null),this._surveyTimeouts.forEach(function(e,n){return t._clearSurveyTimeout(n)}),this._widgetSelectorListeners.forEach(function(e,n){return t._detachWidgetSelectorListener(n)}),this._renderedTargets.forEach(function(e,t){Fr(null,t),null==e||e.remove()}),this._renderedTargets.clear(),this._renderedTabWidgets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort(function(e,t){var n,r,i=ff(e),o=ff(t);if(i&&!o)return-1;if(!i&&o)return 1;var s=e.schedule===ll,a=t.schedule===ll;return s&&!a?1:!s&&a?-1:((null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0)-((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})},t._translateSurveyForRendering=function(e){return ah(e,this._host)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(){var e={},t=!1,n=window.location.search.replace(/^\?/,"");if(!n)return{params:e,autoSubmit:t};for(var r,i=p(n.split("&"));!(r=i()).done;){var o=r.value,s=o.indexOf("=");if(s>0){var a=void 0,u=void 0;try{a=decodeURIComponent(o.slice(0,s)),u=decodeURIComponent(o.slice(s+1))}catch(e){continue}if("auto_submit"!==a||"true"!==u){var l=a.match(/^q(\d+)$/);if(l){var c=parseInt(l[1],10);e[c]||(e[c]=[]),e[c].push(u)}}else t=!0}}return{params:e,autoSubmit:t}}().params;if(0===Object.keys(r).length)return!1;Zl.info("[Survey Prefill] Detected URL prefill parameters");var i=this._processPrefillData(e,r,t);return!!i&&(this._autoSubmitPrefilledResponses(e,i,n,t),this._prefillHandledSurveys.add(e.id),i.isSurveyCompleted)},t._autoSubmitPrefilledResponses=function(e,t,n,r){var i=t.responses,o=t.submissionId,s=t.isSurveyCompleted,a=t.skippedResponses;(Object.keys(a).length>0&&e.enable_partial_responses||s)&&Yd({responses:s?i:a,survey:e,surveySubmissionId:o,posthog:this._host,isSurveyCompleted:s,properties:n,surveyLanguage:r})},t._handleInitialResponses=function(e,t,n,r){for(var i={},o=0,s=Object.entries(t);s.length>o;o++){var a=s[o],u=a[1];i[parseInt(a[0])]=Xr(u)?u.map(String):[String(u)]}Zl.info("[Survey] Processing initial responses");var l=this._processPrefillData(e,i,r);return!!l&&(this._autoSubmitPrefilledResponses(e,l,n,r),l.isSurveyCompleted)},t._processPrefillData=function(e,t,n){try{var r=function(e,t){var n={};return e.questions.forEach(function(e,r){if(t[r]&&e.id){var i=t[r],o=Ll(e.id);try{switch(e.type){case sl:if(!e.choices||0===e.choices.length)return void Sl.warn("[Survey Prefill] Question "+r+" has no choices");var s=parseInt(i[0],10);if(isNaN(s)||0>s||s>=e.choices.length)return void Sl.warn("[Survey Prefill] Invalid choice index for q"+r+": "+i[0]);n[o]=e.choices[s];break;case ol:if(!e.choices||0===e.choices.length)return void Sl.warn("[Survey Prefill] Question "+r+" has no choices");var a=i.map(function(e){return parseInt(e,10)}).filter(function(t){return!isNaN(t)&&t>=0&&e.choices.length>t});if(0===a.length)return void Sl.warn("[Survey Prefill] No valid choices for q"+r);var u=[].concat(new Set(a.map(function(t){return e.choices[t]})));a.length>u.length&&Sl.warn("[Survey Prefill] Removed duplicate choices for q"+r),n[o]=u;break;case al:var l=parseInt(i[0],10),c=e.scale||10,d=10===c?0:1;if(isNaN(l)||d>l||l>c)return void Sl.warn("[Survey Prefill] Invalid rating for q"+r+": "+i[0]+" (scale: "+d+"-"+c+")");n[o]=l;break;default:Sl.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Sl.error("[Survey Prefill] Error converting q"+r+":",e)}}}),n}(e,t);if(0===Object.keys(r).length)return Zl.warn("[Survey Prefill] No valid responses after conversion"),null;var i=xu(),o=function(e,t,n){for(var r=0,i={},o=[],s=e.questions.length+1,a=0;e.questions.length>r&&s>a&&(a++,t.includes(r));){var u=e.questions[r];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=Ll(u.id);ri(n[l])||(i[l]=n[l])}o.push(r);var c=Hf(e,r,u.id?n[Ll(u.id)]:null);if(c===ul)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:o};r=c}return{startQuestionIndex:r,skippedResponses:i,skippedIndices:o}}(e,Object.keys(t).map(function(e){return parseInt(e,10)}).filter(function(t){var n=e.questions[t];return(null==n?void 0:n.id)&&!ri(r[Ll(n.id)])}),r),s=o.startQuestionIndex,a=o.skippedResponses,u=o.skippedIndices,l=s>=e.questions.length;return cf(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:s,questionOrder:ef(e.questions),visitedIndices:u,surveyLanguage:n}),Zl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:l,skippedResponses:a}}catch(e){return Zl.error("[Survey Prefill] Error handling prefill:",e),null}},t._isSurveyFeatureFlagEnabled=function(e,t){var n;if(!e)return!0;var r=null==(n=this._host.client)?void 0:n.getExtension(qr),i=!(null==r||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),o=!0;t&&(o=(null==r?void 0:r.getFeatureFlag(e,{send_event:!1}))===t||"any"===t);var s=i&&o;return s||this._warnIfFeatureFlagsDisabled(e),s},t._warnIfFeatureFlagsDisabled=function(e){this._loggedFeatureFlagsDisabledWarning||!1!==this._host.config.featureFlagEvaluation||(this._loggedFeatureFlagsDisabledWarning=!0,Zl.warn('Survey feature flag "'+e+'" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.'))},t._isSurveyConditionMatched=function(e){return!e.conditions||af(e,this._host)&&function(e){var t,n;return function(e,t){var n,r,i,o;if(!e||0===e.length)return!0;var s="u">typeof window?window:void 0,a=null==(n="u">typeof globalThis?globalThis:s)?void 0:n.navigator,u=null==a?void 0:a.userAgent;if(!u)return!1;var l=Po(u,{userAgentDataPlatform:null==a||null==(r=a.userAgentData)?void 0:r.platform,maxTouchPoints:null==a?void 0:a.maxTouchPoints,screenWidth:null==s||null==(i=s.screen)?void 0:i.width,screenHeight:null==s||null==(o=s.screen)?void 0:o.height,devicePixelRatio:null==s?void 0:s.devicePixelRatio});return Ql[null!=t?t:"icontains"](e,[l])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(e){var t,n;return null==(t=e.conditions)||!t.selector||!(null==(n=document)||!n.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return nf(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._host.client)&&null!=(t=t.getExtension("featureFlagsCommon"))&&t.hasLoadedFlags?{satisfied:this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)}:(this._warnIfFeatureFlagsDisabled(e.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"})},t.checkSurveyEligibility=function(e){var t,n,r={eligible:!0,reason:void 0};if(!ec(e))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+e.end_date,r;if(!oc.includes(e.type))return r.eligible=!1,r.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",r;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this._isSurveyFeatureFlagEnabled(e.linked_flag_key,i))return r.eligible=!1,r.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",r;if(!this._isSurveyFeatureFlagEnabled(e.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var o,s=this._internalFlagCheckSatisfied(e);return s.satisfied?function(e){var t=null;try{t=localStorage.getItem("lastSeenSurveyDate")}catch(e){Zl.error("localStorage error: "+e)}return function(e,t){if(!e||!t)return!0;var n="string"==typeof t?new Date(t):t,r=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(r/864e5)>e}(e,t)}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays)?(function(e){var t=null;try{t=localStorage.getItem(rc(e))}catch(e){Zl.error("localStorage error: "+e)}return!!t&&!nf(e)}(e)&&(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again"),r):(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(o=s.reason)&&void 0!==o?o:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)},t.checkSurveyCaptureEligibility=function(){var e;return null!=(e=this._host.client)&&e.canCapture?{eligible:!0}:{eligible:!1,reason:Xl}},t.checkSurveyDisplayEligibility=function(e){var t=this.checkSurveyCaptureEligibility();return t.eligible?this.checkSurveyEligibility(e):t},t.checkSurveyRenderability=function(e){var t=this.checkSurveyDisplayEligibility(e);return t.eligible&&!this._hasActionOrEventTriggeredSurvey(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t},t._hasActionOrEventTriggeredSurvey=function(e){var t;return!Wl(e)&&!tc(e)||!(null==(t=this._host.surveys)||null==(t=t._surveyEventReceiver)||null==(t=t.getSurveys())||!t.includes(e.id))},t._checkFlags=function(e){var t,n=this;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every(function(e){var t=e.value;return!e.key||!t||n._isSurveyFeatureFlagEnabled(t)})},t._shouldDisplaySurvey=function(e){return this.checkSurveyEligibility(e).eligible&&this._isSurveyConditionMatched(e)&&this._hasActionOrEventTriggeredSurvey(e)&&this._checkFlags(e)},t._removeSurveyFromDom=function(e){try{var t=document.querySelector(pf(e,!0));null!=t&&t.shadowRoot&&(Fr(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Zl.warn("Failed to remove survey "+e.id+" from DOM:",t)}},t.getTestAPI=function(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay.bind(this),checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this),onLanguageChange:this._onLanguageChange.bind(this),currentLanguage:this._currentLanguage,surveyIsRendered:this._surveyIsRendered}},e}();function fh(e){var t=e.survey,n=e.removeSurveyFromFocus,r=void 0===n?function(){}:n,i=e.setSurveyVisible,o=e.isPreviewMode,s=void 0!==o&&o,a=e.posthog;$u(function(){var e;if(!s&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===nl,o=af(t,a),s=(null==(e=t.appearance)?void 0:e.widgetType)===Yu&&n;if(!o)return Zl.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(Zl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};Ml(window,"popstate",n),Ml(window,"hashchange",n);var o=window.history.pushState,u=window.history.replaceState;return window.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),n()},window.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];u.apply(this,t),n()},function(){window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),window.history.pushState=o,window.history.replaceState=u}}},[s,t,r,i,a])}var hh=200;function ph(e){switch(void 0===e&&(e="right"),e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function _h(e){var t,n,r,i,o,s,a,u,l,c,f,h,p=e.survey,_=e.forceDisableHtml,v=e.posthog,g=e.style,m=void 0===g?{}:g,y=e.previewPageIndex,b=e.removeSurveyFromFocus,w=void 0===b?function(){}:b,S=e.isPopup,k=void 0===S||S,x=e.onPreviewSubmit,C=void 0===x?function(){}:x,P=e.onPreviewBack,E=void 0===P?function(){}:P,T=e.onPopupSurveyDismissed,F=void 0===T?function(){}:T,I=e.onCloseConfirmationMessage,R=void 0===I?function(){}:I,A=e.properties,M=e.isSurveyCompleted,O=e.skipShownEvent,L=e.surveyLanguage,D=qu(null),q=Number.isInteger(y),N=function(e,t,n,r,i,o,s,a,u){var l=Du(r||0===n||e.type===rl),c=l[0],f=l[1],h=Du(!1),p=h[0],_=h[1],v=qu(!1),g=function(){var t=function(){o&&i(e),f(!1)};if(!v.current){var n=null==s?void 0:s.current;n?(v.current=!0,n.style.transition="opacity "+hh+"ms ease-out",n.style.opacity="0",setTimeout(function(){v.current=!1,t()},250)):t()}},m=function(t){t.detail.surveyId===e.id&&g()};return $u(function(){if(t){if(!r){var i,o=function(t){var n,r;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return g();_(!0),null!=(r=e.appearance)&&r.autoDisappear&&(i&&clearTimeout(i),i=setTimeout(g,5e3))}},s=function(){var n,r,i;if(af(e,t)){f(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}window.dispatchEvent(new Event("PHSurveyShown")),a||null==(n=t.client)||n.capture(cl,d(((r={})[pl]=e.name,r[hl]=e.id,r[_l]=e.current_iteration,r[vl]=e.current_iteration_start_date,r),u&&((i={})[gl]=u,i),{sessionRecordingUrl:Nr(t)}))}};Ml(window,"PHSurveyClosed",m),Ml(window,"PHSurveySent",o);var l=n>0?setTimeout(s,n):void 0;return ri(l)&&s(),function(){ri(l)||clearTimeout(l),ri(i)||clearTimeout(i),window.removeEventListener("PHSurveyClosed",m),window.removeEventListener("PHSurveySent",o)}}}else Zl.error("usePopupVisibility hook called without a PostHog instance.")},[]),fh({survey:e,removeSurveyFromFocus:i,setSurveyVisible:f,isPreviewMode:r,posthog:t}),{isPopupVisible:c,isSurveySent:p,setIsPopupVisible:f,hidePopupWithAnimation:g}}(p,v,null!=(t=p.appearance)&&t.surveyPopupDelaySeconds?1e3*p.appearance.surveyPopupDelaySeconds:0,q,w,k,D,O,L),B=N.isPopupVisible,j=N.hidePopupWithAnimation,H=N.isSurveySent||y===p.questions.length||!0===M,z=Du(!1),U=z[0],W=z[1],V=Nu(function(){return!!df(p)},[p]),G=!!(null!=(n=p.appearance)&&n.introScreenHeader||null!=(r=p.appearance)&&r.introScreenDescription),K=q?-1===y:!(null==(i=p.appearance)||!i.displayIntroScreen)&&G&&!U&&!V,Q=Nu(function(){var e,t=(null==(e=df(p))?void 0:e.surveySubmissionId)||xu()||"";return{isPreviewMode:q,previewPageIndex:y,onPopupSurveyDismissed:function(){L?Zd(p,v,q,L):Zd(p,v,q),F()},isPopup:k||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:E,posthog:v,properties:A,surveyLanguage:L}},[q,y,k,v,p,F,C,E,A,L]);return B?Rr(rf.Provider,{value:Q,children:Rr("div",{className:"ph-survey",style:d({},_f(p.type,null==(o=p.appearance)?void 0:o.position,null==(s=p.appearance)?void 0:s.widgetType),m),ref:D,children:H?Rr(Tf,{header:(null==(a=p.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(u=p.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!_,contentType:null==(l=p.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:p.appearance||Ud,onClose:function(){j(),R()}}):K?Rr(Ff,{header:(null==(c=p.appearance)?void 0:c.introScreenHeader)||"",description:(null==(f=p.appearance)?void 0:f.introScreenDescription)||"",forceDisableHtml:!!_,contentType:null==(h=p.appearance)?void 0:h.introScreenDescriptionContentType,appearance:p.appearance||Ud,onStart:function(){return W(!0)}}):Rr(vh,{survey:p,forceDisableHtml:!!_,posthog:v})})}):null}function vh(e){var t,n,r=e.survey,i=e.forceDisableHtml,o=e.posthog,s=Nu(function(){var e=df(r);if(!e)return null;var t=ui(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&r.questions.length>e.lastQuestionIndex?e:(hf(r),null)},[r]),a=Du(function(){return null!=s&&s.responses&&Zl.info("Survey is already in progress, filling in initial responses"),(null==s?void 0:s.responses)||{}}),u=a[0],l=a[1],c=Du(!1),f=c[0],h=c[1],p=Bu(rf),_=p.previewPageIndex,v=p.onPopupSurveyDismissed,g=p.isPopup,m=p.onPreviewSubmit,y=p.onPreviewBack,b=p.surveySubmissionId,w=p.isPreviewMode,S=p.properties,k=p.surveyLanguage,x=Du(function(){var e=null==s?void 0:s.lastQuestionIndex,t=ui(e)&&e>=0&&r.questions.length>e?e:0;return ui(_)&&_>=0?_:t}),C=x[0],P=x[1],E=Du(function(){var e;return(null!==(e=null==s?void 0:s.visitedIndices)&&void 0!==e?e:[]).filter(function(e){return e>=0&&r.questions.length>e})}),T=E[0],F=E[1],I=Du(function(){var e,t;return null!==(e=null==(t=df(r))?void 0:t.questionSnapshots)&&void 0!==e?e:{}}),R=I[0],A=I[1],M=Nu(function(){return ef(tf(r,s))},[r.id,s]),O=Nu(function(){if(!M||new Set(M).size!==M.length)return tf(r,s);var e=new Map(r.questions.map(function(e){return[e.id,e]})),t=M.map(function(t){return e.get(t)}).filter(function(e){return!!e});return t.length===M.length?t:r.questions},[M,r.questions,r,s]);$u(function(){!w||ri(_)||0>_||P(_)},[_,w]);var L=!(null==(t=r.appearance)||!t.allowGoBack)&&(w?(null!=_?_:0)>0:T.length>0),D=O.at(C);return D?Rr("form",{className:"survey-form",name:"surveyForm",children:[g&&!0!==(null==(n=r.appearance)?void 0:n.hideCancelButton)&&Rr(Ef,{onClick:function(){v()}}),Rr("div",{className:"survey-box","data-question-index":C,children:[f&&Rr("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),mh({question:D,forceDisableHtml:i,displayQuestionIndex:C,appearance:r.appearance||Ud,onSubmit:function(e){return function(e){var t,n=e.res,i=e.displayQuestionIndex,s=e.questionId;if(o)if(null!=(t=o.client)&&t.canCapture)if(h(!1),s){var a=function(e,t,n,r){var i,o,s=e.questionSnapshots,a=void 0===s?{}:s;return{responses:d({},e.responses,(i={},i[Ll(t)]=n,i)),questionSnapshots:null!=r&&r.id?d({},a,(o={},o[r.id]=r.question,o)):a}}({responses:u,questionSnapshots:R},s,n,O[i]),c=a.responses,f=a.questionSnapshots;l(c),A(f);var p=Hf(r,i,n),_=p===ul,v=[].concat(T,[i]);if(_||(F(v),P(p),cf(r,{surveySubmissionId:b,responses:c,lastQuestionIndex:p,questionOrder:ef(O),visitedIndices:v,surveyLanguage:k,questionSnapshots:f})),r.enable_partial_responses||_){var g=new Set(v.map(function(e){var t;return null==(t=O[e])?void 0:t.id}).filter(function(e){return!!e}).map(function(e){return Ll(e)}));Yd({responses:Object.fromEntries(Object.entries(c).filter(function(e){return g.has(e[0])})),survey:r,surveySubmissionId:b,isSurveyCompleted:_,posthog:o,properties:S,surveyLanguage:k,questionSnapshots:f})}}else Zl.error("onNextButtonClick called without a questionId.");else h(!0);else Zl.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:C,questionId:D.id})},onPreviewSubmit:m,initialValue:D.id?u[Ll(D.id)]:void 0,canGoBack:L,onBack:function(){if(w)y();else if(0!==T.length){var e=T[T.length-1],t=T.slice(0,-1);F(t),P(e),cf(r,{surveySubmissionId:b,responses:u,lastQuestionIndex:e,questionOrder:ef(O),visitedIndices:t,surveyLanguage:k,questionSnapshots:R})}}})]})]}):null}function gh(e){var t,n,r,i,o,s,a,u,l=e.survey,c=e.forceDisableHtml,d=e.posthog,f=e.readOnly,h=e.surveyLanguage,p=Du(!0),_=p[0],v=p[1],g=Du(!1),m=g[0],y=g[1],b=Du({}),w=b[0],S=b[1],k=qu(void 0),x=function(){var e;(m||!d||f||null!=(e=d.client)&&e.canCapture)&&y(!m)};if($u(function(){var e,t;if(d){if(!f){var n;"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&S((n=null==(t=l.appearance)?void 0:t.position)&&n!==Xu&&n!==el?{}:{top:"50%",bottom:"auto"});var r=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===l.id&&(Zl.info("Received show event for feedback button survey "+l.id),S(n.detail.position||{}),x())};return Ml(window,uh,r),function(){ri(k.current)||(clearTimeout(k.current),k.current=void 0),window.removeEventListener(uh,r)}}}else Zl.error("FeedbackWidget called without a PostHog instance.")},[d,f,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(n=l.appearance)?void 0:n.position,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),fh({survey:l,setSurveyVisible:v,posthog:d}),!_)return null;var C=function(){l.schedule!==ll&&v(!1),ri(k.current)||clearTimeout(k.current),k.current=setTimeout(function(){k.current=void 0,y(!1)},200)};return Rr(ur,{children:["tab"===(null==(o=l.appearance)?void 0:o.widgetType)&&Rr("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=l.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:x,disabled:f,style:ph(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(u=l.appearance)?void 0:u.widgetLabel)||""}),m&&Rr(_h,{posthog:d,survey:l,forceDisableHtml:c,style:w,onPopupSurveyDismissed:C,onCloseConfirmationMessage:C,surveyLanguage:h})]})}var mh=function(e){var t=e.question,n=e.onSubmit,r=e.onPreviewSubmit,i={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit:function(e){r(e)},onSubmit:function(e){n(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case il:return sr(Rf,d({},i,{question:t,key:t.id}));case"link":return sr(Af,d({},i,{question:t,key:t.id}));case al:return sr(Mf,d({},i,{question:t,key:t.id}));case sl:case ol:return sr(Lf,d({},i,{question:t,key:t.id}));default:return Zl.error("Unsupported question type: "+t.type),null}},yh="gzip-js",bh="base64";function wh(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&ei(n.then)&&n.then(void 0,function(){})}}}}var Sh=function(){"use strict";function e(){this._events={}}var t=e.prototype;return t.on=function(e,t){var n=this;return this._events[e]||(this._events[e]=[]),this._events[e].push(t),function(){n._events[e]=n._events[e].filter(function(e){return e!==t})}},t.emit=function(e,t){for(var n,r=p(this._events[e]||[]);!(n=r()).done;)(0,n.value)(t);for(var i,o=p(this._events["*"]||[]);!(i=o()).done;)(0,i.value)(e,t)},e}();function kh(e,t,n){if(ai(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var xh=function(){"use strict";function e(e){var t=this;this._host=e,this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new Sh,this._checkStep=function(e,n){return t._checkStepEvent(e,n)&&t._checkStepUrl(e,n)&&t._checkStepElement(e,n)&&t._checkStepProperties(e,n)},this._checkStepEvent=function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}}var t=e.prototype;return t.init=function(){var e,t,n=this;ri(null==(e=this._host)?void 0:e.subscribeCapture)||(this._captureHookUnsubscribe=null==(t=this._host)?void 0:t.subscribeCapture(function(e,t){n.on(e,t)}))},t.dispose=function(){var e,t;null==(e=this._captureHookUnsubscribe)||e.call(this),this._captureHookUnsubscribe=void 0,null==(t=this._host)||null==t.setElementSelectors||t.setElementSelectors(new Set,this),this._debugEventEmitter=new Sh},t.register=function(e){var t,n,r=this;if(!ri(null==(t=this._host)?void 0:t.subscribeCapture)&&(e.forEach(function(e){var t;r._actionRegistry.add(e),null==(t=e.steps)||t.forEach(function(e){r._actionEvents.add((null==e?void 0:e.event)||"")})}),null!=(n=this._host)&&n.setElementSelectors)){var i=new Set;this._actionRegistry.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&i.add(e.selector)})}),this._host.setElementSelectors(i,this)}},t.replace=function(e){this._actionRegistry.clear(),this._actionEvents.clear(),this.register(e)},t.on=function(e,t){var n=this;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(t.event))&&this._actionRegistry.forEach(function(e){n._checkAction(t,e)&&n._debugEventEmitter.emit("actionCaptured",e.name)})},t._addActionHook=function(e){this.onAction("actionCaptured",function(t){return e(t)})},t._checkAction=function(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n,r=p(t.steps);!(n=r()).done;)if(this._checkStep(e,n.value))return!0;return!1},t.onAction=function(e,t){return this._debugEventEmitter.on(e,t)},t._checkStepUrl=function(e,t){if(null!=t&&t.url){var n,r=null==e||null==(n=e.properties)?void 0:n.$current_url;if(null==e||!e.properties||!("$current_url"in e.properties))try{var i;r=null==(i=this._host)||null==i.getActionUrl?void 0:i.getActionUrl()}catch(e){return!1}if(!r||"string"!=typeof r)return!1;if(!kh(r,t.url,t.url_matching||"contains"))return!1}return!0},t._checkStepElement=function(e,t){return!!this._checkStepHref(e,t)&&!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t)},t._checkStepHref=function(e,t){var n;if(null==t||!t.href)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return kh(e.href,t.href,t.href_matching||"exact")});var i,o=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!o&&kh((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")},t._checkStepText=function(e,t){var n;if(null==t||!t.text)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return kh(e.text,t.text,t.text_matching||"exact")||kh(e.$el_text,t.text,t.text_matching||"exact")});var i,o,s,a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!ai(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),o=t.text,s=t.text_matching||"exact",i.some(function(e){return kh(e,o,s)}))},t._checkStepSelector=function(e,t){var n,r;if(null==t||!t.selector)return!0;if(null!=e&&null!=(n=e.properties)&&null!=(n=n.$element_selectors)&&n.includes(t.selector))return!0;var i=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}catch(e){}return!1},t._getElementsList=function(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements},t._checkStepProperties=function(e,t){return null==t||!t.properties||0===t.properties.length||Yl(t.properties.reduce(function(e,t){var n=Xr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:n,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)},e}(),Ch=function(e){"use strict";function t(t,n,r,i){var o,s=e.call(this,{subscribeCapture:function(e){var n=t.onEvent(function(t){return e(t.event,t)});return function(){return n.dispose()}},subscribeSession:function(e){var n=t.onSession(e);return function(){return n.dispose()}},getSessionId:function(){var e;return null==(e=t.session)?void 0:e.sessionId},getProperty:function(e){return t.kv.get(e)},getActionUrl:null==r?void 0:r.getActionUrl,setElementSelectors:null!==(o=null==r?void 0:r.setElementSelectors)&&void 0!==o?o:function(e,n){var r;return null==(r=t.getExtension("autocapture"))?void 0:r.setElementSelectors(e,n)}},i)||this;return s._client=t,s._surveys=n,s._subscribeSession(),s}r(t,e);var n=t.prototype;return n._getActivatedKey=function(){return Lr},n._getActivatedSessionKey=function(){return Dr},n._getActivationTimestampsKey=function(){return $r},n._writeActivationTimestamps=function(e){var t;this._client.kv.set(((t={})[$r]=e,t))},n._clearActivationTimestampsStore=function(){this._client.kv.remove($r)},n._shouldPersistArmedActivation=function(e){var t,n;this._getItems(function(t){n=t.find(function(t){return t.id===e})});var r=null==(t=n)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return ui(r)&&r>0},n._getShownEventName=function(){return cl},n._getItems=function(e){this._surveys.getSurveys(e)},n._cancelPendingItem=function(e){this._surveys.cancelPendingSurvey(e)},n._getLogger=function(){return Zl},n._setActivatedItems=function(e){var t;this._client.kv.set(((t={})[Lr]=e,t))},n._setActivatedSession=function(e){var t;this._client.kv.set(((t={})[Dr]=e,t))},n._clearActivatedSession=function(){this._client.kv.remove(Dr)},n._isItemPermanentlyIneligible=function(){return!1},n._activationOutcome=function(e,t,n){var r,i;return e===fl&&!1===(null==n||null==(r=n.properties)?void 0:r.$survey_completed)?"ignore":(this._getItems(function(e){i=e.find(function(e){return e.id===t})}),!i||Vl(i)?e===cl?"consume":"ignore":e===cl?"persist":e===dl||e===fl?"consume":"ignore")},n.getSurveys=function(){return this.getActivatedIds()},n.getEventToSurveys=function(){return this.getEventToItemsMap()},t}(function(){"use strict";function e(e,t){this._onActivationChanged=t,this._pendingActivatedItems=[],this._host=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}var t=e.prototype;return t._subscribeSession=function(){var e,t,n=this;this._sessionIdUnsubscribe=null==(e=(t=this._host).subscribeSession)?void 0:e.call(t,function(e){return n._onSessionIdChanged(e)})},t._shouldPersistArmedActivation=function(e){return!1},t._getActivationTimestampsKey=function(){return null},t._writeActivationTimestamps=function(e){},t._clearActivationTimestampsStore=function(){},t._doesEventMatchFilter=function(e,t){return!!e&&Yl(e.propertyFilters,null==t?void 0:t.properties)},t._buildEventToItemMap=function(e,t){var n=new Map;return e.forEach(function(e){var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(function(t){if(null!=t&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}})}),n},t._getMatchingItems=function(e,t,n){var r=this,i=(n===Ku?this._eventToItems:this._cancelEventToItems).get(e),o=[];return this._getItems(function(e){o=e.filter(function(e){return null==i?void 0:i.includes(e.id)})}),o.filter(function(i){var o,s=null==(o=i.conditions)||null==(o=o[n])||null==(o=o.values)?void 0:o.find(function(t){return t.name===e});return r._doesEventMatchFilter(s,t)})},t.register=function(e){this._register(e,!1)},t.replace=function(e){this._register(e,!0)},t._register=function(e,t){ri(this._host.subscribeCapture)||(this._setupEventBasedItems(e,t),this._setupActionBasedItems(e,t))},t._setupActionBasedItems=function(e,t){var n=this,r=e.filter(function(e){var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this._actionToItems.clear(),0!==r.length){this._actionMatcher||(this._actionMatcher=new xh(this._host),this._actionMatcher.init(),this._actionMatcher._addActionHook(function(e){return n.onAction(e)}));var i=[];r.forEach(function(e){var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(function(t){if(i.push(t),t.name){var r,o=null!==(r=n._actionToItems.get(t.name))&&void 0!==r?r:[];o.includes(e.id)||o.push(e.id),n._actionToItems.set(t.name,o)}})}),t?this._actionMatcher.replace(i):this._actionMatcher.register(i)}else{var o;t&&(null==(o=this._actionMatcher)||o.replace([]))}},t._mergeItemMaps=function(e,t){t.forEach(function(t,n){var r,i=null!==(r=e.get(n))&&void 0!==r?r:[];t.forEach(function(e){i.includes(e)||i.push(e)}),e.set(n,i)})},t._setupEventBasedItems=function(e,t){var n,r,i,o=this,s=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}),a=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(n=e.conditions)||null==(n=n.cancelEvents)||null==(n=n.values)?void 0:n.length)>0}),u=this._buildEventToItemMap(e,Ku),l=this._buildEventToItemMap(e,Qu);t?(this._eventToItems=u,this._cancelEventToItems=l):(this._mergeItemMaps(this._eventToItems,u),this._mergeItemMaps(this._cancelEventToItems,l)),(0!==s.length||0!==a.length||e.some(function(e){var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length}))&&(null!==(n=this._captureHookUnsubscribe)&&void 0!==n||(this._captureHookUnsubscribe=null==(r=(i=this._host).subscribeCapture)?void 0:r.call(i,function(e,t){o.onEvent(e,t)})))},t.onEvent=function(e,t){var n,r,i=this,o=this._getLogger(),s=(null==t||null==(n=t.properties)?void 0:n.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var a=this._activationOutcome(e,s,t);if("consume"===a)return o.info("event consumed activated item, removing it",{event:e,itemId:s}),void this._deactivateItems([s]);if("persist"===a)return o.info("shown item promoted to persisted activation",{event:e,itemId:s}),this._persistActivation(s),void this._clearActivationTimestamps([s])}if(this._cancelEventToItems.has(e)){var u=this._getMatchingItems(e,t,Qu);u.length>0&&(o.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map(function(e){return e.id})}),this._deactivateItems(u.map(function(e){return e.id})),u.forEach(function(e){return i._cancelPendingItem(e.id)}))}if(this._eventToItems.has(e)){o.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var l=this._getMatchingItems(e,t,Ku);this._activateItems(l.map(function(e){return e.id}))}},t.onAction=function(e){this._actionToItems.has(e)&&this._activateItems(this._actionToItems.get(e)||[])},t._activateItems=function(e){if(0!==e.length){for(var t,n=!!this._host.getSessionId(),r=[],i=p(e);!(t=i()).done;){var o=t.value;n&&this._shouldPersistArmedActivation(o)?this._persistActivation(o)&&this._recordActivationTimestamp(o):r.push(o)}r.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,r)))),this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()}),this._notifyActivationChanged()}},t._persistActivation=function(e){this._pendingActivatedItems=this._pendingActivatedItems.filter(function(t){return t!==e});var t=this._getPersistedActivatedIds();return!t.includes(e)&&(this._setActivatedItems([].concat(t,[e])),this._stampActivationSession(),!0)},t._deactivateItems=function(e){var t=new Set(e);this._pendingActivatedItems=this._pendingActivatedItems.filter(function(e){return!t.has(e)});var n=this._getRawPersistedActivatedIds(),r=n.filter(function(e){return!t.has(e)});r.length!==n.length&&(this._setActivatedItems(r),0===r.length&&this._clearActivationSession()),this._clearActivationTimestamps(e),this._notifyActivationChanged()},t._notifyActivationChanged=function(){try{var e;null==(e=this._onActivationChanged)||e.call(this)}catch(e){this._getLogger().error("Error while handling activated items change",e)}},t._getRawActivationTimestamps=function(){var e=this._getActivationTimestampsKey();if(!e)return{};var t=this._host.getProperty(e);return t&&"object"==typeof t?t:{}},t._recordActivationTimestamp=function(e){var t;if(this._getActivationTimestampsKey()){var n=this._getRawActivationTimestamps();this._writeActivationTimestamps(d({},n,((t={})[e]=Date.now(),t)))}},t._clearActivationTimestamps=function(e){if(this._getActivationTimestampsKey()){for(var t=this._getRawActivationTimestamps(),n={},r=!1,i=0,o=Object.entries(t);o.length>i;i++){var s=o[i],a=s[0],u=s[1];e.includes(a)?r=!0:n[a]=u}r&&(ni(n)?this._clearActivationTimestampsStore():this._writeActivationTimestamps(n))}},t._clearAllActivationTimestamps=function(){this._getActivationTimestampsKey()&&this._clearActivationTimestampsStore()},t.getActivationTimestamp=function(e){if(this._getPersistedActivatedIds().includes(e)){var t=this._getRawActivationTimestamps()[e];return ui(t)?t:void 0}},t._getRawPersistedActivatedIds=function(){var e=this._getActivatedKey();return this._host.getProperty(e)||[]},t._getPersistedActivatedIds=function(){var e=this._getRawPersistedActivatedIds();if(0===e.length)return[];var t=this._host.getProperty(this._getActivatedSessionKey()),n=this._host.getSessionId();return n&&t===n?e:[]},t._stampActivationSession=function(){var e=this._host.getSessionId();e&&this._setActivatedSession(e)},t._clearActivationSession=function(){this._clearActivatedSession()},t._onSessionIdChanged=function(e){var t=this,n=this._host.getProperty(this._getActivatedSessionKey());if(n&&n!==e){var r=this._getRawPersistedActivatedIds(),i=this._getRawActivationTimestamps();r.length>0&&(this._setActivatedItems([]),r.filter(function(e){return ui(i[e])}).forEach(function(e){return t._cancelPendingItem(e)})),this._clearActivationSession(),this._clearAllActivationTimestamps(),r.length>0&&this._notifyActivationChanged()}},t.getActivatedIds=function(){var e=this;return[].concat(new Set([].concat(this._getPersistedActivatedIds(),this._pendingActivatedItems))).filter(function(t){return!e._isItemPermanentlyIneligible(t)})},t.dispose=function(){var e,t,n;null==(e=this._sessionIdUnsubscribe)||e.call(this),this._sessionIdUnsubscribe=void 0,null==(t=this._captureHookUnsubscribe)||t.call(this),this._captureHookUnsubscribe=void 0,null==(n=this._actionMatcher)||n.dispose(),this._actionMatcher=void 0},t.reset=function(){this._pendingActivatedItems=[],this._getRawPersistedActivatedIds().length>0&&this._setActivatedItems([]),this._clearActivationSession(),this._clearAllActivationTimestamps(),this._notifyActivationChanged()},t.getEventToItemsMap=function(){return this._eventToItems},t._getActionMatcher=function(){return this._actionMatcher},e}()),Ph=function(e,t){return null!=e&&e.then?e.then(t):t(e)},Eh="SDK is not enabled or survey functionality is not yet loaded",Th="Disabled. Not loading surveys.",Fh=function(){"use strict";function e(e){var t=this;this._configSource=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyInitializationFailed=!1,this._surveyCallbacks=[],this._activeMatchingSurveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._disposed=!1,this._renderTimeouts=new Set,this.onRemoteConfig=function(e){if(!t._disposed&&!t._config.disableSurveys){if(!e.ok)return t._surveyInitializationFailed=!0,t._notifyActiveMatchingSurveyCallbacks({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Zl.warn("Remote config unavailable. Not loading surveys.");var n=e.config.surveys;if(ai(n))return Zl.warn("Flags not loaded yet. Not loading surveys.");t._isSurveysEnabled=ci(n)?n:n.length>0,Zl.info("flags response received, isSurveysEnabled: "+t._isSurveysEnabled),t.loadIfEnabled()}},this._notifyActiveMatchingSurveyCallbacks=function(e){t._activeMatchingSurveyCallbacks.slice().forEach(function(n){return t._notifyActiveMatchingSurveyCallback(n,e)})}}var t=e.prototype;return t.setup=function(e){var t=this;if(!this._disposed)return this._initializingClient=e,Ph(e.kv.initialize(),function(){if(t._initializingClient===e&&!t._disposed){t._initializingClient=void 0,t._client=e;var n=e.onRemoteConfig(t.onRemoteConfig);t._disposed?n.dispose():(t._remoteConfigSubscription=n,t.loadIfEnabled())}})},t.dispose=function(){var e,t,n,r;this._disposed||(this._disposed=!0,this._initializingClient=void 0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(n=this._surveyManager)||null==n.dispose||n.dispose(),this._surveyManager=null,this._surveyCallbacks=[],this._activeMatchingSurveyCallbacks.forEach(function(e){e.active=!1}),this._activeMatchingSurveyCallbacks=[],null==(r=this._activeMatchingSurveyConditionsUnsubscribe)||r.call(this),this._activeMatchingSurveyConditionsUnsubscribe=void 0,this._getSurveysInFlightPromise=null,this._renderTimeouts.forEach(function(e){return clearTimeout(e)}),this._renderTimeouts.clear())},t.getRenderContext=function(){if(this._client){var e=this;return{client:this._client,get config(){return e._config},surveys:e}}},t.initialize=function(){this.loadIfEnabled()},t.reset=function(){var e;null==(e=this._surveyManager)||null==e.clearInMemoryInProgressSurveyState||e.clearInMemoryInProgressSurveyState();try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith("seenSurvey_")||null!=i&&i.startsWith("inProgressSurvey_"))&&n.push(i)}n.forEach(function(e){return localStorage.removeItem(e)})}catch(e){}this._notifyActiveMatchingSurveyCallbacks()},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._client){var t=this._config;if(!this._surveyManager)if(this._isInitializingSurveys)Zl.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Zl.info(Th);else if(t.cookielessMode&&this._client.isOptedOut)Zl.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!ri(this._isSurveysEnabled)||t.advancedEnableSurveys){var r=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0,this._surveyInitializationFailed=!1;try{var i=n.generateSurveys;if(i)return this._completeSurveyInitialization(i,r),void(this._isInitializingSurveys=!1);var o=n.loadExternalDependency;if(!o)return this._handleSurveyLoadError(Or),void(this._isInitializingSurveys=!1);o(function(t){try{if(e._disposed)return;var n=e._configSource.getExtensions();t||null==n||!n.generateSurveys?e._handleSurveyLoadError("Could not load surveys script",t):e._completeSurveyInitialization(n.generateSurveys,r)}finally{e._isInitializingSurveys=!1}})}catch(e){throw this._isInitializingSurveys=!1,this._handleSurveyLoadError("Error initializing surveys",e),e}}}else this._handleSurveyLoadError("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){var n;if(!this._disposed){this._surveyManager=e(t),this._surveyEventReceiver=this._createEventReceiver(this._client,this._notifyActiveMatchingSurveyCallbacks);var r=null==(n=this._client)?void 0:n.kv.get(Ar);r&&this._registerEventOrActionBasedSurveys(r),Zl.info("Surveys loaded successfully"),this._startActiveMatchingSurveyConditions(),this._notifyActiveMatchingSurveyCallbacks(),this._notifySurveyCallbacks({isLoaded:!0})}},t._createEventReceiver=function(e,t){return new Ch(e,this,void 0,t)},t._handleSurveyLoadError=function(e,t){this._surveyInitializationFailed=!0,Zl.error(e,t),this._notifyActiveMatchingSurveyCallbacks({isLoaded:!1,error:e}),this._notifySurveyCallbacks({isLoaded:!1,error:e})},t.onSurveysLoaded=function(e){var t=this;return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),function(){t._surveyCallbacks=t._surveyCallbacks.filter(function(t){return t!==e})}},t.getSurveys=function(e,t){var n=this;if(void 0===t&&(t=!1),!this._disposed){var r=this._client;if(!r)return e([],{isLoaded:!1,error:Eh});if(this._config.disableSurveys)return Zl.info(Th),e([]);var i=r.kv.get(Ar);if(i&&!t)return e(i,{isLoaded:!0}),void(this._shouldBackgroundRefreshSurveys()&&this.getSurveys(function(){},!0));if(this._getSurveysInFlightPromise)this._getSurveysInFlightPromise.then(function(t){n._disposed||e(t.surveys,t.context)}).catch(function(e){return Zl.error("Error in survey callback",e)});else{var o=r.sendRequest("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then(function(e){try{return n._handleSurveyResponse(r,e)}catch(e){return Zl.error("Error processing surveys response",e),n._handleSurveyResponse(r,{statusCode:0,error:e})}},function(e){return n._handleSurveyResponse(r,{statusCode:0,error:e})});this._getSurveysInFlightPromise=o;var s=function(){n._getSurveysInFlightPromise===o&&(n._getSurveysInFlightPromise=null)};o.then(function(t){s(),n._disposed||(n._notifyActiveMatchingSurveyCallbacks(t.context),e(t.surveys,t.context))},s).catch(function(e){return Zl.error("Error in survey callback",e)})}}},t._handleSurveyResponse=function(e,t){var n;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:Eh}};var r=t.statusCode;if(200!==r||!t.json){var i="Surveys API could not be loaded, status: "+r;return 0!==r?Zl.error(i):t.error||Zl.warn(i),this._lastSurveyRefreshFailedAt=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this._lastSurveyRefreshFailedAt=null;var o=t.json.surveys||[];return e.kv.set(((n={})[Ar]=o,n[Mr]=Date.now(),n)),this._registerEventOrActionBasedSurveys(o),{surveys:o,context:{isLoaded:!0}}},t._registerEventOrActionBasedSurveys=function(e){var t=e.filter(function(e){return ec(e)&&(Wl(e)||tc(e))});this._registerSurveyTriggers(t)},t._registerSurveyTriggers=function(e){var t;null==(t=this._surveyEventReceiver)||t.replace(e)},t._shouldBackgroundRefreshSurveys=function(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()},t._isSurveyCacheStale=function(){var e,t=null==(e=this._client)?void 0:e.kv.get(Mr);return ui(t)&&Date.now()-t>3e5},t._isSurveyRefreshBackingOff=function(){return ui(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n;ic({id:e,current_iteration:null!==(n=null==t?void 0:t.iteration)&&void 0!==n?n:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}this._notifyActiveMatchingSurveyCallbacks()},t._notifySurveyCallbacks=function(e){for(var t,n=p(this._surveyCallbacks);!(t=n()).done;){var r=t.value;if(this._disposed)return;try{e.isLoaded?this.getSurveys(r):r([],e)}catch(e){Zl.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!ai(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Zl.warn("init was not called")},t.onActiveMatchingSurveysChanged=function(e){var t,n=this;if(this._disposed)return function(){};var r={callback:e,active:!0,revision:0};this._activeMatchingSurveyCallbacks.push(r),this._startActiveMatchingSurveyConditions();var i=null==(t=this._client)?void 0:t.kv.get(Ar);return this._config.disableSurveys||!this._surveyManager&&this._surveyInitializationFailed&&!this._isInitializingSurveys||!i&&!ai(this._lastSurveyRefreshFailedAt)&&!this._getSurveysInFlightPromise?this._notifyActiveMatchingSurveyCallback(r,{isLoaded:!1}):this._surveyManager&&this._notifyActiveMatchingSurveyCallback(r),function(){r.active=!1,n._activeMatchingSurveyCallbacks=n._activeMatchingSurveyCallbacks.filter(function(e){return e!==r}),0===n._activeMatchingSurveyCallbacks.length&&(null==n._activeMatchingSurveyConditionsUnsubscribe||n._activeMatchingSurveyConditionsUnsubscribe(),n._activeMatchingSurveyConditionsUnsubscribe=void 0)}},t._startActiveMatchingSurveyConditions=function(){var e,t,n;this._surveyManager&&this._activeMatchingSurveyCallbacks.length>0&&(null!==(e=this._activeMatchingSurveyConditionsUnsubscribe)&&void 0!==e||(this._activeMatchingSurveyConditionsUnsubscribe=null==(t=(n=this._configSource).onMatchingConditionsChanged)?void 0:t.call(n,this._notifyActiveMatchingSurveyCallbacks)))},t._notifyActiveMatchingSurveyCallback=function(e,t){var n=this;if(!this._disposed&&e.active){var r=++e.revision,i=function(i){if(!n._disposed&&e.active&&r===e.revision)try{var o=null!=t?t:{isLoaded:!0},s=JSON.stringify([i,o]);if(s===e.lastResult)return;e.lastResult=s,e.callback(i,o)}catch(e){Zl.error("Error in active matching surveys callback",e)}};try{t&&!t.isLoaded?i([]):this.getActiveMatchingSurveys(i)}catch(e){Zl.error("Error in active matching surveys callback",e)}}},t._getSurveyById=function(e){var t=null;return this.getSurveys(function(n){var r;t=null!==(r=n.find(function(t){return t.id===e}))&&void 0!==r?r:null}),t},t._checkSurveyEligibility=function(e){if(ai(this._surveyManager))return{eligible:!1,reason:Eh};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}},t._checkSurveyRenderability=function(e){var t;if(null==(t=this._client)||!t.canCapture)return{eligible:!1,reason:Xl};if(ai(this._surveyManager))return{eligible:!1,reason:Eh};var n="string"==typeof e?this._getSurveyById(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(ai(this._surveyManager))return Zl.warn("init was not called"),{visible:!1,disabledReason:Eh};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return ai(this._surveyManager)?(Zl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Eh})):new Promise(function(r){n.getSurveys(function(t){var i,o=null!==(i=t.find(function(t){return t.id===e}))&&void 0!==i?i:null;if(o){var s=n._checkSurveyRenderability(o);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})},t.renderSurvey=function(e,t,n){var r,i,o,s=this;if(null!=(r=this._client)&&r.canCapture)if(ai(this._surveyManager))Zl.warn("init was not called");else{var a="string"==typeof e?this._getSurveyById(e):e;if(null!=a&&a.id)if(oc.includes(a.type)){var u=null==(i=typeof document>"u"?void 0:document)?void 0:i.querySelector(t);if(u)if(null!=(o=a.appearance)&&o.surveyPopupDelaySeconds){Zl.info("Rendering survey "+a.id+" with delay of "+a.appearance.surveyPopupDelaySeconds+" seconds");var l=setTimeout(function(){var e,t,r;s._renderTimeouts.delete(l),!s._disposed&&null!=(e=s._client)&&e.canCapture&&(Zl.info("Rendering survey "+a.id+" with delay of "+(null==(t=a.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(r=s._surveyManager)||r.renderSurvey(a,u,n),Zl.info("Survey "+a.id+" rendered"))},1e3*a.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(l)}else this._surveyManager.renderSurvey(a,u,n);else Zl.warn("Survey element not found")}else Zl.warn("Surveys of type "+a.type+" cannot be rendered in the app");else Zl.warn("Survey not found")}},t.displaySurvey=function(e,t){var n,r;if(null!=(n=this._client)&&n.canCapture)if(ai(this._surveyManager))Zl.warn("init was not called");else{var i=this._getSurveyById(e);if(i){var o=i;if(null!=(r=i.appearance)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=d({},i,{appearance:d({},i.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==ml&&t.initialResponses&&Zl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this._checkSurveyEligibility(i);if(!s.eligible)return void Zl.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Zl.warn("Survey not found")}},t.cancelPendingSurvey=function(e){ai(this._surveyManager)?Zl.warn("init was not called"):this._surveyManager.cancelSurvey(e)},t.handlePageUnload=function(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()},a(e,[{key:"_config",get:function(){return this._configSource.get()}}])}(),Ih="u">typeof window?window:void 0,Rh="u">typeof globalThis?globalThis:Ih,Ah=null==Rh?void 0:Rh.navigator,Mh=null==Rh?void 0:Rh.document,Oh=null==Rh?void 0:Rh.location,Lh=null==Rh?void 0:Rh.fetch,Dh=null!=Rh&&Rh.XMLHttpRequest&&"withCredentials"in new Rh.XMLHttpRequest?Rh.XMLHttpRequest:void 0,$h=null==Rh?void 0:Rh.AbortController,qh=null==Rh?void 0:Rh.CompressionStream,Nh=null==Ah?void 0:Ah.userAgent,Bh="undefined"!=typeof globalThis?globalThis:Ih;Bh&&"undefined"==typeof self&&(Bh.self=Bh),Bh&&"undefined"==typeof File&&(Bh.File=function(){});var jh=null!=Ih?Ih:{},Hh=function(e){var t,n=null==(t=typeof document>"u"?void 0:document)?void 0:t.createElement("a");return ri(n)?null:(n.href=e,n)},zh=function(){try{return"u">typeof window&&!1!==window.navigator.onLine}catch(e){return!1}},Uh=function(e,t){return e>=t&&zh()},Wh=function(e,t,n,r){if(0===e){if(zh()){var i=t+1;return i===n&&r(),i}return t}return 0},Vh=function(e,t){try{var n;return JSON.stringify(e,function(e,t){return _i(t)?(null!=n||(n=new WeakMap),n.has(t)||n.set(t,Il(t)),n.get(t)):"bigint"==typeof t?t.toString():t},t)}catch(t){return Qr(e)}},Gh=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var o=r[i].split(/=(.*)/);if(o[0]===t){n=o;break}}if(!Xr(n)||2>n.length)return"";var s=n[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch(e){Sl.error("Skipping decoding for malformed query param: "+s)}return s},Kh=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(/#(.*)/),i=r[1],o=(r[0]||"").split(/\?(.*)/),s=o[1],a=o[0],u=(s||"").split("&"),l=[],c=0;u.length>c;c++){for(var d=u[c].split("?"),f=0;d.length>f&&!t.includes(d[f].split("=")[0]);)f++;l.push(d.length>f?d.slice(0,f).concat(d[f].split("=")[0]+"="+n).join("?"):u[c])}var h=a;return null!=s&&(h+="?"+l.join("&")),null!=i&&(h+="#"+i),h},Qh=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Yh(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}bl.DEBUG=!1,bl.LIB_VERSION="1.455.1",bl.LIB_NAME="web";var Jh=bl,Zh="distinct_id",Xh="$device_id",ep="$device_model",tp="__alias",np="$fbc",rp="$fbc_persistence",ip="$fbp",op="$fbp_persistence",sp="__timers",ap="$heatmaps_enabled_server_side",up="$exception_capture_enabled_server_side",lp="$error_tracking_suppression_rules",cp="$error_tracking_capture_extension_exceptions",dp="$web_vitals_enabled_server_side",fp="$dead_clicks_enabled_server_side",hp="$product_tours_enabled_server_side",pp="$logs_capture_enabled_server_side",_p="$web_vitals_allowed_metrics",vp="$session_recording_remote_config",gp="$replay_sample_rate",mp="$replay_override_sampling",yp="$replay_override_linked_flag",bp="$replay_override_url_trigger",wp="$replay_override_event_trigger",Sp="$sesid",kp="$session_is_sampled",xp="$groups",Cp="ph_product_tours",Pp="$user_state",Ep="$client_session_props",Tp="$capture_rate_limit",Fp="$initial_campaign_params",Ip="$initial_referrer_info",Rp="$initial_person_info",Ap="$epp",Mp="$posthog_cookieless",Op="$cookieless_mode",Lp="$sdk_debug_extensions_init_method",Dp="$sdk_debug_extensions_init_time_ms",$p="$sdk_debug_recording_script_not_loaded",qp="$sdk_debug_replay_stale_config",Np="$sdk_debug_replay_event_trigger_status",Bp="$sdk_debug_replay_linked_flag_trigger_status",jp="$sdk_debug_replay_matched_recording_trigger_groups",Hp="$sdk_debug_replay_pending_trigger_conditions",zp="$sdk_debug_replay_remote_trigger_matching_config",Up="$sdk_debug_replay_trigger_groups_count",Wp="$sdk_debug_replay_url_trigger_status",Vp="anonymous",Gp="identified",Kp="identified_only",Qp="beforeunload",Yp="$pageview",Jp="$pageleave",Zp="$identify",Xp="$groupidentify";function e_(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function t_(e){return!!e&&1===e.nodeType}function n_(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function r_(e){return!!e&&3===e.nodeType}function i_(e){return!!e&&11===e.nodeType&&t_(e.host)}function o_(e){return e?Gr(e).split(/\s+/):[]}function s_(e,t){var n=jd(t);return!!(n&&e&&e.some(function(e){return n.match(e)}))}function a_(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 o_(t)}function u_(e){return ai(e)?null:Gr(e).split(/(\s+)/).filter(function(e){return N_(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function l_(e){var t="";return I_(e)&&!R_(e)&&e.childNodes&&e.childNodes.length&&Cl(e.childNodes,function(e){var n;r_(e)&&e.textContent&&(t+=null!==(n=u_(e.textContent))&&void 0!==n?n:"")}),Gr(t)}function c_(e){var t;return ri(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var d_=["a","button","form","input","select","textarea","label"];function f_(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch(e){return!1}}function h_(e,t){if(ri(t))return!0;for(var n,r,i=function(){var e=r.value;if(t.some(function(t){return f_(e,t)}))return{v:!0}},o=p(e);!(r=o()).done;)if(n=i())return n.v;return!1}function p_(e){var t=e.parentNode;return!(!t||!t_(t))&&t}var __=[".ph-no-autocapture","[data-ph-no-autocapture]"],v_=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],g_=function(){return[].concat(v_,["+","-","−","–"])}(),m_=function(){return g_.length+10}(),y_=["button","a","input","select","textarea","label"],b_=["button","link","tab","menuitem","option"],w_=function(e,t){return/[a-z0-9]/i.test(t)?Vr(g_,t)?new RegExp("\\b"+t+"\\b").test(e):e.includes(t):e===t},S_=function(e){return Vr(y_,e.tagName.toLowerCase())||Vr(b_,(e.getAttribute("role")||"").toLowerCase())};function k_(e){var t="",n="",r=function(e){t_(e)&&I_(e)&&!R_(e)&&(t+=" "+l_(e),n=n||e.getAttribute("aria-label")||"",Cl(e.childNodes,r))};r(e);var i=(N_(t=Gr(t.replace(/\s+/g," ")))?t:"").toLowerCase();return{safeText:i,ariaLabel:Gr(e.getAttribute("aria-label")||(i?"":n)).toLowerCase()}}var x_=[".ph-no-rageclick",".ph-no-capture"],C_=["","text","search","email","password","url","tel","number"];function P_(e,t){if(!(typeof window>"u"?void 0:window)||E_(e))return!1;var n,r,i,o,s;if(ci(t)?(n=!!t&&x_,r=void 0,i=!1):(n=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:x_,r=null==t?void 0:t.content_ignorelist,i=null!==(s=null==t?void 0:t.ignore_text_selection)&&void 0!==s&&s),!1===n)return!1;if(i&&function(e){return!(!e||!t_(e))&&(!!n_(e,"textarea")||(n_(e,"input")?Vr(C_,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var a=T_(e,!1),u=a.targetElementList;return!(!a.isComplete||r&&function(e,t){var n,r=t.safeText,i=t.ariaLabel;if(!0===e)n=v_;else{if(!Xr(e))return!1;if(e.length>m_)return Sl.error("[PostHog] content_ignorelist array cannot exceed "+m_+" items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map(function(e){return e.toLowerCase()})}return n.some(function(e){return w_(r,e)||w_(i,e)})}(r,function(e,t){for(var n,r=p(t);!(n=r()).done;){var i=n.value;if(S_(i))return k_(i)}for(var o,s=p(t);!(o=s()).done;){var a=o.value;try{var u;if("pointer"!==(null==(u=window)?void 0:u.getComputedStyle(a).getPropertyValue("cursor")))break}catch(e){break}var l=k_(a);if(l.safeText||l.ariaLabel)return l}return k_(e)}(e,u))||h_(u,n))}var E_=function(e){return!e||n_(e,"html")||!t_(e)},T_=function(e,t){var n=typeof window>"u"?void 0:window;if(!n||E_(e))return{parentIsUsefulElement:!1,targetElementList:[],isComplete:!1};for(var r=!1,i=[e],o=e,s=new Set([e]);!n_(o,"body");){var a=o.assignedSlot||o.parentNode,u=i_(a)?a.host:a&&t_(a)?a:null;if(!u)break;if(s.has(u)||s.size>=1e3)return{parentIsUsefulElement:r,targetElementList:i,isComplete:!1};if(s.add(u),i_(a))i.push(u),o=u;else{if(t||d_.indexOf(u.tagName.toLowerCase())>-1)r=!0;else try{var l=n.getComputedStyle(u);l&&"pointer"===l.getPropertyValue("cursor")&&(r=!0)}catch(e){}i.push(u),o=u}}return{parentIsUsefulElement:r,targetElementList:i,isComplete:!0}};function F_(e){for(var t=new Set,n=0,r=e;r;){if(n++>=1e3||t.has(r))return!0;t.add(r);var i=a_(r);if(Vr(i,"ph-sensitive")||Vr(i,"ph-no-capture"))return!0;var o=r.assignedSlot||r.parentNode;r=i_(o)?o.host:o&&t_(o)?o:null}return!1}function I_(e){if(F_(e))return!1;if(Vr(a_(e),"ph-include"))return!0;var t=e.type||"";if(ii(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!ii(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function R_(e){return!!(n_(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||n_(e,"select")||n_(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var A_=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),M_=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,O_=[16,15,14,13],L_=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),D_=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),$_=/[0-9A-Za-z_]/;function q_(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function N_(e,t){if(void 0===t&&(t=!0),ai(e))return!1;if(ii(e)){if(e=Gr(e),t?A_.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(M_.lastIndex=0;t=M_.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,""),i=0;r.length>i;i++)for(var o=0,s=O_;s.length>o;o++){var a=i+s[o];if(r.length>=a){var u=r.slice(i,a);if(A_.test(u)&&q_(u))return!0}}}return!1}(e))return!1;if(t?L_.test(e):function(e){var t;for(D_.lastIndex=0;t=D_.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&$_.test(n)&&$_.test(r)))return!0}return!1}(e))return!1}return!0}function B_(e){var t=l_(e);return N_(t=(t+" "+j_(e)).trim())?t:""}function j_(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Cl(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=l_(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+j_(e)).trim())}catch(e){Sl.error("[AutoCapture]",e)}}),t}function H_(e){return e.replace(/"|\\"/g,'\\"')}function z_(e){var t=e.attr__class;if(t)return Xr(t)?t:o_(t)}var U_=function(){"use strict";function e(e){this.disabled=!1===e;var t=ti(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}return e.prototype.isRageClick=function(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1},e}(),W_=function(){return typeof window>"u"?void 0:window},V_=function(){return typeof document>"u"?void 0:document},G_="$copy_autocapture",K_=["password","hidden","file","checkbox","button","submit","reset","image"],Q_=kl("[AutoCapture]");function Y_(e,t){return t.length>e?t.slice(0,e)+"...":t}function J_(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!t_(t));return t}function Z_(e,t){var n,r,i=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=t.disableCaptureUrlHashes;if(!t_(e))return{props:{}};for(var c=[e],f=new Set([e]),h=e;!n_(h,"body")&&1e3>c.length;){var _=h.assignedSlot||h.parentNode,v=i_(_)?_.host:_&&t_(_)?_:null;if(!v||f.has(v))break;f.add(v),c.push(v),h=v}var g="click"===i.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(function(e){return n_(e,"button")||n_(e,"a")}):-1;g>0&&(s=s||c.slice(0,g+1).some(function(e){return!I_(e)||R_(e)}));var m,y,b,w=[],S={},k=!1,x=!1;if(Cl(c,function(e){var t=I_(e);if(t&&n_(e,"a")&&!o&&(null==a||!a.includes("href"))){var n=e.getAttribute("href");k=!!(t&&n&&N_(n))&&(l?Ho(n):n)}Vr(a_(e),"ph-no-capture")&&(x=!0),w.push(function(e,t,n,r,i){void 0===i&&(i=!1);var o=e.tagName.toLowerCase(),s={tag_name:o};d_.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Y_(1024,B_(e)):Y_(1024,l_(e)));var a=a_(e);t||null!=r&&r.includes("class")||0>=a.length||(s.classes=a.filter(function(e){return""!==e})),Cl(F_(e)?[]:e.attributes,function(n){var o;if((!R_(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&N_(n.value)&&(!ii(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){var a=n.value;"class"===n.name&&(a=o_(a).join(" ")),s["attr__"+n.name]=Y_(1024,"href"===n.name&&i?Ho(a):a)}});for(var u=1,l=1,c=e;c=J_(c);)u++,c.tagName===e.tagName&&l++;return s.nth_child=u,s.nth_of_type=l,s}(e,o,s,a,l)),Cl(function(e){if(!I_(e))return{};var t={};return Cl(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&N_(r)&&(t[n]=r)}}),t}(e),function(e,t){({}).hasOwnProperty.call(S,t)||(S[t]=e)})}),x)return{props:{},explicitNoCapture:x};if(g>0&&(e=c[g],w.splice(0,g)),s||(w[0].$el_text=n_(e,"a")||n_(e,"button")?B_(e):l_(e)),k){var C,P;w[0].attr__href=k;var E=null==(C=Hh(k))?void 0:C.host,T=null==(P=W_())||null==(P=P.location)?void 0:P.host;E&&T&&E!==T&&(m=k)}return{props:Pl((y=i.type,{$event_type:y,$ce_version:1}),u?{}:{$elements:w},{$elements_chain:(b=w,Xr(b)?function(e){return e.map(function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();for(var i,o=p(e.attr_class);!(i=o()).done;)r+="."+i.value.replace(/"/g,"")}var s=d({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return El(s).sort(function(e,t){return function(e,t){return t>e?-1:e>t?1:0}(e[0],t[0])}).forEach(function(e){var t=e[1];return a[H_(e[0].toString())]=H_(t.toString())}),(r+=":")+El(a).map(function(e){return e[0]+'="'+e[1]+'"'}).join("")}).join(";")}(function(e){return e.map(function(e){var t,n,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(n=e.attr__href)?void 0:n.slice(0,2048),attr_class:z_(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return El(e).filter(function(e){return 0===e[0].indexOf("attr__")}).forEach(function(e){return r.attributes[e[0]]=e[1]}),r})}(b)):"")},null!=(n=w[0])&&n.$el_text?{$el_text:null==(r=w[0])?void 0:r.$el_text}:{},m&&"click"===i.type?{$external_click_url:m}:{},S),target:e}}var X_="autocapture",ev=function(){"use strict";function e(e){this._configSource=e,this.name=X_,this._initialized=!1,this._isDisabledServerSide=null,this._hasReceivedConfigResponse=!1,this._elementSelectorsByOwner=new Map,this._elementsChainAsString=!1,this._config={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this._disposed=!1,this._configSource.refresh(this._config),this.rageclicks=new U_(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return t._clearPointer=function(){this._pointerDown=void 0,clearTimeout(this._pointerExpiry),this._pointerExpiry=void 0},t._isExcludedPointerTarget=function(e){var t;if(!I_(e))return!0;for(var n,r=null!==(t=this._refreshConfig().css_selector_ignorelist)&&void 0!==t?t:__,i=new Set,o=e,s=function(){if(i.size>=1e3||i.has(o))return{v:!0};i.add(o);var e=o,t=a_(e);if(Vr(t,"ph-no-capture")||Vr(t,"ph-sensitive")||R_(e)||r.some(function(t){return f_(e,t)}))return{v:!0};var n=o.assignedSlot||o.parentNode;o=i_(n)?n.host:n&&t_(n)?n:null};o;)if(n=s())return n.v;return!1},t._trackPointer=function(e){var t=this;if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var n=this._pointerDown;n&&(e.pointerId!==n.id||Math.abs(e.clientX-n.x)>5||Math.abs(e.clientY-n.y)>5?this._clearPointer():"pointerup"===e.type&&(n.released=!0,this._pointerExpiry=setTimeout(function(){return t._clearPointer()},0)))}else{var r;this._clearPointer();var i=c_(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&t_(i)&&(this._pointerDown={target:i,excluded:this._isExcludedPointerTarget(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(r=this._client)?void 0:r.distinctId})}else this._clearPointer()},t._recoverClickTarget=function(e){var t,n=this._pointerDown;this._clearPointer();var r=c_(e);if(null!=n&&n.released&&n.target.isConnected&&n.distinctId===(null==(t=this._client)?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&r&&(n_(r,"html")||n_(r,"body"))){var i,o,s;if(n.excluded)return null;var a=null!==(i=this._refreshConfig().css_selector_ignorelist)&&void 0!==i?i:__;return[r,null==(o=V_())?void 0:o.documentElement,null==(s=V_())?void 0:s.body].some(function(e){if(!e)return!1;var t=a_(e);return Vr(t,"ph-no-capture")||Vr(t,"ph-sensitive")||!I_(e)||R_(e)||a.some(function(t){return f_(e,t)})})?null:n.target}},t.setup=function(e){this._compileUrlPatterns(),this._client=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this._disposed?t.dispose():(this._remoteConfigSubscription=t,this.startIfEnabled())},t.dispose=function(){var e;this._disposed||(this._disposed=!0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._elementSelectorsByOwner.clear(),this._elementSelectors=null,this._removeDomEventHandlers())},t._refreshConfig=function(){return this._configSource.refresh(this._config),this._config},t._compileUrlPatterns=function(){var e,t;return this._refreshConfig(),this._config.url_allowlist=null==(e=this._config.url_allowlist)?void 0:e.map(function(e){return new RegExp(e)}),this._config.url_ignorelist=null==(t=this._config.url_ignorelist)?void 0:t.map(function(e){return new RegExp(e)}),this._config},t._addDomEventHandlers=function(){var e=this,t=W_(),n=V_();if(this.isBrowserSupported()){if(t&&n){this._listenerWindow=t,this._listenerDocument=n;var r=this._domEventHandler=function(n){n=n||(null==t?void 0:t.event);try{if("blur"===n.type)return void e._clearPointer();if(0===n.type.indexOf("pointer"))return void e._trackPointer(n);var r="click"===n.type?e._recoverClickTarget(n):void 0;if(si(r))return;e._captureEvent(n,"$autocapture",r)}catch(e){Q_.error("Failed to capture event",e)}};if(Ml(t,"blur",r),Ml(n,"submit",r,{capture:!0}),Ml(n,"change",r,{capture:!0}),Ml(n,"click",r,{capture:!0}),Cl(["pointerdown","pointermove","pointerup","pointercancel"],function(e){Ml(n,e,r,{capture:!0})}),this._refreshConfig().capture_copied_text){var i=this._copiedTextHandler=function(n){n=n||(null==t?void 0:t.event);try{e._captureEvent(n,G_)}catch(e){Q_.error("Failed to capture clipboard event",e)}};Ml(n,"copy",i,{capture:!0}),Ml(n,"cut",i,{capture:!0}),Ml(n,"paste",i,{capture:!0})}}}else Q_.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){var e=this,t=this._listenerWindow,n=this._listenerDocument;this._clearPointer(),this._domEventHandler&&(null==t||t.removeEventListener("blur",this._domEventHandler),Cl(["pointerdown","pointermove","pointerup","pointercancel"],function(t){null==n||n.removeEventListener(t,e._domEventHandler,!0)}),null==n||n.removeEventListener("submit",this._domEventHandler,!0),null==n||n.removeEventListener("change",this._domEventHandler,!0),null==n||n.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==n||n.removeEventListener("copy",this._copiedTextHandler,!0),null==n||n.removeEventListener("cut",this._copiedTextHandler,!0),null==n||n.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._listenerWindow=void 0,this._listenerDocument=void 0,this._initialized=!1},t.startIfEnabled=function(){this.isEnabled||this._clearPointer(),!this._disposed&&this._client&&this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)},t.onRemoteConfig=function(e){if(!this._disposed)if(this._hasReceivedConfigResponse=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString);var n,r=t.autocapture_opt_out;ci(r)&&(null==(n=this._client)||n.kv.set(oh,r),this._isDisabledServerSide=r),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e,t){if(void 0===t&&(t=this),!this._disposed){e.size?this._elementSelectorsByOwner.set(t,new Set(e)):this._elementSelectorsByOwner.delete(t);var n=new Set;this._elementSelectorsByOwner.forEach(function(e){e.forEach(function(e){return n.add(e)})}),this._elementSelectors=n}},t.getElementSelectors=function(e,t){var n,r=[];return null==(n=this._elementSelectors)||n.forEach(function(n){var i;null==(i=V_())||null==(i=i.querySelectorAll(n))||i.forEach(function(i){e!==i&&t!==i||Vr(r,n)||r.push(n)})}),r},t._captureEvent=function(e,t,n){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r=n||c_(e);r_(r)&&(r=r.parentNode||null);var i,o=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&o.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&P_(r,o.rageclick)&&this._captureEvent(e,"$rageclick",n);var s,a=t===G_,u=a?d({},o,{dom_event_allowlist:void 0}):o;if(r&&function(e,t,n,r,i,o){var s,a=typeof window>"u"?void 0:window;if(!a||E_(e))return!1;if(null!=n&&n.url_allowlist&&!s_(n.url_allowlist,o))return!1;if(null!=n&&n.url_ignorelist&&s_(n.url_ignorelist,o))return!1;if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(function(e){return t.type===e}))return!1}var l=T_(e,r),c=l.parentIsUsefulElement,d=l.targetElementList;if(!l.isComplete)return!1;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(ri(n))return!0;for(var r,i,o=function(){var e=i.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},s=p(e);!(i=s()).done;)if(r=o())return r.v;return!1}(d,n))return!1;if(!h_(d,null==n?void 0:n.css_selector_allowlist))return!1;if(h_(d,null!==(s=null==n?void 0:n.css_selector_ignorelist)&&void 0!==s?s:__))return!1;try{var f=a.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return c?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(d_.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var l,c=Z_(r,{e:e,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),f=c.props;if(c.explicitNoCapture)return!1;var h=this.getElementSelectors(r,c.target);if(h&&h.length>0&&(f.$element_selectors=h),t===G_){var _=e.type||"clipboard";if("paste"!==_){var v,g,m=null==(v=W_())||null==(v=v.getSelection())?void 0:v.toString(),y=u_(m);if(!y)return!1;f.$selected_content=y,f.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}f.$copy_type=_}if("$autocapture"===t&&"change"===e.type&&o.capture_value_css_selector_allowlist&&!o.maskAllText&&(n_(s=r,"input")?!Vr(K_,s.type):n_(s,"textarea")||n_(s,"select")&&!s.multiple)&&function(e,t){var n;if(!I_(e))return!1;var r=null!==(n=t.css_selector_ignorelist)&&void 0!==n?n:__,i=new Set,o=e;n_(e,"select")&&(o=e.options[e.selectedIndex]||e);for(var s,a=function(){var e=o,t=a_(e);if(i.size>=1e3||i.has(o)||Vr(t,"ph-sensitive")||Vr(t,"ph-no-capture")||r.some(function(t){return f_(e,t)}))return{v:!1};i.add(o);var n=o.assignedSlot||o.parentNode;o=i_(n)?n.host:n&&t_(n)?n:null};o;)if(s=a())return s.v;return!0}(r,o)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){var b=o.capture_value_css_selector_allowlist,w=!1;try{w=ei(b)?!!b(r):Xr(b)&&b.some(function(e){return f_(r,e)})}catch(e){Q_.error("capture_value_css_selector_allowlist threw",e)}w&&(f.$input_value=r.value)}return null==(l=this._client)||l.capture(t,f),!0}}else this._clearPointer()},t.isBrowserSupported=function(){var e;return ei(null==(e=V_())?void 0:e.querySelectorAll)},a(e,[{key:"isEnabled",get:function(){var e,t;if(this._disposed)return!1;var n=null==(e=this._client)?void 0:e.kv.get(oh),r=this._isDisabledServerSide,i=this._refreshConfig();if(!i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse)return!1;var o=i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if(si(r)&&!ci(n)&&!o)return!1;var s=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!i.enabled&&!s}}])}(),tv="featureFlags",nv="logs",rv=Uint8Array,iv=Uint16Array,ov=Uint32Array,sv=new rv([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]),av=new rv([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]),uv=new rv([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lv=function(e,t){for(var n=new iv(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new ov(n[30]);for(r=1;30>r;++r)for(var o=n[r];n[r+1]>o;++o)i[o]=o-n[r]<<5|r;return[n,i]},cv=lv(sv,2),dv=cv[1];cv[0][28]=258,dv[258]=28;for(var fv=lv(av,0)[1],hv=new iv(32768),pv=0;32768>pv;++pv){var _v=(43690&pv)>>>1|(21845&pv)<<1;hv[pv]=((65280&(_v=(61680&(_v=(52428&_v)>>>2|(13107&_v)<<2))>>>4|(3855&_v)<<4))>>>8|(255&_v)<<8)>>>1}var vv=function(e,t,n){for(var r=e.length,i=0,o=new iv(t);r>i;++i)++o[e[i]-1];var s,a=new iv(t);for(i=0;t>i;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new iv(1<<t);var u=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,f=d|(1<<c)-1;f>=d;++d)s[hv[d]>>>u]=l}else for(s=new iv(r),i=0;r>i;++i)s[i]=hv[a[e[i]-1]++]>>>15-e[i];return s},gv=new rv(288);for(pv=0;144>pv;++pv)gv[pv]=8;for(pv=144;256>pv;++pv)gv[pv]=9;for(pv=256;280>pv;++pv)gv[pv]=7;for(pv=280;288>pv;++pv)gv[pv]=8;var mv=new rv(32);for(pv=0;32>pv;++pv)mv[pv]=5;var yv=vv(gv,9,0),bv=vv(mv,5,0),wv=function(e){return(e/8|0)+(7&e&&1)},Sv=function(e,t,n){(null==t||0>t)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof iv?iv:e instanceof ov?ov:rv)(n-t);return r.set(e.subarray(t,n)),r},kv=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},xv=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cv=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new rv(0),0];if(1==i){var s=new rv(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=i-1;)a=n[n[d].f>n[l].f?l++:d++],u=n[l!=c&&n[d].f>n[l].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(r=1;i>r;++r)o[r].s>f&&(f=o[r].s);var h=new iv(f+1),p=Pv(n[c-1],h,0);if(p>t){r=0;var _=0,v=p-t,g=1<<v;for(o.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});i>r;++r){var m=o[r].s;if(t>=h[m])break;_+=g-(1<<p-h[m]),h[m]=t}for(_>>>=v;_>0;){var y=o[r].s;t>h[y]?_-=1<<t-h[y]++-1:++r}for(;r>=0&&_;--r){var b=o[r].s;h[b]==t&&(--h[b],++_)}p=t}return[new rv(h),p]},Pv=function(e,t,n){return-1==e.s?Math.max(Pv(e.l,t,n+1),Pv(e.r,t,n+1)):t[e.s]=n},Ev=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new iv(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;t>=a;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Tv=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Fv=function(e,t,n){var r=n.length,i=wv(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;r>o;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Iv=function(e,t,n,r,i,o,s,a,u,l,c){kv(t,c++,n),++i[256];for(var d=Cv(i,15),f=d[0],h=d[1],p=Cv(o,15),_=p[0],v=p[1],g=Ev(f),m=g[0],y=g[1],b=Ev(_),w=b[0],S=b[1],k=new iv(19),x=0;m.length>x;++x)k[31&m[x]]++;for(x=0;w.length>x;++x)k[31&w[x]]++;for(var C=Cv(k,7),P=C[0],E=C[1],T=19;T>4&&!P[uv[T-1]];--T);var F,I,R,A,M=l+5<<3,O=Tv(i,gv)+Tv(o,mv)+s,L=Tv(i,f)+Tv(o,_)+s+14+3*T+Tv(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(O>=M&&L>=M)return Fv(t,c,e.subarray(u,u+l));if(kv(t,c,1+(O>L)),c+=2,O>L){F=vv(f,h,0),I=f,R=vv(_,v,0),A=_;var D=vv(P,E,0);for(kv(t,c,y-257),kv(t,c+5,S-1),kv(t,c+10,T-4),c+=14,x=0;T>x;++x)kv(t,c+3*x,P[uv[x]]);c+=3*T;for(var q=[m,w],N=0;2>N;++N){var B=q[N];for(x=0;B.length>x;++x)kv(t,c,D[j=31&B[x]]),c+=P[j],j>15&&(kv(t,c,B[x]>>>5&127),c+=B[x]>>>12)}}else F=yv,I=gv,R=bv,A=mv;for(x=0;a>x;++x)if(r[x]>255){var j;xv(t,c,F[257+(j=r[x]>>>18&31)]),c+=I[j+257],j>7&&(kv(t,c,r[x]>>>23&31),c+=sv[j]);var H=31&r[x];xv(t,c,R[H]),c+=A[H],H>3&&(xv(t,c,r[x]>>>5&8191),c+=av[H])}else xv(t,c,F[r[x]]),c+=I[r[x]];return xv(t,c,F[256]),c+I[256]},Rv=new ov([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Av=new rv(0),Mv=function(){for(var e=new ov(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ov=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Lv(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;t.length>r;++r)n=Mv[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o,s,a,u,l=(i=e,o=t,s=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,n,r,i,o){var s=e.length,a=new rv(r+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||8>s)for(var c=0;s>=c;c+=65535){var d=c+65535;s>d?l=Fv(u,l,e.subarray(c,d)):(u[c]=o,l=Fv(u,l,e.subarray(c,s)))}else{for(var f=Rv[t-1],h=f>>>13,p=8191&f,_=(1<<n)-1,v=new iv(32768),g=new iv(_+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new ov(25e3),S=new iv(288),k=new iv(32),x=0,C=0,P=(c=0,0),E=0,T=0;s>c;++c){var F=b(c),I=32767&c,R=g[F];if(v[I]=R,g[F]=I,c>=E){var A=s-c;if((x>7e3||P>24576)&&A>423){l=Iv(e,u,0,w,S,k,C,P,T,c-T,l),P=x=C=0,T=c;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)k[M]=0}var O=2,L=0,D=p,q=I-R&32767;if(A>2&&F==b(c-q))for(var N=Math.min(h,A)-1,B=Math.min(32767,c),j=Math.min(258,A);B>=q&&--D&&I!=R;){if(e[c+O]==e[c+O-q]){for(var H=0;j>H&&e[c+H]==e[c+H-q];++H);if(H>O){if(O=H,L=q,H>N)break;var z=Math.min(q,H-2),U=0;for(M=0;z>M;++M){var W=c-q+M+32768&32767,V=W-v[W]+32768&32767;V>U&&(U=V,R=W)}}}q+=(I=R)-(R=v[I])+32768&32767}if(L){w[P++]=268435456|dv[O]<<18|fv[L];var G=31&dv[O],K=31&fv[L];C+=sv[G]+av[K],++S[257+G],++k[K],E=c+O,++x}else w[P++]=e[c],++S[e[c]]}}l=Iv(e,u,o,w,S,k,C,P,T,c-T,l),o||(l=Fv(u,l,Av))}return Sv(a,0,r+wv(l)+i)}(i,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,s,a,!u)),c=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ov(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Ov(l,c-8,n.d()),Ov(l,c-4,r),l}var Dv=!!Dh||!!Lh,$v=new WeakMap,qv="text/plain",Nv=0,Bv=!1,jv=function(e,t){var n=e.split("#"),r=n[1],i=n[0].split("?"),o=i[0],s=i[1];if(!s)return e;var a=s.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return o+(a?"?"+a:"")+(r?"#"+r:"")},Hv=function(e,t,n){void 0===n&&(n=!0);var r=e.indexOf("#"),i=-1===r?"":e.slice(r),o=-1===r?e:e.slice(0,r),s=o.indexOf("?"),a=-1===s?o:o.slice(0,s),u=-1===s?"":o.slice(s+1),l=d({},t),c=u.split("&").filter(function(e){return""!==e}).map(function(e){var t=e.indexOf("="),r=-1===t?e:e.slice(0,t),i=n?l[r]:void 0;return delete l[r],ai(i)?e:r+"="+i}),f=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return Cl(e,function(e,t){ri(e)||ri(t)||"undefined"===t||(n=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n)}),i.join(t)}(l);return f&&c.push(f),""+(c.length>0?a+"?"+c.join("&"):a)+i},zv=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===yh){var r=Lv(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new rv(e.length+(e.length>>>1)),r=0,i=function(e){n[r++]=e},o=0;t>o;++o){if(r+5>n.length){var s=new rv(r+8+(t-o<<1));s.set(n),n=s}var a=e.charCodeAt(o);128>a?i(a):2048>a?(i(192|a>>>6),i(128|63&a)):a>55295&&57344>a?(i(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++o))>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|63&a)):(i(224|a>>>12),i(128|a>>>6&63),i(128|63&a))}return Sv(n,0,r)}(Vh(t)),{mtime:0});return{contentType:qv,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===bh){var i=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):e}(Vh(t)),o="sendBeacon"===e.transport,s=o?i:function(e){return"data="+encodeURIComponent("string"==typeof e?e:Vh(e))}(i);return{contentType:o?qv:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Vh(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Uv=function(e){var t,n,r=function(){return"sendBeacon"===e.transport?{url:Hv(e.url,{compression:bh}),encodedBody:zv(d({},e,{compression:bh,_encodedBody:void 0}))}:{url:jv(e.url,"compression"),encodedBody:zv(d({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=zv(e)}catch(t){if(js(e.compression,Gh(e.url,"compression")))return Sl.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&js(e.compression,Gh(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?Bs(new Uint8Array(n)):ArrayBuffer.isView(n)&&Bs(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Bv=!0,r()):{url:e.url,encodedBody:t}},Wv=function(e){try{return Uv(e)}catch(t){return Sl.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Vv=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return n=Vh(t.data),e.n=1,Ks(n,Jh.DEBUG,{rethrow:!0});case 1:if(r=e.v){e.n=2;break}return e.a(2,t);case 2:return e.n=3,r.arrayBuffer();case 3:return e.a(2,d({},t,{_encodedBody:{contentType:qv,body:i=e.v,estimatedSize:i.byteLength}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),Gv=function(e){return jo("AbortError","PostHog request timed out"+(e?" after "+e+"ms":""))},Kv=/Failed to fetch|NetworkError|Load failed/i,Qv=function(e){return"TypeError"===(null==e?void 0:e.name)&&Kv.test((null==e?void 0:e.message)||"")},Yv=function(e){try{var t=function(e,t,n){if(void 0===t&&(t=Date.now()),void 0===n&&(n=$o),"string"==typeof e&&e){var r=e.trim(),i=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(i)){var o=1e3*Math.min(Number(i),n/1e3);return o>0?o:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i)){var s=/^\w{3} \w{3} /.test(i)?i+" GMT":i,a=Date.parse(s)-t;if(Number.isFinite(a)&&a>0)return Math.min(a,n)}}}(e());return ri(t)?void 0:Math.min(t,3e4)}catch(e){return}},Jv=function(e){var t=Wv(e);if(t){var n=new Dh;$v.set(n,!0);var r=t.url,i=t.encodedBody;n.open(e.method||"GET",r,!0);var o=null!=i?i:{},s=o.contentType,a=o.body;Cl(e.headers,function(e,t){n.setRequestHeader(t,e)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout);var u=!1;n.ontimeout=function(){u=!0},n.onloadend=function(){if(u){var t=Gv(e.timeout);return Sl.warn(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}var r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(r,Yv(function(){return n.getResponseHeader("Retry-After")}))},null==e.onSend||e.onSend(r),n.send(a)}},Zv=function(e){var t=Wv(e);if(t){var n=t.url,r=t.encodedBody,i=null!=r?r:{},o=i.contentType,s=i.body,a=i.estimatedSize,u=new Headers;Cl(e.headers,function(e,t){u.append(t,e)}),o&&u.append("Content-Type",o);var l=null,c=!1;if($h){var f=new $h;l={signal:f.signal,timeout:setTimeout(function(){c=!0;try{f.abort(Gv(e.timeout))}catch(e){p(e)}},e.timeout)}}var h=!1,p=function(t){h||(h=!0,c&&"AbortError"===(null==t?void 0:t.name)||Qv(t)?Sl.warn(t):Sl.error(t),null==e.callback||e.callback({statusCode:0,error:t}))},_=0,v=function(){Nv-=_,_=0,l&&clearTimeout(l.timeout)};try{var g,m=d({method:(null==e?void 0:e.method)||"GET",headers:u,referrerPolicy:"strict-origin",body:s,signal:null==(g=l)?void 0:g.signal},e.fetchOptions);null==e.onSend||e.onSend(n);var y=null!=a?a:ri(s)?0:void 0;m.keepalive="POST"===m.method&&!e._keepaliveDisabled&&!1!==m.keepalive&&m.body===s&&!ri(y)&&y>=0&&52428.8>Nv+y,m.keepalive&&(Nv+=_=y),Lh(n,m).then(function(t){return t.text().then(function(n){if(!h){var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){Sl.error(e)}h=!0,v(),null==e.callback||e.callback(r,Yv(function(){return t.headers.get("Retry-After")}))}})}).catch(function(e){v(),p(e)}).finally(v)}catch(e){v(),p(e)}}},Xv=function(e){try{var t,n=Uv(e),r=n.url,i=n.encodedBody,o=null!=i?i:{},s=o.body,a=o.estimatedSize;if(!s)return;var u=s instanceof Blob?s:new Blob([s],{type:o.contentType});if(Ah.sendBeacon(r,u))return;var l=Xr(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Xr(l)&&l.length>1&&(null!=a?a:0)>16384){var c=Math.ceil(l.length/2),f=function(t){return Xr(e.data)?t:d({},e.data,{batch:t})};return Xv(d({},e,{data:f(l.slice(0,c))})),void Xv(d({},e,{data:f(l.slice(c))}))}Sl.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to "+(Lh?"fetch":"XHR")),Lh?Zv(d({},e,{_keepaliveDisabled:!0})):Jv(e)}catch(e){Sl.warn("Beacon send failed",e)}},eg=function(e,t,n,r){var i,o="query"===r?"POST"===t?"sent_at":"_":void 0;return Hv(n===yh?jv(e,"compression"):e,d({},o?((i={})[o]=Date.now().toString(),i):{},n===yh?{}:{compression:n}))},tg=function(){var e=[];return Lh&&e.push({transport:"fetch",method:Zv}),Dh&&e.push({transport:"XHR",method:Jv}),null!=Ah&&Ah.sendBeacon&&e.push({transport:"sendBeacon",method:Xv}),e}(),ng=function(){var e;return null!=Ih&&null!=(e=Ih.performance)&&e.now?Ih.performance.now():Date.now()},rg=[],ig=function(e){try{return og(e)}catch(e){return}},og=function(e){var t,n=null==Ih?void 0:Ih.PerformanceObserver,r=null==(t=Hh(e))?void 0:t.href;if(n&&r){var i,o,s,a=ng(),u={name:r,before:1/0,inFlight:!0},l=1/0,c=!1,d=function(){c||(c=!0,clearTimeout(s),_.disconnect(),rg.splice(rg.indexOf(u),1))},f=!1,h=function(e){for(var t,n=p(e);!(t=n()).done;){var s=t.value,c=s.startTime;s.name!==r||(f?a>=c:a>c)||c>=u.before||i&&c>=i.startTime||(i=s)}if(i&&o&&l>=i.startTime){var h=o;d(),h(i)}},_=new n(function(e){return h(e.getEntriesByName(r,"resource"))});_.observe({entryTypes:["resource"]});for(var v=0,g=rg;g.length>v;v++){var m=g[v];m.name===r&&(m.before=Math.min(m.before,a),f=f||m.inFlight)}return rg.push(u),{take:function(e,t){c||(l=e,u.inFlight=!1,o=t,s=setTimeout(d,5e3),ei(_.takeRecords)&&h(_.takeRecords()))},stop:d}}},sg=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4],ag=[5,10,25].concat(sg),ug=function(e,t){var n,r,i=t.statusCode||void 0,o={"server.address":(null!==(n=null==(r=Hh(e))?void 0:r.hostname)&&void 0!==n?n:e).replace(/^\[(.*)\]$/,"$1")};i&&(o["http.response.status_code"]=i);var s=function(e,t){return e?400>e?void 0:String(e):"AbortError"===(null==t?void 0:t.name)?"timeout":"_OTHER"}(i,t.error);s&&(o["error.type"]=s);var a=Yh();return a&&(o["client.timezone"]=a),o},lg=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);for(var n,r={},i=p(e);!(n=i()).done;){var o=n.value,s=null==t?void 0:t.get_property(o);ri(s)||(r[o]=s)}return r},t.set=function(e,t){var n,r;null==(n=this._instance.persistence)||n.register("string"==typeof e?((r={})[e]=t,r):e)},t.remove=function(e){var t;null==(t=this._instance.persistence)||t.unregister(e)},e}(),cg=function(){"use strict";function e(e){var t=this;this.instance=e,this._logger=Sl,this.kv=new lg(e),this.onSession=function(e){return wh(t.instance.onSessionId(function(n){try{e(n)}catch(e){t._logger.error("Browser extension session listener failed",e)}}))},this.onEvent=function(e){return wh(t.instance._addCaptureHook(function(n,r){if(r)try{e({event:n,properties:r.properties})}catch(e){t._logger.error("Browser extension event listener failed",e)}}))},this.onRemoteConfig=function(e){var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},r=t.instance._internalEventEmitter.on("extensionsRemoteConfig",n);return t.instance._lastRemoteConfig&&n(t.instance._lastRemoteConfig),wh(r)}}var t=e.prototype;return t.getExtension=function(e){var t;switch(e){case tv:case qr:t=this.instance.featureFlags;break;case nv:t=this.instance.logs;break;case"surveys":t=this.instance.surveys;break;case X_:t=this.instance.autocapture}return t},t.capture=function(e,t,n){if(!n)return this._notRateLimited(this.instance.capture(e,t));var r=d({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},"unload"===n.delivery?{transport:"sendBeacon",send_instantly:!0}:{},"immediate"===n.delivery?{send_instantly:!0}:{});return this._notRateLimited(this.instance.capture(e,t,r))},t._notRateLimited=function(e){var t;return!ri(e)||!(null!=(t=this.instance.rateLimiter)&&t.lastEventRateLimited)},t.registerDynamicEventProperties=function(e){return wh(this.instance._registerExtensionEventProperties(e))},t.sendRequest=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a,u=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),i=null!==(r=n.target)&&void 0!==r?r:"api",o=n.query?Hv(t,n.query):t,s=this.instance.requestRouter.endpointFor(i,o),a={method:n.method,url:s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:"flags"===n.target&&"best-available"===n.compression?jr.Base64:void 0,timestampMode:n.sentAt},"api"===i&&"/i/v1/logs"===t&&(a.batchKey="logs"),"sendBeacon"!==n.transport){e.n=1;break}return this.instance._send_request(a),e.a(2,{statusCode:202});case 1:return e.a(2,new Promise(function(e){var t,n,r;a.callback=e,"flags"===i&&null!=(t=u.instance.config.metrics)&&t.flags&&(a.onDispatch=function(){n=ng()},a.onSend=function(e){r=ig(e)},a.callback=function(t){var i;if(e(t),!ri(n)){var o=n,a=ng();try{var l=ug(s,t);if(u._recordFlagsHistogram("posthog.flags.request.duration",a-o,sg,l),t.statusCode&&r)return void r.take(a,function(e){return u._recordFlagsSplit(e,o,a,l)})}catch(e){Sl.error("Failed to record the /flags request timing",e)}null==(i=r)||i.stop()}}),u.instance._send_request(a)}))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t._recordFlagsSplit=function(e,t,n,r){if(e.responseEnd>=e.startTime)try{var i=Math.min(e.responseEnd,n);this._recordFlagsHistogram("posthog.flags.request.pre_send_duration",e.startTime-t,ag,r),this._recordFlagsHistogram("posthog.flags.request.network_duration",i-e.startTime,sg,r),this._recordFlagsHistogram("posthog.flags.request.main_thread_duration",n-i,ag,r)}catch(e){Sl.error("Failed to record the /flags request timing split",e)}},t._recordFlagsHistogram=function(e,t,n,r){var i;null==(i=this.instance.metrics)||i.histogram(e,t,{unit:"ms",attributes:d({},r),bounds:n})},a(e,[{key:"logger",get:function(){return this._logger}},{key:"distinctId",get:function(){return this.instance.get_distinct_id()}},{key:"anonymousId",get:function(){var e;return null!==(e=this.instance.get_property("$device_id"))&&void 0!==e?e:this.distinctId}},{key:"deviceId",get:function(){var e=this.instance.get_property(Xh);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:Jh.LIB_NAME,version:Jh.LIB_VERSION}}},{key:"initialPersonProperties",get:function(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}},{key:"groups",get:function(){return this.instance.getGroups()}},{key:"session",get:function(){try{var e,t,n,r,i,o=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==o?void 0:o.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==o?void 0:o.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(r=null==o?void 0:o.sessionStartTimestamp)&&void 0!==r?r:0,lastActivityTimestamp:null!==(i=null==o?void 0:o.lastActivityTimestamp)&&void 0!==i?i:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}},{key:"isOptedOut",get:function(){return this.instance.has_opted_out_capturing()}},{key:"canCapture",get:function(){return ei(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}},{key:"isRateLimited",get:function(){var e;return!(null==(e=this.instance.rateLimiter)||!e.isClientRateLimited)}},{key:"projectToken",get:function(){return this.instance.config.token}}])}(),dg=function(e){var t;return null!=e&&e.config.require_subresource_integrity?e.__loadExternalDependency:null==(t=jh.__PosthogExtensions__)?void 0:t.loadExternalDependency},fg=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.get=function(){var e,t,n,r,i=null==(e=this._instance)?void 0:e.config;return{disableSurveys:!(null==i||!i.disable_surveys),cookielessMode:!(null==i||!i.cookieless_mode),advancedEnableSurveys:!(null==i||!i.advanced_enable_surveys),requestTimeoutMs:null!==(t=null==i?void 0:i.surveys_request_timeout_ms)&&void 0!==t?t:1e4,prefillFromUrl:!(null==i||null==(n=i.surveys)||!n.prefillFromUrl),automaticDisplay:!(null!=i&&i.disable_surveys_automatic_display),featureFlagEvaluation:!(null!=i&&i.advanced_disable_feature_flags),overrideLanguage:null==i?void 0:i.override_display_language,prepareStylesheet:null==i?void 0:i.prepare_external_dependency_stylesheet,get_current_url:null==i?void 0:i.get_current_url,uiHost:null==(r=this._instance)||null==(r=r.requestRouter)?void 0:r.endpointFor("ui","")}},t.getExtensions=function(){var e=null==jh?void 0:jh.__PosthogExtensions__;if(e&&this._instance){var t=this._instance,n=e.generateSurveys,r=dg(t);return{generateSurveys:n?function(e){return n(t,e)}:void 0,loadExternalDependency:r?function(e){return r(t,"surveys",e)}:void 0}}},t.onMatchingConditionsChanged=function(e){var t,n,r=null==(t=this._instance)?void 0:t._addCaptureHook(function(t){"$pageview"!==t&&t!==cl&&t!==dl&&t!==fl||e()}),i=function(){return e()};Ml(Ih,"PHSurveyShown",i);var o=!1,s=null==(n=this._instance)?void 0:n.onFeatureFlags(function(){o&&e()});return o=!0,function(){o=!1,null==r||r(),null==s||s(),null==Ih||Ih.removeEventListener("PHSurveyShown",i)}},e}(),hg=function(e){"use strict";function t(t){return e.call(this,new fg(t))||this}return r(t,e),t}(Fh),pg=new WeakMap,_g=function(e,t){var n=function(e){var t,n=new fg(e);if(!e)return{get config(){return n.get()}};if(null!=(t=e.surveys)&&t.getRenderContext)return e.surveys.getRenderContext();var r=pg.get(e);return r||(r={client:new cg(e),get config(){return n.get()},surveys:e.surveys},pg.set(e,r)),r}(e);return n?function(e,t){if("u">=typeof document&&"u">=typeof window){var n=new dh(e);return!1===e.config.automaticDisplay?(Zl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n):!1===t?(Zl.info("There are no surveys to load or Surveys is disabled in the project settings."),n):(n.startAutomaticDisplay(),n)}}(n,t):void 0};function vg(e,t,n){return Vh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}jh.__PosthogExtensions__=jh.__PosthogExtensions__||{},jh.__PosthogExtensions__.generateSurveys=_g,jh.extendPostHogWithSurveys=_g;var gg=function(e){return _i(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message)},mg=kl("[Error tracking]"),yg="webkit-masked-url:",bg=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],wg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",yg],Sg=["__firefox__","__gCrWeb"];function kg(){return new Qo([new vs,new Ps,new ms,new gs,new xs,new ks,new bs,new Cs],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var i=[],o=t.split("\n"),s=Math.min(o.length,r+1e3),a=[],u=r;s>u;u++){var l=o[u];if(1024>=l.length){var c=us.test(l)?l.replace(us,"$1"):l;if(!c.match(/\S*Error: /)){for(var f=0,h=n;h.length>f;f++){var _=(0,h[f])(c,e);if(_){i.push(_);var v=cs(i);if(v){for(var g=a.length-1;g>=0;g--){var m=a[g];if(v.start>=m.start+m.length)break;a.pop()}a.push(v)}break}}if(ps(i,a)>=50)break}}}var y=[].concat(a).sort(function(e,t){return t.start-e.start}),b=y[y.length-1];if(b){var w=fs(i,b);i.splice(b.start-w,w);for(var S,k=p(y);!(S=k()).done;)S.value.start-=w}for(var x,C=p(y);!(x=C()).done;)ds(i,x.value);return a.some(function(e){return 0===e.start&&i.length===e.length})&&function(e){for(var t=e.map(function(e){return e.function+"|"+e.filename+"|"+e.lineno+"|"+e.colno+"|"+e.module}),n=0,r=1;t.length>r;r++)_s(t,r,n)&&(n=r);e.push.apply(e,e.splice(0,n))}(i),function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(function(e){return d({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||"?"});var n})}(i)}}("web:javascript",is,as))}var xg=function(){"use strict";function e(e){var t,n;this._suppressionRules=[],this._errorPropertiesBuilder=kg(),this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property("$error_tracking_suppression_rules"))&&void 0!==t?t:[],this._exceptionStepsConfig=Rs(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new As(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=Rs(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,r,i;if(e.ok){var o=e.config;if("errorTracking"in o){var s=null!==(t=null==(n=o.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[],a=null==(r=o.errorTracking)?void 0:r.captureExtensionExceptions;this._suppressionRules=s,this._instance.persistence&&this._instance.persistence.register(((i={})[lp]=this._suppressionRules,i[cp]=a,i))}}},t.buildProperties=function(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})},t.addExceptionStep=function(e,t){if(this._exceptionStepsConfig.enabled)try{var n;if(!ii(e)||0===e.trim().length)return void mg.warn("Ignoring exception step because message must be a non-empty string");var r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,r){return Fs.has(r)?(t.push(r),n):(n[r]=e[r],n)},{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),i=r.sanitizedProperties,o=r.droppedKeys;o.length>0&&mg.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this._exceptionStepsBuffer.add(d(((n={})[Es]=e,n[Ts]=(new Date).toISOString(),n),i))}catch(e){mg.error("Failed to add exception step. Ignoring breadcrumb.",e)}},t.sendExceptionEvent=function(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void mg.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void mg.info("Skipping exception capture because it was thrown by an extension");if(!this._captureExtensionExceptions&&this._isInjectedBrowserScriptException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by an injected browser script"),void mg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void mg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this._exceptionStepsConfig.enabled&&ai(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,r=function(){if("u">typeof process){var e,t=null==(e=process.env.POSTHOG_RELEASE_ID)?void 0:e.trim();if(t)return t}var n=globalThis._posthogReleaseId;return"string"==typeof n&&n.length>0?n:void 0}();r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return gg(e)||mg.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void(gg(e)||mg.error("Failed to process exception event. Ignoring this exception.",e))}},t._addBufferedExceptionSteps=function(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:d({},e,{$exception_steps:t})}catch(t){return mg.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}},t._addDroppedExceptionStep=function(e){var t;this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add(((t={})[Es]=e,t[Ts]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return ti(e)?d({},e):{}},t._getExceptionStepsConfig=function(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}},t._matchesSuppressionRule=function(e){if(0===e.length)return!1;try{var t=e.reduce(function(e,t){var n=t.type,r=t.value;return ii(n)&&n.length>0&&e.$exception_types.push(n),ii(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(function(e){var n=e.values.map(function(e){var n=Ql[e.operator],r=t[e.key];if(!n||!r)return!1;var i=Xr(e.value)?e.value:[e.value];return i.length>0&&n(i,r)});return"OR"===e.type?n.some(Boolean):n.every(Boolean)})}catch(e){return mg.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}},t._isExtensionException=function(e){var t=e.flatMap(function(e){var t,n;return null!==(t=null==(n=e.stacktrace)?void 0:n.frames)&&void 0!==t?t:[]}),n=t.filter(function(e){var t=e.filename;return!!t&&wg.some(function(e){return t.startsWith(e)})});return 0!==n.length&&(!n.every(function(e){var t=e.filename;return!!t&&t.startsWith(yg)})||e.some(function(e){var t=e.value;return"NoResponse"===e.type||ii(t)&&bg.some(function(e){var n=e.value;return e.exact?t===n:t.includes(n)})})&&!t.some(function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(yg))}))},t._isInjectedBrowserScriptException=function(e){return e.some(function(e){var t=e.value;return ii(t)&&Sg.some(function(e){return t.includes(e)})})},t._isPostHogException=function(e){if(e.length>0){var t,n,r,i,o=null!==(t=null==(n=e[0].stacktrace)?void 0:n.frames)&&void 0!==t?t:[];return null!==(r=null==(i=o[o.length-1])||null==(i=i.filename)?void 0:i.includes("posthog.com/static"))&&void 0!==r&&r}return!1},t._isExceptionList=function(e){return!ai(e)&&Xr(e)},a(e,[{key:"_captureExtensionExceptions",get:function(){var e,t,n=!!this._instance.get_property(cp);return null!==(e=null!==(t=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==t?t:n)&&void 0!==e&&e}}])}(),Cg=kl("[ExceptionAutocapture]"),Pg=kg(),Eg=function(e,t){try{return e()}catch(e){return t}},Tg=function(e){var t;return ei(e)?null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__:void 0},Fg=function(e,t){return Eg(function(){return e(t())},void 0)},Ig=function(e){return Eg(function(){return ei(e)&&ei(e.call)},!1)},Rg=function(e,t){return Eg(function(){e.__POSTHOG_INSTRUMENTED__=!0,Object.defineProperty(e,"__posthog_layer__",{enumerable:!1,value:t})},void 0)},Ag=function(e,t,n,r){Eg(function(){delete n.__POSTHOG_INSTRUMENTED__},void 0),Eg(function(){var i=e[t];if(i!==n)for(var o=[],s=Tg(i);s&&-1===o.indexOf(s);){if(s.next===n)return void((s.checksNext||Ig(r.next))&&(s.next=r.next));o.push(s),s=Tg(s.next)}else e[t]=r.next},void 0)},Mg=function(e){var t=Ih;t||Cg.info("window not available, cannot wrap onerror");var n={next:Eg(function(){return t.onerror},void 0),checksNext:!0},r=e,i=function(){for(var e,t=arguments.length,i=new Array(t),o=0;t>o;o++)i[o]=arguments[o];r&&Fg(r,function(){return Pg.buildFromUnknown(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(null!=o)return o;if(ii(t)&&ii(n)&&n.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:n,lineno:r,colno:i})}catch(e){return t}return t}(i),{mechanism:{handled:!1}})});var s=n.next;return!!Ig(s)&&null!==(e=s.apply(void 0,i))&&void 0!==e&&e};return t.onerror=i,Rg(i,n),function(){r=void 0,Ag(t,"onerror",i,n)}},Og=function(e,t){void 0===t&&(t=!1);var n=Ih;n||Cg.info("window not available, cannot wrap onUnhandledRejection");var r={next:Eg(function(){return n.onunhandledrejection},void 0),checksNext:!0},i=e,o=function(e){var n;i&&Fg(i,function(){return Pg.buildFromUnknown(e,{mechanism:{handled:!1}})});var o=r.next;return Ig(o)?null!==(n=o(e))&&void 0!==n&&n:t};return n.onunhandledrejection=o,Rg(o,r),function(){i=void 0,Ag(n,"onunhandledrejection",o,r)}},Lg={wrapOnError:Mg,wrapUnhandledRejection:Og,wrapConsoleError:function(e){var t=console;t||Cg.info("console not available, cannot wrap console.error");var n={next:Eg(function(){return t.error},void 0),checksNext:!0},r=e,i=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r&&!Eg(function(){return t.length>1&&ii(t[0])&&(/^\[PostHog\.js\](?: |$)/.test(t[0])||"rrweb logger error:"===t[0])},!1)&&Fg(r,function(){var e;e=1==t.length?t[0]:t.join(" ");var n=t.find(function(e){return e instanceof Error});return Pg.buildFromUnknown(n||e,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})});var o=n.next;Ig(o)&&o.apply(void 0,t)};return t.error=i,Rg(i,n),function(){r=void 0,Ag(t,"error",i,n)}}};jh.__PosthogExtensions__=jh.__PosthogExtensions__||{},jh.__PosthogExtensions__.errorWrappingFunctions=Lg,jh.posthogErrorWrappingFunctions=Lg;var Dg=function(e,t){if(ei(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,r=!si(n)&&"object"==typeof n&&Xr(n.errors_to_ignore)?n.errors_to_ignore.reduce(function(e,t){try{e.push(new RegExp(t))}catch(e){Cg.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e},[]):[],i=function(t){try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){Cg.error("Failed to capture exception for a legacy client",e)}};Mg(function(e){r.some(function(t){return e.$exception_list.some(function(e){return t.test(e.value||"")})})||i(e)}),Og(i,!0)}};jh.extendPostHogWithExceptionAutoCapture=Dg,jh.extendPostHogWithExceptionAutocapture=Dg;var $g=function(){},qg=function(e){var t;if(ei(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function Ng(e,t,n){try{if(!(t in e))return $g;var r={next:e[t]},i=n(function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)});return ei(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,function(){if(e[t]!==i)for(var n=e[t],o=qg(n);o;){if(o.next===i)return void(o.next=r.next);o=qg(n=o.next)}else e[t]=r.next}}catch(e){return $g}}var Bg="X-POSTHOG-SESSION-ID",jg="X-POSTHOG-WINDOW-ID",Hg="X-POSTHOG-DISTINCT-ID",zg=[Bg,jg,Hg],Ug="traceparent",Wg=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Vg=function(e,t){return{}.hasOwnProperty.call(e,t)},Gg=function(e){return"object"==typeof e&&!si(e)||ei(e)},Kg=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},Qg=function(e){try{var t;return Kg(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Ih||null==(t=Ih.location)?void 0:t.href).toString()}catch(e){return}},Yg=function(e,t,n,r,i){var o;try{o=new URL(r).hostname}catch(e){return!1}if(!e)return!1;if(Xr(e)&&!e.includes(o))return!1;var s=!1,a=function(e){return ei(e)?e():e}(t);if(a&&"$posthog_cookieless"!==a){try{i.set(Hg,a)}catch(e){return!1}s=!0}if(n){var u=n.checkAndGetSessionAndWindowId(!0),l=u.windowId;i.set(Bg,u.sessionId),i.set(jg,l),s=!0}return s},Jg=function(e){var t=new Uint8Array(e),n=null==Ih?void 0:Ih.crypto;if(n&&ei(n.getRandomValues))n.getRandomValues(t);else for(var r=0;e>r;r++)t[r]=Math.floor(256*Math.random());for(var i="",o=0;e>o;o++)i+=(16>t[o]?"0":"")+t[o].toString(16);return i},Zg=function(e){for(var t=Jg(e);/^0+$/.test(t);)t=Jg(e);return t},Xg=function(){return"00-"+Zg(16)+"-"+Zg(8)+"-01"},em=function(e){try{return new URL(e).origin}catch(e){return}},tm=function(e,t){if(!Xr(e)||0===e.length)return!1;var n;try{n=new URL(t)}catch(e){return!1}for(var r=0;e.length>r;r++){var i=e[r];if(ii(i))if(i.indexOf("://")>-1){if(em(i)===n.origin)return!0}else if(i.toLowerCase()===n.hostname)return!0}return!1},nm=function(e,t,n){return!(n.has(Ug)||!tm(e,t)||(n.set(Ug,Xg()),0))};jh.__PosthogExtensions__=jh.__PosthogExtensions__||{};var rm={_patchFetch:function(e,t,n,r){return Ng(Ih,"fetch",function(i){return function(o,s){var a=arguments.length>1?[o,s]:[o],u=a;try{var l=Qg(o);if(l)if(Kg(o)){var c=new Request(o,s);u=[c];var f=new Headers;try{Yg(e,t,n,c.url,f),f.forEach(function(e,t){return c.headers.set(t,e)})}catch(e){}nm(r,c.url,c.headers)}else{var h=new Headers(Gg(s)?s.headers:void 0),p=Yg(e,t,n,l,h),_=nm(r,l,h);if(p||_){var v=function(e,t){if(ri(e)||si(e))return{headers:t};if(Gg(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(n);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),r}return new Proxy({headers:t},{get:function(e,t){return Vg(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return Vg(e,t)||t in n},ownKeys:function(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(n).forEach(function(e){return t.add(e)}),Wg.forEach(function(e){e in n&&t.add(e)}),Array.from(t)},getOwnPropertyDescriptor:function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r)return r;if("string"==typeof t&&Wg.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get:function(){return Reflect.get(n,t,n)}};var i=Reflect.getOwnPropertyDescriptor(n,t);return i?d({},i,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(s,h);v&&(u=[o,v])}}}catch(e){u=a}return i.apply(this,u)}})},_patchXHR:function(e,t,n,r){var i=Xr(r)&&"undefined"!=typeof WeakMap?new WeakMap:void 0,o=Ng(Ih.XMLHttpRequest.prototype,"open",function(r){return function(o,s,a,u,l){void 0===a&&(a=!0);var c=this,d=new Headers,f=Qg(s);if(f)try{Yg(e,t,n,f,d)}catch(e){d=new Headers}i&&(i.delete(c),f&&i.set(c,f));var h=r.call(c,o,s,a,u,l);return zg.forEach(function(e){var t=d.get(e);if(t)try{c.setRequestHeader(e,t)}catch(e){}}),h}});if(!i)return o;var s,a=Ih.XMLHttpRequest.prototype,u=Ng(a,"setRequestHeader",function(e){return function(t,n){return function(e){try{return String(e).toLowerCase()===Ug}catch(e){return!1}}(t)&&i.delete(this),e.call(this,t,n)}}),l=Ng(a,"send",function(e){return function(){var t=i.get(this);if(t){i.delete(this);try{var n;!tm(r,t)||function(e){try{return!!Ih&&new URL(e,Ih.location.href).origin===Ih.location.origin}catch(e){return!1}}(t)&&function(e){try{for(var t=e,n=0;ei(t)&&20>n;n++){var r,i,o,s=t;if(s.__wrapped)return!(null==Ih||null==(r=Ih[Symbol.for("opentelemetry.js.api.1")])||!r.propagation);t=null==(i=null!==(o=s.__posthog_layer__)&&void 0!==o?o:s.__rrweb_layer__)?void 0:i.next}return!1}catch(e){return!1}}(null==(n=s)?void 0:n.next)||this.setRequestHeader(Ug,Xg())}catch(e){}}return e.apply(this,arguments)}});try{var c;s=null==(c=a.send)?void 0:c.__posthog_layer__}catch(e){}return function(){l(),u(),o()}}};jh.__PosthogExtensions__.tracingHeadersPatchFns=rm,jh.postHogTracingHeadersPatchFns=rm;var im=function(e){if(Mh){try{for(var t=e+"=",n=Mh.cookie.split(";").filter(function(e){return e.length}),r=0;n.length>r;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},om="",sm=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var am=null,um={_is_supported:function(){if(!si(am))return am;if(am=!1,Mh)try{var e="__ph_cookie_support_"+xu();um._set(e,"xyz"),am='"xyz"'===im(e),um._remove(e)}catch(e){am=!1}return am},_error:function(e){Sl.error("cookieStore error: "+e)},_get:im,_parse:function(e){var t;try{t=JSON.parse(um._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(!Mh)return!1;try{var o="",s="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Mh),om)return om;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+xu();!om&&r--;){var o=n.slice(r).join("."),s=i+"=1;domain=."+o+";path=/";t.cookie=s+";max-age=3",t.cookie.includes(i)&&(t.cookie=s+";max-age=0",om=o)}return om}(e);if(!n){var r=function(e){var t=e.match(sm);return t?t[0]:""}(e);r!==n&&Sl.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(Mh.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),o="; expires="+u.toUTCString()}i&&(s="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&Sl.warn("cookieStore warning: large cookie, len="+l.length),Mh.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Mh&&Mh.cookie&&(!t||!si(im(e))))try{um._set(e,"",-1,t)}catch(e){return}}},lm=null,cm={_is_supported:function(){if(!si(lm))return lm;var e=!0;if(ri(Ih))e=!1;else try{var t="__mplssupport__";cm._set(t,"xyz"),'"xyz"'!==cm._get(t)&&(e=!1),cm._remove(t)}catch(t){e=!1}return e||Sl.error("localStorage unsupported; falling back to cookie store"),lm=e,e},_error:function(e){Sl.error("localStorage error: "+e)},_get:function(e){try{return null==Ih?void 0:Ih.localStorage.getItem(e)}catch(e){cm._error(e)}return null},_parse:function(e){try{return JSON.parse(cm._get(e))||{}}catch(e){}return null},_set:function(e,t){try{return null==Ih||Ih.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){cm._error(e)}return!1},_remove:function(e){try{null==Ih||Ih.localStorage.removeItem(e)}catch(e){cm._error(e)}}},dm=[Zf,Uf,Yf,Wf,th,Kf,Gf,Vf,Xf],fm=[Xh,Zh,Sp,kp,Ap,Rp,rp,Pp],hm=function(e){return e+"_cpm"},pm=["__proto__","constructor","prototype"],_m=function(e){if(!ti(e))return{};var t={};return Object.keys(e).forEach(function(n){-1===pm.indexOf(n)&&(t[n]=e[n])}),t},vm=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(fm,t).forEach(function(t){var r=e[t];ri(r)||si(r)||""===r||(n[t]=r)}),n},gm=function(e){for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},mm=function(e,t){return{p:t,f:gm(JSON.stringify(e))}},ym=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=um._parse(hm(e)),r=(null==n?void 0:n.f)===gm(t)&&Xr(n.p);return{properties:r?n.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},bm=function(e,t){return t+"|"+(um._get(hm(e))||"")},wm={},Sm={_is_supported:function(){return!0},_error:function(e){Sl.error("memoryStorage error: "+e)},_get:function(e){return e in wm?wm[e]:null},_parse:function(e){return e in wm?wm[e]:null},_set:function(e,t){return wm[e]=t,!0},_remove:function(e){delete wm[e]}},km=null,xm={_is_supported:function(){if(!si(km))return km;if(km=!0,ri(Ih))km=!1;else try{var e="__support__";xm._set(e,"xyz"),'"xyz"'!==xm._get(e)&&(km=!1),xm._remove(e)}catch(e){km=!1}return km},_error:function(e){Sl.error("sessionStorage error: ",e)},_get:function(e){try{return null==Ih?void 0:Ih.sessionStorage.getItem(e)}catch(e){xm._error(e)}return null},_parse:function(e){try{return JSON.parse(xm._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Ih||Ih.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){xm._error(e)}return!1},_remove:function(e){try{null==Ih||Ih.sessionStorage.removeItem(e)}catch(e){xm._error(e)}}},Cm=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return"always"===this._config.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._config.cookieless_mode},t.isOptedIn=function(){return!this.isOptedOut()},t.isExplicitlyOptedOut=function(){return 0===this.consent},t.isRejected=function(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default},t.optInOut=function(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)},t.reset=function(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)},t._getDnt=function(){return!!this._config.respect_dnt&&[null==Ah?void 0:Ah.doNotTrack,null==Ah?void 0:Ah.msDoNotTrack,jh.doNotTrack,null==Ah?void 0:Ah.globalPrivacyControl].some(function(e){return yi(e)})},a(e,[{key:"_config",get:function(){return this._instance.config}},{key:"consent",get:function(){return this._getDnt()?0:this._storedConsent}},{key:"_storageKey",get:function(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:"__ph_opt_in_out_"+t)}},{key:"_storedConsent",get:function(){var e=this._storage._get(this._storageKey);return yi(e)?1:Vr(bi,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?cm:um,n=t._is_supported()?t:Sm;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var r="localStorage"===e?um:cm;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(yi(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}(),Pm=kl("[Dead Clicks]"),Em=function(){return!0},Tm=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(fp)),r=e.instance.config.capture_dead_clicks;return ci(r)?r:!!ti(r)||n},Fm=function(){"use strict";function e(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}var t=e.prototype;return t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register(((t={})[fp]=n.captureDeadClicks,t)),this.startIfEnabledOrStop())}},t.startIfEnabledOrStop=function(){var e=this;this.isEnabled(this)?this._loadScript(function(){e._start()}):this.stop()},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=dg(this.instance))||n(this.instance,"dead-clicks-autocapture",function(t){t?Pm.error("failed to load script",t):e()})},t._start=function(){var e;if(Mh){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=jh.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=ti(this.instance.config.capture_dead_clicks)?d({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=jh.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Mh),Pm.info("starting...")}}else Pm.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Pm.info("stopping..."))},a(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Im=kl("[SegmentIntegration]");function Rm(e,t,n){void 0===n&&(n=!0);var r=e.config.segment;if(!r)return t();var i,o=function(e){return ei(e.register)}(i=r)?{analytics:i}:i,s=o.analytics,a=o.filterProperties;!function(e,t,n,r){var i=function(t){var i=function(){return t.anonymousId()||xu()};e.config.get_device_id=i,r&&t.id()&&(e.register({distinct_id:t.id(),$device_id:i()}),e.persistence.set_property(Pp,Gp)),n(r?void 0:t.anonymousId()||void 0)},o=t.user();"then"in o&&ei(o.then)?o.then(i):i(o)}(e,s,function(n){s.register(function(e,t,n){var r=(void 0===n?{}:n).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Im.warn("This browser does not have Promise support, and can not use the segment integration");var i=function(n,i){if(!i)return n;var o=!!t&&n.event.anonymousId===t&&!n.event.userId;o||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Im.info("No userId set, resetting PostHog"),e.reset()),o||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Im.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var s=e.calculateEventProperties(i,n.event.properties);if(!ai(r)){for(var a=n.event.properties||{},u={},l=0,c=Object.keys(s);c.length>l;l++){var f=c[l];Jr.call(a,f)||(u[f]=s[f])}var h=function(e,t){for(var n,r=Xr(e)?e:[e],i=d({},t),o=p(r);!(n=o()).done;){var s=n.value;try{if(i=s(i),ai(i))return null}catch(e){return Im.error("Error in Segment filterProperties:",e),null}}return i}(r,u);if(ai(h))return n;s=h}return n.event.properties=Object.assign({},s,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return i(e,e.event.event)},page:function(e){return i(e,Yp)},identify:function(e){return i(e,Zp)},screen:function(e){return i(e,"$screen")}}}(e,n,{filterProperties:a})).then(function(){t()},function(e){Im.error("Failed to register the Segment integration",e),t()})},n)}var Am="posthog-js";function Mm(e,t){var n=void 0===t?{}:t,r=n.organization,i=n.projectId,o=n.prefix,s=n.severityAllowList,a=void 0===s?["error"]:s,u=n.sendExceptionsToPostHog,l=void 0===u||u;return function(t){var n,s,u,c,f,h;if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var _=(null==(n=t.exception)?void 0:n.values)||[],v=_.map(function(e){return d({},e,{stacktrace:e.stacktrace?d({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(function(e){return d({},e,{platform:"web:javascript"})})}):void 0})}),g={$exception_message:(null==(s=_[0])?void 0:s.value)||t.message,$exception_type:null==(u=_[0])?void 0:u.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=_[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(f=_[0])?void 0:f.type,$sentry_tags:t.tags};return r&&i&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),l&&(null==(h=e.exceptions)||h.sendExceptionEvent(g)),t}}var Om=function(e,t,n,r,i,o){"use strict";this.name=Am,this.setupOnce=function(s){s(Mm(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==o||o}))}},Lm=function(){"use strict";function e(e){var t=this;this._onSessionIdChange=function(e,n,r){r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(Sl.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),t._currentPageview=void 0,t._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}var t=e.prototype;return t._setupSessionRotationHandler=function(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)},t.destroy=function(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0},t.doPageView=function(e,t){var n,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Ih?void 0:Ih.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r},t.doPageLeave=function(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)},t.doEvent=function(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}},t._previousPageViewProperties=function(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var o=i.maxScrollHeight,s=i.lastScrollY,a=i.maxScrollY,u=i.maxContentHeight,l=i.lastContentY,c=i.maxContentY;if(!(ri(o)||ri(s)||ri(a)||ri(u)||ri(l)||ri(c))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var d=o>1?xi(s/o,0,1,Sl):1,f=o>1?xi(a/o,0,1,Sl):1,h=u>1?xi(l/u,0,1,Sl):1,p=u>1?xi(c/u,0,1,Sl):1;r=Pl(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r},e}(),Dm=["flags","surveys"],$m=((u={}).$people_distinct_id={exposure:"hidden"},u[tp]={exposure:"hidden"},u.__cmpns={exposure:"hidden"},u[sp]={exposure:"hidden"},u[rp]={exposure:"hidden"},u[op]={exposure:"hidden"},u[oh]={exposure:"event"},u[ap]={exposure:"hidden"},u[pp]={exposure:"hidden"},u[up]={exposure:"event"},u[lp]={exposure:"hidden"},u[cp]={exposure:"event"},u[dp]={exposure:"event"},u[fp]={exposure:"event"},u[hp]={exposure:"hidden"},u[_p]={exposure:"event"},u[vp]={exposure:"hidden"},u.$session_recording_enabled_server_side={exposure:"hidden"},u[Sp]={exposure:"hidden"},u[kp]={exposure:"event"},u[gp]={exposure:"event",shouldSkipFromEventProperties:function(e){return si(e)}},u.$session_past_minimum_duration={exposure:"event"},u.$session_recording_url_trigger_activated_session={exposure:"event"},u.$session_recording_event_trigger_activated_session={exposure:"event"},u.$debug_first_full_snapshot_timestamp={exposure:"event"},u.$sess_rec_flush_size={exposure:"hidden"},u[Yf]={exposure:"hidden",storageGroup:"flags"},u[Uf]={exposure:"hidden",storageGroup:"flags"},u[zf]={exposure:"hidden"},u[Wf]={exposure:"hidden",storageGroup:"flags"},u[th]={exposure:"hidden",storageGroup:"flags"},u[Kf]={exposure:"hidden",storageGroup:"flags",volatile:!0},u[Qf]={exposure:"hidden",storageGroup:"flags"},u[nh]={exposure:"hidden"},u[rh]={exposure:"hidden"},u[Zf]={exposure:"hidden"},u[Jf]={exposure:"hidden"},u[Ar]={exposure:"hidden",storageGroup:"surveys"},u[Mr]={exposure:"hidden",storageGroup:"surveys",volatile:!0},u[Lr]={exposure:"event"},u[Dr]={exposure:"hidden"},u[$r]={exposure:"hidden"},u[Cp]={exposure:"hidden"},u.$product_tours_activated={exposure:"hidden"},u.$product_tours_activated_session={exposure:"hidden"},u.$conversations_widget_session_id={exposure:"event"},u.$conversations_ticket_id={exposure:"event"},u.$conversations_widget_state={exposure:"event"},u.$conversations_user_traits={exposure:"event"},u[Xf]={exposure:"hidden"},u[eh]={exposure:"hidden"},u[xp]={exposure:"event"},u[Vf]={exposure:"hidden"},u[Gf]={exposure:"hidden",storageGroup:"flags",volatile:!0},u[Pp]={exposure:"hidden"},u[Ep]={exposure:"hidden"},u[Tp]={exposure:"hidden"},u[Fp]={exposure:"hidden"},u[Ip]={exposure:"hidden"},u[Rp]={exposure:"hidden"},u[Ap]={exposure:"hidden"},u[mp]={exposure:"event"},u[yp]={exposure:"event"},u[bp]={exposure:"event"},u[wp]={exposure:"event"},u[Lp]={exposure:"event"},u[Dp]={exposure:"event"},u[$p]={exposure:"hidden"},u[qp]={exposure:"hidden"},u[Np]={exposure:"hidden"},u[Bp]={exposure:"hidden"},u[jp]={exposure:"hidden"},u[Hp]={exposure:"hidden"},u[zp]={exposure:"hidden"},u[Up]={exposure:"hidden"},u[Wp]={exposure:"hidden"},u.$session_recording_start_reason={exposure:"event"},u),qm=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Nm=function(e){var t=$m[e];if(t)return t;for(var n=0,r=qm;r.length>n;n++){var i=r[n],o=i[1];if(0===e.indexOf(i[0]))return o}},Bm=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],jm=["ScCid","SsCid"],Hm={sccid:jm},zm=function(){return[].concat(Bm,jm,["sscid"])}(),Um=function(){return["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Bm)}(),Wm="<masked>",Vm=["li_fat_id"];function Gm(e,t,n){if(!Mh)return{};var r,i=t?[].concat(zm,n||[]):[],o=Km(Kh(Mh.URL,i,Wm),e);return Pl((r={},Cl(Vm,function(e){var t=im(e);r[e]=t||null}),r),o)}function Km(e,t){var n=Um.concat(t||[]),r={};return Cl(n,function(t){var n=Gh(e,t);!n&&Jr.call(Hm,t)&&xl(Hm[t],function(t){n=n||Gh(e,t)}),r[t]=n||null}),r}function Qm(e){var t=function(e){return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!si(t)){r.$search_engine=t;var i=Mh?Gh(Mh.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function Ym(){return navigator.language||navigator.userLanguage}var Jm="$direct";function Zm(){return(null==Mh?void 0:Mh.referrer)||Jm}function Xm(e,t,n){var r;void 0===n&&(n=!1);var i=e?[].concat(zm,t||[]):[],o=null==(r=n?Ho(null==Oh?void 0:Oh.href):null==Oh?void 0:Oh.href)?void 0:r.substring(0,1e3);return{r:Zm().substring(0,1e3),u:o?Kh(o,i,Wm):void 0}}function ey(e,t,n,r){var i;void 0===t&&(t=!1);var o=e.r,s=e.u,a=t?Ho(s):s,u=a&&n?Kh(a,[].concat(zm,r||[]),Wm):a,l={$referrer:o,$referring_domain:null==o?void 0:o==Jm?Jm:null==(i=Hh(o))?void 0:i.host};if(u){l.$current_url=u;var c=Hh(u);l.$host=null==c?void 0:c.host,l.$pathname=null==c?void 0:c.pathname,Pl(l,Km(u))}return o&&Pl(l,Qm(o)),l}function ty(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var ny={flags:Gf,surveys:Mr},ry=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],iy=function(e){return e+"_cookie_identity_change_pending"},oy=function(e){for(var t,n="",r=0,i=p(e);!(t=i()).done;){var o=t.value,s=encodeURIComponent(JSON.stringify(o).slice(1,-1)).length;if(r+s>1e3)break;n+=o,r+=s}return n},sy="main",ay=[Yf,Uf,Wf,th,Kf,Gf,Qf,Zf],uy=function(e){return-1!==ay.indexOf(e)},ly=[rp,op],cy=function(e){return-1!==ly.indexOf(e)},dy=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return e===t}},fy=function(e){if(!e)return{};var t=JSON.parse(e);return ti(t)?t:{}},hy=function(e){var t,n=e[Wf];return ti(n)?d({},e,((t={})[Wf]=Object.fromEntries(Object.entries(n).map(function(e){var t,n=e[0],r=e[1];if(!ti(r)||!("value"in r)||1!==(null==(t=r.metadata)?void 0:t.config_version))return[n,r];var i=d({},r,{metadata:d({},r.metadata)});delete i.value;for(var o=0,s=["config_version","rule_type","rule_id","variant_key","forced_variant"];s.length>o;o++)delete i.metadata[s[o]];return[n,i]})),t)):e},py=function(e,t){Cl(e,function(n,r){var i=Nm(r);i&&"event"!==i.exposure||{}.hasOwnProperty.call(t,r)||delete e[r]})},_y=function(){"use strict";function e(e,t,n,r){var i=this;if(void 0===n&&(n=!0),void 0===r&&(r=!e.cookieless_mode),this._slotState={},this._splitStorageEligible=!1,this._storesIdentityInCookie=!1,this._splitStorage=!1,this._cookieIdentityChangePending=!1,this._cookieSyncSuppressed=!1,this._pendingCrossTabFeatureFlagChanges=new Map,this._storageMigrationInProgress=!1,this._localIdentityChangePending=!1,this._crossTabFeatureFlagIdentityMismatch=!1,this._metaIdentifierChangePending=new Set,this._crossTabFeatureFlagHandlers=new Set,this._config=e,this._ownsSplitStorage=n,this.props={},this._campaign_params_url=void 0,this._name=function(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._disabled=e.disable_persistence||!!t,this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(r),this._markLoadedCrossTabFeatureFlagChangesPending(),e.debug&&Sl.info("Persistence loaded",e.persistence,d({},this.props)),this.update_config(e,e,t),this.save(),Ih){var o=function(){return i.flush()};Ml(Ih,"beforeunload",o,{capture:!1}),Ml(Ih,"pagehide",o,{capture:!1}),this._onStorage=function(e){if(i._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Ih?void 0:Ih.localStorage))&&e.key)if(e.key!==i._name){if(i._splitStorage){var t=Dm.find(function(t){return e.key===i._groupEntryName(t)});t&&i._syncCrossTabFeatureFlagProperties(e.key,t)}}else i._syncCrossTabFeatureFlagProperties(e.key,sy)},Ml(Ih,"storage",this._onStorage)}}var t=e.prototype;return t.reconcileFeatureFlagsBeforeMerge=function(){return!(this._disabled||this._cookieSyncSuppressed||this._storageMigrationInProgress)&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite()},t.markCrossTabFeatureFlagChanges=function(e){var t=this;Object.entries(e).forEach(function(e){var n=e[0],r=e[1],i=t._pendingCrossTabFeatureFlagChanges.get(n);if(uy(n)&&!0!==i)if(!0!==r){var o=new Set(i||[]);r.forEach(function(e){return o.add(e)}),o.size&&t._setCrossTabFeatureFlagChangesPending(n,o)}else t._setCrossTabFeatureFlagChangesPending(n,!0)})},t.onCrossTabFeatureFlagChange=function(e){var t=this;return this._crossTabFeatureFlagHandlers.add(e),function(){return t._crossTabFeatureFlagHandlers.delete(e)}},t.destroy=function(){this._onStorage&&Ih&&(Ih.removeEventListener("storage",this._onStorage),this._onStorage=void 0),this._crossTabFeatureFlagHandlers.clear()},t._syncCrossTabFeatureFlagProperties=function(e,t,n){if(void 0===n&&(n=!0),this._disabled)return!1;var r,i;try{if(i=cm._get(e),si(i)){var o=this._slotWriteState(t);return o.storageValue=null,t!==sy?o.persisted=!1:this._mergeMetaIdentifierProperties({}),!1}r=fy(i)}catch(e){return!1}t===sy&&this._mergeMetaIdentifierProperties(r);var s=t===sy?r:cm._parse(this._name);if(s&&this._hasCrossTabFeatureFlagIdentityMismatch(s))return!1;var a=this._mergeCrossTabFeatureFlagProperties(r,t,n);return t===sy&&this._splitStorage&&!dy(this._partitionProps().main,r)||this._rememberCrossTabStorageFingerprint(r,t,!0,i),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[Zh],n=e[Zh];return!ri(t)&&!ri(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,r){var i=this._slotWriteState(t);i.storageValue=r,t!==sy&&(i.persisted=n);try{i.fingerprint=this._entryFingerprint(e,t)}catch(e){i.fingerprint=void 0}},t._mergeCrossTabFeatureFlagProperties=function(e,t,n){var r=this,i=!1;return ay.forEach(function(n){var o,s=null==(o=Nm(n))?void 0:o.storageGroup;if(!(t===sy&&r._splitStorage&&s||t!==sy&&s!==t)){var a=n in e,u=r._mergePendingCrossTabFeatureFlagChanges(n,a?e[n]:void 0),l=r._pendingCrossTabFeatureFlagChanges.has(n)?n in r.props:a;l===n in r.props&&dy(u,r.props[n])||(l?r._setProp(n,u,!1):r._deleteProp(n,!1),i=!0)}}),i&&n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}),i},t._mergeMetaIdentifierProperties=function(e){var t=this,n=this._storesIdentityInCookie&&this._config.cookieWinsOnConflict?[].concat(fm,this._config.cookie_persisted_properties||[]):[];ly.forEach(function(r){t._metaIdentifierChangePending.has(r)||-1!==n.indexOf(r)||(r in e?dy(e[r],t.props[r])||t._setProp(r,e[r],!1):r in t.props&&t._deleteProp(r,!1))})},t._metaIdentifierCookieSyncEnabled=function(){return this._storesIdentityInCookie&&this._splitStorageEligible&&!this._config.cookieWinsOnConflict},t._adoptMetaIdentifiersFromCookie=function(){var e=this;if(this._metaIdentifierCookieSyncEnabled()){var t;try{t=um._get(this._name)||void 0}catch(e){return}if(t&&t!==this._lastSeenMetaIdentifierCookieValue){var n;this._lastSeenMetaIdentifierCookieValue=t;try{n=_m(JSON.parse(t))}catch(e){return}ly.forEach(function(t){!(t in n)||t in e.props||e._metaIdentifierChangePending.has(t)||e._setProp(t,n[t],!1)})}}},t._rememberMetaIdentifierCookieValue=function(e){if(this._metaIdentifierCookieSyncEnabled())try{var t=JSON.stringify(vm(e,this._config.cookie_persisted_properties||[])),n=um._get(this._name)||void 0;n===t&&(this._lastSeenMetaIdentifierCookieValue=n)}catch(e){}},t._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=cm._get(this._name),r=this._slotWriteState(sy),i=!1,o=!1;if(n!==r.storageValue)if(si(n))ii(r.storageValue)&&this._mergeMetaIdentifierProperties({}),r.storageValue=null;else{if(t=fy(n),this._mergeMetaIdentifierProperties(t),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;o=this._mergeCrossTabFeatureFlagProperties(t,sy,!1),!this._splitStorage||dy(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,sy,!0,n):r.storageValue=n,i=!0}return this._splitStorage&&Dm.forEach(function(n){var r=cm._get(e._groupEntryName(n)),s=e._slotWriteState(n),a=t||{},u=i&&ay.some(function(e){var t;return(null==(t=Nm(e))?void 0:t.storageGroup)===n&&e in a});if(r!==s.storageValue||u){if(si(r))return s.storageValue=null,s.persisted=!1,void(u&&(o=e._mergeCrossTabFeatureFlagProperties(a,n,!1)||o));var l=fy(r);o=e._mergeCrossTabFeatureFlagProperties(l,n,!1)||o,e._rememberCrossTabStorageFingerprint(l,n,!0,r)}}),o}catch(e){return!1}},t._setCrossTabFeatureFlagChangesPending=function(e,t){this._pendingCrossTabFeatureFlagChanges.set(e,t);var n=Nm(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||sy).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;ay.forEach(function(t){return e._pendingCrossTabFeatureFlagChanges.set(t,!0)})},t._markLoadedCrossTabFeatureFlagChangesPending=function(){var e=this;if(this._splitStorageEligible)try{var t=cm._get(this._name),n=fy(t);this._slotWriteState(sy).storageValue=t,ay.forEach(function(t){var r,i=e._splitStorage?null==(r=Nm(t))?void 0:r.storageGroup:void 0,o=i?cm._get(e._groupEntryName(i)):null;if(i){var s=e._slotWriteState(i);s.storageValue=o,s.persisted=!si(o)}var a=i&&!si(o)?fy(o):n;t in e.props?e._markPendingCrossTabFeatureFlagChanges(t,a[t],e.props[t]):t in a&&e._setCrossTabFeatureFlagChangesPending(t,!0)})}catch(e){}},t._mergePendingCrossTabFeatureFlagChanges=function(e,t){var n=this._pendingCrossTabFeatureFlagChanges.get(e);if(!n)return t;if(!0===n)return this.props[e];if("$active_feature_flags"===e){var r=new Set(Xr(t)?t:[]),i=new Set(Xr(this.props[e])?this.props[e]:[]);return n.forEach(function(e){return i.has(e)?r.add(e):r.delete(e)}),Array.from(r)}var o=ti(t)?d({},t):{},s=ti(this.props[e])?this.props[e]:{};return n.forEach(function(e){e in s?o[e]=s[e]:delete o[e]}),o},t._markPendingCrossTabFeatureFlagChanges=function(e,t,n){if(uy(e)){var r=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==r){var i=t;if(this._splitStorageEligible)try{var o,s=this._splitStorage?null==(o=Nm(e))?void 0:o.storageGroup:void 0,a=s?this._groupEntryName(s):this._name;i=fy(cm._get(a))[e]}catch(e){}var u=new Set(r||[]);if("$active_feature_flags"===e){if(!ri(t)&&!Xr(t)||!ri(i)&&!Xr(i)||!Xr(n))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var l=new Set(t||[]),c=new Set(i||[]),d=new Set(n);new Set([].concat(l,d)).forEach(function(e){l.has(e)!==d.has(e)&&u.add(e)}),u.forEach(function(e){c.has(e)===d.has(e)&&u.delete(e)})}else{if(!ti(n))return void(dy(i,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!ri(t)&&!ti(t)||ri(t)&&ni(n)&&ri(i))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var f=ti(t)?t:{},h=ti(i)?i:{};new Set([].concat(Object.keys(f),Object.keys(n))).forEach(function(e){e in f==e in n&&dy(f[e],n[e])||u.add(e)}),u.forEach(function(e){e in h==e in n&&dy(h[e],n[e])&&u.delete(e)})}u.size?this._setCrossTabFeatureFlagChangesPending(e,u):this._pendingCrossTabFeatureFlagChanges.delete(e)}}},t._saveDebounceMs=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return ui(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=vm(e,this._config.cookie_persisted_properties||[]),n=mm(t,this._config.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),i=um._get(this._name)||void 0;i&&bm(this._name,i)===r&&(this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i)}catch(e){}else try{var o=um._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=o?bm(this._name,o):void 0,this._lastSeenMainCookieValue=o}catch(e){}},t.syncCookieProperties=function(){return this._syncCookieProperties(this._config)},t._syncCookieProperties=function(e,t){var n,r=this;if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{n=um._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var i,o=bm(this._name,n);try{i=_m(JSON.parse(n))}catch(e){return!1}if((um._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=o,this._lastSeenMainCookieValue=n;var s=ym(this._name,n),a=[].concat(fm,s.properties),u={};if(Object.keys(i).forEach(function(e){var t=i[e];(ri(t)||si(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(u[e]=!0,delete i[e])}),ni(i))return!1;var l="distinct_id"in i||"anonymous"===i.$user_state||"identified"===i.$user_state,c=this.props,d=c[Zh],f=c[Pp],h=Pl({},c);[].concat(fm,e.cookie_persisted_properties||[]).forEach(function(e){if(-1!==a.indexOf(e)&&!(e in i)&&!u[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=h[e];(s.isValid||-1===fm.indexOf(e)||!1!==t&&0!==t)&&delete h[e]}}),this.props=Pl(h,i),ay.forEach(function(e){var t=e in r.props;e in c===t&&dy(c[e],r.props[e])||(t?r._markPendingCrossTabFeatureFlagChanges(e,c[e],r.props[e]):r._setCrossTabFeatureFlagChangesPending(e,!0))}),!l||"$user_state"in i||"$user_state"in this.props||this._setProp(Pp,Vp);var p=this.props[Zh],_=this.props[Pp];return!l||p===d&&_===f||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,xm._set(iy(this._name),!0),this._deleteProp(Zf),this._deleteProp(Uf),this._deleteProp(Yf),this._deleteProp(Wf),this._deleteProp(th),this._deleteProp(Kf),this._deleteProp(Gf),this._deleteProp(Vf),this._deleteProp(Xf),"anonymous"!==_||"identified"!==f&&"anonymous"!==i.$user_state&&(ri(d)||p===d)||(py(this.props,i),this._deleteProp(Jf)),"identified"===_?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(tp)),!0},t.consumeCookieIdentityChange=function(){var e=iy(this._name),t=this._cookieIdentityChangePending||!!xm._get(e);return this._cookieIdentityChangePending=!1,t&&xm._remove(e),t},t._beginCookieSyncSuppression=function(e){return void 0===e&&(e=!1),!(this._cookieSyncSuppressed||this._disabled&&!e||!this._config.cookieWinsOnConflict||"localstorage+cookie"!==this._config.persistence.toLowerCase()||(this._cookieSyncSuppressed=!0,0))},t._publishSuppressedCookieSnapshot=function(){this._cookieSyncSuppressed&&(ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[sy],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){var t=this;-1===ry.indexOf(e.persistence.toLowerCase())&&(Sl.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=function(e,t,n){void 0===e&&(e=[]),void 0===t&&(t=!1),void 0===n&&(n=function(){return!1});var r=[].concat(fm,e);return d({},cm,{_parse:function(e){try{var i,o={};try{i=um._get(e)||void 0,o=i?_m(JSON.parse(i)):{}}catch(e){}var s,a=JSON.parse(cm._get(e)||"{}");if(t){var u=ym(e,i),l=[].concat(fm,u.properties),c={};Object.keys(o).forEach(function(e){var t=o[e];si(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(c[e]=t)});var d="distinct_id"in c||"anonymous"===c.$user_state||"identified"===c.$user_state;if(Object.keys(c).length>0){var f,h=a[Zh],p=null!==(f=a.$user_state)&&void 0!==f?f:"anonymous";r.forEach(function(e){if(-1!==l.indexOf(e)&&!(e in o)&&(d||"distinct_id"!==e&&"$user_state"!==e)){var t=a[e];(u.isValid||-1===fm.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!d||"$user_state"in o||"$user_state"in a||(a[Pp]=Vp),!d||("distinct_id"in c?c[Zh]:a[Zh])===h&&("$user_state"in c?c[Pp]:a[Pp])===p||(dm.forEach(function(e){return delete a[e]}),"identified"===c.$user_state&&"distinct_id"in c?a.$user_id=c[Zh]:delete a.$user_id,"identified"!==c.$user_state&&(delete a[xp],delete a[Jf]),delete a.__alias)}s=Pl(a,c)}else s=Pl(o,a);return n()||cm._set(e,s),s}catch(e){}return null},_set:function(n,r,i,o,s,a){var u=cm._set(n,r,void 0,void 0,a);try{var l=vm(r,e);if(Object.keys(l).length){if(t){var c=hm(n),d=mm(l,e);if(um._set(c,d,i,o,s,a),um._get(c)!==JSON.stringify(d)){um._remove(c,o);var f=vm(r);return um._set(n,f,i,o,s,a),u}}um._set(n,l,i,o,s,a)}}catch(e){cm._error(e)}return u},_remove:function(e,t){try{null==Ih||Ih.localStorage.removeItem(e),um._remove(e,t),um._remove(hm(e),t)}catch(e){cm._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,function(){return!!t._disabled}),i=!1,o=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&cm._is_supported()?(n=cm,o=!0):"localstorage+cookie"===s&&r._is_supported()?(n=r,o=!0,i=!0):"sessionstorage"===s&&xm._is_supported()?n=xm:"memory"===s?n=Sm:"cookie"===s&&um._is_supported()?(n=um,i=!0):r._is_supported()?(n=r,o=!0,i=!0):um._is_supported()?(n=um,i=!0):n=Sm,this._splitStorageEligible=o,this._storesIdentityInCookie=i,n},t._groupEntryName=function(e){return this._name+"__"+e},t._resolveSplitStorage=function(e){return this._splitStorageEligible&&!!e.split_storage},t.properties=function(){var e={};return Cl(this.props,function(t,n){var r=Nm(n);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t))return;e[n]=t}}),e},t.load=function(e){var t=this;if(void 0===e&&(e=!1),!this._disabled||e){var n=this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase(),r=n?cm._parse(this._name):null,i={};if(n)try{Cl(i=_m(um._parse(this._name)),function(e,t){(ri(e)||si(e)||""===e)&&delete i[t]})}catch(e){}var o=this._storage._parse(this._name);if(o&&(this.props=Pl({},o)),this._splitStorage&&this._loadGroupEntries(),n&&o){var s,a,u=null==r?void 0:r[Zh],l=null!==(s=null==r?void 0:r.$user_state)&&void 0!==s?s:"anonymous",c=o[Zh],d=null!==(a=o.$user_state)&&void 0!==a?a:"anonymous",f=xm._parse(this._name),h=!ri(u)||!ri(null==r?void 0:r.$user_state)||!!f&&!ni(f);if(c!==u||d!==l){h&&(this._cookieIdentityChangePending=!0,this._disabled||xm._set(iy(this._name),!0));var p=Pl({},this.props);dm.forEach(function(e){return delete p[e]}),h&&"anonymous"===d&&("identified"===l||"anonymous"===i.$user_state||!ri(u)&&c!==u)&&(py(p,i),delete p[Jf]),this.props=p;var _=new Set;dm.forEach(function(e){var t,n=null==(t=Nm(e))?void 0:t.storageGroup;n&&_.add(n)}),_.forEach(function(e){if(!t._disabled){var n={};Cl(t.props,function(t,r){var i;(null==(i=Nm(r))?void 0:i.storageGroup)===e&&(n[r]=t)});var r=hy(n);ni(n)?(cm._remove(t._groupEntryName(e)),t._slotState[e]={}):cm._set(t._groupEntryName(e),r)&&(t._slotState[e]={persisted:!0,fingerprint:t._entryFingerprint(r,e)})}})}}xm._get(iy(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e=0,t=Dm;t.length>e;e++){var n=t[e],r=cm._parse(this._groupEntryName(n));if(r&&!ni(r)){var i=this._slotWriteState(n);i.persisted=!0,this._mainCarriesGroupKey(n)||(i.fingerprint=this._entryFingerprint(r,n)),this._groupEntryIsStale(n,r)||Pl(this.props,r)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=Nm(t))?void 0:n.storageGroup)===e})},t._groupEntryIsStale=function(e,t){var n=ny[e];if(!n)return!1;var r=t[n],i=this.props[n];return ui(r)&&ui(i)&&i>r},t.refreshKey=function(e){this._refreshKeys([e])},t._refreshKeys=function(e){var t=this;if(!this._disabled){var n,r=!1,i=function(){return r||(n=t._storage._parse(t._name),r=!0),n};e.forEach(function(e){var n;if(!t._metaIdentifierChangePending.has(e)){var r=t._splitStorage?null==(n=Nm(e))?void 0:n.storageGroup:void 0,o=r?cm._parse(t._groupEntryName(r)):i();if(o&&e in o)t._setProp(e,o[e],!1);else{if(r){var s=i();if(s&&e in s)return void t._setProp(e,s[e],!1)}t._deleteProp(e,!1)}}})}},t.refreshMetaIdentifiers=function(){this._disabled||(this._usesMetaIdentifierSnapshotRefresh()?this._refreshMetaIdentifiersIfStorageChanged():this._refreshKeys(ly))},t._refreshMetaIdentifiersIfStorageChanged=function(){var e=this._storageSnapshot();(ri(e)||e!==this._metaIdentifierStorageSnapshot)&&(this._refreshKeys(ly),this._rememberMetaIdentifierStorageSnapshot(e))},t._rememberMetaIdentifierStorageSnapshot=function(e){void 0===e&&(e=this._storageSnapshot()),this._metaIdentifierStorageSnapshot=0===this._metaIdentifierChangePending.size?e:void 0},t.refreshMetaIdentifiersBeforeCapture=function(){this._disabled||this._cookieSyncSuppressed||(this._usesMetaIdentifierSnapshotRefresh()||this._adoptMetaIdentifiersFromCookie(),this._refreshMetaIdentifiersIfStorageChanged())},t._usesMetaIdentifierSnapshotRefresh=function(){return this._storage===um||this._storage===xm||this._storage===Sm},t._storageSnapshot=function(){var e=this._storage._get(this._name);return ii(e)?e:void 0},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?ri(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(function(){e._pendingSaveTimer=void 0,e._writeNow()},t)):this._writeNow()}},t.flush=function(){ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())},t._writeNow=function(e){if(void 0===e&&(e=!1),!(this._disabled||this._cookieSyncSuppressed&&!e)){e||(this.syncCookieProperties(),this._usesMetaIdentifierSnapshotRefresh()&&this.refreshMetaIdentifiers());var t=!e&&!this._storageMigrationInProgress;t||(this._crossTabFeatureFlagIdentityMismatch=!1);var n=!!t&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&Sl.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(e||this._adoptMetaIdentifiersFromCookie(),this._splitStorage)return this._writeNowSplit(),void(n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}));var r=this._writeEntry(this._storage,this._name,this.props,sy);"written"===r&&(this._rememberCurrentCookieProperties(this.props),this._rememberMetaIdentifierCookieValue(this.props)),"failed"!==r&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear()),"written"===r&&this._rememberMetaIdentifierStorageSnapshot(),n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()})}}},t._writeNowSplit=function(){var e=this,t=this._partitionProps(),n=t.main,r=t.groups,i=this._writeEntry(this._storage,this._name,n,sy);"written"===i&&(this._rememberCurrentCookieProperties(n),this._rememberMetaIdentifierCookieValue(n)),"failed"!==i&&(this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear(),ay.forEach(function(t){var n;null!=(n=Nm(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)})),"written"===i&&this._rememberMetaIdentifierStorageSnapshot();for(var o=function(){var t,n=a[s],i=r[n];if(ni(i)&&(null==(t=e._slotState[n])||!t.persisted))return ay.forEach(function(t){var r;(null==(r=Nm(t))?void 0:r.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)}),1;var o=e._writeEntry(cm,e._groupEntryName(n),i,n);"failed"!==o&&ay.forEach(function(t){var r=Nm(t);(null==r?void 0:r.storageGroup)!==n||"written"!==o&&r.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)})},s=0,a=Dm;a.length>s;s++)if(o())continue},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return Cl(this.props,function(n,r){var i,o=null==(i=Nm(r))?void 0:i.storageGroup;o?t[o][r]=n:e[r]=n}),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===sy)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return Cl(e,function(e,t){var r;n[t]=null!=(r=Nm(t))&&r.volatile?"__volatile__":e}),JSON.stringify(n)},t._writeEntry=function(e,t,n,r){var i=this._slotWriteState(r);if(r!==sy&&!i.dirty&&!ri(i.fingerprint))return"skipped";var o,s=n;try{if(s=hy(n),(o=this._entryFingerprint(s,r))===i.fingerprint)return i.dirty=!1,"skipped"}catch(e){o=void 0}return e._set(t,s,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(i.dirty=!1,r!==sy&&(i.persisted=!0),ri(o)||(i.fingerprint=o),this._splitStorageEligible&&(i.storageValue=cm._get(t)),"written"):(this._config.debug&&Sl.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")},t.remove=function(e){var t=(void 0===e?{}:e).keepGroupEntries,n=void 0!==t&&t;if(this._markAllCrossTabFeatureFlagChangesPending(),ri(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!n&&this._ownsSplitStorage)for(var r=0,i=Dm;i.length>r;r++)cm._remove(this._groupEntryName(i[r]));n?delete this._slotState[sy]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._lastSeenMetaIdentifierCookieValue=void 0},t.clear=function(){this.remove(),this.props={},this._campaign_params_url=void 0},t.register_once=function(e,t,n){var r=this;if(ti(e)){this.syncCookieProperties(),ri(t)&&(t="None"),this._expire_days=ri(n)?this._default_expiry:n;var i=!1;if(Cl(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r._setProp(n,e),i=!0)}),i)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(ti(e)){this.syncCookieProperties(),this._expire_days=ri(t)?this._default_expiry:t;var r=!1;if(Cl(e,function(t,i){e.hasOwnProperty(i)&&(n.props[i]!==t||ti(t)||Xr(t))&&(n._setProp(i,t),r=!0)}),r)return this.save(),!0}return!1},t.unregister=function(e){this.syncCookieProperties();for(var t,n=!1,r=p("string"==typeof e?[e]:e);!(t=r()).done;){var i=t.value;i in this.props&&(this._deleteProp(i),n=!0)}n&&this.save()},t.update_campaign_params=function(){var e=null==Mh?void 0:Mh.URL;if(e!==this._campaign_params_url){var t=Gm(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!ni(Fl(t));return n&&this.register(t),this._campaign_params_url=e,n?t:void 0}},t.update_search_keyword=function(){var e;this.register((e=null==Mh?void 0:Mh.referrer)?Qm(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:Zm(),$referring_domain:null!=Mh&&Mh.referrer&&(null==(e=Hh(Mh.referrer))?void 0:e.host)||Jm},void 0)},t.set_initial_person_info=function(){var e;if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Xm(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[Rp]=this._storesIdentityInCookie?{r:oy(t.r),u:t.u?oy(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};Cl([Ip,Fp],function(n){var r=e.props[n];r&&Cl(r,function(e,n){t["$initial_"+Kr(n)]=e})});var n=this.props[Rp];return n&&Pl(t,function(e,t,n,r){void 0===t&&(t=!1);var i=ey(e,t,n,r),o={};return Cl(i,function(e,t){o["$initial_"+Kr(t)]=e}),o}(n,this._config.disable_capture_url_hashes,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)),t},t.safe_merge=function(e){return Cl(this.props,function(t,n){n in e||(e[n]=t)}),e},t.update_config=function(e,t,n){var r=e.persistence!==t.persistence,i=!function(e,t){if(e.length!==t.length)return!1;var n=[].concat(e).sort(),r=[].concat(t).sort();return n.every(function(e,t){return e===r[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=r||i,s=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!n,u=!!this._disabled&&!a;a||this._syncCookieProperties(t,u),this._config=e,!a&&(r||i||s)&&(this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._lastSeenMetaIdentifierCookieValue=void 0,this._syncCookieProperties(d({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),u));var l=o||s?this._buildStorage(e):this._storage;this._truncateExistingPersonInfoForCookie();var c=this._resolveSplitStorage(e),f=o||c!==this._splitStorage,h=!a&&(f||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(u);this._storageMigrationInProgress=f;try{if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),f){var p=this.props;this.clear(),this._storage=l,this._splitStorage=c,this.props=p,this.save()}else s&&(this._storage=l,a||(delete this._slotState[sy],this._writeNow()))}finally{this._storageMigrationInProgress=!1,h&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[Rp];if(this._storesIdentityInCookie&&ti(e)&&"string"==typeof e.r){var t=oy(e.r),n="string"==typeof e.u?oy(e.u):e.u;t===e.r&&n===e.u||this._setProp(Rp,d({},e,{r:t,u:n}))}},t.set_disabled=function(e){this._disabled=e,this._disabled?this.remove():this.save()},t.set_cross_subdomain=function(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_secure=function(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this._setProp(sp,n),this.save()},t.remove_event_timer=function(e){var t=this.props.__timers||{},n=t[e];return ri(n)||(delete t[e],this._setProp(sp,t),this.save()),n},t.get_property=function(e){return this.props[e]},t.set_property=function(e,t){this._setProp(e,t),this.save()},t._setProp=function(e,t,n){var r;void 0===n&&(n=!0);var i=this.props[e];this.props[e]=t,n&&("distinct_id"!==e&&"$user_state"!==e||i===t||(this._localIdentityChangePending=!0),cy(e)&&!dy(i,t)&&this._metaIdentifierChangePending.add(e),this._markPendingCrossTabFeatureFlagChanges(e,i,t),null!=(r=Nm(e))&&r.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(uy(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),cy(e)&&this._metaIdentifierChangePending.add(e),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=Nm(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),vy=kl("[RateLimiter]"),gy=function(){"use strict";function e(e){var t=this;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(function(e){vy.info((e||"events")+" is quota limited."),t.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void vy.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}var t=e.prototype;return t.clientRateLimitContext=function(e){var t;void 0===e&&(e=!1);var n=this._refilledBucket(),r=1>n.tokens;if(r||e||(n.tokens=Math.max(0,n.tokens-1)),r&&!e){var i=(ui(n.dropped)?n.dropped:0)+1;n.dropped=i,!this.lastEventRateLimited&&this._captureWarning(i)&&(n.dropped=0)}return this.lastEventRateLimited=r,null==(t=this.instance.persistence)||t.set_property(Tp,n),{isRateLimited:r,remainingTokens:n.tokens}},t._refilledBucket=function(){var e,t=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,r=(new Date).getTime(),i=null==(e=this.instance.persistence)?void 0:e.get_property(Tp),o=i?d({},i):{tokens:t,last:r};return o.tokens+=Math.max(0,r-o.last)/1e3*n,o.last=Math.max(o.last,r),o.tokens>t&&(o.tokens=t),o},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Xr(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Oh&&Oh.pathname)return""+(null!==(e=Oh.origin)&&void 0!==e?e:"")+Oh.pathname},t._captureWarning=function(e){var t,n,r=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,o=this._triggeringPage(),s=this._isPropertyAllowed("$session_id")?null==(t=(n=this.instance).get_session_id)?void 0:t.call(n):void 0,a=[e+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,s?"session "+s:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+i+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})},t.isServerRateLimited=function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t},a(e,[{key:"captureEventsPerSecond",get:function(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}},{key:"captureEventsBurstLimit",get:function(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}},{key:"isClientRateLimited",get:function(){return 1>this._refilledBucket().tokens}}])}(),my=kl("[RemoteConfig]"),yy=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t=this,n=dg(this._instance);n?n(this._instance,"remote-config",function(){return e(t.remoteConfig)}):e()},t._loadRemoteConfigJSON=function(e){var t=this,n=this._instance.__pending_remote_config_callbacks;if(n)n.push(e);else{var r=[e];this._instance.__pending_remote_config_callbacks=r;try{this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),batchKey:"remote_config",fireCallbackOnDrop:!0,callback:function(e){t._instance.__pending_remote_config_callbacks=void 0,r.forEach(function(t){return t(e)})}})}catch(e){throw this._instance.__pending_remote_config_callbacks=void 0,e}}},t.load=function(){var e=this;try{if(this.remoteConfig)return my.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void my.warn("Remote config is disabled. Falling back to local config.");if(!this._instance.config.opt_in_site_apps)return void this._loadRemoteConfigJSON(function(t){e._onRemoteConfig(t.json,t)});this._loadRemoteConfigJs(function(t){if(!t)return my.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON(function(t){e._onRemoteConfig(t.json,t)});e._onRemoteConfig(t)})}catch(e){my.error("Error loading remote config",e),this._onRemoteConfig()}},t._onRemoteConfig=function(e,t){!e&&t&&(0===t.statusCode?t.error||my.warn("Failed to fetch remote config from PostHog."):my.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){my.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;null==(n=this._instance.featureFlags)||n.ensureFlagsLoaded()}catch(e){my.error("Error loading feature flags",e)}},a(e,[{key:"remoteConfig",get:function(){var e;return null==(e=jh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),by=!Dv&&-1===(null==Nh?void 0:Nh.indexOf("MSIE"))&&-1===(null==Nh?void 0:Nh.indexOf("Mozilla"));function wy(e,t,n){var r;n&&(t=d({},t,{callback:function(e){return n(e)}})),e.__loaded?by?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=d({},e.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(r=e.compression)&&void 0!==r?r:t.compressionFallback:t.compression,(ri(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,null==t.onDispatch||t.onDispatch(),function(e,t){var n,r,i,o=d({},e,{callback:null!=t?t:function(t){return null==e.callback?void 0:e.callback(t)}});o.timeout=o.timeout||6e4;var s,a,u,l,c,f=null!==(n=o.transport)&&void 0!==n?n:"fetch";"sendBeacon"===f&&ri(o.compression)&&o.data&&(o.compression=bh),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!==(a=null==(c=(l=(Xr(s=o.data)?s:[s]).map(function(e){return d({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})}))[0])||null==(u=c.properties)?void 0:u.token)&&void 0!==a?a:null==c?void 0:c.token,batch:l,sent_at:(new Date).toISOString()}:"body"===o.timestampMode&&(o.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Xr(e)?e.map(function(e){return d({},e,{sent_at:t})}):d({},e,{sent_at:t})}(o.data))),o.url=eg(o.url,o.method,o.compression,o.timestampMode);var h=tg.filter(function(e){return!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport)}),p=null!==(r=null==(i=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(h,function(e){return e.transport===f}))?void 0:i.method)&&void 0!==r?r:h[0].method;if(!p)throw new Error("No available transport method");var _=function(e){try{p(e)}catch(e){Qv(e)?Sl.warn(e):Sl.error(e),null==o.callback||o.callback({statusCode:0,error:e})}};"sendBeacon"!==f&&!o.preferSyncCompression&&o.data&&o.compression===yh&&qh&&"undefined"!=typeof Promise&&!Bv?Vv(o).then(function(e){_(e)}).catch(function(t){if(Hs(t))return Bv=!0,void _(d({},o,{compression:void 0,url:eg(e.url,e.method,void 0,e.timestampMode)}));(function(e){if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return Hs(e)||t===Ns})(t)&&(Bv=!0),_(o)}):_(o)}(t,function(r,i){e.rateLimiter.checkForLimiting(r),400>r.statusCode||null==e.config.on_request_error||e.config.on_request_error(r),n?n(r,i):null==t.callback||t.callback(r)})):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}var Sy=function(){"use strict";function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=xi((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,Sl.createLogger("flush interval"),3e3),this._sendRequest=e}var t=e.prototype;return t.enqueue=function(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()},t.unload=function(){var e=this;this._clearFlushTimeout();var t=this._queue.length>0?this._formatQueue():{},n=Object.values(t);[].concat(n.filter(function(e){return 0===e.url.indexOf("/e")}),n.filter(function(e){return 0!==e.url.indexOf("/e")})).map(function(t){e._sendRequestSafely(d({},t,{callback:void 0}),"sendBeacon")})},t.enable=function(){this._isPaused=!1,this._setFlushTimeout()},t._setFlushTimeout=function(){var e=this;this._isPaused||(this._flushTimeout=setTimeout(function(){e._clearFlushTimeout(),e._flush()},this._flushTimeoutMs))},t._flush=function(){if(this._queue.length>0){var e=this._formatQueue();for(var t in e)this._sendRequestSafely(e[t])}},t._sendRequestSafely=function(e,t){try{this._sendRequest(e,t)}catch(e){Sl.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={},t={};Cl(this._queue,function(n){var r,i=n,o=((i?i.batchKey:null)||i.url)+(i.batchGroup?":"+i.batchGroup:"");ri(e[o])&&(e[o]=d({},i,{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[o]=[]),null==(r=e[o].data)||r.push(i.data),i.callback&&t[o].push(i.callback)});var n=function(){var n=t[r];n.length&&(e[r].callback=function(e){for(var t,r=p(n);!(t=r()).done;)(0,t.value)(e)})};for(var r in t)n();return this._queue=[],e},e}(),ky=function(){"use strict";function t(e){this._instance=e,this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._queue=[],this._areWeOnline=!0,this.resume()}var r=t.prototype;return r.resume=function(){var e=this;if(!ri(Ih)&&"onLine"in Ih.navigator){if(this._areWeOnline=Ih.navigator.onLine,this._onlineListener)return;this._onlineListener=function(){e._areWeOnline=!0,e._flush()},this._offlineListener=function(){e._areWeOnline=!1},Ml(Ih,"online",this._onlineListener),Ml(Ih,"offline",this._offlineListener)}},r.retriableRequest=function(t,r){var i=this,o=t.retriesPerformedSoFar,s=n(t,e);li(o)&&(s.url=Hv(s.url,{retry_count:o})),wy(this._instance,r?d({},s,{transport:r}):s,function(e,t){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=o?o:0))return void i._enqueue(d({retriesPerformedSoFar:o},s),t);0===e.statusCode&&Sl.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=o?o:0)+" retries.")}null==s.callback||s.callback(e)})},r._enqueue=function(e,t){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=Math.max(function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(n),null!=t?t:0),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),Sl.warn(o),this._isPolling||(this._isPolling=!0,this._poll())},r._poll=function(){var e=this;if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout(function(){e._areWeOnline&&e._queue.length>0&&e._flush(),e._poll()},this._pollIntervalMs)},r._flush=function(){var e=Date.now(),t=[],n=this._queue.filter(function(n){return e>n.retryAt||(t.push(n),!1)});if(this._queue=t,n.length>0)for(var r,i=p(n);!(r=i()).done;)this.retriableRequest(r.value.requestOptions)},r.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,ri(Ih)||(this._onlineListener&&(Ih.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Ih.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=p(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(d({},n,{callback:Xr(n.data)?void 0:n.callback,transport:"sendBeacon"}))}catch(e){Sl.error(e)}}this._queue=[]},a(t,[{key:"length",get:function(){return this._queue.length}}])}(),xy=function(){"use strict";function e(e){var t=this;this._instance=e,this._updateScrollData=function(){var e,n,r,i;t._context||(t._context={});var o=t.scrollElement(),s=t.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=s+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;t._context.lastScrollY=Math.ceil(s),t._context.maxScrollY=Math.max(s,null!==(e=t._context.maxScrollY)&&void 0!==e?e:0),t._context.maxScrollHeight=Math.max(a,null!==(n=t._context.maxScrollHeight)&&void 0!==n?n:0),t._context.lastContentY=u,t._context.maxContentY=Math.max(u,null!==(r=t._context.maxContentY)&&void 0!==r?r:0),t._context.maxContentHeight=Math.max(l,null!==(i=t._context.maxContentHeight)&&void 0!==i?i:0)}}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return this._context=void 0,setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){Ml(Ih,"scroll",this._updateScrollData,{capture:!0}),Ml(Ih,"scrollend",this._updateScrollData,{capture:!0}),Ml(Ih,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Ih||null==(e=Ih.document)?void 0:e.documentElement;for(var t,n=p(Xr(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var r,i=null==Ih||null==(r=Ih.document)?void 0:r.querySelector(t.value);if(i)return i}},t._scrollPosition=function(e){var t,n,r="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var i=this.scrollElement();return i&&i[r]||0}return Ih?"y"===e?Ih.scrollY||Ih.pageYOffset||(null==(t=Ih.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Ih.scrollX||Ih.pageXOffset||(null==(n=Ih.document)||null==(n=n.documentElement)?void 0:n.scrollLeft)||0:0},t.scrollY=function(){return this._scrollPosition("y")},t.scrollX=function(){return this._scrollPosition("x")},a(e,[{key:"_scrollRoot",get:function(){return this._instance.config.scroll_root_selector}}])}(),Cy=function(e){return Xm(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes)},Py=function(){"use strict";function e(e,t,n,r){var i=this;this._onSessionIdCallback=function(e){var t,n=i._getStored();if(!n||n.sessionId!==e){var r={sessionId:e,props:i._sessionSourceParamGenerator(i._instance)};i._persistence.register(((t={})[Ep]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||Cy,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Ep]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ey(t,this._instance.config.disable_capture_url_hashes,this._instance.config.mask_personal_data_properties,this._instance.config.custom_personal_data_properties):{$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}:{}},t.getSessionProps=function(){var e={};return Cl(Fl(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+Kr(n)]=t}),e},e}(),Ey=kl("[SessionId]"),Ty=864e5,Fy=function(){"use strict";function e(e,t,n){var r,i=this;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new Sh,this._sessionHasBeenIdleTooLong=function(e,t){return!(!li(e)||!li(t))&&Math.abs(e-t)>i.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._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._pendingBootstrapSession=void 0,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||xu,this._windowIdGenerator=n||xu;var o=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*xi(this._config.session_idle_timeout_seconds||1800,60,36e3,Ey.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var s=xm._parse(this._window_id_storage_key),a=xm._parse(this._primary_window_exists_storage_key);s&&!a?this._windowId=s:xm._remove(this._window_id_storage_key),xm._set(this._primary_window_exists_storage_key,!0)}null!=(r=this._config.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this._config.bootstrap.sessionID),this._listenToReloadWindow()}var t=e.prototype;return t.on=function(e,t){return this._eventEmitter.on(e,t)},t.onSessionId=function(e){var t=this;return ri(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(t){return t!==e})}},t._canUseSessionStorage=function(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&xm._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&xm._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?xm._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!si(t)&&!si(e)&&5e3>Math.abs(e-t)},t._setSessionId=function(e,t,n){var r,i=t!==this._sessionActivityTimestamp,o=!(e!==this._sessionId||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,o&&!i||o&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register(((r={})[Sp]=[t,e,n],r)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return li(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(Sp):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!si(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var n=this._getSessionId();n[1]===this._sessionId&&n[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register(((t={})[Sp]=[this._sessionActivityTimestamp,null!==(e=this._sessionId)&&void 0!==e?e:null,this._sessionStartTimestamp],t)),this._persistence.flush())}},t._freshestActivityTimestamp=function(){var e=this._getSessionId()[0],t=li(e)?e:0,n=li(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)},t._isSessionIdleAfterCrossTabRefresh=function(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())},t._getSessionId=function(){var e=this._persistence.props[Sp];return Xr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},t.resetSessionId=function(){this._lastPersistedActivityTimestamp=null,this._pendingBootstrapSession=void 0,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)},t.setBootstrapSessionId=function(e,t){void 0===t&&(t=!1);var n=function(e,t){void 0===t&&(t=(new Date).getTime());try{var n=function(e){var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)}(e);return n>t+6e4?void Ey.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void Ey.error("Invalid sessionID in bootstrap",e)}}(e);return!ri(n)&&(t?this._pendingBootstrapSession={sessionId:e,sessionStartTimestamp:n}:this._setSessionId(e,(new Date).getTime(),n),!0)},t.destroy=function(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&Ih&&(Ih.removeEventListener(Qp,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&xm._remove(e._primary_window_exists_storage_key)},Ml(Ih,Qp,this._beforeUnloadListener,{capture:!1})},t.checkAndGetSessionAndWindowId=function(e,t,n){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===n&&(n=!1),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),i=this._sessionId;if(n)this._lastCookieSyncTimestamp=r;else if(si(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>r||r-this._lastCookieSyncTimestamp>=1e3){var o,s;null==(o=(s=this._persistence).syncCookieProperties)||o.call(s),this._lastCookieSyncTimestamp=r}var a=this._getSessionId(),u=a[1],l=a[2],c=!ri(i)&&u!==i,d=this._freshestActivityTimestamp(),f=this._getWindowId(),h=this._pendingBootstrapSession,p=!!h&&(h.sessionStartTimestamp>r+6e4||r-h.sessionStartTimestamp>Ty),_=h?p:li(l)&&Math.abs(r-l)>Ty,v=!1,g=c,m=!u||!!h,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(r,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(r))||Ey.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2],b||(m=!u||!!h)}if(m||b||_){g=!1;var S=h&&!p;u=S?h.sessionId:this._sessionIdGenerator(),f=this._windowIdGenerator(),Ey.info("new session ID assigned",{sessionId:u,windowId:f,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),l=S?h.sessionStartTimestamp:r,this._pendingBootstrapSession=void 0,v=!0}else f||(f=this._windowIdGenerator(),v=!0),(g=g||u!==y)&&(Ey.info("adopted cross-tab session id",{sessionId:u,windowId:f}),v=!0);var k=li(d)&&e&&!_?d:r,x=li(l)?l:(new Date).getTime();this._setWindowId(f),this._setSessionId(u,k,x),e||this._resetIdleTimer();var C={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_,crossTabAdoption:g};return v&&this._sessionIdChangedHandlers.forEach(function(e){return e(u,f,C)}),{sessionId:u,windowId:f,sessionStartTimestamp:x,changeReason:v?C:void 0,lastActivityTimestamp:d}},t._resetIdleTimer=function(){var e=this;this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(function(){if(!e._destroyed)if(e._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var t=e._sessionId;e.resetSessionId(),e._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}else e._resetIdleTimer()},1.1*this.sessionTimeoutMs))},a(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),Iy=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),Ry=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&ki(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(function(e){return ki(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver};function Ay(){return(Ay=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==Ah?void 0:Ah.userAgentData)&&t.getHighEntropyValues){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,t.getHighEntropyValues(["model"]);case 2:if(null!=(n=e.v)){e.n=3;break}i=void 0,e.n=4;break;case 3:i=n.model;case 4:return e.a(2,ii(r=i)&&r.length>0?r:void 0);case 5:return e.p=5,Sl.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}},e,null,[[1,5]])}))).apply(this,arguments)}var My="custom",Oy="i.posthog.com",Ly=/^\/static\//,Dy=["/s/","/e/","/i/"],$y=function(){"use strict";function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(Ly.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}},t._urlKey=function(e){var t=Hh(e);return t?t.protocol+"//"+t.host+t.pathname:void 0},t._prepareEndpoint=function(e,t,n){if("ui"===e)return n;var r=n,i=this.instance.config.rewriteRequestPath;if(i){var o,s=(null==(o=Hh(n))?void 0:o.href)||n;r=i(new URL(s)).toString()}if(i&&"api"===e&&Dy.some(function(e){return 0===t.indexOf(e)})){var a=this._urlKey(r);if(a){var u,l=this.apiHost,c=this._ingestionEndpoints;(null==(u=c)?void 0:u.apiHost)===l&&c.rewriteRequestPath===i||(this._ingestionEndpoints=c={apiHost:l,rewriteRequestPath:i,urls:new Set}),c.urls.add(a)}}return r},t.isIngestionEndpoint=function(e){var t=this._ingestionEndpoints,n=this._urlKey(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)},t.endpointFor=function(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this._prepareEndpoint(e,t,this.uiHost+t);if("flags"===e)return this._prepareEndpoint(e,t,this.flagsApiHost+t);if("assets"===e){var n=this._staticAssetHostOverride(t);if(n)return this._prepareEndpoint(e,t,""+n+t)}if(this.region===My)return this._prepareEndpoint(e,t,this.apiHost+t);var r=Oy+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+r);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+r)}},a(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"flagsApiHost",get:function(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}},{key:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Oy,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(this._regionCache[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":My),this._regionCache[this.apiHost]}}])}(),qy=kl("[PostHog ExternalIntegrations]"),Ny={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},By=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=dg(this._instance))||n(this._instance,e,function(e){if(e)return qy.error("failed to load script",e);t()})},t.startIfEnabledOrStop=function(){for(var e=this,t=function(){var t,i,o,s=r[n],a=s[0],u=s[1];!u||null!=(t=jh.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(Ny[a],function(){var t;null==(t=jh.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)}),!u&&null!=(i=jh.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[a]&&(null==(o=jh.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[a])||o.stop())},n=0,r=Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{});r.length>n;n++){var i;t()}},e}(),jy={},Hy=0,zy=function(){},Uy='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Wy="Surveys module not available",Vy="sanitize_properties is deprecated. Use before_send instead",Gy="Invalid value for property_denylist config: ",Ky=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],Qy=["$feature_flag_called","$$heatmap","$snapshot"],Yy=function(e){return"$"===e.charAt(0)&&!Vr(Qy,e)},Jy=/^[A-Za-z0-9_-]{1,400}$/,Zy=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Xy=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,eb=["token","distinct_id",Op],tb="posthog",nb=[].concat(Iy).sort()[Iy.length-1],rb=function(e){var t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},ib=function(e){var t;return d({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Al(null==Mh?void 0:Mh.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:zy,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Oh&&ii(null==Oh?void 0:Oh.search)&&-1!==Oh.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Ih||null==(t=Ih.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,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error:function(e){Sl.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Kp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:zy},function(e){return{rageclick:e&&e>="2026-05-30"?{content_ignorelist:g_,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:rb(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}}(e))},ob=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],sb=function(e){for(var t={},n=0,r=ob;r.length>n;n++){var i=r[n],o=i[0],s=i[1];ri(e[o])||(t[s]=e[o])}var a=Pl({},t,e),u=e.__preview_external_dependency_versioned_paths;return ri(u)||(ri(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),ii(u)&&ri(e.asset_host)&&(a.asset_host=u)),Xr(e.property_blacklist)&&(ri(e.property_denylist)?a.property_denylist=e.property_blacklist:Xr(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):Sl.error(Gy+e.property_denylist)),a},ab=function(){"use strict";return a(function(){this.__forceAllowLocalhost=!1},[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Sl.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),ub=(c=function(){"use strict";function e(){var t,n=this;this._botFilterWarned=!1,this._isPageUnloading=!1,this._isShutdown=!1,this.webPerformance=new ab,this._personProcessingSetOncePropertiesSent=!1,this.version=Jh.LIB_VERSION,this.__loadExternalDependency=void 0,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new Sh,this._extensions=[],this._extensionEventPropertyProducers=[],this._replayDebugPropertiesPaused=!1,this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._hasWarnedAboutMissingHistoryAutocapture=!1,this._isConsentTransition=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ib(),this.SentryIntegration=Om,this.sentryIntegration=function(e){return function(e,t){var n=Mm(e,t);return{name:Am,processEvent:function(e){return n(e)}}}(n,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new xy(this),this.pageViewManager=new Lm(this),this.rateLimiter=new gy(this),this.requestRouter=new $y(this),this.consent=new Cm(this),this.externalIntegrations=new By(this);var r=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:function(e,t,r){var i,o=ii(e)?((i={})[e]=t,i):e;n.setPersonProperties(o),null==r||r({})},set_once:function(e,t,r){var i,o=ii(e)?((i={})[e]=t,i):e;n.setPersonProperties(void 0,o),null==r||r({})}},this.on("eventCaptured",function(e){return Sl.info('send "'+(null==e?void 0:e.event)+'"',e)})}var t=e.prototype;return t._removeExtension=function(e){if(e){var t=this._extensions.indexOf(e);-1!==t&&this._extensions.splice(t,1)}},t._replaceExtension=function(e,t){return this._removeExtension(e),this._extensions.push(t),null==t.initialize||t.initialize(),t},t._inCookielessMode=function(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()},t._warnIfHistoryAutocaptureMissing=function(){if(!this._hasWarnedAboutMissingHistoryAutocapture&&this._originalUserConfig&&"capture_pageview"in this._originalUserConfig&&!d({},e.__defaultExtensionClasses,this.config.__extensionClasses).historyAutocapture){var t=this.config.capture_pageview;("history_change"===t||ti(t)&&(t.path||t.search||t.hash&&!this.config.disable_capture_url_hashes))&&(this._hasWarnedAboutMissingHistoryAutocapture=!0,Sl.warn("capture_pageview is set to capture history changes, but the history autocapture extension is not loaded, so only the first pageview of each page load is captured. With the slim bundle, pass __extensionClasses: { historyAutocapture: AnalyticsExtensions.historyAutocapture } from 'posthog-js/dist/extension-bundles', or set capture_pageview: true to capture page loads only."))}},t._warnIfVolatileIdentityWithoutStableId=function(){if(!(this._hasWarnedAboutVolatileIdentity||this.config.reuseAnonymousId||this.config.segment||this._inCookielessMode())){var e,t,n,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this._hasStableInitialDistinctId||(r?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._hasWarnedAboutVolatileIdentity=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+n)))}},t._syncCookielessIdentity=function(){var e=this.persistence;if(e&&!this._isConsentTransition)if(this._inCookielessMode())"on_reject"===this.config.cookieless_mode&&"$posthog_cookieless"!==this.get_distinct_id()&&(this._sync_opt_out_with_persistence(),this._enterCookielessMode());else if("$posthog_cookieless"===this.get_distinct_id()){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var n=this.config.get_device_id(xu());this.register({distinct_id:n,$device_id:n}),e.set_property(Pp,Vp)}this._sync_opt_out_with_persistence()}},t.init=function(t,n,r){if(r&&r!==tb){var i,o=null!==(i=jy[r])&&void 0!==i?i:new e;return o._init(t,n,r),jy[r]=o,jy[tb][r]=o,o}return this._init(t,n,r)},t._init=function(e,t,n){var r,i,o,s=this;void 0===t&&(t={});var a,u=ii(e)?e.trim():"";if(!u)return Sl.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return u!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ib(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var l=ib(t.defaults),c=sb(t),f=Pl({},l,c,{name:n,token:u});ti(l.rageclick)&&ti(c.rageclick)&&(f.rageclick=Pl({},l.rageclick,c.rageclick)),ti(l.session_recording)&&ti(c.session_recording)&&(f.session_recording=Pl({},l.session_recording,c.session_recording)),this.set_config(f),this.config.on_xhr_error&&Sl.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:yh;var h=this._is_persistence_disabled(),p=!this._inCookielessMode();if(this.persistence=new _y(this.config,h,!0,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new _y(d({},this.config,{persistence:"sessionStorage"}),h,!1,p),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!h&&xm._is_supported()){var _=xm._parse(this._sessionRegisteredPropertiesStorageKey);Xr(_)&&_.forEach(function(e){ii(e)&&s._sessionRegisteredPropKeys.add(e)})}else xm._remove(this._sessionRegisteredPropertiesStorageKey);var v=d({},this.persistence.props),g=d({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new Sy(function(e,t){return s._send_retriable_request(e,t)},this.config.request_queue_config),this._retryQueue=new ky(this),this.__request_queue=[];var m=this._inCookielessMode();m||(this.sessionManager=new Fy(this),this.sessionPropsManager=new Py(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(function(e,t,n){(null!=n&&n.activityTimeout||null!=n&&n.sessionPastMaximumLength||null!=n&&n.crossTabAdoption)&&s._clearSessionRegisteredProps()})),this._enrollFeatureFlags(),this.config.__preview_deferred_init_extensions?(Sl.info("Deferring extension initialization to improve startup performance"),this._extensionInitTimeout=setTimeout(function(){s._extensionInitTimeout=void 0,s._initExtensions(m)},0)):(Sl.info("Initializing extensions synchronously"),this._initExtensions(m)),Jh.DEBUG=Jh.DEBUG||this.config.debug,Jh.DEBUG&&Sl.info("Starting in debug mode",{this:this,config:t,thisC:d({},this.config),p:v,s:g}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=d({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(i=t.bootstrap)?void 0:i.distinctID;if(this._hasStableInitialDistinctId=!!y&&!oi(y),null!=(o=t.bootstrap)&&o.distinctID){var b=t.bootstrap.distinctID,w=this.get_distinct_id(),S=this.persistence.get_property(Pp);if(t.bootstrap.isIdentifiedID&&null!=w&&w!==b&&"anonymous"===S)this.identify(b);else if(t.bootstrap.isIdentifiedID&&null!=w&&w!==b&&"identified"===S)Sl.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var k=this.config.get_device_id(xu()),x=t.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(Pp,t.bootstrap.isIdentifiedID?Gp:Vp),this.register({distinct_id:b,$device_id:x})}}if(m)this.register_once({distinct_id:Mp,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(xu());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(Pp,Vp)}return Ml(Ih,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Ml(Ih,"pageshow",function(e){if(s._isPageUnloading=!1,!s._isShutdown){var t;if(e.persisted&&s.persistence){var n=s.persistence.get_property(Zh),r=s.persistence.get_property(Pp);s.persistence.load(),s._processCookieIdentityChange()||n===s.persistence.get_property("distinct_id")&&r===s.persistence.get_property("$user_state")||s._processIdentityChange()}null==(t=s._retryQueue)||t.resume()}}),t.segment?Rm(this,function(){return s._loaded()}):this._loaded(),ei(this.config._onCapture)&&this.config._onCapture!==zy&&(Sl.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return s.config._onCapture(e.event,e)})),this.config.ip&&Sl.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Ay.apply(this,arguments)}().then(function(e){var t;e&&s.register(((t={})[ep]=e,t))}).catch(zy),this},t._isSharedExtension=function(e){var t=e;return ii(t.name)&&ei(t.setup)},t._enrollExtension=function(e,t){var n=this;this._isSharedExtension(e)?t.push(h(l().m(function t(){return l().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.setup(n._getBrowserClientAdapter());case 1:t.n=6;break;case 2:return t.p=2,Sl.error('Failed to set up extension "'+e.name+'"',t.v),t.p=3,t.n=4,null==e.dispose?void 0:e.dispose();case 4:t.n=6;break;case 5:t.p=5,Sl.error('Failed to dispose extension "'+e.name+'"',t.v);case 6:return t.a(2)}},t,null,[[3,5],[0,2]])}))):this._extensions.push(e)},t._enrollFeatureFlags=function(){var t,n,r,i,o,s,a=this,u=null!==(t=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)&&void 0!==t?t:null==(r=e.__defaultExtensionClasses)?void 0:r.featureFlags;if(u)if(this.featureFlags&&this.featureFlags instanceof u||(null==(s=this._featureFlagsReloadingUnsubscribe)||s.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),ei(this.featureFlags.onReloading)&&ei(this.featureFlags.setup)){if(!this._featureFlagsReloadingUnsubscribe){this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading(function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)});var c=this.featureFlags;h(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,c.setup(a._getBrowserClientAdapter());case 1:e.n=6;break;case 2:e.p=2,Sl.error("Failed to set up feature flags",e.v),t=a._featureFlagsReloadingUnsubscribe,a._featureFlagsReloadingUnsubscribe=void 0;try{null==t||t()}catch(e){Sl.error("Failed to unsubscribe feature flag reloading",e)}return e.p=3,e.n=4,c.dispose();case 4:e.n=6;break;case 5:e.p=5,Sl.error("Failed to dispose feature flags",e.v);case 6:return e.a(2)}},e,null,[[3,5],[0,2]])}))()}}else null==(i=(o=this.featureFlags).initialize)||i.call(o)},t._initExtensions=function(t){var n,r,i,o,s,a,u,l,c=this,f=performance.now(),h=d({},e.__defaultExtensionClasses,this.config.__extensionClasses),p=[];h.exceptions&&this._extensions.push(this.exceptions=null!==(n=this.exceptions)&&void 0!==n?n:new h.exceptions(this)),h.historyAutocapture&&this._extensions.push(this.historyAutocapture=new h.historyAutocapture(this)),this._warnIfHistoryAutocaptureMissing(),h.tracingHeaders&&this._extensions.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this._extensions.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this._extensions.push(this.sessionRecording=new h.sessionRecording(this)),h.autocapture&&this._enrollExtension(this.autocapture=new h.autocapture(this),p),h.surveys&&this._enrollExtension(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new h.surveys(this),p),h.logs&&this._enrollExtension(this.logs=null!==(i=this.logs)&&void 0!==i?i:new h.logs(this),p),h.metrics&&this._extensions.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new h.metrics(this)),h.conversations&&this._extensions.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new h.conversations(this)),h.productTours&&this._extensions.push(this.productTours=new h.productTours(this)),h.heatmaps&&this._extensions.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this._extensions.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Tm)),h.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this._extensions.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new h.experiments(this)),h.webMCP&&this._extensions.push(this.webMCP=null!==(l=this.webMCP)&&void 0!==l?l:new h.webMCP(this));var _=this._extensions.length>0||p.length>0;this.config.disable_scroll_properties||p.unshift(function(){c.scrollManager.startMeasuringScrollPosition()}),this._extensions.forEach(function(e){e.initialize&&p.push(function(){null==e.initialize||e.initialize()})}),p.push(function(){if(c._pendingRemoteConfig){var e=c._pendingRemoteConfig;c._pendingRemoteConfig=void 0,c._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})}}),this._processInitTaskQueue(p,f,_)},t._processInitTaskQueue=function(e,t,n){for(var r,i,o,s=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void(this._extensionInitTimeout=setTimeout(function(){s._extensionInitTimeout=void 0,s._processInitTaskQueue(e,t,n)},0));var a=e.shift();if(a)try{a()}catch(e){Sl.error("Error initializing extension:",e)}}var u=Math.round(performance.now()-t);n&&u>0?this.register_for_session(((r={})[Lp]=this.config.__preview_deferred_init_extensions?"deferred":"synchronous",r[Dp]=u,r)):ri(null==(i=this.sessionPersistence)?void 0:i.props.$sdk_debug_extensions_init_method)&&ri(null==(o=this.sessionPersistence)?void 0:o.props.$sdk_debug_extensions_init_time_ms)||(this.unregister_for_session(Lp),this.unregister_for_session(Dp)),this.config.__preview_deferred_init_extensions&&Sl.info("PostHog extensions initialized ("+u+"ms)")},t._onRemoteConfig=function(e){var t=this;if(!Mh||!Mh.body)return Sl.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t._onRemoteConfig(e)},500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(r.supportedCompression,yh)?yh:Vr(r.supportedCompression,bh)?bh:void 0),null!=(n=r.analytics)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Kp}),this._internalEventEmitter.emit("extensionsRemoteConfig",e),this._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})},t._loaded=function(){var e=this;try{this.config.loaded(this)}catch(e){Sl.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Oh&&Oh.hostname){var t=Oh.hostname,n=this.config.internal_or_test_user_hostname;("string"==typeof n?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(function(){(e.consent.isOptedIn()||e._inCookielessMode())&&e._captureInitialPageview()},1),this._remoteConfigLoader=new yy(this),this._remoteConfigLoader.load()},t._start_queue_if_opted_in=function(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())},t._dom_loaded=function(){var e=this;this.is_capturing()&&xl(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()},t._handle_unload=function(){var e,t,n,r,i;this._isPageUnloading=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(Jp),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(Jp,null,{transport:"sendBeacon"})},t._send_request=function(e){wy(this,e)},t._send_retriable_request=function(e,t){this._retryQueue?this._retryQueue.retriableRequest(e,t):this._send_request(t?d({},e,{transport:t}):e)},t._execute_array=function(e){var t=this;Hy++;try{var n,r=[],i=[],o=[];xl(e,function(e){if(e)if(Xr(n=e[0]))o.push(e);else if(ei(e))try{e.call(t)}catch(t){Sl.error("Error executing queued PostHog call",e,t)}else Xr(e)&&"alias"===n?r.push(e):Xr(e)&&-1!==n.indexOf("capture")&&ei(t[n])?o.push(e):i.push(e)});var s=function(e,t){xl(e,function(e){try{if(Xr(e[0])){var n=t;Cl(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){Sl.error("Error executing queued PostHog call",e,t)}})};s(r,this),s(i,this),s(o,this)}finally{Hy--}},t.push=function(t){if(Hy>0&&Xr(t)&&ii(t[0])){var n=e.prototype[t[0]];ei(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedMetaIdentifier=function(e){var t,n=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return ii(n)&&e.pattern.test(n)?{value:n,delivered:!1}:ti(n)&&ii(n.value)&&e.pattern.test(n.value)?{value:n.value,delivered:!0===n.delivered}:void 0},t._storeMetaIdentifier=function(e,t,n){return t===(null==n?void 0:n.value)?{value:t,pending:!n.delivered}:(e.register(t,!1),{value:t,pending:!0})},t._readMetaCookie=function(e){if(this.config.save_campaign_params&&!this._inCookielessMode()){var t=im(e.cookieName);return ii(t)&&e.pattern.test(t)?t:void 0}},t._updateFacebookClickId=function(e,t,n,r){if(this.persistence){var i=this._facebookClickIdChannel,o=this._getPersistedMetaIdentifier(i);if(!r){if(n)return ii(t)&&Zy.test(t)?this._storeMetaIdentifier(i,t,o):void i.unregister();var s=ii(e)&&Jy.test(e)?e:void 0,a=this._readMetaCookie(i);return a&&function(e,t,n){var r=e.split(".");if(t)return r[3]===t;if(!n)return!0;var i=n.value.split(".");return r[3]===i[3]||Number(r[2])>Number(i[2])}(a,s,o)?this._storeMetaIdentifier(i,a,o):s?(null==o?void 0:o.value.split(".")[3])===s?{value:o.value,pending:!o.delivered}:this._storeMetaIdentifier(i,"fb.1."+Date.now()+"."+s,o):o?{value:o.value,pending:!o.delivered}:void 0}i.unregister()}},t._updateFacebookBrowserId=function(e,t,n){if(this.persistence){var r=this._facebookBrowserIdChannel,i=this._getPersistedMetaIdentifier(r);if(!n){if(t)return ii(e)&&Xy.test(e)?this._storeMetaIdentifier(r,e,i):void r.unregister();var o=this._readMetaCookie(r);return o?this._storeMetaIdentifier(r,o,i):i?{value:i.value,pending:!i.delivered}:void 0}r.unregister()}},t._markMetaIdentifiersDelivered=function(e){var t=this;if(this.persistence){var n=function(e){var n=e.value,r=t._getPersistedMetaIdentifier(e.channel);return(null==r?void 0:r.value)===n&&!r.delivered},r=e.filter(n);r.length&&(this.persistence.refreshMetaIdentifiers(),r.filter(n).forEach(function(e){return e.channel.register(e.value,!0)}))}},t.capture=function(e,t,n){var r,i,o,s,a,u,l,c,f,h,p=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue)if(this.is_capturing())if(!ri(e)&&ii(e)){if(this._syncCookielessIdentity(),"$snapshot"!==e||!this._inCookielessMode()){var _=!this.config.opt_out_useragent_filter&&this._is_bot();if(_&&!this.config.__preview_capture_bot_pageviews)return this._botFilterWarned||(this._botFilterWarned=!0,console.warn("[PostHog.js] Events are being dropped because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture them, e.g. in end-to-end tests. Note that logs from `captureLog` are not subject to this filter.")),void Sl.info('Event "'+e+'" was not captured because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture it.');var v=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=v&&v.isRateLimited)Sl.critical("This capture call is ignored due to client rate limiting.");else{var g;null!=t&&t.$current_url&&!ii(null==t?void 0:t.$current_url)&&(Sl.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=n&&n._originatedFromCaptureException||Sl.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.persistence.syncCookieProperties(),this._processCookieIdentityChange(),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(g=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var m=new Date,y=(null==n?void 0:n.timestamp)||m,b=Bo(null==n?void 0:n.uuid,xu),w={uuid:b,event:e,properties:this._calculateEventProperties(e,t||{},y,b,!1,!0)},S=null==(r=this.featureFlags)||null==r.flagEventCapture?void 0:r.flagEventCapture(t);if(!S||(Cl(S.omit,function(e){delete w.properties[e]}),!1!==(null==S.resolved?void 0:S.resolved(w.properties)))){"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&_&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),v&&(w.properties.$lib_rate_limit_remaining_tokens=v.remainingTokens);var k="$feature_flag_called"===e&&!1===w.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=n&&n.$set&&!k&&(w.$set=null==n?void 0:n.$set);var x=ti(null==t?void 0:t.$set)?t.$set:void 0,C=Xr(null==t?void 0:t.$unset)?t.$unset:[],P=(null==n?void 0:n.$unset)||[],E=function(e){var t,r=!(null==n||!n.$set)&&e in n.$set;return{hasProvided:r||!!x&&e in x,provided:r?null==n||null==(t=n.$set)?void 0:t[e]:null==x?void 0:x[e],unset:-1!==C.indexOf(e)||-1!==P.indexOf(e)}};this.persistence.refreshMetaIdentifiersBeforeCapture();for(var T=E(np),F=E(ip),I=[{channel:this._facebookClickIdChannel,hasProvided:T.hasProvided,update:this._updateFacebookClickId(null==(i=g)?void 0:i.fbclid,T.provided,T.hasProvided,T.unset)},{channel:this._facebookBrowserIdChannel,hasProvided:F.hasProvided,update:this._updateFacebookBrowserId(F.provided,F.hasProvided,F.unset)}],R=0,A=I;A.length>R;R++){var M,O=A[R],L=O.update;L&&!0===w.properties.$process_person_profile&&L.pending&&!O.hasProvided&&!k&&(w.$set=d(((M={})[O.channel.property]=L.value,M),w.$set))}var D=null==n?void 0:n.$unset;D&&(w.$unset=D);var q=k?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==Xp,e===Zp);if(q&&(w.$set_once=q),null!=n&&n._noTruncate||(l=this.config.properties_string_max_length,c=w,f=function(e){return ii(e)?e.slice(0,l):e},h=new Set,w=function e(t,n){if(t!==Object(t))return f?f(t):t;if(!h.has(t)){var r;if(h.add(t),Xr(t))r=[],xl(t,function(t){r.push(e(t))});else{var i={};Cl(_i(t)?Il(t):t,function(t,n){h.has(t)||(i[n]=e(t,n))}),r=i}return r}}(c)),w.timestamp=y,ri(null==n?void 0:n.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=m),k&&(w.properties=function(e,t){void 0===t&&(t=[]);var n={},r=function(t){void 0!==e[t]&&(n[t]=e[t])};return qs.forEach(r),t.forEach(r),n}(w.properties,S?eb.concat(S.keep):eb)),e===dl||e===fl){var N,B=null==t?void 0:t[hl],j=null==t?void 0:t[_l];ic({id:B,current_iteration:j}),w.$set=d({},w.$set,((N={})[Nl({id:B,current_iteration:j},e===fl?"responded":"dismissed")]=!0,N))}else e===cl&&(w.$set=d({},w.$set,((o={}).$survey_last_seen_date=(new Date).toISOString(),o)));if("product tour shown"===e){var H,z=null==t?void 0:t.$product_tour_type;z&&(w.$set=d({},w.$set,((H={})["$product_tour_last_seen_date/"+z]=(new Date).toISOString(),H)))}var U=d({},w.properties.$set,w.$set);if(ni(U)||this.setPersonPropertiesForFlags(U),!ai(this.config.before_send)){var W=this._runBeforeSend(w,null==S?void 0:S.failed);if(!W)return;(w=W).uuid=Bo(w.uuid,xu)}this.sessionRecording&&!this.sessionRecording.isReplayOff&&!this._replayDebugPropertiesPaused&&Yy(e)&&(this._replayDebugPropertiesPaused=!0,setTimeout(function(){return p._replayDebugPropertiesPaused=!1},3e4));var V=[];I.forEach(function(e){var t,n,r,i=e.channel,o=e.update,s=null!==(t=null==(n=w.$set)?void 0:n[i.property])&&void 0!==t?t:ti(null==(r=w.properties)?void 0:r.$set)?w.properties.$set[i.property]:void 0;null!=o&&o.pending&&s===o.value&&V.push({channel:i,value:o.value})}),this._internalEventEmitter.emit("eventCaptured",w);var G,K,Q=null!==(s=null==n?void 0:n._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),Y="recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(Q),J=d({method:"POST",url:Q,data:w,compression:"best-available",preferSyncCompression:null==n?void 0:n.send_instantly,timestampMode:Y?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},Y&&null!=(a=w.properties)&&a.$session_id?{batchGroup:w.properties.$session_id+(w.properties.$window_id?"-"+w.properties.$window_id:"")}:{},null!=n&&n.transport?{transport:n.transport}:{},V.length?{fireCallbackOnDrop:!0,callback:function(e){e.statusCode>=200&&300>e.statusCode&&p._markMetaIdentifiersDelivered(V)}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?(!J.transport&&!J.callback&&ni(null!==(G=this.config.request_headers)&&void 0!==G?G:{})&&this._isPageUnloading&&(K="sendBeacon"),this._send_retriable_request(J,K)):this._requestQueue.enqueue(J),null==(u=this.featureFlags)||u.sendFlagCallsPendingCapture(),w}}}}else Sl.error("No event name provided to posthog.capture");else Sl.info('Event "'+e+'" was not captured because capturing is disabled (opted out or consent pending).');else Sl.uninitializedWarning("posthog.capture")},t._addCaptureHook=function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})},t.getExtension=function(e){var t;return null==(t=this._browserClientAdapter)?void 0:t.getExtension(e)},t._getBrowserClientAdapter=function(){var e;return null!==(e=this._browserClientAdapter)&&void 0!==e?e:this._browserClientAdapter=new cg(this)},t._registerExtensionEventProperties=function(e){var t=this;this._extensionEventPropertyProducers.push(e);var n=!0;return function(){if(n){n=!1;var r=t._extensionEventPropertyProducers.indexOf(e);-1!==r&&t._extensionEventPropertyProducers.splice(r,1)}}},t._processCookieIdentityChange=function(e){var t;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange()||(this._processIdentityChange(e),0))},t._processIdentityChange=function(e){var t,n,r;void 0===e&&(e=!0),this._cachedPersonProperties=null,"anonymous"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))&&(null==(r=this.sessionPersistence)||r.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags()},t.calculateEventProperties=function(e,t,n,r,i){return this._calculateEventProperties(e,t,n,r,i,!1)},t._calculateEventProperties=function(e,t,n,r,i,o){if(void 0===o&&(o=!1),n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this._syncCookielessIdentity(),o||(this.persistence.syncCookieProperties(),this._processCookieIdentityChange());var s=i?void 0:this.persistence.remove_event_timer(e),a=d({},t);if(a.token=this.config.token,a.$config_defaults="latest"===this.config.defaults?nb:this.config.defaults,this._inCookielessMode()&&(a[Op]=!0),"$snapshot"===e){var u=d({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ii(a.distinct_id)&&!ui(a.distinct_id)||oi(a.distinct_id))&&Sl.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,c,f=function(e,t,n,r){var i,o,s,a;if(void 0===r&&(r=!1),!Nh)return{};var u,l=e?[].concat(zm,t||[]):[],c=xo(Nh),d=c[0],f=c[1],h=function(e){for(var t=0;To.length>t;t++){var n,r=To[t],i=r[1],o=r[2],s=e.match(r[0]);if(s)return[i,(null==(n=o&&e.match(o)||s)?void 0:n[1])||""]}return["",""]}(Nh),p=h[0],_=h[1],v=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},g={};ri(n)||(g.detectGoogleSearchApp=n);var m={},y=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,b=null==(o=navigator)?void 0:o.maxTouchPoints,w=null==Ih||null==(s=Ih.screen)?void 0:s.width,S=null==Ih||null==(a=Ih.screen)?void 0:a.height,k=null==Ih?void 0:Ih.devicePixelRatio;ri(y)||(m.userAgentDataPlatform=y),ri(b)||(m.maxTouchPoints=b),ri(w)||(m.screenWidth=w),ri(S)||(m.screenHeight=S),ri(k)||(m.devicePixelRatio=k);var x,C=Pl(Fl({$os:d,$os_version:f,$browser:bo(Nh,navigator.vendor,v,g),$webview_app:p,$webview_app_version:_,$device:Co(Nh),$device_type:Po(Nh,m),$timezone:Yh(),$timezone_offset:ty()}),{$current_url:Kh(r?Ho(null==Oh?void 0:Oh.href):null==Oh?void 0:Oh.href,l,Wm),$host:null==Oh?void 0:Oh.host,$pathname:null==Oh?void 0:Oh.pathname,$raw_user_agent:Nh.length>1e3?Nh.substring(0,997)+"...":Nh,$browser_version:So(Nh,navigator.vendor,v,g),$browser_language:Ym(),$browser_language_prefix:(x=Ym(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==Ih?void 0:Ih.screen.height,$screen_width:null==Ih?void 0:Ih.screen.width,$viewport_height:null==Ih?void 0:Ih.innerHeight,$viewport_width:null==Ih?void 0:Ih.innerWidth,$lib:bl.LIB_NAME,$lib_version:bl.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return bl.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=bl.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime(),!0),_=h.windowId;a.$session_id=h.sessionId,a.$window_id=_}this.sessionPropsManager&&Pl(a,this.sessionPropsManager.getSessionProps());try{var v;if(this.sessionRecording){var g=this.sessionRecording.sdkDebugProperties,m=!this._replayDebugPropertiesPaused&&Yy(e);for(var y in g)(m||Vr(Ky,y))&&(a[y]=g[y])}l=null==(v=this._retryQueue)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===My&&(a.$lib_custom_api_host=this.config.api_host),c="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),a=Pl(a,c),"$pageview"===e&&Mh&&(a.title=Mh.title),!ri(s)){var b=n.getTime()-s;a.$duration=parseFloat((b/1e3).toFixed(3))}Nh&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var w=this.persistence.properties(),S=this.sessionPersistence.properties(),k=a.$groups,x=w.$groups;ti(k)&&!ni(k)&&(a.$groups=d({},ti(x)?x:{},k)),Cl(["$referrer","$referring_domain"],function(e){e in w&&delete S[e]});var C={};if(this._extensionEventPropertyProducers.length>0)for(var P,E=p(this._extensionEventPropertyProducers.slice());!(P=E()).done;){var T=P.value;try{Pl(C,T())}catch(e){Sl.error("Failed to produce browser extension event properties",e)}}a=Pl({},f,w,S,d({},C,a)),l?a.$sdk_debug_retry_queue_size=l:delete a.$sdk_debug_retry_queue_size,a.$is_identified=this._isIdentified(),Xr(this.config.property_denylist)?Cl(this.config.property_denylist,function(e){delete a[e]}):Sl.error(Gy+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var F=this.config.sanitize_properties;F&&(Sl.error(Vy),a=F(a,e));var I=this._hasPersonProcessing();return a.$process_person_profile=I,I&&!i&&this._requirePersonProcessing("_calculate_event_properties"),a},t._calculate_set_once_properties=function(e,t,n){var r;if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!n)return e;var i=Pl({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),o=this.config.sanitize_properties;return o&&(Sl.error(Vy),i=o(i,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),ni(i)?void 0:i},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)},t.register_for_session=function(e){var t,n,r=this;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(n=this.sessionPersistence)||n.register(e),Object.keys(e).forEach(function(e){return r._sessionRegisteredPropKeys.add(e)}),this._persistSessionRegisteredPropKeys()},t.unregister=function(e){var t;null==(t=this.persistence)||t.unregister(e)},t.unregister_for_session=function(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this._sessionRegisteredPropKeys.delete(e),this._persistSessionRegisteredPropKeys()},t._register_single=function(e,t){var n;this.register(((n={})[e]=t,n))},t._clearSessionRegisteredProps=function(){var e=this;this._sessionRegisteredPropKeys.forEach(function(t){var n;null==(n=e.sessionPersistence)||n.unregister(t)}),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()},t._persistSessionRegisteredPropKeys=function(){var e;if(this._sessionRegisteredPropertiesStorageKey)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e._disabled||!xm._is_supported())xm._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach(function(e){return t.push(e)}),t.length>0?xm._set(this._sessionRegisteredPropertiesStorageKey,t):xm._remove(this._sessionRegisteredPropertiesStorageKey)}},t.getFeatureFlag=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlag(e,t)},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)},t.getFeatureFlagResult=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlagResult(e,t)},t.getAllFeatureFlags=function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]},t.isFeatureEnabled=function(e,t){var n,r;return null!==(n=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t))&&void 0!==n?n:null==t?void 0:t.defaultValue},t.reloadFeatureFlags=function(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()},t.updateFlags=function(e,t,n){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,n)},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,n)},t.getEarlyAccessFeatures=function(e,t,n){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,n)},t.on=function(e,t){return this._internalEventEmitter.on(e,t)},t.onFeatureFlags=function(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),function(){})},t.onSurveysLoaded=function(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Wy}),function(){})},t.onSessionId=function(e){var t,n;return null!==(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}},t.getSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Wy})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Wy})},t.onActiveMatchingSurveysChanged=function(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:Wy}),function(){})},t.renderSurvey=function(e,t){var n;null==(n=this.surveys)||n.renderSurvey(e,t)},t.displaySurvey=function(e,t){var n;void 0===t&&(t=sc),null==(n=this.surveys)||n.displaySurvey(e,t)},t.cancelPendingSurvey=function(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)},t.canRenderSurvey=function(e){var t,n;return null!==(t=null==(n=this.surveys)?void 0:n.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:Wy}},t.canRenderSurveyAsync=function(e,t){var n,r;return void 0===t&&(t=!1),null!==(n=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))&&void 0!==n?n:Promise.resolve({visible:!1,disabledReason:Wy})},t._validateIdentifyId=function(e){return!e||oi(e)?(Sl.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(Sl.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Sl.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)},t.identify=function(e,t,n){if(!this.__loaded||!this.persistence)return Sl.uninitializedWarning("posthog.identify");if(ui(e)&&(e=e.toString(),Sl.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){this._syncCookielessIdentity();var r=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,o=this._processCookieIdentityChange(!1),s=this.persistence._beginCookieSyncSuppression(),a=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property("__alias")&&(this.unregister(tp),this.register({distinct_id:e}));var l=(this.persistence.get_property("$user_state")||"anonymous")===Vp,c=e!==u,d=!c&&l;if(c&&l){var f,h=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:u};this.persistence.set_property(Pp,Gp),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$identify",h,{$set:t||{},$set_once:n||{}})&&(this._cachedPersonProperties=vg(e,t,n)),null==(f=this.featureFlags)||f.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(d){this.persistence.set_property(Pp,Gp);var p=t||{},_=n||{};this.setPersonPropertiesForFlags({$set:p,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:p,$set_once:_})&&(this._cachedPersonProperties=vg(e,t,n))}else(t||n)&&this.setPersonProperties(t,n);c||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Xf)):d&&(t||n)&&this.reloadFeatureFlags(),a=!0}finally{s&&this.persistence._endCookieSyncSuppression(a)}}},t.setPersonProperties=function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=vg(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}})&&(this._cachedPersonProperties=n)):Sl.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Xr(e)?e:[e]).filter(function(e){return ii(e)&&e.length>0});0!==n.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(n,!0),this.capture("$set",{$unset:n}),this._cachedPersonProperties=null)},t.group=function(e,t,n){var r,i,o;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var s=this.getGroups(),a=s[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:d({},s,(i={},i[e]=t,i))}),(a||n)&&this._hasPersonProcessing()){var u={$group_type:e,$group_key:t};n&&(u.$group_set=n),this.capture(Xp,u)}n&&this.setGroupPropertiesForFlags(((o={})[e]=n,o)),a&&!n&&this.reloadFeatureFlags()}else Sl.error("posthog.group requires a group type and group key")},t.resetGroups=function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()},t.setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),null==(n=this.featureFlags)||n.setPersonPropertiesForFlags(e,t)},t.resetPersonPropertiesForFlags=function(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(n=this.featureFlags)||n.setGroupPropertiesForFlags(e,t))},t.resetGroupPropertiesForFlags=function(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)},t.reset=function(e){var t=ci(e)?e:null==e?void 0:e.resetDeviceID,n=ci(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var r,i,o,s,a;if(void 0===t&&(t=!1),Sl.info("reset"),!this.__loaded)return Sl.uninitializedWarning("posthog.reset");var u=null==n?void 0:n.sessionID;this.config.bootstrap=n||(null==(r=this._originalUserConfig)?void 0:r.bootstrap)||{},null==(i=this.featureFlags)||null==i.updateConfig||i.updateConfig(this.config,this._shouldDisableFlags());var l=this.get_property(Xh),c=this.get_property(ep),f=this.get_property(vp);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var h=this.is_capturing();t||this.consent.reset(),t||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var p=null==(s=this.persistence)||null==s._beginCookieSyncSuppression?void 0:s._beginCookieSyncSuppression(),_=this._isConsentTransition;this._isConsentTransition=_||t;var v=!1;try{var g,m,y,b,w,S,k,x,C,P,E,T,F,I;if(null==(g=this.persistence)||g.clear(),null==(m=this.sessionPersistence)||m.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),ri(f)||null==(y=this.persistence)||y.register(((b={})[vp]=f,b)),null==(w=this.surveys)||w.reset(),null==(S=this.featureFlags)||S.reset(),null==(k=this.conversations)||k.reset(),null==(x=this.logs)||x.reset(),null==(C=this.metrics)||C.reset(),null==(P=this.persistence)||P.set_property(Pp,Vp),null==(E=this.sessionManager)||E.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Mp,$device_id:null},"");else{var R,A=this.config.get_device_id(xu());this.register_once({distinct_id:A,$device_id:e?A:l},""),e||ri(c)||this.register(((R={})[ep]=c,R))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(n.distinctID&&!this._inCookielessMode()&&(null==(I=this.persistence)||I.set_property(Pp,n.isIdentifiedID?Gp:Vp),this.register({distinct_id:n.distinctID})),null==(T=this.featureFlags)||T.initialize(),!(ai(u)||null!=(F=this.sessionManager)&&F.setBootstrapSessionId(u,!0))){var M=d({},n);delete M.sessionID,this.config.bootstrap=M}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,v=!0}finally{var O;this._isConsentTransition=_,p&&(null==(O=this.persistence)||null==O._endCookieSyncSuppression||O._endCookieSyncSuppression(v))}this._lastRemoteConfig&&(null==(a=this.conversations)||a.onRemoteConfig(this._lastRemoteConfig)),this.reloadFeatureFlags()},t.shutdown=function(){var e=h(l().m(function e(t){var n,r,i,o,s,a=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return Sl.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:for(this._isShutdown=!0,clearTimeout(this._extensionInitTimeout),this._extensionInitTimeout=void 0,n=this._featureFlagsReloadingUnsubscribe,this._featureFlagsReloadingUnsubscribe=void 0,r=0,i=[function(){var e;return null==(e=a.sessionRecording)?void 0:e.dispose()},function(){var e;return null==(e=a.logs)?void 0:e.flushLogs("sendBeacon")},function(){var e;return null==(e=a.metrics)?void 0:e.flush("sendBeacon")},function(){var e;return null==(e=a.metrics)?void 0:e.dispose()},function(){var e;return null==(e=a.logs)?void 0:e.dispose()},function(){var e;return null==(e=a.surveys)?void 0:e.dispose()},function(){var e;return null==(e=a.autocapture)?void 0:e.dispose()},function(){return null==n?void 0:n()},function(){var e;return null==(e=a._requestQueue)?void 0:e.unload()},function(){var e;return null==(e=a._retryQueue)?void 0:e.unload()},function(){var e;return null==(e=a.featureFlags)?void 0:e.destroy()},function(){var e;return null==(e=a.persistence)?void 0:e.destroy()},function(){var e;return null==(e=a.sessionPersistence)?void 0:e.destroy()}];i.length>r;r++){o=i[r];try{(s=o())&&ei(s.then)&&s.then(void 0,function(e){Sl.error("Error during shutdown",e)})}catch(e){Sl.error("Error during shutdown",e)}}case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.setIdentity=function(e,t){var n;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(n=this.conversations)||n._onIdentityChanged()},t.clearIdentity=function(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e._onIdentityCleared()},t.get_distinct_id=function(){return this.get_property("distinct_id")},t.getGroups=function(){return this.get_property("$groups")||{}},t.get_session_id=function(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""},t.get_session_replay_url=function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&n){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-o,0)}return r},t.alias=function(e,t){return e===this.get_property("$people_distinct_id")?(Sl.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(ri(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(tp,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Sl.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t=d({},this.config);if(ti(e)){var n,r,i,o,s,a,u,l,c,f,h,p,_,v;Pl(this.config,sb(e));var g=this._is_persistence_disabled();if(this.persistence){var m,y,b,w="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;w&&this.sessionPersistence!==this.persistence&&(null==(y=this.sessionPersistence)||y.remove(),null==(b=this.sessionPersistence)||b.destroy()),this.persistence.update_config(this.config,t,g),w?this.sessionPersistence=this.persistence:this.sessionPersistence===this.persistence?this.sessionPersistence=new _y(d({},this.config,{persistence:"sessionStorage"}),g,!1):null==(m=this.sessionPersistence)||m.update_config(d({},this.config,{persistence:"sessionStorage"}),d({},t,{persistence:"sessionStorage"}),g)}var S=this._checkLocalStorageForDebug(this.config.debug);ci(S)&&(this.config.debug=S),ci(this.config.debug)&&(this.config.debug?(Jh.DEBUG=!0,cm._is_supported()&&cm._set("ph_debug",!0),Sl.info("set_config",{config:e,oldConfig:t,newConfig:d({},this.config)})):(Jh.DEBUG=!1,cm._is_supported()&&cm._remove("ph_debug"))),null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(i=this.exceptions)||i.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(s=this.webMCP)||s.startIfEnabled(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(u=this.tracingHeaders)||u.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(c=this.heatmaps)||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(f=this.historyAutocapture)||f.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(_=this.surveys)||_.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Rm(this,zy,!1)}},t._overrideSDKInfo=function(e,t){Jh.LIB_NAME=e,Jh.LIB_VERSION=t},t.startSessionRecording=function(e){var t,n,r,i,o,s=!0===e,a={sampling:s||!(null==e||!e.sampling),linked_flag:s||!(null==e||!e.linked_flag),url_trigger:s||!(null==e||!e.url_trigger),event_trigger:s||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(i=this.sessionRecording)||i.overrideTrigger("url")),a.event_trigger&&(null==(o=this.sessionRecording)||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})},t.stopSessionRecording=function(){this.set_config({disable_session_recording:!0})},t.sessionRecordingStarted=function(){var e;return!(null==(e=this.sessionRecording)||!e.started)},t.captureException=function(e,t){try{if(!this.exceptions)return;var n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(d({},n,t))}catch(e){return}},t.addExceptionStep=function(e,t){var n;null==(n=this.exceptions)||n.addExceptionStep(e,t)},t.captureLog=function(e){var t;null==(t=this.logs)||t.captureLog(e)},t.startExceptionAutocapture=function(e){this.set_config({capture_exceptions:null==e||e})},t.stopExceptionAutocapture=function(){this.set_config({capture_exceptions:!1})},t.loadToolbar=function(e){var t,n;return null!==(t=null==(n=this.toolbar)?void 0:n.loadToolbar(e))&&void 0!==t&&t},t.get_property=function(e){var t;return null==(t=this.persistence)?void 0:t.props[e]},t.getSessionProperty=function(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]},t.toString=function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:tb;return t!==tb&&(t="posthog."+t),t},t._isIdentified=function(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ni(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))},t._shouldCapturePageleave=function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview},t.createPersonProfile=function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})},t.setInternalOrTestUser=function(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})},t._requirePersonProcessing=function(e){return"never"===this.config.person_profiles?(Sl.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(Ap,!0),!0)},t._is_persistence_disabled=function(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)},t._sync_opt_out_with_persistence=function(){var e,t,n,r,i,o,s=this._is_persistence_disabled();return this.is_capturing()||(null==(i=this.logs)||i._onOptOut(),null==(o=this.heatmaps)||o.discardPending()),(null==(e=this.persistence)?void 0:e._disabled)!==s&&(null==(t=this.persistence)||t.set_disabled(s)),(null==(n=this.sessionPersistence)?void 0:n._disabled)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),this._persistSessionRegisteredPropKeys(),s},t.opt_in_capturing=function(t){var n,r,i,o,s;if("always"!==this.config.cookieless_mode){if(this._inCookielessMode()){var a,u,l,c,d,f;null==(a=this.sessionRecording)||a.dispose({discardBufferedEvents:!0}),this._reset(!0,!0),null==(u=this.sessionManager)||u.destroy(),null==(l=this.pageViewManager)||l.destroy(),this.sessionManager=new Fy(this),this.pageViewManager=new Lm(this),this.persistence&&(this.sessionPropsManager=new Py(this,this.sessionManager,this.persistence));var h,p=null!==(c=null==(d=this.config.__extensionClasses)?void 0:d.sessionRecording)&&void 0!==c?c:null==(f=e.__defaultExtensionClasses)?void 0:f.sessionRecording;p&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new p(this)),this._lastRemoteConfig&&(null==(h=this.sessionRecording)||null==h.onRemoteConfig||h.onRemoteConfig(this._lastRemoteConfig)))}var _,v,g=1===this.consent.consent;g?this._syncCookielessIdentity():null==(n=this.heatmaps)||n.discardPending(),this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(_=this.surveys)||_.loadIfEnabled(),null==(v=this.conversations)||v.loadIfEnabled()),!g&&(ri(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(i=null==t?void 0:t.captureEventName)&&void 0!==i?i:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),null==(o=this.persistence)||o.syncCookieProperties(),this._processCookieIdentityChange(),null==(s=this.featureFlags)||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this._captureInitialPageview()}else Sl.warn(Uy)},t.opt_out_capturing=function(){"always"!==this.config.cookieless_mode?(this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&this._enterCookielessMode()):Sl.warn(Uy)},t._enterCookielessMode=function(){var e,t,n,r=this.sessionRecording;null==r||r.dispose({discardBufferedEvents:!0}),null==(e=this.heatmaps)||e.discardPending(),"$posthog_cookieless"!==this.get_distinct_id()&&this._reset(!0,!0),this.register({distinct_id:Mp,$device_id:null}),this._removeExtension(r),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in()},t.has_opted_in_capturing=function(){return this.consent.isOptedIn()},t.has_opted_out_capturing=function(){return this.consent.isOptedOut()},t.get_explicit_consent_status=function(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"},t.is_capturing=function(){return!this._isConsentTransition&&("always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))},t.clear_opt_in_out_capturing=function(){this.consent.reset(),this._sync_opt_out_with_persistence()},t._is_bot=function(){return Ah?Ry(Ah,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Mh&&("visible"===Mh.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(Yp,{title:Mh.title},{send_instantly:!0}),this._visibilityStateListener&&(Mh.removeEventListener(ih,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Ml(Mh,ih,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Ih||Ih.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Ih||Ih.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}))},t._shouldDisableFlags=function(){var e=this._originalUserConfig||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Sl.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,n,r,i){var o=t in e&&!ai(e[t]),s=n in e&&!ai(e[n]);return o?e[t]:!!s&&(i&&i.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n])}(e,"advanced_disable_flags","advanced_disable_decide",0,Sl)},t._runBeforeSend=function(e,t){var n;if(ai(this.config.before_send))return e;for(var r,i=Object.keys(null!==(n=e.properties)&&void 0!==n?n:{}).filter(fi),o=e,s=p(Xr(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(r=s()).done;){var a=r.value;try{if(o=a(o),ai(o)){var u="Event '"+e.event+"' was rejected in beforeSend function";return di(e.event)?Sl.warn(u+". This can cause unexpected behavior."):Sl.info(u),null}o.properties&&!ni(o.properties)||Sl.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(n){return Sl.error("Error in beforeSend function for event '"+e.event+"':",n),null==t||t(),null}}for(var l,c=p(i);!(l=c()).done;){var d=l.value;if(o.properties&&ai(o.properties[d]))return Sl.warn("Event '"+e.event+"' had its '"+d+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null}return o},t.getPageViewId=function(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId},t.captureTraceFeedback=function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})},t.captureTraceMetric=function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})},t._checkLocalStorageForDebug=function(e){var t=ci(e)&&!e,n=cm._is_supported()&&"true"===cm._get("ph_debug");return!t&&(!!n||e)},a(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"flagsEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"_facebookClickIdChannel",get:function(){var e=this;return{property:np,persistenceKey:rp,cookieName:"_fbc",pattern:Zy,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[rp]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(rp)}}}},{key:"_facebookBrowserIdChannel",get:function(){var e=this;return{property:ip,persistenceKey:op,cookieName:"_fbp",pattern:Xy,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[op]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(op)}}}},{key:"logger",get:function(){var t,n;return null!==(t=null==(n=this.logs)?void 0:n.logger)&&void 0!==t?t:e._noopLogger}}])}(),c.__defaultExtensionClasses={},c._noopLogger=function(){var e=function(){};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}}(),c);!function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Tl(e.prototype[t[n]])}(ub,["identify"]);var lb=["[data-ph-capture-value]"],cb=function(){"use strict";function e(e){this._instance=e}return e.prototype.refresh=function(e){var t,n=this._instance.config,r=ti(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance._shouldDisableFlags(),e.url_allowlist=null==r?void 0:r.url_allowlist,e.url_ignorelist=null==r?void 0:r.url_ignorelist,e.dom_event_allowlist=null==r?void 0:r.dom_event_allowlist,e.element_allowlist=null==r?void 0:r.element_allowlist,e.css_selector_allowlist=null==r?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=null==r?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=null==r?void 0:r.element_attribute_ignorelist,e.capture_copied_text=null==r?void 0:r.capture_copied_text,e.capture_value_css_selector_allowlist=null!==(t=null==r?void 0:r.capture_value_css_selector_allowlist)&&void 0!==t?t:lb},e}(),db=function(e){"use strict";function t(t){var n=e.call(this,new cb(t))||this;return n.instance=t,n}return r(t,e),t}(ev),fb=kl("[ExceptionAutocapture]"),hb=function(){"use strict";function e(e){var t,n=this;this._startCapturing=function(){var e;if(Ih&&n.isEnabled&&null!=(e=jh.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=jh.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=jh.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=jh.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!n._unwrapOnError&&n._config.capture_unhandled_errors&&(n._unwrapOnError=t(n.captureException.bind(n))),!n._unwrapUnhandledRejection&&n._config.capture_unhandled_rejections&&(n._unwrapUnhandledRejection=r(n.captureException.bind(n))),!n._unwrapConsoleError&&n._config.capture_console_errors&&(n._unwrapConsoleError=i(n.captureException.bind(n)))}catch(e){fb.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[up]),this._rateLimiter=new Ci(d({},function(e){var t,n,r,i;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(n=e.exceptionRateLimiterRefillRate)&&void 0!==n?n:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(r=null!==(i=e.exceptionRateLimiterBucketSize)&&void 0!==i?i:e.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,_logger:fb})),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}var t=e.prototype;return t._requiredConfig=function(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ti(e)?t=d({},t,e):(ri(e)?this._remoteEnabled:e)&&(t=d({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(fb.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=dg(this._instance))||n(this._instance,"exception-autocapture",function(t){if(t)return fb.error("failed to load script",t);e()})},t._stopCapturing=function(){var e,t,n;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(n=this._unwrapConsoleError)||n.call(this),this._unwrapConsoleError=void 0},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"autocaptureExceptions"in n&&(this._remoteEnabled=!!n.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register(((t={})[up]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){try{var t,n,r,i=null!==(t=null==e||null==(n=e.$exception_list)||null==(n=n[0])?void 0:n.type)&&void 0!==t?t:"Exception";if(this._rateLimiter.consumeRateLimit(i))return void fb.info("Skipping exception capture because of client rate limiting.",{exception:i});null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}catch(e){}},a(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),pb=function(){"use strict";function e(e){this._isFlushingPageview=!1,this._instance=e,this._lastLocation=this._getCurrentLocation()}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){this.isEnabled&&(Sl.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())},t.startIfEnabledOrStop=function(){this.stop(),this._lastLocation=this._getCurrentLocation(),this.startIfEnabled()},t.stop=function(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,this._hashchangeListener&&this._hashchangeListener(),this._hashchangeListener=void 0,Sl.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Ih&&Ih.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Ih&&(null==(t=Ih.history[e])||!t.__posthog_wrapped__)){var n=this;Ng(Ih.history,e,function(t){return function(r,i,o){var s;n._isUrlChanging(o)&&n._flushPendingPageview(),t.call(this,r,i,o),n._capturePageview(e,!n._isFlushingPageview&&"popstate"!==(null==Ih||null==(s=Ih.event)?void 0:s.type))}})}},t._getCurrentLocation=function(){var e=null==Ih?void 0:Ih.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}},t._getCaptureOptions=function(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:ti(e)?e:{}},t._shouldCaptureHashChanges=function(e){return void 0===e&&(e=this._getCaptureOptions()),!!e.hash&&!this._instance.config.disable_capture_url_hashes},t._hasLocationChanged=function(e){var t=this._getCaptureOptions(),n=this._lastLocation;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this._shouldCaptureHashChanges(t)&&e.hash!==n.hash))},t._capturePageview=function(e,t){var n=this;void 0===t&&(t=!1);try{t||this._flushPendingPageview();var r=this._getCurrentLocation();if(!r)return;if(this._hasLocationChanged(r)){var i=function(){return n._instance.capture(Yp,{navigation_type:e})};t?(this._pendingPageview=i,Promise.resolve().then(function(){return n._flushPendingPageview()})):i()}this._lastLocation=r}catch(t){Sl.error("Error capturing "+e+" pageview",t)}},t._isUrlChanging=function(e){var t,n;return!(ai(e)||!Ih)&&(null==(t=Hh(String(e)))?void 0:t.href)!==(null==(n=Ih.location)?void 0:n.href)},t._flushPendingPageview=function(){var e=this._pendingPageview;if(e){this._pendingPageview=void 0,this._isFlushingPageview=!0;try{e()}catch(e){Sl.error("Error capturing deferred pageview",e)}finally{this._isFlushingPageview=!1}this._lastLocation=this._getCurrentLocation()}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};Ml(Ih,"popstate",t),this._popstateListener=function(){Ih&&Ih.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};Ml(Ih,"hashchange",t),this._hashchangeListener=function(){Ih&&Ih.removeEventListener("hashchange",t)}}},a(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),_b=kl("[TracingHeaders]"),vb=function(){"use strict";function e(e){var t=this;this._instance=e,this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._patchedHostnames=void 0,this._traceparentTargetsForPatch=[],this._startCapturing=function(){var e,n,r=t._syncForPatch(),i=r.hostnames;i||r.traceparentTargets?(i||Xr(t._hostnamesForPatch)||(t._hostnamesForPatch=[]),t._patchedHostnames!==t._hostnamesForPatch&&(t._stopCapturing(),t._patchedHostnames=t._hostnamesForPatch),ri(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=jh.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(t._hostnamesForPatch,function(){return t._instance.get_distinct_id()},t._instance.sessionManager,t._traceparentTargetsForPatch)),ri(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=jh.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(t._hostnamesForPatch,function(){return t._instance.get_distinct_id()},t._instance.sessionManager,t._traceparentTargetsForPatch))):t._stopCapturing()}}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=dg(this._instance))||n(this._instance,"tracing-headers",function(t){if(t)return _b.error("failed to load script",t);e()})},t._getConfiguredHostnames=function(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers},t._syncHostnamesForPatch=function(){var e,t=this._getConfiguredHostnames();return Xr(t)?(Xr(this._hostnamesForPatch)?(e=this._hostnamesForPatch).splice.apply(e,[0,this._hostnamesForPatch.length].concat(t)):this._hostnamesForPatch=[].concat(t),t.length>0?this._hostnamesForPatch:void 0):!Xr(this._hostnamesForPatch)||(this._hostnamesForPatch.splice(0),t)?(this._hostnamesForPatch=t||void 0,this._hostnamesForPatch):void 0},t._syncTraceparentTargetsForPatch=function(){var e,t=this._instance.config.trace_propagation_targets,n=Xr(t)?t.filter(function(e){return ii(e)&&!!e}):[];return(e=this._traceparentTargetsForPatch).splice.apply(e,[0,this._traceparentTargetsForPatch.length].concat(n)),n.length>0?this._traceparentTargetsForPatch:void 0},t._syncForPatch=function(){return{hostnames:this._syncHostnamesForPatch(),traceparentTargets:this._syncTraceparentTargetsForPatch()}},t._stopCapturing=function(){var e,t;null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0},t.startIfEnabledOrStop=function(){var e=this._syncForPatch();e.hostnames||e.traceparentTargets?this._loadScript(this._startCapturing):this._stopCapturing()},e}(),gb=kl("[Web Vitals]"),mb=9e5,yb=["CLS","FCP","INP","LCP"],bb=["INP","LCP"],wb=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Sb=function(){"use strict";function e(e){var t,n=this;this._instance=e,this._enabledServerSide=!1,this._initialized=!1,this._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(e){void 0===e&&(e=!1),clearTimeout(n._delayedFlushTimer),n._delayedFlushTimer=void 0,0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",d({$current_url:n._buffer.url},n._buffer.metrics.reduce(function(e,t){var n;return d({},e,((n={})["$web_vitals_"+t.name+"_event"]=d({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))},{})),e?{transport:"sendBeacon",send_instantly:!0}:void 0),n._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=function(e){var t;if(n._buffer=n._buffer||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ai(null==e?void 0:e.name)||ai(null==e?void 0:e.value))gb.error("Invalid metric received",e);else{var r="string"==typeof e.navigationURL?e.navigationURL:void 0,i=n._maskedURL(r);if(!ri(i)){var o=ui(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+i;if(!n._maxAllowedValue||n._maxAllowedValue>e.value){n._buffer.navigationKey!==o&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),ri(n._buffer.navigationKey)&&(n._buffer.navigationKey=o,n._buffer.url=i),n._buffer.firstMetricTimestamp=ri(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var s=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=d({},e,r?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete a.entries,ti(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var u,l={},c=p(wb);!(u=c()).done;){var f=u.value,h="url"===f&&"string"==typeof e.attribution[f]?n._maskedURL(e.attribution[f]):e.attribution[f];ri(h)||(l[f]=h)}a.attribution=l}else delete a.attribution;ri(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),n._buffer.metrics.push(a),n._buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()}else gb.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,r,i,o=!1,s=jh.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,u=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&ri(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!ri(u)){var l=u.withoutAttribution,c=n.attributionMetrics;o=!ri(l),e=c.indexOf("LCP")>-1?u.onLCP:(null==l?void 0:l.onLCP)||u.onLCP,t=c.indexOf("CLS")>-1?u.onCLS:(null==l?void 0:l.onCLS)||u.onCLS,r=c.indexOf("FCP")>-1?u.onFCP:(null==l?void 0:l.onFCP)||u.onFCP,i=c.indexOf("INP")>-1?u.onINP:(null==l?void 0:l.onINP)||u.onINP}if(e&&t&&r&&i){var f={reportSoftNavs:n.useSoftNavs},h=o&&n.attributionMetrics.indexOf("INP")>-1?d({},f,{includeProcessedEventEntries:!1}):f;n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n),f),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n),f),n.allowedMetrics.indexOf("FCP")>-1&&r(n._addToBuffer.bind(n),f),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n),h);var p=null==Ih?void 0:Ih.document;Ml(p,ih,function(){"hidden"===(null==p?void 0:p.visibilityState)&&n._flushToCapture(!0)}),Ml(Ih,"pagehide",function(){return n._flushToCapture(!0)}),n._initialized=!0}else gb.error("web vitals callbacks not loaded - not starting")}},this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[dp]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(gb.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n,r,i=ti(t.capturePerformance)&&!!t.capturePerformance.web_vitals,o=ti(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[dp]=i,n)),this._instance.persistence.register(((r={})[_p]=o,r))),this._enabledServerSide=i,this.startIfEnabled()}}},t._loadScript=function(e){var t,n=jh.__PosthogExtensions__,r=this._callbackFlavor,i=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor;null!=i&&i[r]||"web-vitals"===r&&ri(i)&&null!=n&&n.postHogWebVitalsCallbacks?e():null==(t=dg(this._instance))||t(this._instance,r,function(t){t?gb.error("failed to load script",t):e()})},t._maskedURL=function(e){var t=e||(null==Ih?void 0:Ih.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?Ho(t):t;return Kh(n,this._instance.config.mask_personal_data_properties?[].concat(zm,this._instance.config.custom_personal_data_properties||[]):[],Wm)}gb.error("Could not determine current URL")},a(e,[{key:"_perfConfig",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=ti(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return ai(n)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||yb:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(ti(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=ti(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return ci(e)?e?yb:[]:Xr(e)?e:bb}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e;return null!==(e=ti(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0)&&void 0!==e&&e}},{key:"_maxAllowedValue",get:function(){var e=ti(this._perfConfig)&&ui(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:mb;return e>0&&6e4>=e?mb:e}},{key:"isEnabled",get:function(){var e=null==Oh?void 0:Oh.protocol;if("http:"!==e&&"https:"!==e)return gb.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ti(this._perfConfig)?this._perfConfig.web_vitals:ci(this._perfConfig)?this._perfConfig:void 0;return ci(t)?t:this._enabledServerSide}},{key:"_callbackFlavor",get:function(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}}])}(),kb="disabled",xb="lazy_loading";function Cb(e){return"ph_replay_pending_buffer_"+JSON.stringify([e.persistence_name||e.token,e.token])}var Pb=kl("[SessionRecording]"),Eb=[$p,qp,Np,Bp,jp,Hp,zp,Up,Wp],Tb=function(){"use strict";function e(e){var t,n=this;if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=kb,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._selectMaskingFn=void 0,this._documentWasEverVisible=function(){var e;if(null==Mh||!Mh.visibilityState||"visible"===Mh.visibilityState)return!0;var t=null==Ih||null==(e=Ih.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(function(e){return"visible"===e.name})}(),this._onVisibilityChange=function(){var e;"visible"===(null==Mh?void 0:Mh.visibilityState)&&(n._documentWasEverVisible=!0,null==(e=n._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Pb.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._config.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');var r=this._instance.get_property(kp);ii(r)&&"!"===r[0]&&(null==(t=this._persistence)||t.unregister(kp)),null!=Mh&&Mh.addEventListener&&Ml(Mh,"visibilitychange",this._onVisibilityChange)}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t.dispose=function(e){var t=(void 0===e?{}:e).discardBufferedEvents,n=void 0!==t&&t;this._sessionRecordingDisposed=!0,null==Mh||null==Mh.removeEventListener||Mh.removeEventListener("visibilitychange",this._onVisibilityChange),n?this._discardRecording(!0):this.stopRecording()},t.startIfEnabledOrStop=function(e){if(!this._sessionRecordingDisposed){var t;if(this._lazyLoadedSessionRecording)if(this._selectMaskingFn!==(null==(t=this._config.session_recording)?void 0:t.selectMaskingFn))xm._remove(Cb(this._config)),this._lazyLoadedSessionRecording.discard({discardProducerEvents:!0}),this._selectMaskingFn=void 0;else if(this._lazyLoadedSessionRecording.isStarted&&this._isRecordingEnabled)return void(this._checkSelectMaskingSupport()||this._discardRecording(!0));var n=!ri(Object.assign)&&!ri(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Pb.info("starting")):(this._recordingStatus=kb,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,r=this;if(this._isRecordingEnabled)if("awaiting_config"!==this._recordingStatus&&"missing_config"!==this._recordingStatus&&(this._recordingStatus=xb),null!=jh&&null!=(t=jh.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=jh.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var i,o=this._instance.sessionManager;null==(i=dg(this._instance))||i(this._instance,this._scriptName,function(t){if(!r._sessionRecordingDisposed&&r._isRecordingEnabled&&r._instance.sessionManager===o){var n;if(t)return r._instance.register_for_session(((n={})[$p]=!0,n)),Pb.error("could not load recorder",t);r._onScriptLoaded(e)}else r._recordingStatus=kb})}},t.stopRecording=function(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()},t._discardRecording=function(e){var t,n,r;void 0===e&&(e=!1),e&&(this._selectMaskingFn||null!=(t=this._config.session_recording)&&t.selectMaskingFn)&&xm._remove(Cb(this._config)),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=void 0,null==(r=this._lazyLoadedSessionRecording)||r.discard({discardProducerEvents:e}),this._selectMaskingFn=void 0},t._resetSampling=function(){var e,t;null==(e=this._persistence)||e.unregister(kp),null==(t=this._persistence)||t.unregister(gp)},t._validateSampleRate=function(e,t){if(ai(e))return null;var n,r=ui(e)?e:parseFloat(e);return"number"!=typeof(n=r)||!Number.isFinite(n)||0>n||n>1?(Pb.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r},t._persistRemoteConfig=function(e){var t=this;if(this._persistence){var n,r,i=this._persistence,o=function(){var n,r,o=!1===e.sessionRecording?void 0:e.sessionRecording,s=t._validateSampleRate(null==(n=t._config.session_recording)?void 0:n.sampleRate,"session_recording.sampleRate"),a=t._validateSampleRate(null==o?void 0:o.sampleRate,"remote config sampleRate"),u=null!=s?s:a;ai(u)&&t._resetSampling();var l=null==o?void 0:o.minimumDurationMilliseconds;i.register(((r={})[vp]=d({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:d({capturePerformance:e.capturePerformance},null==o?void 0:o.networkPayloadCapture),canvasRecording:{enabled:null==o?void 0:o.recordCanvas,fps:null==o?void 0:o.canvasFps,quality:null==o?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:ri(l)?null:l,endpoint:null==o?void 0:o.endpoint,triggerMatchType:null==o?void 0:o.triggerMatchType,masking:null==o?void 0:o.masking,urlTriggers:null==o?void 0:o.urlTriggers,version:null==o?void 0:o.version,triggerGroups:null==o?void 0:o.triggerGroups}),r))};o(),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(o)}},t.onRemoteConfig=function(e){var t=e.ok?e.config:void 0;if(t&&"sessionRecording"in t){if(!1===t.sessionRecording)return this._persistRemoteConfig(t),void this._discardRecording();this._persistRemoteConfig(t),this.startIfEnabledOrStop()}else{var n;"awaiting_config"===this._recordingStatus&&(this._recordingStatus="missing_config",this._instance.register_for_session(((n={})[qp]=!0,n)),Pb.warn("config refresh failed, recording will not start until page reload")),this.startIfEnabledOrStop()}},t.log=function(e,t){var n;void 0===t&&(t="log"),null!=(n=this._lazyLoadedSessionRecording)&&n.log?this._lazyLoadedSessionRecording.log(e,t):Pb.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(vp);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Pb.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!ai(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._checkSelectMaskingSupport=function(){var e,t,n;return null==(e=this._config.session_recording)||!e.selectMaskingFn||!(!0!==(null==(t=jh.__PosthogExtensions__)||null==(t=t.rrweb)||null==(t=t.record)?void 0:t.supportsSelectMasking)||!0!==(null==(n=jh.__PosthogExtensions__)||null==(n=n.initSessionRecording)?void 0:n.supportsSelectMasking)||this._lazyLoadedSessionRecording&&!0!==this._lazyLoadedSessionRecording.supportsSelectMasking)||(this._recordingStatus=kb,Pb.error("Session recording has not started: the recorder does not support selectMaskingFn."),!1)},t._onScriptLoaded=function(e){var t,n,r,i,o;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var s,a;if(null==(t=jh.__PosthogExtensions__)||!t.initSessionRecording)return Pb.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((s={},s[$p]=!0,s));if(this._checkSelectMaskingSupport())if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(a=jh.__PosthogExtensions__)?void 0:a.initSessionRecording(this._instance,this._documentWasEverVisible),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this._checkSelectMaskingSupport()){if(!this._isRemoteConfigFresh()){if("missing_config"===this._recordingStatus||"awaiting_config"===this._recordingStatus)return;return this._recordingStatus="awaiting_config",Pb.info("persisted remote config is stale, requesting fresh config before starting"),void new yy(this._instance).load()}this._recordingStatus=xb,null==(n=(r=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(r,this._documentWasEverVisible);var u=null==(i=this._config.session_recording)?void 0:i.selectMaskingFn;this._lazyLoadedSessionRecording.start(e),this._selectMaskingFn=u,this._lazyLoadedSessionRecording.isStarted&&u!==(null==(o=this._config.session_recording)?void 0:o.selectMaskingFn)&&this.startIfEnabledOrStop()}else this._discardRecording(!0)}else this._recordingStatus=kb},t.onRRwebEmit=function(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)},t.overrideLinkedFlag=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[yp]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[mp]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideSampling()},t.overrideTrigger=function(e){var t,n,r;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})["url"===e?bp:wp]=!0,n)),null==(r=this._lazyLoadedSessionRecording)||r.overrideTrigger(e)},t.tryAddCustomEvent=function(e,t){var n;return!(null==(n=this._lazyLoadedSessionRecording)||!n.tryAddCustomEvent(e,t))},t.flushBeforeIdentityReset=function(){var e;null==(e=this._lazyLoadedSessionRecording)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()},a(e,[{key:"_config",get:function(){return this._instance.config}},{key:"_persistence",get:function(){return this._instance.persistence}},{key:"started",get:function(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}},{key:"status",get:function(){var e,t;return this.isReplayOff?kb:"awaiting_config"===this._recordingStatus||"missing_config"===this._recordingStatus?this._recordingStatus:null!==(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)&&void 0!==e?e:this._recordingStatus}},{key:"_isRecordingEnabled",get:function(){var e,t=!(null==(e=this._instance.get_property(vp))||!e.enabled),n=!this._config.disable_session_recording,r=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Ih&&t&&n&&!r}},{key:"isReplayOff",get:function(){var e;return!!this._config.disable_session_recording||this._instance.consent.isOptedOut()||!1===(null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.enabled)}},{key:"_scriptName",get:function(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property("$session_recording_remote_config"))||null==(e=e.scriptConfig)?void 0:e.script)||"lazy-recorder"}},{key:"sdkDebugProperties",get:function(){var e;if(this.isReplayOff)return{$recording_status:kb};for(var t={},n=0,r=Eb;r.length>n;n++){var i,o=r[n],s=null==(i=this._instance.sessionPersistence)?void 0:i.get_property(o);ri(s)||(t[o]=s)}return d({},t,(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}}])}(),Fb=kl("[Heatmaps]");function Ib(e){return ti(e)&&"clientX"in e&&"clientY"in e&&ui(e.clientX)&&ui(e.clientY)}var Rb,Ab=function(){"use strict";function e(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._mouseMoveCapturing=!1,this._consentChangedAt=0,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[ap]),this.rageclicks=new U_(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Fb.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("heatmaps"in n){var r=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[ap]=r,t)),this._enabledServerSide=r,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t.discardPending=function(){this._consentChangedAt=Date.now(),clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=void 0,this.getAndClearBuffer()},t._onDeadClick=function(e){Ib(e.originalEvent)&&e.timestamp>this._consentChangedAt&&this._onClick(e.originalEvent,"deadclick")},t._onVisibilityChange=function(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Mh)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Ih&&Mh&&(this._flushHandler=this._flush.bind(this),Ml(Ih,Qp,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Ih?void 0:Ih.event))},Ml(Mh,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Ih?void 0:Ih.event))},Ml(Mh,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Fm(this.instance,Em,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Ml(Mh,ih,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Ih&&Mh&&(this._flushHandler&&Ih.removeEventListener(Qp,this._flushHandler),this._onClickHandler&&Mh.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Mh.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Mh.removeEventListener(ih,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=void 0,null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)},t._getProperties=function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&t_(r)&&!n_(r,"body");){if(r===n)return!1;var i=void 0;try{var o,s,a;i=null==(o=null!==(s=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==s?s:Ih)?void 0:o.getComputedStyle(r).position}catch(e){return!1}if(Vr(t,i))return!0;r=p_(r)}return!1}(c_(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}},t._onClick=function(e,t){var n;if(void 0===t&&(t="click"),!e_(e.target)&&Ib(e)&&this.instance.is_capturing()){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&P_(c_(e),this.instance.config.rageclick)&&this._capture(d({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!e_(e.target)&&Ib(e)&&(ri(this._mouseMoveTimeout)&&(this._mouseMoveCapturing=this.instance.is_capturing()),clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._mouseMoveTimeout=void 0,t._mouseMoveCapturing&&t.instance.is_capturing()&&t._capture(t._getProperties(e,"mousemove"))},500))},t._capture=function(e){if(Ih){var t=this._config.disable_capture_url_hashes?Ho(Ih.location.href):Ih.location.href,n=Kh(t,this._config.mask_personal_data_properties?[].concat(zm,this._config.custom_personal_data_properties||[]):[],Wm);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}},t._flush=function(){this._buffer&&!ni(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},a(e,[{key:"_config",get:function(){return this.instance.config}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return ti(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return ai(this._config.capture_heatmaps)?ai(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),Mb=kl("[Product Tours]"),Ob=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(hp))},Lb=function(){"use strict";function e(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("productTours"in n){var r,i;if(this._persistence&&this._persistence.register(((t={})[hp]=!!n.productTours,t)),!Ob(this._instance))return!this._productTourManager&&ai(null==(r=this._persistence)?void 0:r.props.ph_product_tours)||Mb.info("product tours disabled; stopping and clearing cached tours"),null==(i=this._productTourManager)||i.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}},t.loadIfEnabled=function(){var e=this;!this._productTourManager&&Ob(this._instance)&&this._loadScript(function(){return e._startProductTours()})},t._loadScript=function(e){var t,n;null!=(t=jh.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=dg(this._instance))||n(this._instance,"product-tours",function(t){t?Mb.error("Could not load product tours script",t):e()})},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=jh.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=jh.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Xr(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[Cp];if(Xr(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:function(t){var i;if(Ob(n._instance)){var o=t.statusCode;if(200!==o||!t.json){var s="Product Tours API could not be loaded, status: "+o;return 0===o?t.error||Mb.warn(s):Mb.error(s),void e([],{isLoaded:!1,error:s})}var a=Xr(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,r&&r.register(((i={})[Cp]=a,i)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){ai(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)},t.showProductTour=function(e){var t;null==(t=this._productTourManager)||t.showTourById(e)},t.previewTour=function(e){var t=this;this._productTourManager?this._productTourManager.previewTour(e):this._loadScript(function(){var n;t._startProductTours(),null==(n=t._productTourManager)||n.previewTour(e)})},t.dismissProductTour=function(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")},t.nextStep=function(){var e;null==(e=this._productTourManager)||e.nextStep()},t.previousStep=function(){var e;null==(e=this._productTourManager)||e.previousStep()},t.clearCache=function(){var e;this._cachedTours=null,null==(e=this._persistence)||e.unregister(Cp)},t.resetTour=function(e){var t;null==(t=this._productTourManager)||t.resetTour(e)},t.resetAllTours=function(){var e;null==(e=this._productTourManager)||e.resetAllTours()},t.cancelPendingTour=function(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)},a(e,[{key:"_persistence",get:function(){return this._instance.persistence}}])}(),Db=kl("[SiteApps]"),$b="Error while initializing PostHog app with config id ",qb=function(){"use strict";function e(e){this._instance=e,this._siteAppElementPatchCount=0,this._bufferedInvocations=[],this.apps={}}var r=e.prototype;return r._eventCollector=function(e,t){if(t){var n=this.globalsForEvent(t);this._bufferedInvocations.push(n),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}},r.initialize=function(){var e=this;if(this._instance.config.opt_in_site_apps&&!this.isEnabled&&Db.critical("opt_in_site_apps is ignored: require_subresource_integrity disables site apps"),this.isEnabled){var t=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=function(){t(),e._bufferedInvocations=[],e._stopBuffering=void 0}}},r.globalsForEvent=function(e){var r,i,o,s,a,u,l;if(!e)throw new Error("Event payload is required");for(var c={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{},p=0,_=Object.entries(h);_.length>p;p++){var v=_[p],g=v[0];c[g]={id:f[g],type:g,properties:v[1]}}var m=e.$set_once,y=e.$set;return{event:d({},n(e,t),{properties:d({},e.properties,y?{$set:d({},null!==(r=null==(i=e.properties)?void 0:i.$set)&&void 0!==r?r:{},y)}:{},m?{$set_once:d({},null!==(o=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==o?o:{},m)}:{}),elements_chain:null!==(a=null==(u=e.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=e.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}},r._prepareElementForSiteApp=function(e){var t,n=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===n&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Db.error("prepare_external_dependency_stylesheet returned null"),null):"script"===n&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Db.error("prepare_external_dependency_script returned null"),null):e},r._patchSiteAppElementInsertionMethods=function(){var e,t,n,r,i,o,s,a,u=this;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return function(){};var l=null==Mh?void 0:Mh.defaultView,c=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!c)return function(){};if(this._siteAppElementPatchCount++,this._restoreSiteAppElementPatches)return this._releaseSiteAppElementPatches();var d=[],f=this,h=new WeakSet,p=function(e,t,n){if(null!=e&&e[t]){var r=e[t];e[t]=n(r),d.push(function(){e[t]=r})}},_=function(e){if(h.has(e))return e;var t=f._prepareElementForSiteApp(e);return t&&h.add(t),t},v=function(e){return e.map(function(e){return"string"==typeof e?e:_(e)}).filter(function(e){return!si(e)})};return p(c,"appendChild",function(e){return function(t){var n=_(t);return n?e.call(this,n):t}}),p(c,"insertBefore",function(e){return function(t,n){var r=_(t);return r?e.call(this,r,n):t}}),p(c,"replaceChild",function(e){return function(t,n){var r=_(t);return r?e.call(this,r,n):n}}),[null==(t=l.Element)?void 0:t.prototype,null==(n=l.Document)?void 0:n.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(function(e){p(e,"append",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"prepend",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}})}),[null==(i=l.Element)?void 0:i.prototype,null==(o=l.CharacterData)?void 0:o.prototype,null==(s=l.DocumentType)?void 0:s.prototype].forEach(function(e){p(e,"before",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"after",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"replaceWith",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=v(n);return n.length&&!i.length?void 0:e.apply(this,i)}})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",function(e){return function(t,n){var r=_(n);return r?e.call(this,t,r):null}}),this._restoreSiteAppElementPatches=function(){d.forEach(function(e){return e()}),u._restoreSiteAppElementPatches=void 0},this._releaseSiteAppElementPatches()},r._releaseSiteAppElementPatches=function(){var e=this,t=!1;return function(){t||(t=!0,e._siteAppElementPatchCount--,0===e._siteAppElementPatchCount&&(null==e._restoreSiteAppElementPatches||e._restoreSiteAppElementPatches()))}},r._runWithPreparedSiteAppElements=function(e,t){void 0===t&&(t=!0);var n=this._patchSiteAppElementInsertionMethods();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}},r.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(Db.info("Processing "+t._bufferedInvocations.length+" events for site app with id "+e.id),t._bufferedInvocations.forEach(function(e){return t._runWithPreparedSiteAppElements(function(){return null==n.processEvent?void 0:n.processEvent(e)})}),n.processedBuffer=!0),Object.values(t.apps).every(function(e){return e.processedBuffer||e.errored})&&(null==t._stopBuffering||t._stopBuffering())},i=!1,o=function(t){n.errored=!t,n.loaded=!0,Db.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),i&&r()};try{var s=this._runWithPreparedSiteAppElements(function(n){return e.init({posthog:t._instance,callback:function(e){n(),o(e)}})},!1).processEvent;s&&(n.processEvent=s),i=!0}catch(t){Db.error($b+e.id,t),o(!1)}if(i&&n.loaded)try{r()}catch(t){Db.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}},r._setupSiteApps=function(){for(var e,t=this.siteAppLoaders||[],n=p(t);!(e=n()).done;){var r=e.value;this.apps[r.id]={id:r.id,loaded:!1,errored:!1,processedBuffer:!1}}for(var i,o=p(t);!(i=o()).done;)this.setupSiteApp(i.value)},r._onCapturedEvent=function(e){var t=this;if(0!==Object.keys(this.apps).length)for(var n=this.globalsForEvent(e),r=function(){var r=o[i];try{t._runWithPreparedSiteAppElements(function(){return null==r.processEvent?void 0:r.processEvent(n)})}catch(t){Db.error("Error while processing event "+e.event+" for site app "+r.id,t)}},i=0,o=Object.values(this.apps);o.length>i;i++)r()},r.onRemoteConfig=function(e){var t,n,r,i=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",function(e){return i._onCapturedEvent(e)})):void Db.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this._stopBuffering)||n.call(this),e.ok){var o=e.config;if(null!=(r=o.siteApps)&&r.length)if(this.isEnabled)for(var s,a=function(){var e,t=s.value,n=t.id,r=t.url;jh["__$$ph_site_app_"+n]=i._instance,null==(e=jh.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,function(e){if(e)return Db.error($b+n,e)})},u=p(o.siteApps);!(s=u()).done;)a();else Db.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},a(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps&&!this._instance.config.require_subresource_integrity}},{key:"siteAppLoaders",get:function(){var e;return null==(e=jh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),Nb=function(){return null!=Ih&&Ih.location?Qh(Ih.location.hash,"__posthog")||Qh(location.hash,"state"):null}(),Bb="_postHogToolbarParams",jb=kl("[Toolbar]"),Hb=function(){"use strict";function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){jh.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=jh.ph_toolbar_state)&&void 0!==e?e:0},t.initialize=function(){return this.maybeLoadToolbar()},t.maybeLoadToolbar=function(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),Ol(this.instance.config))return!1;if(!Ih||!Mh)return!1;e=null!=e?e:Ih.location,n=null!=n?n:Ih.history;try{if(!t){try{Ih.localStorage.setItem("test","test"),Ih.localStorage.removeItem("test")}catch(e){return!1}t=null==Ih?void 0:Ih.localStorage}var r,i=Nb||Qh(e.hash,"__posthog")||Qh(e.hash,"state"),o=i?zo(function(){return JSON.parse(atob(decodeURIComponent(i)))})||zo(function(){return JSON.parse(decodeURIComponent(i))}):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(Bb)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}},t._callLoadToolbar=function(e){var t=jh.ph_load_toolbar||jh.ph_load_editor;!ai(t)&&ei(t)?t(e,this.instance):jb.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Mh||!Mh.getElementById("__POSTHOG_TOOLBAR__"));if(!Ih||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=d({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Ih.localStorage.setItem(Bb,JSON.stringify(d({},i,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(i);else if(0===this._getToolbarState()){var o;this._setToolbarState(1),null==(o=dg(this.instance))||o(this.instance,"toolbar",function(e){if(e)return jb.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(i)}),Ml(Ih,"turbolinks:load",function(){t._setToolbarState(0),t.loadToolbar(i)})}return!0},t._loadEditor=function(e){return this.loadToolbar(e)},t.maybeLoadEditor=function(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)},e}(),zb=kl("[FeatureFlags]"),Ub=kl("[FeatureFlags]",{debugEnabled:!0}),Wb="\" failed. Feature flags didn't load in time.",Vb=[502,504],Gb=["click","keydown","wheel","touchstart","pointerdown"],Kb="connection_error",Qb=function(e,t){var n=Object.keys(t||{}).filter(function(e){var n;return null==t||null==(n=t[e])?void 0:n.failed});if(!n.length)return e||{};var r=d({},e);return n.forEach(function(e){return delete r[e]}),r},Yb=function(e,t){var n=d({},e);return t.forEach(function(e){var t;null!=(t=n[e])&&t.failed&&delete n[e]}),n},Jb=function(e,t){return!(null==t||!t.partialResponse)||!!e.errorsWhileComputingFlags},Zb=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Xb=function(e){for(var t,n={},r=p(El(e||{}));!(t=r()).done;){var i=t.value,o=i[1];o&&(n[i[0]]=o)}return n},ew=function(e,t){var n=e.flags;return n?d({},e,{featureFlags:Object.fromEntries(Object.keys(n).filter(function(e){return!n[e].failed}).map(function(e){var t;return[e,null!==(t=n[e].variant)&&void 0!==t?t:n[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(n).filter(function(e){return!n[e].failed&&n[e].enabled}).filter(function(e){var t;return!ri(null==(t=n[e].metadata)?void 0:t.payload)}).map(function(e){var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)},tw={version:2},nw=function(e,t){return e.distinctId===t.distinctId&&e.sessionId===t.sessionId&&function(e,t){var n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(function(n){return e[n]===t[n]})}(e.groups,t.groups)},rw=function(){"use strict";function e(e){var t=this;this.name="featureFlags",this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=zb,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._reloadingHandlers=[],this._pendingReloads=new Set,this._activeReloads=new Set,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._requestGeneration=0,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._firingFeatureFlagsCallbacks=!1,this._flagCallsPendingCapture=new Map,this._sendingFlagCallsPendingCapture=!1,this._flagsLoadedFromRemote=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._hadUserInteraction=!1,this._loggedResponseWithoutTypedValues=!1,this._flagEventCaptures=new WeakMap,this._flagEventCaptureThrows=new Map,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n,r=t._refreshIntervalMs,i=null!==(e=t._dueRefreshIntervalMs)&&void 0!==e?e:r;ri(r)||ri(i)||t._config.remoteRequestsDisabled||!t._document||"hidden"===t._document.visibilityState||Date.now()-(null!==(n=t._lastRefreshAt)&&void 0!==n?n:0)<i||(t._dueRefreshIntervalMs=t._hadUserInteraction||!t._config.idleRefreshBackoff?r:Math.min(2*i,36e5),t._hadUserInteraction=!1,t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onUserInteraction=function(){t._hadUserInteraction&&t._dueRefreshIntervalMs===t._refreshIntervalMs||t._resumeConfiguredInterval()},this._onVisibilityChange=function(){var e;"visible"===(null==(e=t._document)?void 0:e.visibilityState)&&t._resumeConfiguredInterval()},this._configSource=e}var t=e.prototype;return t._onConfigUpdated=function(){this._client&&this._syncAutomaticRefresh()},t.setup=function(e){var t=this;try{this._window=typeof window>"u"?void 0:window,this._document=typeof document>"u"?void 0:document}catch(e){this._window=void 0,this._document=void 0}return this._initializingClient=e,this._logger=e.logger.createLogger("[FeatureFlags]"),Ph(e.kv.initialize(),function(){t._initializingClient===e&&(t._initializingClient=void 0,t._client=e,t._finishSetup(e))})},t._finishSetup=function(e){var t,n=this;if(this._client===e)return this._window&&Ml(this._window,"online",this._onOnline),this._syncAutomaticRefresh(),this._dynamicProperties=e.registerDynamicEventProperties(function(){return n._isCacheStale()?n._baseEventProperties:n._eventPropertiesWithFlagValues}),this._crossTabPersistenceUnsubscribe=null==(t=this._crossTabPersistence)?void 0:t.onCrossTabFeatureFlagChange(function(){n._clearBootstrapState(),n._rebuildEventProperties(),n._fireFeatureFlagsCallbacks()}),this._rebuildEventProperties(),this.initialize()},t._resumeConfiguredInterval=function(){this._hadUserInteraction=!0,this._dueRefreshIntervalMs=this._refreshIntervalMs,this._refreshIfDue()},t._syncAutomaticRefresh=function(){var e,t=this,n=this._config.refreshIntervalMs,r=!this._config.remoteRequestsDisabled&&this._document&&!ri(n)&&n>0?n:void 0;this._config.idleRefreshBackoff||(this._dueRefreshIntervalMs=r),r!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),ri(r)||(this._refreshIntervalMs=r,this._dueRefreshIntervalMs=r,this._scheduleNextRefresh(),null!=(e=this._document)&&e.addEventListener&&(Ml(this._document,ih,this._onVisibilityChange),xl(Gb,function(e){Ml(t._document,e,t._onUserInteraction,{capture:!0})}))))},t._scheduleNextRefresh=function(){ri(this._refreshIntervalMs)||(ri(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){var e,t=this;ri(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==(e=this._document)||null==e.removeEventListener||e.removeEventListener(ih,this._onVisibilityChange),xl(Gb,function(e){var n;null==(n=t._document)||null==n.removeEventListener||n.removeEventListener(e,t._onUserInteraction,{capture:!0})})),this._refreshIntervalMs=void 0,this._dueRefreshIntervalMs=void 0,this._hadUserInteraction=!1,this._lastRefreshAt=void 0},t.destroy=function(){this._dispose()},t.dispose=function(){this._dispose()},t._dispose=function(){var e,t,n;this._stopAutomaticRefresh(),this._requestGeneration++,this._additionalReloadRequested=!1,this._initializingClient=void 0,this._settleReloads(this._pendingReloads,"cancelled"),this._settleReloads(this._activeReloads,"cancelled"),this._client&&(this._clearDebouncer(),null==(e=this._dynamicProperties)||e.dispose(),this._dynamicProperties=void 0,null==(t=this._crossTabPersistenceUnsubscribe)||t.call(this),this._crossTabPersistenceUnsubscribe=void 0,this._reloadingHandlers=[],null==(n=this._window)||n.removeEventListener("online",this._onOnline),this._client=void 0)},t._prop=function(e){var t;return this._bootstrapState&&e in this._bootstrapState?this._bootstrapState[e]:null==(t=this._client)?void 0:t.kv.get(e)},t._clearBootstrapState=function(){return!!this._bootstrapState&&(this._bootstrapState=void 0,!0)},t._fallBackToPersistedFlags=function(){var e;return!ri(null==(e=this._client)?void 0:e.kv.get("$enabled_feature_flags"))&&this._clearBootstrapState()},t._set=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.set(e)})},t._markCrossTabFeatureFlagSnapshot=function(e,t,n){var r;if(this._crossTabPersistence&&e.$enabled_feature_flags){var i=this._prop("$enabled_feature_flags")||{},o=e.$enabled_feature_flags||{},s=t.flags||t.featureFlags,a=t.flags?Object.entries(t.flags).filter(function(e){var t=e[1];return!(null!=t&&t.failed)}).map(function(e){return e[0]}):[],u=!!t.errorsWhileComputingFlags&&!!t.flags,l=u||n&&t.flags?a:n&&!Xr(s)?Object.keys(s||{}):Array.from(new Set([].concat(Object.keys(i),Object.keys(o)))),c=this._prop("$feature_flag_payloads")||{},d=e.$feature_flag_payloads||{},f=u||n?l:Array.from(new Set([].concat(Object.keys(c),Object.keys(d)))),h=!u&&!n,p=!!h||l,_=!!h||f,v=((r={})[Uf]=p,r[Yf]=p,r[th]=_,r);e.$feature_flag_details&&(v[Wf]=p);for(var g=0,m=[Kf,Gf,Qf];m.length>g;g++){var y=m[g];ri(e[y])||(v[y]=!0)}this._crossTabPersistence.markCrossTabFeatureFlagChanges(v)}},t._remove=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.remove(e)})},t._persist=function(e){try{e()}catch(e){this._logger.error("Failed to update feature flag persistence",e)}},t._rebuildEventProperties=function(){for(var e={},t=this._prop(Wf),n=0,r=[Kf,nh];r.length>n;n++){var i=r[n],o=this._prop(i);ri(o)||(e[i]=o)}var s=this._prop(Uf);s&&(e[Uf]=s.filter(function(e){var n;return!(null!=t&&null!=(n=t[e])&&n.failed)}));var a=this._prop(th);a&&(e[th]=Qb(a,t)),this._baseEventProperties=e;var u=d({},e),l=Qb(this._prop(Yf),t);if(l)for(var c=0,f=Object.entries(l);f.length>c;c++){var h=f[c];u["$feature/"+h[0]]=h[1]}this._eventPropertiesWithFlagValues=u},t._isCacheStale=function(){var e=this._config.cacheTtlMs;if(!e||0>=e)return!1;var t=this._prop(Gf);return"number"!=typeof t||Date.now()-t>e},t._checkAndTriggerStaleRefresh=function(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,this._logger.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)},t._getValidEvaluationEnvironments=function(){var e=this,t=this._config.evaluationContexts;return null!=t&&t.length?t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]},t._getValidFlagKeys=function(){var e=this,t=this._config.flagKeys;if(!ri(t))return t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid flag key found:",t,"Expected non-empty string"),n})},t.initialize=function(){var e,t,n=this._config,r=null!==(e=null==(t=n.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(r).length){var i,o,s=null!==(i=null==(o=n.bootstrap)?void 0:o.featureFlagPayloads)&&void 0!==i?i:{},a=Object.keys(r).filter(function(e){return!ri(r[e])}).reduce(function(e,t){return e[t]=r[t],e},{}),u=Object.keys(s).filter(function(e){return a[e]}).reduce(function(e,t){return e[t]=n.encodeBootstrapPayloads?JSON.stringify(s[t]):s[t],e},{});return this._receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u},void 0,{persist:!1})}},t.updateFlags=function(e,t,n){for(var r=null!=n&&n.merge?Qb(this._prop(Yf),this._prop(Wf)):{},i=null!=n&&n.merge?Qb(this._prop(th),this._prop(Wf)):{},o=d({},r,e),s=d({},i,t),a={},u=0,l=Object.entries(o);l.length>u;u++){var c=l[u],f=c[0],h=c[1];a[f]={key:f,enabled:Ls(h),variant:Ds(h),reason:void 0,metadata:ri(null==s?void 0:s[f])?void 0:{id:0,version:void 0,description:void 0,payload:s[f]}}}this._receivedFeatureFlags({flags:a})},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._flagsWithDetails(),t=this._responseFormat.publicDetail;return t?Object.fromEntries(Object.entries(e).map(function(e){return[e[0],t(e[1])]})):e},t._flagsWithDetails=function(){var e=this._prop(Wf),t=this._prop(nh),n=this._prop(rh);if(!n&&!t)return e||{};for(var r,i=Pl({},e||{}),o=p([].concat(new Set([].concat(Object.keys(n||{}),Object.keys(t||{})))));!(r=o()).done;){var s,a,u=r.value,l=i[u],c=null==t?void 0:t[u],f=ri(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,h=ri(c)?null==l?void 0:l.variant:"string"==typeof c?c:void 0,_=null==n?void 0:n[u],v=d({},l,{enabled:f,variant:f?null!=h?h:null==l?void 0:l.variant:void 0});f!==(null==l?void 0:l.enabled)&&(v.original_enabled=null==l?void 0:l.enabled),h!==(null==l?void 0:l.variant)&&(v.original_variant=null==l?void 0:l.variant),_&&(v.metadata=d({},null==l?void 0:l.metadata,{payload:_,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),i[u]=v}return this._override_warning||(this._logger.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i},t.getAllFeatureFlags=function(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(function(n){var r=e[n];return{key:n,enabled:Ls(r),variant:Ds(r),payload:Os(t[n])}})},t.getFlagVariants=function(){var e=Qb(this._prop(Yf),this._prop(Wf)),t=this._prop(nh);if(!t)return e||{};for(var n=Pl({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this._override_warning||(this._logger.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n},t.getFlagPayloads=function(){var e=Qb(this._prop(th),this._prop(Wf)),t=this._prop(rh);if(!t)return e||{};for(var n=Pl({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this._override_warning||(this._logger.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this._override_warning=!0),n},t.reloadFeatureFlags=function(){var e=this;this._reloadingDisabled||this._config.featureFlagsDisabled||this._hasStatusZeroCircuitBreakerTripped()||(this._firingFeatureFlagsCallbacks&&this._logger.warn("reloadFeatureFlags() was called inside an onFeatureFlags callback. This callback also runs when flags change in other tabs, so this can cause a request loop."),this._requestInFlight&&(this._additionalReloadRequested=!0),this._reloadDebouncer||(this._reloadDebouncer=setTimeout(function(){e._callFlagsEndpoint()},5),this._reloadingHandlers.slice().forEach(function(t){try{t()}catch(t){e._logger.error("Error while running feature flags reloading callback",t)}})))},t.reloadFeatureFlagsAsync=function(){var e=this;return!this._client||this._reloadingDisabled||this._config.featureFlagsDisabled||this._config.remoteRequestsDisabled||this._hasStatusZeroCircuitBreakerTripped()?Promise.resolve({status:"skipped"}):new Promise(function(t){e._pendingReloads.add(t),e.reloadFeatureFlags()})},t._settleReloads=function(e,t){e.forEach(function(e){return e({status:t})}),e.clear()},t._clearDebouncer=function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0},t.onReloading=function(e){var t=this;return this._reloadingHandlers.push(e),function(){t._reloadingHandlers=t._reloadingHandlers.filter(function(t){return t!==e})}},t.ensureFlagsLoaded=function(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()},t.setAnonymousDistinctId=function(e){this.$anon_distinct_id=e},t.setReloadingPaused=function(e){this._reloadingDisabled=e},t.resetFlagCallReported=function(){this._remove(Xf),this._flagCallsPendingCapture=new Map,this._flagEventCaptureThrows=new Map},t.sendFlagCallsPendingCapture=function(){var e;if(0!==this._flagCallsPendingCapture.size&&!this._sendingFlagCallsPendingCapture&&null!=(e=this._client)&&e.canCapture&&!this._client.isRateLimited){this._sendingFlagCallsPendingCapture=!0;try{for(var t=this.getFlagVariants(),n=0,r=Array.from(this._flagCallsPendingCapture.keys());r.length>n;n++){var i,o=r[n],s=this._flagCallsPendingCapture.get(o);if(s){var a=null==(i=this._configVersion2FlagEvents(o,t[o]))?void 0:i.calledKey;if(s.value!==String(t[o])||s.calledKey&&s.calledKey!==a||!nw(s.context,this._flagCallContext()))this._flagCallsPendingCapture.delete(o);else if(this.getFeatureFlagResult(o),this._flagCallsPendingCapture.has(o))break}}}finally{this._sendingFlagCallsPendingCapture=!1}}},t._callFlagsEndpoint=function(e){var t,n=this;this._clearDebouncer();var r=this._client;if(!r||this._config.remoteRequestsDisabled||this._hasStatusZeroCircuitBreakerTripped())this._settleReloads(this._pendingReloads,"skipped");else if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i={token:r.projectToken,distinct_id:r.distinctId,groups:r.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:d({},r.initialPersonProperties,this._prop("$stored_person_properties")||{},{$lib:r.library.name,$lib_version:r.library.version}),group_properties:this._prop(Jf),timezone:Yh()};ri(r.deviceId)||(i.$device_id=r.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(i.disable_flags=!0);var o=this._getValidEvaluationEnvironments();o.length&&(i.evaluation_contexts=o);var s=this._getValidFlagKeys();ri(s)||(i.flag_keys=s);var a=this._config.onlyEvaluateSurveyFeatureFlags,u="/flags/?v="+this._responseFormat.version+(a?"&only_evaluate_survey_feature_flags=true":""),l=this._requestGeneration,c=this._pendingReloads;this._pendingReloads=new Set,this._activeReloads=c,this._requestInFlight=!0;var f=function(){n._additionalReloadRequested&&(n._additionalReloadRequested=!1,n._callFlagsEndpoint())},h=function(e){var t;n._requestInFlight=!1,l===n._requestGeneration?(n._set(((t={})[Vf]=[Kb],t)),n._logger.error("Feature flag request failed",e),n._fallBackToPersistedFlags()&&n._fireFeatureFlagsCallbacks(!0),n._settleReloads(c,"error"),f()):f()},p=null!==(t=this._config.requestMaxRetries)&&void 0!==t?t:1,_=function(){if(l!==n._requestGeneration||!n._client||n._config.remoteRequestsDisabled)return n._requestInFlight=!1,n._settleReloads(c,"skipped"),void f();try{r.sendRequest(u,{target:"flags",method:"POST",body:i,compression:n._config.compression,sentAt:"body",timeoutMs:n._config.requestTimeoutMs}).then(function(e){if(function(e){return Vb.includes(e.statusCode)||function(e){return 0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name}(e)}(e)&&p>0&&l===n._requestGeneration)return p--,void setTimeout(_,500);!function(e){var t,r,o=n._readFlagsResponse(e.json),s=200!==e.statusCode;if(n._requestInFlight=!1,l===n._requestGeneration)if(n._trackStatusZeroReachability(e.statusCode),s||n._additionalReloadRequested||(n.$anon_distinct_id=void 0),!i.disable_flags||n._additionalReloadRequested){n._flagsLoadedFromRemote=!s;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?Kb:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),o.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var d=!(null==(t=o.quotaLimited)||!t.includes("feature_flags"));d&&u.push("quota_limited"),n._set(((r={})[Vf]=u,r)),d?n._logger.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||n._receivedFeatureFlags(o,s,{partialResponse:a}),n._settleReloads(c,i.disable_flags?"skipped":u.length||!o.flags&&!o.featureFlags?"error":"loaded"),f()}else n._settleReloads(c,"skipped");else f()}(e)}).catch(h)}catch(e){h(e)}};_()}},t._readFlagsResponse=function(e){var t=null!=e?e:{},n=this._responseFormat.read;if(!n)return t;var r=n(t),i=r.body;return r.withoutTypedValues&&!this._loggedResponseWithoutTypedValues&&(this._loggedResponseWithoutTypedValues=!0,this._logger.info("The /flags response has no typed flag values. Its flags are read as before.")),i},t._hasStatusZeroCircuitBreakerTripped=function(){return Uh(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=Wh(e,this._consecutiveStatusZeroFailures,3,function(){return t._logger.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")})},t._flagsNotLoaded=function(e){var t;return!(this._hasLoadedFlags||this.getFlags().length||null!=(t=this.getFeatureFlagDetails(e))&&t.failed)},t.getFeatureFlag=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._flagsNotLoaded(e))this._logger.warn('getFeatureFlag for key "'+e+Wb);else if(!this._checkAndTriggerStaleRefresh()){var r=this.getFeatureFlagResult(e,t);return null!==(n=null==r?void 0:r.variant)&&void 0!==n?n:null==r?void 0:r.enabled}},t.getFeatureFlagDetails=function(e){var t=this._flagsWithDetails()[e],n=this._responseFormat.publicDetail;return t&&n?n(t):t},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.getFeatureFlagResult(e,{send_event:!1}))?void 0:t.payload},t.getFeatureFlagResult=function(e,t){var n,r=this;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._flagsNotLoaded(e))this._logger.warn('getFeatureFlagResult for key "'+e+Wb);else if(!this._checkAndTriggerStaleRefresh()){var i,o=null==(n=this._prop(Wf))||null==(n=n[e])?void 0:n.failed,s=o?void 0:this._prop(Yf),a=o?void 0:this._prop(th),u=this._prop(nh),l=!!u&&{}.hasOwnProperty.call(u,e),c=l||!!s&&e in s,f=l?u[e]:null==s?void 0:s[e],h=this._prop(rh),p=h&&{}.hasOwnProperty.call(h,e)?h[e]:null==a?void 0:a[e],_=String(f),v=this._prop("$feature_flag_request_id")||void 0,g=this._prop("$feature_flag_evaluated_at")||void 0,m=this._prop("$flag_call_reported")||{};if(this._config.deduplicateCallsPerSession){var y,b=null==(y=this._client)||null==(y=y.session)?void 0:y.sessionId,w=this._prop(eh);b&&b!==w&&(m={},i=b)}if(!t.send_event&&"send_event"in t){var S;i&&this._set(((S={})[Xf]=m,S[eh]=i,S))}else{var k,x,C,P,E,T,F,I,R=!(null!=(k=this._client)&&k.canCapture),A=!(R||null!=(x=this._client)&&x.isRateLimited),M=this._configVersion2FlagEvents(e,f),O=M?M.calledKey:_,L=null==M?void 0:M.exposureKey,D=function(){return r._holdFlagCall(e,_,null==M?void 0:M.calledKey)};if(A)this._flagCallsPendingCapture.delete(e);else R&&Object.keys(m).length>0&&this._set(((I={})[Xf]=m={},I)),null!=(T=m[e])&&T.includes(O)&&(!L||null!=(F=m[e])&&F.includes(L))||D();var q=!(null!=(C=m[e])&&C.includes(O)),N=!(!L||null!=(P=m[e])&&P.includes(L));if(A&&M&&(q||N)){var B;i&&this._set(((B={})[Xf]=m,B[eh]=i,B));var j=M.build(this._flagCalledProperties(e,f,p,v,g)),H=q?this._captureFlagEventOnce(e,O,j.called,D):void 0;N&&j.exposure&&this._captureFlagEventOnce(e,L,j.exposure,D,H)}else if(A&&q){var z,U;Xr(m[e])?m[e].push(_):m[e]=[_],this._set(d(((z={})[Xf]=m,z),i?((U={})[eh]=i,U):{}));var W=this._flagCalledProperties(e,f,p,v,g);this._captureFeatureFlagCalled(W)||(this._unmarkFlagCallReported(e,_),D())}else i&&this._set(((E={})[Xf]=m,E[eh]=i,E))}if(c)return{key:e,enabled:!!f,variant:"string"==typeof f?f:void 0,payload:Os(p)}}},t._flagCalledProperties=function(e,t,n,r,i){var o,s,a,u,l,c,d,f,h,p,_,v,g,m=this._flagsWithDetails()[e],y=[].concat(null!==(o=this._prop("$feature_flag_errors"))&&void 0!==o?o:[]);ri(t)&&y.push(null!=m&&m.failed?"evaluation_failed":"flag_missing");var b={$feature_flag:e,$feature_flag_response:t,$feature_flag_payload:null!=n?n:null,$feature_flag_request_id:r,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:null!==(s=null==(a=this._config.bootstrap)||null==(a=a.featureFlags)?void 0:a[e])&&void 0!==s?s:null,$feature_flag_bootstrapped_payload:null!==(u=null==(l=this._config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])&&void 0!==u?u:null,$used_bootstrap_value:!this._flagsLoadedFromRemote};ri(null==m||null==(c=m.metadata)?void 0:c.has_experiment)||(b.$feature_flag_has_experiment=m.metadata.has_experiment),ri(null==m||null==(d=m.metadata)?void 0:d.version)||(b.$feature_flag_version=m.metadata.version);var w=null!==(f=null==m||null==(h=m.reason)?void 0:h.description)&&void 0!==f?f:null==m||null==(p=m.reason)?void 0:p.code;return w&&(b.$feature_flag_reason=w),null!=m&&null!=(_=m.metadata)&&_.id&&(b.$feature_flag_id=m.metadata.id),ri(null==m?void 0:m.original_variant)&&ri(null==m?void 0:m.original_enabled)||(b.$feature_flag_original_response=ri(m.original_variant)?m.original_enabled:m.original_variant),null!=m&&null!=(v=m.metadata)&&v.original_payload&&(b.$feature_flag_original_payload=null==m||null==(g=m.metadata)?void 0:g.original_payload),y.length&&(b.$feature_flag_error=y.join(",")),b},t._configVersion2FlagEvents=function(e,t){var n,r,i,o=this._responseFormat.flagEvents,s=this._prop(nh);if(!(!o||ti(s)&&Jr.call(s,e)))return o({key:e,response:t,groups:null!==(n=null==(r=this._client)?void 0:r.groups)&&void 0!==n?n:{},record:null==(i=this._prop(Wf))?void 0:i[e]})},t._captureFlagEventOnce=function(e,t,n,r,i){var o,s,a,u,l,c=this._prop("$flag_call_reported")||{},f=e+t,h=this._flagEventCaptureThrows.get(f)||0;if(!(null!=(o=c[e])&&o.includes(t)||h>1)){this._set(((a={})[Xf]=d({},c,((s={})[e]=[].concat(c[e]||[],[t]).slice(-10),s)),a));var p,_,v=!1,g=!1;this._flagEventCaptures.set(n.properties,d({},n.capture,{failed:function(){v=!0},resolved:function(e){return _=e.$session_id,p=JSON.stringify([e.distinct_id,e.$groups,_,e.$process_person_profile]),!(g=!!i&&p!==i)}}));var m=!1;try{var y,b;(m=!1!==(null==(y=this._client)?void 0:y.capture(n.event,n.properties))&&!(null==(b=this._client)||!b.canCapture))||r()}catch(e){v=!0,this._logger.error("Failed to capture "+n.event,e)}v&&this._flagEventCaptureThrows.set(f,h+1);var w=m&&!v&&!g;return w||this._unmarkFlagCallReported(e,t),this._config.deduplicateCallsPerSession&&_&&_!==this._prop("$flag_call_reported_session_id")&&this._set(((l={})[Xf]=w?((u={})[e]=[t],u):{},l[eh]=_,l)),p}},t.flagEventCapture=function(e){return e?this._flagEventCaptures.get(e):void 0},t._captureFeatureFlagCalled=function(e){try{var t;return!1!==(null==(t=this._client)?void 0:t.capture("$feature_flag_called",e))}catch(e){return this._logger.error("Failed to capture feature flag call",e),!0}},t._holdFlagCall=function(e,t,n){this._flagCallsPendingCapture.set(e,{value:t,calledKey:n,context:this._flagCallContext()})},t._flagCallContext=function(){var e,t,n;return{distinctId:null==(e=this._client)?void 0:e.distinctId,groups:d({},null==(t=this._client)?void 0:t.groups),sessionId:this._config.deduplicateCallsPerSession?null==(n=this._client)||null==(n=n.session)?void 0:n.sessionId:void 0}},t._unmarkFlagCallReported=function(e,t){var n,r=this._prop("$flag_call_reported")||{},i=r[e];Xr(i)&&i.includes(t)&&(r[e]=i.filter(function(e){return e!==t}),this._set(((n={})[Xf]=r,n)))},t.getRemoteConfigPayload=function(e,t){this._getRemoteConfigPayload(e,t)},t._getRemoteConfigPayload=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a,u,c,d,f,h;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},(o=this._getValidEvaluationEnvironments()).length&&(i.evaluation_contexts=o),s=this._getValidFlagKeys(),ri(s)||(i.flag_keys=s),e.p=2,e.n=3,r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs});case 3:if(f=u=e.v.json,d=null==f){e.n=4;break}d=null==(u=u.featureFlagPayloads);case 4:if(!d){e.n=5;break}h=void 0,e.n=6;break;case 5:h=u[t];case 6:if(c=h){e.n=7;break}c=void 0;case 7:a=c,e.n=9;break;case 8:return e.p=8,this._logger.error("Remote config feature flag request failed",e.v),e.a(2);case 9:try{n(a)}catch(e){this._logger.error("Remote config feature flag callback failed",e)}case 10:return e.a(2)}},e,this,[[2,8]])}));return function(t,n){return e.apply(this,arguments)}}(),t.isFeatureEnabled=function(e,t){if(void 0===t&&(t={}),t.fresh&&!this._flagsLoadedFromRemote)return t.defaultValue;if(this._flagsNotLoaded(e))return this._logger.warn('isFeatureEnabled for key "'+e+Wb),t.defaultValue;var n=this.getFeatureFlag(e,t);return ri(n)?t.defaultValue:!!n},t.addFeatureFlagsHandler=function(e){this.featureFlagEventHandlers.push(e)},t.removeFeatureFlagsHandler=function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})},t.receivedFeatureFlags=function(e,t,n){this._receivedFeatureFlags(e,t,n)},t._receivedFeatureFlags=function(e,t,n){if(this._client){var r;this._hasLoadedFlags=!0,!1!==(null==n?void 0:n.persist)&&Jb(e,n)&&null!=(r=this._crossTabPersistence)&&null!=r.reconcileFeatureFlagsBeforeMerge&&r.reconcileFeatureFlagsBeforeMerge()&&this._clearBootstrapState();var i=this.getFlagVariants(),o=!e.flags&&Xr(e.featureFlags),s=function(e,t,n,r,i,o){var s,a,u;void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o=zb);var l=ew(e,o),c=l.flags,f=l.featureFlags,h=l.featureFlagPayloads;if(f){var p=e.requestId,_=e.evaluatedAt;if(Xr(f)){var v;o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var g={};if(f)for(var m=0;f.length>m;m++)g[f[m]]=!0;return(v={})[Uf]=f,v[Yf]=g,v[Wf]=Yb(r,f),v[th]=Qb(n,r),v[Qf]=!1,v}var y=f,b=h,w=c;if(Jb(e,i)){var S=Object.keys(y),k=b||{};y=d({},t,y),b=d({},n,k),(null!=i&&i.partialResponse||c)&&S.forEach(function(e){var t;e in k||null==(t=b)||delete t[e]}),w=c?d({},r,Object.fromEntries(Object.entries(c).filter(function(e){return!(e[1].failed&&(n=e[0],{}.hasOwnProperty.call(t,n)&&!ri(t[n])));var n}))):Yb(r,S)}return d(((s={})[Uf]=Object.keys(Xb(y)),s[Yf]=y||{},s[th]=b||{},s[Wf]=w||{},s[Qf]=!0===e.minimalFlagCalledEvents,s),p?((a={})[Kf]=p,a):{},_?((u={})[Gf]=_,u):{})}}(e,i,o?this._prop("$feature_flag_payloads")||{}:this.getFlagPayloads(),o?this._prop("$feature_flag_details")||{}:this._flagsWithDetails(),n,this._logger);if(s)if(!1===(null==n?void 0:n.persist)){var a=!ri(this._client.kv.get(Yf));this._bootstrapState=s,a||this._set(s)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(s,e,!(null==n||!n.partialResponse)),this._set(s);else t&&this._fallBackToPersistedFlags();t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}},t.override=function(e,t){void 0===t&&(t=!1),this._logger.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})},t.overrideFeatureFlags=function(e){this._overrideFeatureFlags(e)},t._overrideFeatureFlags=function(e){if(this._client){if(!1===e)return this._remove([nh,rh]),this._fireFeatureFlagsCallbacks(),void Ub.info("All overrides cleared");var t,n;if(Xr(e))return this._set(((t={})[nh]=Zb(e),t)),this._fireFeatureFlagsCallbacks(),void Ub.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;this._override_warning=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r);var o={},s=i.flags,a=i.payloads;return s&&(o[nh]=Xr(s)?Zb(s):s),a&&(o[rh]=a),Object.keys(o).length&&this._set(o),!1===s&&!1===a?this._remove([nh,rh]):!1===s?this._remove(nh):!1===a&&this._remove(rh),this._fireFeatureFlagsCallbacks(),!1===s?Ub.info("Flag overrides cleared"):s&&Ub.info("Flag overrides set",{flags:s}),void(!1===a?Ub.info("Payload overrides cleared"):a&&Ub.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[nh]=e,n)),this._fireFeatureFlagsCallbacks(),void Ub.info("Flag overrides set",{flags:e});this._logger.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this._logger.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")},t.onFeatureFlags=function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;try{e(r,i)}catch(e){this._logger.error("Error while running feature flags callback",e)}}return function(){return t.removeFeatureFlagsHandler(e)}},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var r,i,o,s,a,u,l,c,f,h,p=(this._prop("$early_access_features")||[]).find(function(t){return t.flagKey===e}),_=((r={})["$feature_enrollment/"+e]=t,r),v={$feature_flag:e,$feature_enrollment:t,$set:_};p&&(v.$early_access_feature_name=p.name),n&&(v.$feature_enrollment_stage=n);var g=d({},this.getFlagVariants(),((i={})[e]=t,i)),m=d({},this._prop(Wf)),y=null==(o=m[e])?void 0:o.failed,b=d({},this._prop(th));y&&(delete m[e],delete b[e]),null==(s=this._crossTabPersistence)||s.markCrossTabFeatureFlagChanges(d(((a={})[Uf]=[e],a[Yf]=[e],a),y?((u={})[Wf]=[e],u[th]=[e],u):{},((l={})[Zf]=Object.keys(_),l))),this._set(d(((c={})[Uf]=Object.keys(Xb(g)),c[Yf]=g,c),y?((f={})[Wf]=m,f[th]=b,f):{},((h={})[Zf]=d({},this._prop("$stored_person_properties")||{},_),h))),this._fireFeatureFlagsCallbacks();try{var w;null==(w=this._client)||w.capture("$feature_enrollment_update",v)}catch(e){this._logger.error("Failed to capture early access feature enrollment",e)}},t.getEarlyAccessFeatures=function(e,t,n){void 0===t&&(t=!1);var r=this._prop(zf);!r||t?this._getEarlyAccessFeatures(e,n):e(r)},t._getEarlyAccessFeatures=function(){var e=h(l().m(function e(t,n){var r,i,o,s,a;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i=n?"&"+n.map(function(e){return"stage="+e}).join("&"):"",e.p=2,e.n=3,r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});case 3:if((a=e.v).json){e.n=4;break}return e.a(2);case 4:this._set(((s={})[zf]=o=a.json.earlyAccessFeatures,s)),e.n=6;break;case 5:return e.p=5,this._logger.error("Early access feature request failed",e.v),e.a(2);case 6:try{t(o)}catch(e){this._logger.error("Early access feature callback failed",e)}case 7:return e.a(2)}},e,this,[[2,5]])}));return function(t,n){return e.apply(this,arguments)}}(),t._prepareFeatureFlagsForCallbacks=function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}},t._fireFeatureFlagsCallbacks=function(e){var t=this;this._rebuildEventProperties();var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants,o=this._firingFeatureFlagsCallbacks;this._firingFeatureFlagsCallbacks=!0,this.featureFlagEventHandlers.forEach(function(n){try{n(r,i,{errorsLoading:e})}catch(e){t._logger.error("Error while running feature flags callback",e)}}),this._firingFeatureFlagsCallbacks=o},t.setPersonPropertiesForFlags=function(e,t){void 0===t&&(t=!0),this._setPersonPropertiesForFlags(e,t)},t._setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=this._prop("$stored_person_properties")||{},i=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),o=null==e?void 0:e.$set_once,s={};if(o)for(var a in o)({}).hasOwnProperty.call(o,a)&&(a in r||(s[a]=o[a]));this._set(((n={})[Zf]=d({},r,s,i),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=d({},this._prop("$stored_person_properties")||{});e.forEach(function(e){delete r[e]}),this._set(((n={})[Zf]=r,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(Zf),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var r=this._prop("$stored_group_properties")||{},i=d({},r),o=0,s=Object.keys(e);s.length>o;o++){var a=s[o];i[a]=d({},r[a],e[a])}this._set(((n={})[Jf]=i,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._prop("$stored_group_properties")||{};this._set(((n={})[Jf]=d({},r,((t={})[e]={},t)),n))}else this._remove(Jf)},t.reset=function(){this._requestGeneration++,this._settleReloads(this._pendingReloads,"cancelled"),this._settleReloads(this._activeReloads,"cancelled"),this._additionalReloadRequested=!1,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._bootstrapState=void 0,this._hasLoadedFlags=!1,this._reloadingDisabled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1,this._consecutiveStatusZeroFailures=0,this._flagCallsPendingCapture=new Map,this._flagEventCaptureThrows=new Map},a(e,[{key:"_responseFormat",get:function(){return tw}},{key:"_crossTabPersistence",get:function(){}},{key:"_config",get:function(){return this._configSource.get()}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),iw=function(e){return ti(e)&&"value"in e?e:void 0},ow=function(e){return ii(e)?e:ui(e)||ti(e)||!0===e},sw="$experiment_exposure",aw="experiment_split",uw="experiment",lw=((f={targeting_match:["targeted_release","percentage_rollout"]})[aw]=[uw],f.rollout_miss=["percentage_rollout",uw],f.experiment_paused=[uw],f.holdout=[uw],f),cw="$feature_flag_config_version",dw="$feature_flag_reason_code",fw="$feature_flag_rule_id",hw="$feature_flag_rule_type",pw="$feature_flag_variant_key",_w="$feature_flag_experiment_id",vw="$feature_flag_forced_variant",gw=[cw,dw,fw,hw,pw],mw=[].concat(gw,["$feature_flag_reason",vw,_w]),yw=[cw,dw,hw,"$experiment_exposure_source",_w,vw],bw=["$feature_flag_id","$feature_flag_version","$feature_flag_request_id","$feature_flag_evaluated_at"],ww=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Sw=function(e){return ii(e)?e:void 0},kw={},xw=function(e){return ui(e)&&e%1==0},Cw=[["key",ii],["failed",ci]],Pw=[["code",ii],["condition_index",xw],["description",ii]],Ew=[["id",xw],["version",xw],["description",ii],["has_experiment",ci],["config_version",xw],["rule_type",ii],["rule_id",ii],["variant_key",ii],["forced_variant",ci],["experiment_id",xw]],Tw=function(e,t){if(!ai(e)){if(!ti(e))throw kw;for(var n,r={},i=p(t);!(n=i()).done;){var o=n.value,s=o[0],a=o[1],u=e[s];if(!ai(u)){if(!a(u))throw kw;r[s]=u}}return r}},Fw=function(e,t){var n=Tw(t,Cw),r=null==t?void 0:t.value;if(!n||!(si(r)||ci(r)||ii(r)||ti(r)||ui(r)&&isFinite(r)))throw kw;var i=t.metadata,o=Tw(i,Ew),s=!0===n.failed,a=s?null:r,u=ui(a)||ti(a),l=ow(a);return{key:e,enabled:!1!==l,variant:ii(l)?l:null,value:a,reason:Tw(t.reason,Pw),metadata:o||u?d({},o,{payload:s?null:u?JSON.stringify(a):null==i?void 0:i.payload,experiment_id:void 0}):void 0,failed:s||void 0}},Iw=["config_version","rule_type","rule_id","variant_key","forced_variant"],Rw={version:4,read:function(e){var t=ti(e)?e.flags:void 0,n=!1;if(!ti(t)){var r=ti(e)?e.featureFlags:void 0;return{body:e,withoutTypedValues:ti(r)&&Object.keys(r).length>0}}return{body:d({},e,{flags:Object.fromEntries(Object.keys(t).map(function(e){var r=t[e];if(ti(r)&&!("value"in r))return n=!0,[e,r];try{return[e,Fw(e,r)]}catch(t){return[e,{key:e,enabled:!1}]}}))}),withoutTypedValues:n}},publicDetail:function(e){if(!iw(e))return e;var t=d({},e);if(delete t.value,ti(t.metadata))for(var n=t.metadata=d({},t.metadata),r=0,i=Iw;i.length>r;r++)delete n[i[r]];return t},flagEvents:function(e){var t,n=e.key,r=e.response,i=e.record,o=function(e){var t,n=iw(e),r=null==n?void 0:n.metadata;if(n&&2===(null==r?void 0:r.config_version)){var i,o,s,a=Sw(null==(t=n.reason)?void 0:t.code)||void 0,u=a&&Jr.call(lw,a)?lw[a]:void 0,l=Sw(r.rule_id),c=Sw(r.rule_type);return!n.failed&&u&&l&&ww.test(l)&&c&&-1!==u.indexOf(c)&&(a!==aw?(i=l,o=c):ii(r.variant_key)&&(i=l,o=c,s=r.variant_key)),{reasonCode:a,ruleId:i,ruleType:o,variantKey:s}}}(i),s=iw(i);if(o&&s&&(s.failed?ri(r):ow(s.value)===r)){var a=o.reasonCode,u=o.ruleId,l=o.ruleType,c=o.variantKey,f=Object.keys(e.groups).sort().map(function(t){return[t,e.groups[t]]}),h=((t={})[cw]=2,t);a&&(h[dw]=a),u&&(h[fw]=u,h[hw]=l);var p=ii(c);return p&&(h[pw]=c),{calledKey:JSON.stringify([r,f,2,a||null,u||null,l||null,p?c:null]),exposureKey:p?JSON.stringify([sw,f,2,u,c]):void 0,build:function(e){var t=d({},e,h);delete t.$feature_flag_reason;var i={event:"$feature_flag_called",properties:t,capture:{omit:mw.filter(function(e){return!(e in t)}),keep:gw}};if(!p)return{called:i,exposure:void 0};for(var o={},s=0,a=bw;a.length>s;s++){var l=a[s];ri(t[l])||(o[l]=t[l])}return o.$feature_flag=n,o.$feature_flag_response=r,o[pw]=c,o[fw]=u,o.locally_evaluated=!1,{called:i,exposure:{event:sw,properties:o,capture:{omit:yw,keep:[]}}}}}}}},Aw=kl("[FeatureFlags]"),Mw=function(){"use strict";function e(e,t){void 0===t&&(t=!1),this._loggedEvaluationEnvironmentsDeprecation=!1,this.update(e,t)}var t=e.prototype;return t.update=function(e,t){this._snapshot=function(e,t){var n,r,i,o,s,a,u,l;return{bootstrap:{featureFlags:null!==(n=null==(r=e.bootstrap)?void 0:r.featureFlags)&&void 0!==n?n:void 0,featureFlagPayloads:null!==(i=null==(o=e.bootstrap)?void 0:o.featureFlagPayloads)&&void 0!==i?i:void 0},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(s=e.remote_config_refresh_interval_ms)&&void 0!==s?s:3e5,idleRefreshBackoff:ri(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!==(a=e.feature_flag_request_max_retries)&&void 0!==a?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(u=null!==(l=e.evaluation_contexts)&&void 0!==l?l:e.evaluation_environments)&&void 0!==u?u:[],flagKeys:Xr(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(Aw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),ri(e.flag_keys)||Xr(e.flag_keys)||Aw.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),Ow=function(e){"use strict";function t(t){var n,r=new Mw(t.config,t._shouldDisableFlags());return(n=e.call(this,r)||this).name=tv,n._instance=t,n._mutableConfigSource=r,n}return r(t,e),t.prototype.updateConfig=function(e,t){this._mutableConfigSource.update(e,t),this._onConfigUpdated()},a(t,[{key:"_crossTabPersistence",get:function(){return this._instance.persistence}},{key:"_responseFormat",get:function(){return Rw}}])}(rw),Lw="Refusing to render web experiment since the viewer is a likely bot",Dw={ADD_ATTR:function(e,t){return"target"===e&&"a"===t||"form"===e&&/^(button|fieldset|input|output|select|textarea)$/.test(t)},ADD_URI_SAFE_ATTR:["form"]},$w={icontains:function(e,t){return t.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return-1===t.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return Gl(t,e)},not_regex:function(e,t){return!Gl(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},qw=function(){"use strict";function e(t){var n=this;this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),n.getWebExperiments(function(t){e._logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,t.forEach(function(t){if(t.feature_flag_key){var r;n._flagToExperiments&&(e._logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=n._flagToExperiments)||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);ii(i)&&t.variants[i]&&n._applyVariantForFlag(t,i)}else if(t.variants)for(var o in t.variants){var s=t.variants[o];e._matchesTestVariant(s,n._instance)&&n._applyTransforms(t.name,o,s.transforms)}})},t)},this._instance.onFeatureFlags(function(e){n.onFeatureFlags(e)})}var t=e.prototype;return t.initialize=function(){},t.onFeatureFlags=function(t){var n=this;if(this._is_bot())e._logInfo(Lw);else if(!this._config.disable_web_experiments){if(ai(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e._logInfo("applying feature flags",t),t.forEach(function(e){var t;if(n._flagToExperiments&&null!=(t=n._flagToExperiments)&&t.has(e)){var r,i=n._instance.getFeatureFlag(e),o=null==(r=n._flagToExperiments)?void 0:r.get(e);i&&null!=o&&o.variants[i]&&n._applyVariantForFlag(o,i)}})}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var r=Gh(null==n?void 0:n.search,"__experiment_id"),i=Gh(null==n?void 0:n.search,"__experiment_variant");r&&i&&(e._logInfo("previewing web experiments "+r+" && "+i),this.getWebExperiments(function(e){t._showPreviewWebExperiment(parseInt(r),i,e)},!1,!0))}},t.loadIfEnabled=function(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()},t.getWebExperiments=function(e,t,n){if(this._config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._config.token),method:"GET",timestampMode:"query",callback:function(t){return e(200===t.statusCode&&t.json&&t.json.experiments||[])}})},t._showPreviewWebExperiment=function(t,n,r){var i=r.filter(function(e){return e.id===t});i&&i.length>0&&(e._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this._applyTransforms(i[0].name,n,i[0].variants[n].transforms))},t._applyVariantForFlag=function(t,n){var r=t.variants[n];e._matchUrlConditions(r,this._instance)?this._applyTransforms(t.name,n,r.transforms):e._logInfo("skipping variant "+n+" of experiment "+t.name+" because this page does not match its url conditions")},e._matchesTestVariant=function(t,n){return!ai(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var r;if(ai(t.conditions)||ai(null==(r=t.conditions)?void 0:r.url))return!0;var i=e.getWindowLocation();if(i){var o,s,a,u=Bd(n,i.href);return null==(o=t.conditions)||!o.url||$w[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,u)}return!1},e.getWindowLocation=function(){return null==Ih?void 0:Ih.location},e._matchUTMConditions=function(e){var t;if(ai(e.conditions)||ai(null==(t=e.conditions)?void 0:t.utm))return!0;var n=Gm();if(n.utm_source){var r,i,o,s,a,u,l,c,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_campaign)==n.utm_campaign,f=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_source||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_source)==n.utm_source,h=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==n.utm_medium,p=null==(l=e.conditions)||null==(l=l.utm)||!l.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==n.utm_term;return d&&h&&p&&f}return!1},e._logInfo=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];Sl.info("[WebExperiments] "+e,n)},e._logWarn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];Sl.warn("[WebExperiments] "+e,n)},e._sanitizeLinkTargets=function(t){("http://www.w3.org/1999/xhtml"===t.namespaceURI&&"template"===t.localName?t.content:t).querySelectorAll("a[target], template").forEach(function(t){var n;if("template"!==t.localName)if("http://www.w3.org/1999/xhtml"===t.namespaceURI&&"_blank"===(null==(n=t.getAttribute("target"))?void 0:n.toLowerCase())){var r=(t.getAttribute("rel")||"").split(/\s+/).filter(function(e){return e&&!/^(opener|noopener)$/i.test(e)});r.push("noopener"),t.setAttribute("rel",r.join(" "))}else t.removeAttribute("target");else"http://www.w3.org/1999/xhtml"===t.namespaceURI&&e._sanitizeLinkTargets(t)})},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo(Lw):"control"!==n?r.forEach(function(r){if(r.selector){var i;e._logInfo("applying transform of variant "+n+" for experiment "+t+" ",r);var o=null==(i=document)?void 0:i.querySelectorAll(r.selector);if(null==o||!o.length)return void e._logWarn("no element on this page matches selector "+r.selector+" of variant "+n+" for experiment "+t);var s=new Map;null==o||o.forEach(function(t){if("script"!==t.localName.toLowerCase()){var n=t;if(r.html){var i,o="http://www.w3.org/1998/Math/MathML"===t.namespaceURI&&"annotation-xml"===t.localName&&(null==(i=t.getAttribute("encoding"))?void 0:i.toLowerCase())||"",a=JSON.stringify([t.namespaceURI,t.localName,o]),u=s.get(a);if(ai(u)){var l=null!=Rb?Rb:Rb=Od(),c=t.ownerDocument.implementation.createHTMLDocument(""),f=c.createElementNS(t.namespaceURI,t.localName);o&&f.setAttribute("encoding",o);var h=c.createRange();h.selectNodeContents(f);var p="http://www.w3.org/2000/svg"===t.namespaceURI&&/^(foreignObject|desc|title)$/.test(t.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(o)?"http://www.w3.org/1999/xhtml":t.namespaceURI,_=h.createContextualFragment(r.html);"http://www.w3.org/1998/Math/MathML"===t.namespaceURI&&/^(mi|mo|mn|ms|mtext)$/.test(t.localName)?(f.appendChild(_),l.sanitize(f,d({},Dw,{NAMESPACE:p||void 0,IN_PLACE:!0}))):("http://www.w3.org/1999/xhtml"===f.namespaceURI&&"template"===f.localName?f.content:f).appendChild(l.sanitize(_,d({},Dw,{NAMESPACE:p||void 0,RETURN_DOM_FRAGMENT:!0}))),e._sanitizeLinkTargets(f),s.set(a,u=f.innerHTML)}n.innerHTML=u}r.css&&n.setAttribute("style",r.css)}})}}):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return Ah&&this._instance?Ry(Ah,this._config.custom_blocked_useragents):void 0},a(e,[{key:"_config",get:function(){return this._instance.config}}])}(),Nw=kl("[Conversations]"),Bw="Conversations not available yet.",jw=function(){"use strict";function e(e){this._instance=e,this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._loadFailed=!1,this._resetGeneration=0,this._pendingPanelAction=null,this._theme=null}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){if(this._instance.config.disable_conversations)this._pendingPanelAction=null;else if(this._remoteConfigSuccessful=e.ok,e.ok){var t=e.config.conversations;ai(t)?this._pendingPanelAction=null:(ci(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this._isConversationsEnabled||(this._pendingPanelAction=null),this.loadIfEnabled())}},t.reset=function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._resetGeneration++,this._isConversationsEnabled=void 0,this._remoteConfig=null,this._remoteConfigSuccessful=void 0,this._loadFailed=!1,this._pendingPanelAction=null},t.loadIfEnabled=function(){var e=this;if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||Ol(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==jh?void 0:jh.__PosthogExtensions__;if(t&&!ri(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var n=t.initConversations;if(n)return this._completeInitialization(n),void(this._isInitializing=!1);var r=dg(this._instance);if(!r)return void this._handleLoadError(Or);var i=this._resetGeneration;r(this._instance,"conversations",function(n){if(i!==e._resetGeneration)return e._isInitializing=!1,void e.loadIfEnabled();n||!t.initConversations?e._handleLoadError("Could not load conversations script",n):e._completeInitialization(t.initConversations),e._isInitializing=!1})}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else Nw.error("Conversations enabled but missing token in remote config.")}},t._completeInitialization=function(e){if(this._remoteConfig){try{this._conversationsManager=e(this._remoteConfig,this._instance),this._loadFailed=!1,Nw.info("Conversations loaded successfully")}catch(e){return void this._handleLoadError("Error completing conversations initialization",e)}this._theme&&this._conversationsManager.setTheme(this._theme),this._applyPendingPanelAction()}else Nw.error("Cannot complete initialization: remote config is null")},t._applyPendingPanelAction=function(){var e=this._pendingPanelAction;this._pendingPanelAction=null,this._conversationsManager&&e&&("open"===e?this._conversationsManager.open():this._conversationsManager.close())},t._handleLoadError=function(e,t){Nw.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():Nw.warn("Conversations not loaded yet.")},t.hide=function(){"open"===this._pendingPanelAction&&(this._pendingPanelAction=null),this._conversationsManager&&this._conversationsManager.hide()},t.open=function(){this._conversationsManager?(this._pendingPanelAction=null,this._conversationsManager.open()):this._pendingPanelAction="open"},t.close=function(){this._conversationsManager?(this._pendingPanelAction=null,this._conversationsManager.close()):this._pendingPanelAction="close"},t.setTheme=function(e){var t,n;this._theme=d({},this._theme,e,{dark:d({},null==(t=this._theme)?void 0:t.dark,null==e?void 0:e.dark)}),null==(n=this._conversationsManager)||n.setTheme(e)},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!si(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ol(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":ri(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?ai(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=jh&&jh.__PosthogExtensions__?this._isInitializing?"initializing":this._loadFailed?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"},t.isVisible=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e},t.sendMessage=function(){var e=h(l().m(function e(t,n,r){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.sendMessage(t,n,r))}},e,this)}));return function(t,n,r){return e.apply(this,arguments)}}(),t.getMessages=function(){var e=h(l().m(function e(t,n){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getMessages(t,n))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t.markAsRead=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.markAsRead(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.getTickets=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getTickets(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.requestRestoreLink=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.requestRestoreLink(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromToken=function(){var e=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromToken(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromUrlToken=function(){var e=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Nw.warn(Bw),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromUrlToken())}},e,this)}));return function(){return e.apply(this,arguments)}}(),t.getCurrentTicketId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null},t.getWidgetSessionId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null},t._onIdentityChanged=function(){var e;null==(e=this._conversationsManager)||e.setIdentity()},t._onIdentityCleared=function(){var e;null==(e=this._conversationsManager)||e.clearIdentity()},e}();function Hw(e,t){var n,r,i,o,s,a,u,l=null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:3e3,c=null!==(r=null==e?void 0:e.maxBufferSize)&&void 0!==r?r:100,f=null!=t&&t.consoleCapture?void 0:null!==(i=null==e?void 0:e.maxLogsPerInterval)&&void 0!==i?i:1e3,h=ri(f)?Math.max(c,2048):Math.max(c,f),p=d({},function(){var e="",t="";try{var n,r=null==(n="u">typeof globalThis?globalThis:"u">typeof window?window:void 0)||null==(n=n.navigator)?void 0:n.userAgent;if(r){var i=xo(r);e=i[0],t=i[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(Wa,e)?Wa[e]:e}(e);return d({},n?{"os.name":n}:{},t?{"os.version":t}:{})}(e,t)}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(o=null!==(s=null==p?void 0:p["service.name"])&&void 0!==s?s:null==e?void 0:e.serviceName)&&void 0!==o?o:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==p?void 0:p["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(u=null==p?void 0:p["deployment.environment"])&&void 0!==u?u:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:l,maxBufferSize:c,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:f,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var zw=["debug","log","warn","error","info"],Uw="console",Ww="__posthogHandledLogsRequestError",Vw=function(e,t){var n=e instanceof Error?e:new Error(t);return n[Ww]=!0,n},Gw=function(e){return!!e&&"object"==typeof e&&!0===e[Ww]},Kw=function(e){"use strict";function t(t){var n=e.call(this,{get:function(){var e;return null==t||null==(e=t.config)?void 0:e.logs},captureHintKey:pp,get remoteConfigWillArrive(){var e;return!(null!=t._shouldDisableFlags&&t._shouldDisableFlags()&&(null==(e=jh._POSTHOG_REMOTE_CONFIG)||null==(e=e[t.config.token])||!e.config))}},function(){return function(e){var t,n={};if(n.distinctId=e.get_distinct_id(),e.sessionManager){var r=e.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,o=r.sessionStartTimestamp,s=r.lastActivityTimestamp;n.sessionId=r.sessionId,n.windowId=i,ai(o)||(n.sessionStartTimestamp=o),ai(s)||(n.lastActivityTimestamp=s)}if(null!=jh&&null!=(t=jh.location)&&t.href&&(n.currentUrl=e.config.disable_capture_url_hashes?Ho(jh.location.href):jh.location.href),e.featureFlags){var a=e.featureFlags.getFlags();a&&a.length>0&&(n.activeFeatureFlags=a)}return n}(t)})||this;return n._instance=t,n.name=nv,n._listenForReconnect(),n}return r(t,e),t.prototype._getConsoleLoader=function(){var e=this,t=kl("[logs]"),n=null==jh?void 0:jh.__PosthogExtensions__;if(n){var r=dg(this._instance);if(r)return function(t){r(e._instance,"logs",function(e){var r=n.logs;t(e,null!=r&&r.initializeLogs?{initialize:function(e){return r.initializeLogs(e)},replay:function(e,t){return null==r.replayConsoleBuffer?void 0:r.replayConsoleBuffer(e,t)}}:void 0)})};t.error(Or)}else t.error("PostHog Extensions not found.")},a(t,[{key:"_isRequestReady",get:function(){return this._instance.__loaded}}])}(function(){"use strict";function e(e,t){var n,r=this;this._configSource=e,this._getSdkContext=t,this.name="logs",this._isLogsEnabled=!1,this._isLoaded=!1,this._isLoading=!1,this._logger=kl("[logs]"),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._setupStarted=!1,this._disposed=!1,this._consoleBuffer=[],this._consoleRecorderUnpatchers=[],this._isRecordingConsole=!1,this._isRecordingConsoleEntry=!1,this._listeningForReconnect=!1,this._onReconnect=function(){var e,t;r._disposed||(r._consecutiveStatusZeroFailures=0,null==(e=r._core)||e.onReconnect(),null==(t=r._consoleCore)||t.onReconnect())},this._isLogsEnabled=!(null==(n=e.get())||!n.captureConsoleLogs)}var t=e.prototype;return t._getConsoleLoader=function(){},t._listenForReconnect=function(){if(!this._listeningForReconnect){try{this._window=typeof window>"u"?void 0:window}catch(e){this._window=void 0}this._window&&(Ml(this._window,"online",this._onReconnect),this._listeningForReconnect=!0)}},t._buildCore=function(e,t,n,r){var i=this;this._listenForReconnect();var o=Hw(this._configSource.get(),n);return[new tu(this._createHost(e,t),o,this._coreLogger,function(){return i._getSdkContext()},function(e){return e()},void 0,r),o]},t._getCore=function(){var e=this,t=this._configSource.get();if(!this._core||this._resolvedFrom!==t){var n;null==(n=this._core)||n.reset(),this._resolvedFrom=t;var r=this._buildCore(function(){return e._queue},function(t){e._queue=t});this._core=r[0],this._resolvedConfig=r[1]}return this._core},t._getConsoleCore=function(){var e=this,t=this._configSource.get();if(!this._consoleCore||this._consoleResolvedFrom!==t){var n;null==(n=this._consoleCore)||n.reset(),this._consoleResolvedFrom=t;var r=this._buildCore(function(){return e._consoleQueue},function(t){e._consoleQueue=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Uw);this._consoleCore=r[0],this._consoleResolvedConfig=r[1]}return this._consoleCore},t.setup=function(e){var t=this;if(!this._disposed&&!this._setupStarted)return this._setupStarted=!0,this._client=e,this._logger=e.logger.createLogger("[logs]"),Ph(e.kv.initialize(),function(){t._disposed||t._finishSetup(e)})},t._finishSetup=function(e){var t,n=this;this._listenForReconnect(),null!=(t=this._configSource.get())&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),(this._isLogsEnabled||this._configSource.remoteConfigWillArrive&&e.kv.get(this._configSource.captureHintKey))&&this._startConsoleRecorder();var r=!1,i=e.onRemoteConfig(function(e){var t;r=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),n.onRemoteConfig(e)});this._disposed?i.dispose():(this._remoteConfigSubscription=i,r||this.loadIfEnabled())},t.dispose=function(){var e,t,n,r,i,o,s;this._disposed||(this._disposed=!0,this._stopConsoleRecorder(),null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._client=void 0,this._isLoading=!1,null==(t=this._window)||t.removeEventListener("online",this._onReconnect),null==(n=this._consoleLogsDispose)||n.call(this),this._consoleLogsDispose=void 0,null==(r=this._core)||r.clearQueue(),null==(i=this._consoleCore)||i.clearQueue(),null==(o=this._core)||o.reset(),null==(s=this._consoleCore)||s.reset())},t.onRemoteConfig=function(e){var t,n;if(!this._disposed){var r=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;ai(r)?this._stopRecorderStartedByPersistedHint():(null==(n=this._client)||n.kv.set(this._configSource.captureHintKey,!!r),r?(this._isLogsEnabled=!0,this._isLoaded||this._startConsoleRecorder(),this.loadIfEnabled()):this._stopRecorderStartedByPersistedHint())}},t.reset=function(){var e,t,n,r;this._stopConsoleRecorder(),null==(e=this._core)||e.clearQueue(),this._queue=[],null==(t=this._core)||t.reset(),null==(n=this._consoleCore)||n.clearQueue(),this._consoleQueue=[],null==(r=this._consoleCore)||r.reset(),this._consecutiveStatusZeroFailures=0},t.captureLog=function(e){!this._disposed&&this._client&&this._getCore().captureLog(e)},t.captureConsoleLog=function(e){!this._disposed&&this._client&&this._getConsoleCore().captureLog(e)},t.captureBufferedConsoleLog=function(e,t,n){!this._disposed&&this._client&&this._getConsoleCore().captureLog(e,{context:t,occurredAtMs:n})},t._onOptOut=function(){var e;this._stopConsoleRecorder(),null==(e=this._consoleCore)||e.clearQueue(),this._consoleQueue=[]},t._stopRecorderStartedByPersistedHint=function(){this._isLogsEnabled||this._stopConsoleRecorder()},t._startConsoleRecorder=function(){var e,t=this;if(!this._isRecordingConsole&&null!=(e=this._window)&&e.console){var n=Hw(this._configSource.get()).maxBufferSize,r=!0;this._consoleRecorderUnpatchers.push(function(){r=!1});for(var i=function(){var e,i=s[o];try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(t._window.console[i])}catch(e){return 1}e&&t._consoleRecorderUnpatchers.push(Ng(t._window.console,i,function(o){var s=function(){for(var e=arguments.length,s=new Array(e),a=0;e>a;a++)s[a]=arguments[a];try{r&&t._recordConsoleEntry(i,s,n)}catch(e){}return o.apply(t._window.console,s)};return s.__rrweb_original__=e,s}))},o=0,s=zw;s.length>o;o++)if(i())continue;this._isRecordingConsole=!0,this._consoleRecorderTimeout=setTimeout(function(){t._stopConsoleRecorder()},3e4)}},t._recordConsoleEntry=function(e,t,n){var r;if(this._isRecordingConsole&&!this._isRecordingConsoleEntry&&0!==t.length)if(null!=(r=this._client)&&r.canCapture){if(n>this._consoleBuffer.length){this._isRecordingConsoleEntry=!0;try{this._consoleBuffer.push({level:e,args:t,occurredAtMs:Date.now(),context:this._getSdkContext()})}finally{this._isRecordingConsoleEntry=!1}}}else this._stopConsoleRecorder()},t._stopConsoleRecorder=function(){if(this._consoleBuffer=[],this._isRecordingConsole){this._isRecordingConsole=!1,this._consoleRecorderTimeout&&(clearTimeout(this._consoleRecorderTimeout),this._consoleRecorderTimeout=void 0);for(var e,t=p(this._consoleRecorderUnpatchers);!(e=t()).done;)(0,e.value)();this._consoleRecorderUnpatchers=[]}},t._takeConsoleBuffer=function(){var e=this._consoleBuffer;return this._stopConsoleRecorder(),e},t.flushLogs=function(e){var t=this;this._client&&(e?this._flushViaTransport(e):(this._core&&this._core.flush().catch(function(e){return t._logFlushError(e)}),this._consoleCore&&this._consoleCore.flush().catch(function(e){return t._logFlushError(e)})))},t.flush=function(){var e=h(l().m(function e(){var t,n,r,i,o=this;return l().w(function(e){for(;;)switch(e.n){case 0:return r=null==(t=this._core)?void 0:t.flush().catch(function(e){return o._logFlushError(e)}),i=null==(n=this._consoleCore)?void 0:n.flush().catch(function(e){return o._logFlushError(e)}),e.n=1,r;case 1:return e.n=2,i;case 2:return e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._logFlushError=function(e){Gw(e)||this._logger.error("PostHog logs flush failed:",e)},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._isLogsEnabled&&!this._isLoaded&&!this._isLoading){var t=this._getConsoleLoader();if(t){this._isLoading=!0;try{t(function(t,n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled)if(t||!n)e._logger.error("Could not load logs script",t),e._stopConsoleRecorder();else{var r=e._takeConsoleBuffer();e._consoleLogsDispose=n.initialize(e._client),e._isLoaded=!0,r.length>0&&n.replay(e._client,r)}})}catch(e){throw this._isLoading=!1,e}}else this._stopConsoleRecorder()}},t._createHost=function(e,t){var n=this,r=this._client;return{get isDisabled(){return!1},get optedOut(){return!r.canCapture},getPersistedProperty:function(t){return t===Br.LogsQueue?e():void 0},setPersistedProperty:function(e,n){e===Br.LogsQueue&&t(null!=n?n:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return r.library.name},getLibraryVersion:function(){return r.library.version}}},t._sendLogsBatch=function(e){var t=this;return new Promise(function(n){if(Uh(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:Vw(void 0,"logs endpoint is unreachable, dropping batch")});else{var r=!1,i=function(e){r||(r=!0,clearTimeout(o),n(e))},o=setTimeout(function(){t._logger.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:Vw(void 0,"logs request timed out")})},9e4),s=t._isRequestReady;t._client.sendRequest("/i/v1/logs",{method:"POST",query:{token:t._client.projectToken},body:e,compression:"best-available",timeoutMs:6e4}).then(function(e){var n,r=e.statusCode;t._trackEndpointReachability(r,s),r>=200&&300>r?i({kind:"ok"}):413===r?i({kind:"too-large"}):0!==r&&408!==r&&429!==r&&500>r?i({kind:"fatal",error:new Error("logs request failed with status "+r)}):0===r?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:Vw(e.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(n=e.error)&&void 0!==n?n:new Error("logs request failed with status "+r)})},function(e){i({kind:"retry-later",error:e})})}})},t._trackEndpointReachability=function(e,t){var n=this;(0!==e||t)&&(this._consecutiveStatusZeroFailures=Wh(e,this._consecutiveStatusZeroFailures,3,function(){return n._logger.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")}))},t._flushViaTransport=function(e){var t=this;this._queue.length>0&&this._drainQueueViaTransport(e,this._queue,this._resolvedConfig,this._client.library.name,function(e){t._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,Uw,function(e){t._consoleQueue=e})},t._drainQueueViaTransport=function(e,t,n,r,i){var o=this;if(0!==t.length){var s=t.map(function(e){return e.record});i([]);var a=Ja(s,Ya(n,this._client.library.name,this._client.library.version),r,this._client.library.version);this._client.sendRequest("/i/v1/logs",{method:"POST",query:{token:this._client.projectToken},body:a,compression:"best-available",transport:e,timeoutMs:6e4}).catch(function(e){return o._logFlushError(e)})}},a(e,[{key:"_coreLogger",get:function(){var e=this;return d({},this._logger,{error:function(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.some(Gw)||(t=e._logger).error.apply(t,r)}})}},{key:"_isRequestReady",get:function(){return!0}},{key:"logger",get:function(){var e=this;return this._capture_logger||(this._capture_logger={trace:function(t,n){return e.captureLog({body:t,level:"trace",attributes:n})},debug:function(t,n){return e.captureLog({body:t,level:"debug",attributes:n})},info:function(t,n){return e.captureLog({body:t,level:"info",attributes:n})},warn:function(t,n){return e.captureLog({body:t,level:"warn",attributes:n})},error:function(t,n){return e.captureLog({body:t,level:"error",attributes:n})},fatal:function(t,n){return e.captureLog({body:t,level:"fatal",attributes:n})}}),this._capture_logger}}])}()),Qw=kl("[NetworkMetrics]"),Yw={"http:":80,"https:":443},Jw=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),Zw=function(e){return ii(e)&&0===e.toLowerCase().indexOf("text/event-stream")},Xw=function(e){try{return e()}catch(e){return}},eS=function(e,t){var n,r=String(t);return{method:String(e).toUpperCase(),url:(null==(n=Hh(r))?void 0:n.href)||r}},tS=function(e,t,n,r,i,o,s){void 0===s&&(s=!1);try{var a,u=i();if(!u)return;var l=n||void 0,c=ng()-r,f=Hh(t.url);if(f&&"http:"!==f.protocol&&"https:"!==f.protocol)return;var h={url:(null==f?void 0:f.href)||t.url,method:t.method},p=ei(u.name)?u.name(h):ii(u.name)?u.name:"http.client.request.duration";if(!p)return;var _=s&&!l?void 0:function(e,t){return e?400>e?void 0:String(e):(null==t?void 0:t.name)||"_OTHER"}(l,o),v=d({},d({"http.request.method":m=Jw.has(g=h.method)?g:"_OTHER"},"_OTHER"===m&&g!==m?{"http.request.method_original":g}:{}),f?function(e){return{"server.address":e.hostname.startsWith("[")&&e.hostname.endsWith("]")?e.hostname.slice(1,-1):e.hostname,"server.port":Number(e.port)||Yw[e.protocol],"url.scheme":e.protocol.slice(0,-1),"url.template":(t=e.pathname,t.split("/").map(function(e){return function(e){return/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e)}(e)?":id":e}).join("/"))};var t}(f):{},l?{"http.response.status_code":l}:{},_?{"error.type":_}:{},null==u.attributes?void 0:u.attributes(h,{status:l,durationMs:c}));null==(a=e.metrics)||a.histogram(p,c,{unit:"ms",attributes:v})}catch(e){Qw.error("Failed to record network metric",e)}var g,m},nS=function(){},rS=function(e){var t=!0,n=function(){return t?function(e){var t,n=null==(t=e.config.metrics)?void 0:t.network;return!0===n?{}:n||void 0}(e):void 0},r=function(e,t){return ei(null==Ih?void 0:Ih.fetch)?Ng(Ih,"fetch",function(n){return function(){for(var r=ng(),i=arguments.length,o=new Array(i),s=0;i>s;s++)o[s]=arguments[s];var a=n.apply(this,o);if(!t())return a;try{var u,l,c,d=o[0],f=o[1],h=eS(null!==(u=null!==(l=null==f?void 0:f.method)&&void 0!==l?l:null==d?void 0:d.method)&&void 0!==u?u:"GET",null!==(c=null==d?void 0:d.url)&&void 0!==c?c:d);return a.then(function(n){return Zw(Xw(function(){var e;return null==n||null==(e=n.headers)?void 0:e.get("content-type")}))||tS(e,h,null==n?void 0:n.status,r,t,void 0,!0),n},function(n){throw tS(e,h,void 0,r,t,n),n})}catch(e){return Qw.error("Failed to observe fetch",e),a}}}):nS}(e,n),i=function(e,t){var n,r=null==Ih||null==(n=Ih.XMLHttpRequest)?void 0:n.prototype;if(!r)return nS;var i=new WeakMap,o=Ng(r,"open",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];try{(function(e){return $v.has(e)})(this)||i.set(this,eS(n[0],n[1]))}catch(e){Qw.error("Failed to observe XHR open",e)}return e.apply(this,n)}}),s=Ng(r,"send",function(n){return function(){var r,o,s=this;try{var a=i.get(this);if(a&&t()){var u=ng(),l=function(){return Zw(Xw(function(){return s.getResponseHeader("content-type")}))},c=!1;r=function(){s.removeEventListener("loadend",r),s.removeEventListener("readystatechange",o),c||l()||tS(e,a,s.status,u,t)},Ml(this,"readystatechange",o=function(){2===s.readyState&&(c=l())}),Ml(this,"loadend",r)}}catch(e){Qw.error("Failed to observe XHR send",e)}try{for(var d=arguments.length,f=new Array(d),h=0;d>h;h++)f[h]=arguments[h];return n.apply(this,f)}catch(e){throw r&&this.removeEventListener("loadend",r),o&&this.removeEventListener("readystatechange",o),e}}});return function(){o(),s()}}(e,n);return function(){t=!1,r(),i()}},iS=function(){"use strict";function e(e){var t=this;this._instance=e,this._logger=kl("[metrics]"),this._disposed=!1,this._visibilityListening=!1,this._onVisibilityChange=function(){"hidden"===(null==Mh?void 0:Mh.visibilityState)&&t.flush()}}var t=e.prototype;return t.initialize=function(){this.onConfigChange(),this._disposed||this._visibilityListening||null==Mh||!Mh.addEventListener||(Ml(Mh,"visibilitychange",this._onVisibilityChange),this._visibilityListening=!0)},t.onConfigChange=function(){var e;if(!this._disposed){var t=!(null==(e=this._instance.config.metrics)||!e.network);t&&!this._stopNetworkMetrics?this._stopNetworkMetrics=rS(this._instance):!t&&this._stopNetworkMetrics&&(this._stopNetworkMetrics(),this._stopNetworkMetrics=void 0)}},t._getCore=function(){var e;if(!this._disposed){var t=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;if(!this._core||this._resolvedFrom!==t){var n;null==(n=this._core)||n.reset(),this._resolvedFrom=t;var r=function(e){var t,n,r,i,o,s=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==s?void 0:s["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(n=null==s?void 0:s["service.version"])&&void 0!==n?n:null==e?void 0:e.serviceVersion,environment:null!==(r=null==s?void 0:s["deployment.environment"])&&void 0!==r?r:null==e?void 0:e.environment,resourceAttributes:s,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i:1e4,maxSeriesPerFlush:null!==(o=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==o?o:1e3}}(t);ri(null==t?void 0:t.flushIntervalMs)&&(r.flushIntervalMs=6e4),this._core=new lu(this._createHost(),r,this._logger)}return this._core}},t.count=function(e,t,n){var r;void 0===t&&(t=1),null==(r=this._getCore())||r.count(e,t,n)},t.gauge=function(e,t,n){var r;null==(r=this._getCore())||r.gauge(e,t,n)},t.histogram=function(e,t,n){var r;null==(r=this._getCore())||r.histogram(e,t,n)},t.flush=function(e){var t=this;if(!this._core)return Promise.resolve();if(e){var n=this._core.drainWindow();return n&&this._sendMetricsBatch(n,e),Promise.resolve()}return this._core.flush().catch(function(e){return t._logger.error("PostHog metrics flush failed:",e)})},t.reset=function(){var e;null==(e=this._core)||e.reset()},t.dispose=function(){var e,t;this._disposed=!0,null==Mh||null==Mh.removeEventListener||Mh.removeEventListener("visibilitychange",this._onVisibilityChange),this._visibilityListening=!1,null==(e=this._stopNetworkMetrics)||e.call(this),this._stopNetworkMetrics=void 0,null==(t=this._core)||t.reset()},t._createHost=function(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},_sendMetricsBatch:function(e){return t._sendMetricsBatch(e)},getLibraryId:function(){return Jh.LIB_NAME},getLibraryVersion:function(){return Jh.LIB_VERSION}}},t._sendMetricsBatch=function(e,t){var n=this;return new Promise(function(r){var i=!1,o=function(e){i||(i=!0,clearTimeout(s),r(e))},s=setTimeout(function(){return o({kind:"retry-later",error:new Error("metrics request timed out")})},9e4);n._instance._send_request(d({method:"POST",url:n._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},"hidden"===(null==Mh?void 0:Mh.visibilityState)&&{preferSyncCompression:!0},{fireCallbackOnDrop:!0,callback:function(e){var t,n=e.statusCode;o(n>=200&&300>n?{kind:"ok"}:413===n?{kind:"too-large"}:0!==n&&408!==n&&429!==n&&500>n?{kind:"fatal",error:new Error("metrics request failed with status "+n)}:{kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:new Error("metrics request failed with status "+n)})}}))})},t._metricsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)},e}(),oS=new WeakMap,sS=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),aS={maxStringLength:2048,truncationSuffix:"..."},uS={maxStringLength:2048,truncationSuffix:"..."};function lS(e){if(e)return!0===e?{intent:!0,model:!0}:{intent:!1!==e.intent,model:!1!==e.model}}function cS(e,t){return{}.hasOwnProperty.call(e,t)}function dS(e,t){var n=Object.create(e);return t&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),n}function fS(e,t,n){if(void 0===n&&(n=!1),ii(e)){var r=e.trim();if(r)return(n?Ia(r,aS):r).slice(0,t)}}function hS(e){try{return ti(e)&&!0===e.isError}catch(e){return!1}}function pS(e){return Ia(e||"Unknown error",uS).slice(0,2048)}function _S(e,t){try{return pS(t?function(e){try{if(!ti(e)||!Xr(e.content))return;return e.content.filter(function(e){return ti(e)&&"text"===e.type&&ii(e.text)}).map(function(e){return e.text}).join(" ").trim()||void 0}catch(e){return}}(e):ti(e)&&ii(e.message)?e.message:ii(e)?e:String(e))}catch(e){return"Unknown error"}}function vS(e,t,n){return t.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:e.buildProperties(t.error,{handled:!0}).$exception_list.map(function(e){return d({},e,{value:pS(e.value)})})}function gS(e,t){if(t)return"Error";try{if(!ti(e))return"Error";var n=ii(e.name)?e.name.trim():"",r=e.constructor;return n&&"Error"!==n||!ei(r)||"Error"===r.name||(n=r.name),(n||"Error").slice(0,256)}catch(e){return"Error"}}function mS(e,t){return{message:_S(e,t),type:gS(e,t)}}if(ub.__defaultExtensionClasses=d({},{featureFlags:Ow,sessionRecording:Tb,autocapture:db,historyAutocapture:pb,heatmaps:Ab,deadClicksAutocapture:Fm,webVitalsAutocapture:Sb,exceptionObserver:hb,exceptions:xg,productTours:Lb,siteApps:qb,surveys:hg,tracingHeaders:vb,toolbar:Hb,experiments:qw,conversations:jw,logs:Kw,metrics:iS,webMCP:function(){"use strict";function e(e){this._instance=e,this._isPatched=!1}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this._instance.config.capture_webmcp&&!this._isPatched){var e=null==Mh?void 0:Mh.modelContext;if(e&&ei(e.registerTool)){var t=oS.get(e);if(t)return t.instances.add(this._instance),void(this._isPatched=!0);var n={instances:new Set([this._instance])},r=e.registerTool,i=this;Ng(e,"registerTool",function(e){var t=e;return function(e){for(var r=e,o=arguments.length,s=new Array(o>1?o-1:0),a=1;o>a;a++)s[a-1]=arguments[a];try{r=i._wrapTool(e,n)}catch(n){return t.call.apply(t,[this,e].concat(s))}return t.call.apply(t,[this,r].concat(s))}}),e.registerTool!==r&&(oS.set(e,n),this._isPatched=!0)}}},t._wrapTool=function(e,t){if(!e||!ei(e.execute))return e;var n=e.execute,r=this,i=function(e,t){var n={intent:!1,model:!1},r=e.inputSchema;if(!function(e){return!!ri(e)||ti(e)&&Object.keys(e).every(function(e){return sS.has(e)||e.startsWith("x-")})&&!0!==e.additionalProperties&&!ti(e.additionalProperties)&&(!e.type||"object"===e.type)&&(!e.properties||ti(e.properties))&&(!e.required||Xr(e.required))}(r))return{tool:dS(e),injected:n};var i=(null==r?void 0:r.properties)||{},o=function(e){return cS(i,e)||Xr(null==r?void 0:r.required)&&r.required.includes(e)};if(n.intent=t.intent&&!o("context"),n.model=t.model&&!o("llm_model"),!n.intent&&!n.model)return{tool:dS(e),injected:n};var s=d({},i),a=Xr(null==r?void 0:r.required)?[].concat(r.required):[];return n.intent&&(s.context={type:"string",description:'Explain why this tool is called and how it supports the user\'s goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".'},a.includes("context")||a.push("context")),n.model&&(s.llm_model={type:"string",description:'The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the site developer\'s analytics.'},a.includes("llm_model")||a.push("llm_model")),{tool:dS(e,d({},r,{type:(null==r?void 0:r.type)||"object",properties:s,required:a})),injected:n}}(e,function(e){for(var t,n={intent:!1,model:!1},r=p(e.instances);!(t=r()).done;){var i=lS(t.value.config.capture_webmcp);n.intent||(n.intent=!0===(null==i?void 0:i.intent)),n.model||(n.model=!0===(null==i?void 0:i.model))}return n}(t)),o=i.tool,s=i.injected;return Object.defineProperty(o,"execute",{configurable:!0,enumerable:!0,writable:!0,value:function(){for(var i=new Date,a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];var c,f,h=function(e,t){if(!ti(e))return{};try{var n=t.intent?fS(e.context,2048,!0):void 0,r=t.model?fS(e.llm_model,256):void 0;return d({},n&&"{}"!==n?{intent:n}:{},r&&"unknown"!==r.toLowerCase()?{model:r}:{})}catch(e){return{}}}(u[0],s),p=function(e,t){var n=e[0];if(!ti(n))return e;try{var r=t.intent&&cS(n,"context"),i=t.model&&cS(n,"llm_model");if(!r&&!i)return e;var o=d({},n);return r&&delete o.context,i&&delete o.llm_model,[o].concat(e.slice(1))}catch(t){return e}}(u,s);try{c=n.apply(this===o?e:this,p)}catch(e){throw r._captureToolCall(t,o,i,{error:e,errorResult:!1},h),e}if((f=c)&&"function"==typeof f.then)return Promise.resolve(c).then(function(e){var n=hS(e)?{error:e,errorResult:!0}:void 0;return r._captureToolCall(t,o,i,n,h),e},function(e){throw r._captureToolCall(t,o,i,{error:e,errorResult:!1},h),e});var _=hS(c)?{error:c,errorResult:!0}:void 0;return r._captureToolCall(t,o,i,_,h),c}}),o},t._captureToolCall=function(e,t,n,r,i){for(var o,s,a=Date.now()-n.getTime(),u=p(e.instances);!(s=u()).done;){var l,c=s.value,f=lS(c.config.capture_webmcp);if(f){r&&!o&&(o=mS(r.error,r.errorResult));try{c.capture("$mcp_tool_call",d({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:null==Oh?void 0:Oh.hostname,$mcp_duration_ms:a,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{},f.intent&&i.intent?{$mcp_intent:i.intent,$mcp_intent_source:"context_parameter"}:{},f.model&&i.model?{$mcp_llm_model:i.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch(e){continue}if(r&&o&&c.exceptions&&null!=(l=c.exceptionObserver)&&l.isEnabled)try{var h={$exception_list:vS(c.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:null==Oh?void 0:Oh.hostname};c.exceptionObserver.captureException(h)}catch(e){}}}},e}()}),function(){Jh.SDK_DIST_CHANNEL="cdn";var e=jh.posthog;if(!e||Xr(e._i)||!ei(e.init)){var t=jy[tb]=new ub;if(e){var n=[];Cl(e._i,function(r){if(r&&Xr(r)){var i=t.init(r[0],r[1],r[2]),o=e[r[2]]||e;i.__loaded&&-1===n.indexOf(o)&&(n.push(o),i._execute_array.call(i.people,o.people),i._execute_array(o))}});var r=e.people;if(!t.__loaded&&Xr(e)){var i=t.init,o=!0;t.init=function(n,s,a){var u=i.call(t,n,s,a);return o&&u===t&&u.__loaded&&(o=!1,t.init=i,u._execute_array.call(u.people,r),u._execute_array(e)),u}}}t.__SV=1,jh.posthog=t,function(){function e(){e.done||(e.done=!0,by=!1,Cl(jy,function(e){e._dom_loaded()}))}null!=Mh&&Mh.addEventListener?"complete"===Mh.readyState?e():Ml(Mh,"DOMContentLoaded",e,{capture:!1}):Ih&&Sl.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var yS="undefined"!=typeof performance?performance:{};yS.now=yS.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=yS)}}()}();
2
2
  //# sourceMappingURL=array.full.es5.js.map