posthog-js 1.426.3 → 1.426.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/conversations.js +1 -1
- package/dist/customizations.d.ts +3 -0
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +3 -0
- package/dist/module.full.d.ts +3 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +3 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.d.ts +3 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.d.ts +3 -0
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/src/posthog-featureflags.d.ts +3 -0
- package/lib/package.json +1 -1
- package/lib/src/posthog-featureflags.d.ts +3 -0
- package/lib/src/posthog-featureflags.js +41 -3
- package/lib/src/posthog-featureflags.js.map +1 -1
- package/package.json +6 -6
package/dist/array.full.es5.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var e,t,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={};function i(){if(t)return e;t=1;var r=function(e){return e&&e.Math===Math&&e};return e=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")()}var o,s,a,u,l,c,d,f,h={};function p(){return s?o:(s=1,o=function(e){try{return!!e()}catch(e){return!0}})}function _(){if(u)return a;u=1;var e=p();return a=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function v(){if(c)return l;c=1;var e=p();return l=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function g(){if(f)return d;f=1;var e=v(),t=function(){}.call;return d=e?t.bind(t):function(){return t.apply(t,arguments)},d}var m,y,b,w,S,k,x,C,E,P,T,I,F,R,L,A,O,M,D,q,N,B,H,j,U,V,z,W,G,Q,K,Z,Y,J,X,ee,te,ne,re,ie,oe,se={};function ae(){if(m)return se;m=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return se.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,se}function ue(){return b?y:(b=1,y=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function le(){if(S)return w;S=1;var e=v(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return w=e?r:function(e){return function(){return n.apply(e,arguments)}},w}function ce(){if(x)return k;x=1;var e=le(),t=e({}.toString),n=e("".slice);return k=function(e){return n(t(e),8,-1)}}function de(){return T?P:(T=1,P=function(e){return null==e})}function fe(){if(F)return I;F=1;var e=de(),t=TypeError;return I=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function he(){if(L)return R;L=1;var e=function(){if(E)return C;E=1;var e=le(),t=p(),n=ce(),r=Object,i=e("".split);return C=t((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?i(e,""):r(e)}:r}(),t=fe();return R=function(n){return e(t(n))}}function pe(){if(O)return A;O=1;var e="object"==typeof document&&document.all;return A=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function _e(){if(D)return M;D=1;var e=pe();return M=function(t){return"object"==typeof t?null!==t:e(t)}}function ve(){if(N)return q;N=1;var e=i(),t=pe();return q=function(n,r){return 2>arguments.length?t(i=e[n])?i:void 0:e[n]&&e[n][r];var i},q}function ge(){if(H)return B;H=1;var e=le();return B=e({}.isPrototypeOf)}function me(){if(U)return j;U=1;var e=i().navigator,t=e&&e.userAgent;return j=t?String(t):""}function ye(){if(z)return V;z=1;var e,t,n=i(),r=me(),o=n.process,s=n.Deno,a=o&&o.versions||s&&s.version,u=a&&a.v8;return u&&(t=(e=u.split("."))[0]>0&&4>e[0]?1:+(e[0]+e[1])),!t&&r&&((e=r.match(/Edge\/(\d+)/))&&74>e[1]||(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1])),V=t}function be(){if(G)return W;G=1;var e=ye(),t=p(),n=i().String;return W=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&41>e}))}function we(){if(K)return Q;K=1;var e=be();return Q=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Se(){if(Y)return Z;Y=1;var e=ve(),t=pe(),n=ge(),r=we(),i=Object;return Z=r?function(e){return"symbol"==typeof e}:function(r){var o=e("Symbol");return t(o)&&n(o.prototype,i(r))}}function ke(){if(X)return J;X=1;var e=String;return J=function(t){try{return e(t)}catch(e){return"Object"}}}function xe(){if(te)return ee;te=1;var e=pe(),t=ke(),n=TypeError;return ee=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Ce(){if(re)return ne;re=1;var e=xe(),t=de();return ne=function(n,r){var i=n[r];return t(i)?void 0:e(i)},ne}function Ee(){if(oe)return ie;oe=1;var e=g(),t=pe(),n=_e(),r=TypeError;return ie=function(i,o){var s,a;if("string"===o&&t(s=i.toString)&&!n(a=e(s,i)))return a;if(t(s=i.valueOf)&&!n(a=e(s,i)))return a;if("string"!==o&&t(s=i.toString)&&!n(a=e(s,i)))return a;throw new r("Can't convert object to primitive value")}}var Pe,Te,Ie,Fe,Re,Le,Ae,Oe,Me,De,qe,$e,Ne,Be,He,je,Ue,Ve,ze,We,Ge,Qe,Ke,Ze,Ye={exports:{}};function Je(){return Te?Pe:(Te=1,Pe=!1)}function Xe(){if(Fe)return Ie;Fe=1;var e=i(),t=Object.defineProperty;return Ie=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function et(){if(Re)return Ye.exports;Re=1;var e=Je(),t=i(),n=Xe(),r="__core-js_shared__",o=Ye.exports=t[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.49.0",mode:e?"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"}),Ye.exports}function tt(){if(Ae)return Le;Ae=1;var e=et();return Le=function(t,n){return e[t]||(e[t]=n||{})}}function nt(){if(Me)return Oe;Me=1;var e=fe(),t=Object;return Oe=function(n){return t(e(n))}}function rt(){if(qe)return De;qe=1;var e=le(),t=nt(),n=e({}.hasOwnProperty);return De=Object.hasOwn||function(e,r){return n(t(e),r)}}function it(){if(Ne)return $e;Ne=1;var e=le(),t=0,n=Math.random(),r=e(1.1.toString);return $e=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function ot(){if(He)return Be;He=1;var e=i(),t=tt(),n=rt(),r=it(),o=be(),s=we(),a=e.Symbol,u=t("wks"),l=s?a.for||a:a&&a.withoutSetter||r;return Be=function(e){return n(u,e)||(u[e]=o&&n(a,e)?a[e]:l("Symbol."+e)),u[e]}}function st(){if(Ue)return je;Ue=1;var e=g(),t=_e(),n=Se(),r=Ce(),i=Ee(),o=ot(),s=TypeError,a=o("toPrimitive");return je=function(o,u){if(!t(o)||n(o))return o;var l,c=r(o,a);if(c){if(void 0===u&&(u="default"),l=e(c,o,u),!t(l)||n(l))return l;throw new s("Can't convert object to primitive value")}return void 0===u&&(u="number"),i(o,u)}}function at(){if(ze)return Ve;ze=1;var e=st(),t=Se();return Ve=function(n){var r=e(n,"string");return t(r)?r:r+""}}function ut(){if(Ge)return We;Ge=1;var e=i(),t=_e(),n=e.document,r=t(n)&&t(n.createElement);return We=function(e){return r?n.createElement(e):{}}}function lt(){if(Ke)return Qe;Ke=1;var e=_(),t=p(),n=ut();return Qe=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function ct(){if(Ze)return h;Ze=1;var e=_(),t=g(),n=ae(),r=ue(),i=he(),o=at(),s=rt(),a=lt(),u=Object.getOwnPropertyDescriptor;return h.f=e?u:function(e,l){if(e=i(e),l=o(l),a)try{return u(e,l)}catch(e){}if(s(e,l))return r(!t(n.f,e,l),e[l])},h}var dt,ft,ht,pt,_t,vt,gt,mt={};function yt(){if(ft)return dt;ft=1;var e=_(),t=p();return dt=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function bt(){if(pt)return ht;pt=1;var e=_e(),t=String,n=TypeError;return ht=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function wt(){if(_t)return mt;_t=1;var e=_(),t=lt(),n=yt(),r=bt(),i=at(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return mt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var o=a(e,t);o&&o[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:o[l],enumerable:u in n?n[u]:o[u],writable:!1})}return s(e,t,n)}:s:function(e,n,a){if(r(e),n=i(n),r(a),t)try{return s(e,n,a)}catch(e){}if("get"in a||"set"in a)throw new o("Accessors not supported");return"value"in a&&(e[n]=a.value),e},mt}function St(){if(gt)return vt;gt=1;var e=_(),t=wt(),n=ue();return vt=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}var kt,xt,Ct,Et,Pt,Tt,It,Ft,Rt,Lt,At,Ot,Mt,Dt,qt,$t={exports:{}};function Nt(){if(xt)return kt;xt=1;var e=_(),t=rt(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,"name"),o=i&&"something"===function(){}.name,s=i&&(!e||e&&r(n,"name").configurable);return kt={EXISTS:i,PROPER:o,CONFIGURABLE:s}}function Bt(){if(Et)return Ct;Et=1;var e=le(),t=pe(),n=et(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Ct=n.inspectSource}function Ht(){if(Ft)return It;Ft=1;var e=tt(),t=it(),n=e("keys");return It=function(e){return n[e]||(n[e]=t(e))}}function jt(){return Lt?Rt:(Lt=1,Rt={})}function Ut(){if(Ot)return At;Ot=1;var e,t,n,r=function(){if(Tt)return Pt;Tt=1;var e=i(),t=pe(),n=e.WeakMap;return Pt=t(n)&&/native code/.test(String(n))}(),o=i(),s=_e(),a=St(),u=rt(),l=et(),c=Ht(),d=jt(),f="Object already initialized",h=o.TypeError;if(r||l.state){var p=l.state||(l.state=new(0,o.WeakMap));p.get=p.get,p.has=p.has,p.set=p.set,e=function(e,t){if(p.has(e))throw new h(f);return t.facade=e,p.set(e,t),t},t=function(e){return p.get(e)||{}},n=function(e){return p.has(e)}}else{var _=c("state");d[_]=!0,e=function(e,t){if(u(e,_))throw new h(f);return t.facade=e,a(e,_,t),t},t=function(e){return u(e,_)?e[_]:{}},n=function(e){return u(e,_)}}return At={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!s(n)||(r=t(n)).type!==e)throw new h("Incompatible receiver, "+e+" required");return r}}}}function Vt(){if(Mt)return $t.exports;Mt=1;var e=le(),t=p(),n=pe(),r=rt(),i=_(),o=Nt().CONFIGURABLE,s=Bt(),a=Ut(),u=a.enforce,l=a.get,c=String,d=Object.defineProperty,f=e("".slice),h=e("".replace),v=e([].join),g=i&&!t((function(){return 8!==d((function(){}),"length",{value:8}).length})),m=String(String).split("String"),y=$t.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+h(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||o&&e.name!==t)&&(i?d(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&r(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=u(e);return r(s,"source")||(s.source=v(m,"string"==typeof t?t:"")),e};return Function.prototype.toString=y((function(){return n(this)&&l(this).source||s(this)}),"toString"),$t.exports}function zt(){if(qt)return Dt;qt=1;var e=pe(),t=wt(),n=Vt(),r=Xe();return Dt=function(i,o,s,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:o;if(e(s)&&n(s,l,a),a.global)u?i[o]=s:r(o,s);else{try{a.unsafe?i[o]&&(u=!0):delete i[o]}catch(e){}u?i[o]=s:t.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},Dt}var Wt,Gt,Qt,Kt,Zt,Yt,Jt,Xt,en,tn,nn,rn,on,sn,an,un,ln,cn={};function dn(){if(Kt)return Qt;Kt=1;var e=function(){if(Gt)return Wt;Gt=1;var e=Math.ceil,t=Math.floor;return Wt=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},Wt}();return Qt=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function fn(){if(Yt)return Zt;Yt=1;var e=dn(),t=Math.max,n=Math.min;return Zt=function(r,i){var o=e(r);return 0>o?t(o+i,0):n(o,i)}}function hn(){if(Xt)return Jt;Xt=1;var e=dn(),t=Math.min;return Jt=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function pn(){if(tn)return en;tn=1;var e=hn();return en=function(t){return e(t.length)}}function _n(){if(sn)return on;sn=1;var e=le(),t=rt(),n=he(),r=function(){if(rn)return nn;rn=1;var e=he(),t=fn(),n=pn(),r=function(r){return function(i,o,s){var a=e(i),u=n(a);if(0===u)return!r&&-1;var l,c=t(s,u);if(r&&o!=o){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((r||c in a)&&a[c]===o)return r||c||0;return!r&&-1}};return nn={includes:r(!0),indexOf:r(!1)}}().indexOf,i=jt(),o=e([].push);return on=function(e,s){var a,u=n(e),l=0,c=[];for(a in u)!t(i,a)&&t(u,a)&&o(c,a);for(;s.length>l;)t(u,a=s[l++])&&(~r(c,a)||o(c,a));return c},on}function vn(){return un?an:(un=1,an=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var gn,mn,yn,bn,wn,Sn,kn,xn,Cn,En,Pn,Tn,In,Fn,Rn,Ln,An,On,Mn,Dn,qn,$n,Nn,Bn,Hn,jn,Un,Vn,zn,Wn={};function Gn(){if(yn)return mn;yn=1;var e=ve(),t=le(),n=function(){if(ln)return cn;ln=1;var e=_n(),t=vn().concat("length","prototype");return cn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},cn}(),r=(gn||(gn=1,Wn.f=Object.getOwnPropertySymbols),Wn),i=bt(),o=t([].concat);return mn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),s=r.f;return s?o(t,s(e)):t}}function Qn(){if(wn)return bn;wn=1;var e=rt(),t=Gn(),n=ct(),r=wt();return bn=function(i,o,s){for(var a=t(o),u=r.f,l=n.f,c=0;a.length>c;c++){var d=a[c];e(i,d)||s&&e(s,d)||u(i,d,l(o,d))}},bn}function Kn(){if(kn)return Sn;kn=1;var e=p(),t=pe(),n=/#|\.prototype\./,r=function(n,r){var u=o[i(n)];return u===a||u!==s&&(t(r)?e(r):!!r)},i=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return Sn=r}function Zn(){if(Cn)return xn;Cn=1;var e=i(),t=ct().f,n=St(),r=zt(),o=Xe(),s=Qn(),a=Kn();return xn=function(i,u){var l,c,d,f,h,p=i.target,_=i.global,v=i.stat;if(l=_?e:v?e[p]||o(p,{}):e[p]&&e[p].prototype)for(c in u){if(f=u[c],d=i.dontCallGetSet?(h=t(l,c))&&h.value:l[c],!a(_?c:p+(v?".":"#")+c,i.forced)&&void 0!==d){if(typeof f==typeof d)continue;s(f,d)}(i.sham||d&&d.sham)&&n(f,"sham",!0),r(l,c,f,i)}}}function Yn(){if(In)return Tn;In=1;var e=rt(),t=pe(),n=nt(),r=Ht(),i=function(){if(Pn)return En;Pn=1;var e=p();return En=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Tn=i?s.getPrototypeOf:function(r){var i=n(r);if(e(i,o))return i[o];var u=i.constructor;return t(u)&&i instanceof u?u.prototype:i instanceof s?a:null},Tn}function Jn(){if(Rn)return Fn;Rn=1;var e=_n(),t=vn();return Fn=Object.keys||function(n){return e(n,t)},Fn}function Xn(){if(Dn)return Mn;Dn=1;var e=i();return Mn=e}function er(){if(Bn)return Nn;Bn=1;var e=function(){if($n)return qn;$n=1,function(){if(On)return r;On=1;var $=Zn(),e=function(){if(An)return Ln;An=1;var e=_(),t=p(),n=le(),r=Yn(),i=Jn(),o=he(),s=n(ae().f),a=n([].push),u=e&&t((function(){var e=Object.create(null);return e[2]=2,!s(e,2)})),l=function(t){return function(n){for(var l,c=o(n),d=i(c),f=u&&null===r(c),h=d.length,p=0,_=[];h>p;)l=d[p++],e&&!(f?l in c:s(c,l))||a(_,t?[l,c[l]]:c[l]);return _}};return Ln={entries:l(!0),values:l(!1)}}().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}();var e=Xn();return qn=e.Object.entries}();return Nn=e}zn||(zn=1,function(){if(Vn)return Un;Vn=1;var e=function(){if(jn)return Hn;jn=1;var e=er();return Hn=e}();Un=e}());var tr,nr,rr,ir,or,sr,ar,ur,lr,cr,dr,fr,hr,pr,_r,vr,gr,mr,yr,br,wr,Sr,kr,xr,Cr,Er,Pr,Tr,Ir,Fr={};function Rr(){if(rr)return nr;rr=1;var e=ve();return nr=e("document","documentElement")}function Lr(){if(or)return ir;or=1;var e,t=bt(),n=function(){if(tr)return Fr;tr=1;var e=_(),t=yt(),n=wt(),r=bt(),i=he(),o=Jn();return Fr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var s,a=i(t),u=o(t),l=u.length,c=0;l>c;)n.f(e,s=u[c++],a[s]);return e},Fr}(),r=vn(),i=jt(),o=Rr(),s=ut(),a=Ht(),u="prototype",l="script",c=a("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+"</"+l+">"},h=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},p=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;p="undefined"!=typeof document?document.domain&&e?h(e):(n=s("iframe"),i="java"+l+":",n.style.display="none",o.appendChild(n),n.src=String(i),(t=n.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F):h(e);for(var a=r.length;a--;)delete p[u][r[a]];return p()};return i[c]=!0,ir=Object.create||function(e,r){var i;return null!==e?(d[u]=t(e),i=new d,d[u]=null,i[c]=e):i=p(),void 0===r?i:n.f(i,r)},ir}function Ar(){if(ar)return sr;ar=1;var e=ot(),t=Lr(),n=wt().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),sr=function(e){i[r][e]=!0}}function Or(){return lr?ur:(lr=1,ur={})}function Mr(){if(dr)return cr;dr=1;var e,t,n,r=p(),i=pe(),o=_e(),s=Lr(),a=Yn(),u=zt(),l=ot(),c=Je(),d=l("iterator"),f=!1;return[].keys&&("next"in(n=[].keys())?(t=a(a(n)))!==Object.prototype&&(e=t):f=!0),!o(e)||r((function(){var t={};return e[d].call(t)!==t}))?e={}:c&&(e=s(e)),i(e[d])||u(e,d,(function(){return this})),cr={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:f}}function Dr(){if(hr)return fr;hr=1;var e=wt().f,t=rt(),n=ot()("toStringTag");return fr=function(r,i,o){r&&!o&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function qr(){if(yr)return mr;yr=1;var e=_e();return mr=function(t){return e(t)||null===t}}function $r(){if(wr)return br;wr=1;var e=qr(),t=String,n=TypeError;return br=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function Nr(){if(kr)return Sr;kr=1;var e=function(){if(gr)return vr;gr=1;var e=le(),t=xe();return vr=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}(),t=_e(),n=fe(),r=$r();return Sr=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,s={};try{(i=e(Object.prototype,"__proto__","set"))(s,[]),o=s instanceof Array}catch(e){}return function(e,s){return n(e),r(s),t(e)?(o?i(e,s):e.__proto__=s,e):e}}():void 0),Sr}function Br(){if(Cr)return xr;Cr=1;var $=Zn(),e=g(),t=Je(),n=Nt(),r=pe(),i=function(){if(_r)return pr;_r=1;var e=Mr().IteratorPrototype,t=Lr(),n=ue(),r=Dr(),i=Or(),o=function(){return this};return pr=function(s,a,u,l){var c=a+" Iterator";return s.prototype=t(e,{next:n(+!l,u)}),r(s,c,!1,!0),i[c]=o,s},pr}(),o=Yn(),s=Nr(),a=Dr(),u=St(),l=zt(),c=ot(),d=Or(),f=Mr(),h=n.PROPER,p=n.CONFIGURABLE,_=f.IteratorPrototype,v=f.BUGGY_SAFARI_ITERATORS,m=c("iterator"),y="keys",b="values",w="entries",S=function(){return this};return xr=function(n,c,f,g,k,x,C){i(f,c,g);var E,P,T,I=function(e){if(e===k&&O)return O;if(!v&&e&&e in L)return L[e];switch(e){case y:case b:case w:return function(){return new f(this,e)}}return function(){return new f(this)}},F=c+" Iterator",R=!1,L=n.prototype,A=L[m]||L["@@iterator"]||k&&L[k],O=!v&&A||I(k),M="Array"===c&&L.entries||A;if(M&&(E=o(M.call(new n)))!==Object.prototype&&E.next&&(t||o(E)===_||(s?s(E,_):r(E[m])||l(E,m,S)),a(E,F,!0,!0),t&&(d[F]=S)),h&&k===b&&A&&A.name!==b&&(!t&&p?u(L,"name",b):(R=!0,O=function(){return e(A,this)})),k)if(P={values:I(b),keys:x?O:I(y),entries:I(w)},C)for(T in P)(v||R||!(T in L))&&l(L,T,P[T]);else $({target:c,proto:!0,forced:v||R},P);return t&&!C||L[m]===O||l(L,m,O,{name:k}),d[c]=O,P},xr}function Hr(){return Pr?Er:(Pr=1,Er=function(e,t){return{value:e,done:t}})}function jr(){if(Ir)return Tr;Ir=1;var e=he(),t=Ar(),n=Or(),r=Ut(),i=wt().f,o=Br(),s=Hr(),a=Je(),u=_(),l="Array Iterator",c=r.set,d=r.getterFor(l);Tr=o(Array,"Array",(function(t,n){c(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,s(void 0,!0);switch(e.kind){case"keys":return s(n,!1);case"values":return s(t[n],!1)}return s([n,t[n]],!1)}),"values");var f=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!a&&u&&"values"!==f.name)try{i(f,"name",{value:"values"})}catch(e){}return Tr}var Ur,Vr,zr,Wr,Gr,Qr,Kr,Zr,Yr,Jr,Xr,ei,ti,ni,ri,ii,oi,si,ai,ui,li,ci,di,fi={};function hi(){if(Wr)return zr;Wr=1;var e=function(){if(Vr)return Ur;Vr=1;var e=ce(),t=le();return Ur=function(n){if("Function"===e(n))return t(n)}}(),t=xe(),n=v(),r=e(e.bind);return zr=function(e,i){return t(e),void 0===i?e:n?r(e,i):function(){return e.apply(i,arguments)}},zr}function pi(){if(Qr)return Gr;Qr=1;var e=ot(),t=Or(),n=e("iterator"),r=Array.prototype;return Gr=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function _i(){if(Zr)return Kr;Zr=1;var e={};return e[ot()("toStringTag")]="z",Kr="[object z]"===String(e)}function vi(){if(Jr)return Yr;Jr=1;var e=_i(),t=pe(),n=ce(),r=ot()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Yr=e?n:function(e){var s,a,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(a=function(e,t){try{return e[t]}catch(e){}}(s=i(e),r))?a:o?n(s):"Object"===(u=n(s))&&t(s.callee)?"Arguments":u},Yr}function gi(){if(ei)return Xr;ei=1;var e=vi(),t=Ce(),n=de(),r=Or(),i=ot()("iterator");return Xr=function(o){if(!n(o))return t(o,i)||t(o,"@@iterator")||r[e(o)]}}function mi(){if(ni)return ti;ni=1;var e=g(),t=xe(),n=bt(),r=ke(),i=gi(),o=TypeError;return ti=function(s,a){var u=2>arguments.length?i(s):a;if(t(u))return n(e(u,s));throw new o(r(s)+" is not iterable")},ti}function yi(){if(ii)return ri;ii=1;var e=g(),t=bt(),n=Ce();return ri=function(r,i,o){var s,a;t(r);try{if(!(s=n(r,"return"))){if("throw"===i)throw o;return o}s=e(s,r)}catch(e){a=!0,s=e}if("throw"===i)throw o;if(a)throw s;return t(s),o}}function bi(){if(si)return oi;si=1;var e=hi(),t=g(),n=bt(),r=ke(),i=pi(),o=pn(),s=ge(),a=mi(),u=gi(),l=yi(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return oi=function(h,p,_){var v,g,m,y,b,w,S,k=!(!_||!_.AS_ENTRIES),x=!(!_||!_.IS_RECORD),C=!(!_||!_.IS_ITERATOR),E=!(!_||!_.INTERRUPTED),P=e(p,_&&_.that),T=function(e){var t=v;return v=void 0,t&&l(t,"normal"),new d(!0,e)},I=function(e){return k?(n(e),E?P(e[0],e[1],T):P(e[0],e[1])):E?P(e,T):P(e)};if(x)v=h.iterator;else if(C)v=h;else{if(!(g=u(h)))throw new c(r(h)+" is not iterable");if(i(g)){for(m=0,y=o(h);y>m;m++)if((b=I(h[m]))&&s(f,b))return b;return new d(!1)}v=a(h,g)}for(w=x?h.next:v.next;!(S=t(w,v)).done;){var F=S.value;try{b=I(F)}catch(e){if(!v)throw e;l(v,"throw",e)}if("object"==typeof b&&b&&s(f,b))return b}return new d(!1)}}function wi(){if(ui)return ai;ui=1;var e=_(),t=wt(),n=ue();return ai=function(r,i,o){e?t.f(r,i,n(0,o)):r[i]=o}}var Si,ki,xi,Ci,Ei,Pi,Ti,Ii,Fi,Ri,Li,Ai,Oi={};function Mi(){if(Ei)return Oi;Ei=1;var e=i(),t=ki?Si:(ki=1,Si={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}),n=function(){if(Ci)return xi;Ci=1;var e=ut()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return xi=t===Object.prototype?void 0:t}(),r=jr(),o=St(),s=Dr(),a=ot()("iterator"),u=r.values,l=function(e,n){if(e){if(e[a]!==u)try{o(e,a,u)}catch(t){e[a]=u}if(s(e,n,!0),t[n])for(var i in r)if(e[i]!==r[i])try{o(e,i,r[i])}catch(t){e[i]=r[i]}}};for(var c in t)l(e[c]&&e[c].prototype,c);return l(n,"DOMTokenList"),Oi}function Di(){if(Fi)return Ii;Fi=1;var e=function(){if(Ti)return Pi;Ti=1;var e=function(){if(di)return ci;di=1,jr(),function(){if(li)return fi;li=1;var $=Zn(),e=bi(),t=wi();$({target:"Object",stat:!0},{fromEntries:function(n){var r={};return e(n,(function(e,n){t(r,e,n)}),{AS_ENTRIES:!0}),r}})}();var e=Xn();return ci=e.Object.fromEntries}();return Mi(),Pi=e}();return Ii=e}Ai||(Ai=1,function(){if(Li)return Ri;Li=1;var e=Di();Ri=e}());var qi,$i,Ni,Bi,Hi,ji,Ui,Vi,zi,Wi,Gi,Qi,Ki,Zi,Yi={},Ji={};function Xi(){if($i)return qi;$i=1;var e=_e(),t=St();return qi=function(n,r){e(r)&&"cause"in r&&t(n,"cause",r.cause)},qi}function eo(){if(Wi)return zi;Wi=1;var e=vi(),t=String;return zi=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function to(){if(Qi)return Gi;Qi=1;var e=eo();return Gi=function(t,n){return void 0===t?2>arguments.length?"":n:e(t)},Gi}function no(){return Zi||(Zi=1,function(){if(Ki)return Ji;Ki=1;var $=Zn(),e=ge(),t=Yn(),n=Nr(),r=Qn(),i=Lr(),o=St(),s=ue(),a=Xi(),u=function(){if(Vi)return Ui;Vi=1;var e=St(),t=function(){if(Bi)return Ni;Bi=1;var e=le(),t=Error,n=e("".replace),r=String(new t("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(r);return Ni=function(e,r){if(o&&"string"==typeof e&&!t.prepareStackTrace)for(;r--;)e=n(e,i,"");return e}}(),n=function(){if(ji)return Hi;ji=1;var e=p(),t=ue();return Hi=!e((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",t(1,7)),7!==e.stack)}))}(),r=Error.captureStackTrace;return Ui=function(i,o,s,a){n&&(r?r(i,o):e(i,"stack",t(s,a)))},Ui}(),l=bi(),c=to(),d=ot()("toStringTag"),f=Error,h=[].push,_=function(r,s){var p,g=e(v,this);n?p=n(new f,g?t(this):v):(p=g?this:i(v),o(p,d,"Error")),void 0!==s&&o(p,"message",c(s)),u(p,_,p.stack,1),arguments.length>2&&a(p,arguments[2]);var m=[];return l(r,h,{that:m}),o(p,"errors",m),p};n?n(_,f):r(_,f,{name:!0});var v=_.prototype=i(f.prototype,{constructor:s(1,_),message:s(1,""),name:s(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:_})}()),Yi}var ro,io,oo,so={};var ao,uo,lo,co,fo,ho,po,_o,vo,go,mo,yo,bo,wo,So,ko,xo,Co,Eo,Po,To,Io,Fo,Ro,Lo,Ao,Oo,Mo,Do,qo,$o,No,Bo,Ho,jo,Uo,Vo,zo,Wo,Go,Qo,Ko,Zo,Yo,Jo={},Xo={};function es(){if(uo)return ao;uo=1;var e=i(),t=me(),n=ce(),r=function(e){return t.slice(0,e.length)===e};return ao=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":e.Bun&&"string"==typeof Bun.version?"BUN":e.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(e.process)?"NODE":e.window&&e.document?"BROWSER":"REST"}function ts(){if(co)return lo;co=1;var e=es();return lo="NODE"===e}function ns(){if(ho)return fo;ho=1;var e=Vt(),t=wt();return fo=function(n,r,i){return i.get&&e(i.get,r,{getter:!0}),i.set&&e(i.set,r,{setter:!0}),t.f(n,r,i)}}function rs(){if(_o)return po;_o=1;var e=ve(),t=ns(),n=ot(),r=_(),i=n("species");return po=function(n){var o=e(n);r&&o&&!o[i]&&t(o,i,{configurable:!0,get:function(){return this}})}}function is(){if(go)return vo;go=1;var e=ge(),t=TypeError;return vo=function(n,r){if(e(r,n))return n;throw new t("Incorrect invocation")}}function os(){if(yo)return mo;yo=1;var e=le(),t=p(),n=pe(),r=vi(),i=ve(),o=Bt(),s=function(){},a=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=e(u.exec),c=!u.test(s),d=function(e){if(!n(e))return!1;try{return a(s,[],e),!0}catch(e){return!1}},f=function(e){if(!n(e))return!1;switch(r(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,o(e))}catch(e){return!0}};return f.sham=!0,mo=!a||t((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?f:d}function ss(){if(wo)return bo;wo=1;var e=os(),t=ke(),n=TypeError;return bo=function(r){if(e(r))return r;throw new n(t(r)+" is not a constructor")}}function as(){if(ko)return So;ko=1;var e=bt(),t=ss(),n=de(),r=ot()("species");return So=function(i,o){var s,a=e(i).constructor;return void 0===a||n(s=e(a)[r])?o:t(s)},So}function us(){if(Co)return xo;Co=1;var e=v(),t=Function.prototype,n=t.apply,r=t.call;return xo="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),xo}function ls(){if(Po)return Eo;Po=1;var e=le();return Eo=e([].slice)}function cs(){if(Io)return To;Io=1;var e=TypeError;return To=function(t,n){if(n>t)throw new e("Not enough arguments");return t}}function ds(){if(Ro)return Fo;Ro=1;var e=me();return Fo=/ipad|iphone|ipod/i.test(e)&&/applewebkit/i.test(e)}function fs(){if(Ao)return Lo;Ao=1;var e,t,n,r,o=i(),s=us(),a=hi(),u=pe(),l=rt(),c=p(),d=Rr(),f=ls(),h=ut(),_=cs(),v=ds(),g=ts(),m=o.setImmediate,y=o.clearImmediate,b=o.process,w=o.Dispatch,S=o.Function,k=o.MessageChannel,x=o.String,C=0,E={},P="onreadystatechange";c((function(){e=o.location}));var T=function(e){if(l(E,e)){var t=E[e];delete E[e],t()}},I=function(e){return function(){T(e)}},F=function(e){T(e.data)},R=function(t){o.postMessage(x(t),e.protocol+"//"+e.host)};return m&&y||(m=function(e){_(arguments.length,1);var n=u(e)?e:S(e),r=f(arguments,1);return E[++C]=function(){s(n,void 0,r)},t(C),C},y=function(e){delete E[e]},g?t=function(e){b.nextTick(I(e))}:w&&w.now?t=function(e){w.now(I(e))}:k&&!v?(r=(n=new k).port2,n.port1.onmessage=F,t=a(r.postMessage,r)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&e&&"file:"!==e.protocol&&!c(R)?(t=R,o.addEventListener("message",F,!1)):t=P in h("script")?function(e){d.appendChild(h("script"))[P]=function(){d.removeChild(this),T(e)}}:function(e){setTimeout(I(e),0)}),Lo={set:m,clear:y}}function hs(){if(Mo)return Oo;Mo=1;var e=i(),t=_(),n=Object.getOwnPropertyDescriptor;return Oo=function(r){if(!t)return e[r];var i=n(e,r);return i&&i.value}}function ps(){if(qo)return Do;qo=1;var e=function(){this.head=null,this.tail=null};return e.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}},Do=e}function _s(){return zo||(zo=1,Vo=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}),Vo}function vs(){return Go?Wo:(Go=1,Wo=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}})}function gs(){if(Ko)return Qo;Ko=1;var e=i();return Qo=e.Promise}function ms(){if(Yo)return Zo;Yo=1;var e=i(),t=gs(),n=pe(),r=Kn(),o=Bt(),s=ot(),a=es(),u=Je(),l=ye(),c=t&&t.prototype,d=s("species"),f=!1,h=n(e.PromiseRejectionEvent),p=r("Promise",(function(){var e=o(t),n=e!==String(t);if(!n&&66===l)return!0;if(u&&(!c.catch||!c.finally))return!0;if(!l||51>l||!/native code/.test(e)){var r=new t((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((r.constructor={})[d]=i,!(f=r.then((function(){}))instanceof i))return!0}return!(n||"BROWSER"!==a&&"DENO"!==a||h)}));return Zo={CONSTRUCTOR:p,REJECTION_EVENT:h,SUBCLASSING:f}}var ys,bs,ws={};function Ss(){if(ys)return ws;ys=1;var e=xe(),t=TypeError,n=function(n){var r,i;this.promise=new n((function(e,n){if(void 0!==r||void 0!==i)throw new t("Bad Promise constructor");r=e,i=n})),this.resolve=e(r),this.reject=e(i)};return ws.f=function(e){return new n(e)},ws}var ks,xs,Cs,Es,Ps,Ts={};function Is(){if(xs)return ks;xs=1;var e=ot()("iterator"),t=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){t=!0}};r[e]=function(){return this},Array.from(r,(function(){throw 2}))}catch(e){}return ks=function(n,r){try{if(!r&&!t)return!1}catch(e){return!1}var i=!1;try{var o={};o[e]=function(){return{next:function(){return{done:i=!0}}}},n(o)}catch(e){}return i}}function Fs(){if(Es)return Cs;Es=1;var e=gs(),t=Is(),n=ms().CONSTRUCTOR;return Cs=n||!t((function(t){e.all(t).then(void 0,(function(){}))}))}var Rs,Ls,As,Os,Ms,Ds,qs,$s={},Ns={},Bs={},Hs={};function js(){if(Ms)return Os;Ms=1;var e=bt(),t=_e(),n=Ss();return Os=function(r,i){if(e(r),t(i)&&i.constructor===r)return i;var o=n.f(r);return(0,o.resolve)(i),o.promise},Os}function Us(){return qs||(qs=1,function(){if(bs)return Xo;bs=1;var e,t,n,r,$=Zn(),o=Je(),s=ts(),a=i(),u=Xn(),l=g(),c=zt(),d=Nr(),f=Dr(),h=rs(),p=xe(),_=pe(),v=_e(),m=is(),y=as(),b=fs().set,w=function(){if(Uo)return jo;Uo=1;var e,t,n,r,o,s=i(),a=hs(),u=hi(),l=fs().set,c=ps(),d=ds(),f=function(){if(No)return $o;No=1;var e=me();return $o=/ipad|iphone|ipod/i.test(e)&&"undefined"!=typeof Pebble}(),h=function(){if(Ho)return Bo;Ho=1;var e=me();return Bo=/web0s(?!.*chrome)/i.test(e)}(),p=ts(),_=s.MutationObserver||s.WebKitMutationObserver,v=s.document,g=s.process,m=s.Promise,y=a("queueMicrotask");if(!y){var b=new c,w=function(){var t,n;for(p&&(t=g.domain)&&t.exit();n=b.get();)try{n()}catch(t){throw b.head&&e(),t}t&&t.enter()};d||p||h||!_||!v?!f&&m&&m.resolve?((r=m.resolve(void 0)).constructor=m,o=u(r.then,r),e=function(){o(w)}):p?e=function(){g.nextTick(w)}:(l=u(l,s),e=function(){l(w)}):(t=!0,n=v.createTextNode(""),new _(w).observe(n,{characterData:!0}),e=function(){n.data=t=!t}),y=function(t){b.head||e(),b.add(t)}}return jo=y}(),S=_s(),k=vs(),x=ps(),C=Ut(),E=gs(),P=ms(),T=Ss(),I="Promise",F=P.CONSTRUCTOR,R=P.REJECTION_EVENT,L=P.SUBCLASSING,A=C.getterFor(I),O=C.set,M=E&&E.prototype,D=E,q=M,N=a.TypeError,B=a.document,H=a.process,j=T.f,U=j,V=!!(B&&B.createEvent&&a.dispatchEvent),z="unhandledrejection",W=function(e){var t;return!(!v(e)||!_(t=e.then))&&t},G=function(e,t){var n,r,i,o=t.value,s=1===t.state,a=s?e.ok:e.fail,u=e.resolve,c=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&J(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=W(n))?l(r,n,u,c):u(n)):c(o)}catch(e){d&&!i&&d.exit(),c(e)}},Q=function(e,t){e.notified||(e.notified=!0,w((function(){for(var n,r=e.reactions;n=r.get();)G(n,e);e.notified=!1,t&&!e.rejection&&Z(e)})))},K=function(e,t,n){var r,i;V?((r=B.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),a.dispatchEvent(r)):r={promise:t,reason:n},!R&&(i=a["on"+e])?i(r):e===z&&S("Unhandled promise rejection",n)},Z=function(e){l(b,a,(function(){var t,n=e.facade,r=e.value;if(Y(e)&&(t=k((function(){s?H.emit("unhandledRejection",r,n):K(z,n,r)})),e.rejection=s||Y(e)?2:1,t.error))throw t.value}))},Y=function(e){return 1!==e.rejection&&!e.parent},J=function(e){l(b,a,(function(){var t=e.facade;s?H.emit("rejectionHandled",t):K("rejectionhandled",t,e.value)}))},X=function(e,t,n){return function(r){e(t,r,n)}},ee=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Q(e,!0))},te=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=W(t);r?w((function(){var n={done:!1};try{l(r,t,X(te,n,e),X(ee,n,e))}catch(t){ee(n,t,e)}})):(e.value=t,e.state=1,Q(e,!1))}catch(t){ee({done:!1},t,e)}}};if(F&&(D=function(t){m(this,q),p(t),l(e,this);var n=A(this);try{t(X(te,n),X(ee,n))}catch(e){ee(n,e)}},(e=function(e){O(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:null})}).prototype=c(q=D.prototype,"then",(function(e,t){var n=A(this),r=j(y(this,D));return n.parent=!0,r.ok=!_(e)||e,r.fail=_(t)&&t,r.domain=s?H.domain:void 0,0===n.state?n.reactions.add(r):w((function(){G(r,n)})),r.promise})),t=function(){var t=new e,n=A(t);this.promise=t,this.resolve=X(te,n),this.reject=X(ee,n)},T.f=j=function(e){return e===D||e===n?new t(e):U(e)},!o&&_(E)&&M!==Object.prototype)){r=M.then,L||c(M,"then",(function(e,t){var n=this;return new D((function(e,t){l(r,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete M.constructor}catch(e){}d&&d(M,q)}$({global:!0,constructor:!0,wrap:!0,forced:F},{Promise:D}),n=u.Promise,f(D,I,!1,!0),h(I)}(),function(){if(Ps)return Ts;Ps=1;var $=Zn(),e=g(),t=xe(),n=Ss(),r=vs(),i=bi();$({target:"Promise",stat:!0,forced:Fs()},{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}})}(),function(){if(Rs)return $s;Rs=1;var $=Zn(),e=Je(),t=ms().CONSTRUCTOR,n=gs(),r=ve(),i=pe(),o=zt(),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})}}(),function(){if(Ls)return Ns;Ls=1;var $=Zn(),e=g(),t=xe(),n=Ss(),r=vs(),i=bi();$({target:"Promise",stat:!0,forced:Fs()},{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}})}(),function(){if(As)return Bs;As=1;var $=Zn(),e=Ss();$({target:"Promise",stat:!0,forced:ms().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(Ds)return Hs;Ds=1;var $=Zn(),e=ve(),t=Je(),n=gs(),r=ms().CONSTRUCTOR,i=js(),o=e("Promise"),s=t&&!r;$({target:"Promise",stat:!0,forced:t||r},{resolve:function(e){return i(s&&this===o?n:this,e)}})}()),Jo}var Vs,zs={};function Ws(){if(Vs)return zs;Vs=1;var $=Zn(),e=g(),t=xe(),n=Ss(),r=vs(),i=bi();return $({target:"Promise",stat:!0,forced:Fs()},{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}}),zs}var Gs,Qs={};function Ks(){if(Gs)return Qs;Gs=1;var $=Zn(),e=g(),t=xe(),n=ve(),r=Ss(),i=vs(),o=bi(),s=Fs(),a="No one promise resolved";return $({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}}),Qs}var Zs,Ys={};function Js(){if(Zs)return Ys;Zs=1;var $=Zn(),e=i(),t=us(),n=ls(),r=Ss(),o=xe(),s=vs(),a=e.Promise,u=!1;return $({target:"Promise",stat:!0,forced:!a||!a.try||s((function(){a.try((function(e){u=8===e}),8)})).error||!u},{try:function(e){var i=arguments.length>1?n(arguments,1):[],a=r.f(this),u=s((function(){return t(o(e),void 0,i)}));return(u.error?a.reject:a.resolve)(u.value),a.promise}}),Ys}var Xs,ea={};function ta(){if(Xs)return ea;Xs=1;var $=Zn(),e=Ss();return $({target:"Promise",stat:!0},{withResolvers:function(){var t=e.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}}),ea}var na,ra,ia,oa,sa,aa,ua,la,ca,da,fa,ha,pa,_a,va,ga,ma,ya,ba={},wa={};function Sa(){if(aa)return sa;aa=1,no(),jr(),function(){if(oo)return so;oo=1;var e=_i(),t=zt(),n=function(){if(io)return ro;io=1;var e=_i(),t=vi();return ro=e?{}.toString:function(){return"[object "+t(this)+"]"}}();e||t(Object.prototype,"toString",n,{unsafe:!0})}(),Us(),Ws(),Ks(),Js(),ta(),function(){if(na)return ba;na=1;var $=Zn(),e=Je(),t=gs(),n=p(),r=ve(),i=pe(),o=as(),s=js(),a=zt(),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})}}(),function(){if(oa)return wa;oa=1;var e=function(){if(ia)return ra;ia=1;var e=le(),t=dn(),n=eo(),r=fe(),i=e("".charAt),o=e("".charCodeAt),s=e("".slice),a=function(e){return function(a,u){var l,c,d=n(r(a)),f=t(u),h=d.length;return 0>f||f>=h?e?"":void 0:55296>(l=o(d,f))||l>56319||f+1===h||56320>(c=o(d,f+1))||c>57343?e?i(d,f):l:e?s(d,f,f+2):c-56320+(l-55296<<10)+65536}};return ra={codeAt:a(!1),charAt:a(!0)}}().charAt,t=eo(),n=Ut(),r=Br(),i=Hr(),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)}))}();var e=Xn();return sa=e.Promise}function ka(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 xa(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 Ca(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){xa(o,r,i,s,a,"next",e)}function a(e){xa(o,r,i,s,a,"throw",e)}s(void 0)}))}}function Ea(e,t,n){return t&&function(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,Oa(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pa(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 ka(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)?ka(e,t):void 0}}(e))||t){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 Ta(){return Ta=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},Ta.apply(null,arguments)}function Ia(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Aa(e,t)}function Fa(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 Ra(){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 La(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 l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(La(t={},r,(function(){return this})),t),d=l.prototype=a.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,La(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=l,La(d,"constructor",l),La(l,"constructor",u),u.displayName="GeneratorFunction",La(l,i,"GeneratorFunction"),La(d),La(d,i,"Generator"),La(d,r,(function(){return this})),La(d,"toString",(function(){return"[object Generator]"})),(Ra=function(){return{w:o,m:f}})()}function La(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}La=function(e,t,n,r){function o(t,n){La(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))},La(e,t,n,r)}function Aa(e,t){return Aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Aa(e,t)}function Oa(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}ya||(ya=1,function(){if(ma)return ga;ma=1;var e=function(){if(ha)return fa;ha=1;var e=function(){if(la)return ua;la=1;var e=Sa();return Mi(),ua=e}();return ca||(ca=1,Js()),da||(da=1,ta()),fa=e}();pa||(pa=1,no()),_a||(_a=1,Ws()),va||(va=1,Ks()),ga=e}());var Ma,Da,qa,$a,Na,Ba,Ha,ja,Ua,Va,za,Wa,Ga,Qa,Ka,Za={},Ya=[],Ja=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xa=Array.isArray;function eu(e,t){for(var n in t)e[n]=t[n];return e}function tu(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function nu(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?Ma.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 ru(e,s,r,i,null)}function ru(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?++qa:i,__i:-1,__u:0};return null==i&&null!=Da.vnode&&Da.vnode(o),o}function iu(e){return e.children}function ou(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 su(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=eu({},t);o.__v=t.__v+1,Da.vnode&&Da.vnode(o),gu(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,yu(r,o,i),t.__e=t.__=null,o.__e!=n&&au(o)}}function au(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})),au(e)}function uu(e){(!e.__d&&(e.__d=!0)&&$a.push(e)&&!lu.__r++||Na!=Da.debounceRendering)&&((Na=Da.debounceRendering)||Ba)(lu)}function lu(){try{for(var e,t=1;$a.length;)$a.length>t&&$a.sort(Ha),e=$a.shift(),t=$a.length,su(e)}finally{$a.length=lu.__r=0}}function cu(e,t,n,r,i,o,s,a,u,l,c){var d,f,h,p,_,v,g,m=r&&r.__k||Ya,y=t.length;for(u=du(n,t,m,u,y),d=0;y>d;d++)null!=(h=n.__k[d])&&(f=-1!=h.__i&&m[h.__i]||Za,h.__i=d,v=gu(e,h,f,i,o,s,a,u,l,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Su(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=fu(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 du(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]=ru(null,s,null,null,null):Xa(s)?s=e.__k[o]=ru(iu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=ru(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=hu(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])&&0==(2&a.__u)&&(a.__e==r&&(r=$(a)),ku(a,a));return r}function fu(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=fu(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 hu(e,t,n,r){var i,o,s,a=e.key,u=e.type,l=t[n],c=null!=l&&0==(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--])&&0==(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function pu(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ja.test(t)?n:n+"px"}function _u(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||pu(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||pu(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(za,"$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[Va]=r[Va]:(n[Va]=Wa,e.addEventListener(t,o?Qa:Ga,o)):e.removeEventListener(t,o?Qa:Ga,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 vu(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[Ua])t[Ua]=Wa++;else if(n[Va]>t[Ua])return;return n(Da.event?Da.event(t):t)}}}function gu(e,t,n,r,i,o,s,a,u,l){var c,d,f,h,p,_,v,g,m,y,$,b,w,S,k,x,C=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=Da.__b)&&c(t);e:if("function"==typeof C){d=s.length;try{if(m=t.props,y=C.prototype&&C.prototype.render,$=(c=C.contextType)&&r[c.__c],b=c?$?$.props.value:c.__:r,n.__c?g=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new C(m,b):(t.__c=f=new ou(m,b),f.constructor=C,f.render=xu),$&&$.sub(f),f.state||(f.state={}),f.__n=r,h=f.__d=!0,f.__h=[],f._sb=[]),y&&null==f.__s&&(f.__s=f.state),y&&null!=C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=eu({},f.__s)),eu(f.__s,C.getDerivedStateFromProps(m,f.__s))),p=f.props,_=f.state,f.__v=t,h)y&&null==C.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),y&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(y&&null==C.getDerivedStateFromProps&&m!==p&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(m,b),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(m,f.__s,b)){t.__v!=n.__v&&(f.props=m,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),Ya.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(m,f.__s,b),y&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(p,_,v)}))}if(f.context=b,f.props=m,f.__P=e,f.__e=!1,w=Da.__r,S=0,y)f.state=f.__s,f.__d=!1,w&&w(t),c=f.render(f.props,f.state,f.context),Ya.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,w&&w(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++S);f.state=f.__s,null!=f.getChildContext&&(r=eu(eu({},r),f.getChildContext())),y&&!h&&null!=f.getSnapshotBeforeUpdate&&(v=f.getSnapshotBeforeUpdate(p,_)),k=null!=c&&c.type===iu&&null==c.key?bu(c.props.children):c,a=cu(e,Xa(k)?k:[k],t,n,r,i,o,s,a,u,l),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),g&&(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(x=o.length;x--;)tu(o[x]);mu(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||mu(t);Da.__e(e,t,n)}}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=wu(n.__e,t,n,r,i,o,s,u,l);return(c=Da.diffed)&&c(t),128&t.__u?void 0:a}function mu(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(mu))}function yu(e,t,n){for(var r=0;n.length>r;r++)Su(n[r],n[++r],n[++r]);Da.__c&&Da.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Da.__e(e,t.__v)}}))}function bu(e){return"object"!=typeof e||null==e||e.__b>0?e:Xa(e)?e.map(bu):void 0!==e.constructor?null:eu({},e)}function wu(e,t,n,r,i,o,s,a,u){var l,c,d,f,h,p,_,v=n.props||Za,g=t.props,m=t.type;if("svg"==m?i="http://www.w3.org/2000/svg":"math"==m?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==!!m&&(m?h.localName==m:3==h.nodeType)){e=h,o[l]=null;break}if(null==e){if(null==m)return document.createTextNode(g);e=document.createElementNS(i,m,g.is&&g),a&&(Da.__m&&Da.__m(t,o),a=!1),o=null}if(null==m)v===g||a&&e.data==g||(e.data=g);else{if(o="textarea"==m&&null!=g.defaultValue?null:o&&Ma.call(e.childNodes),!a&&null!=o)for(v={},l=0;e.attributes.length>l;l++)v[(h=e.attributes[l]).name]=h.value;for(l in v)h=v[l],"dangerouslySetInnerHTML"==l?d=h:"children"==l||l in g||"value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g||_u(e,l,null,h,i);for(l in g)h=g[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?p=h:"checked"==l?_=h:a&&"function"!=typeof h||v[l]===h||_u(e,l,h,v[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=""),cu("template"==t.type?e.content:e,Xa(f)?f:[f],t,n,r,"foreignObject"==m?"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--;)tu(o[l]);a&&"textarea"!=m||(l="value","progress"==m&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[l]||"progress"==m&&!p||"option"==m&&p!=v[l])&&_u(e,l,p,v[l],i),l="checked",null!=_&&_!=e[l]&&_u(e,l,_,v[l],i))}return e}function Su(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){Da.__e(e,n)}}function ku(e,t,n){var r,i;if(Da.unmount&&Da.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Su(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Da.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;r.length>i;i++)r[i]&&ku(r[i],t,n||"function"!=typeof e.type);n||tu(e.__e),e.__c=e.__=e.__e=void 0}function xu(e,t,n){return this.constructor(e,n)}function Cu(e,t,n){var r,i,o;t==document&&(t=document.documentElement),Da.__&&Da.__(e,t),r=t.__k,i=[],o=[],gu(t,e=t.__k=nu(iu,null,[e]),r||Za,Za,t.namespaceURI,r?null:t.firstChild?Ma.call(t.childNodes):null,i,r?r.__e:t.firstChild,!1,o),yu(i,e,o),e.props.children=null}Ma=Ya.slice,Da={__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}},qa=0,ou.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=eu({},this.state),"function"==typeof e&&(e=e(eu({},n),this.props)),e&&eu(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),uu(this))},ou.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),uu(this))},ou.prototype.render=iu,$a=[],Ba="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ha=function(e,t){return e.__v.__b-t.__v.__b},lu.__r=0,ja=Math.random().toString(8),Ua="__d"+ja,Va="__a"+ja,za=/(PointerCapture)$|Capture$/i,Wa=0,Ga=vu(!1),Qa=vu(!0),Ka=0;var Eu,Pu,Tu,Iu,Fu=0,Ru=[],Lu=Da,Au=Lu.__b,Ou=Lu.__r,Mu=Lu.diffed,Du=Lu.__c,qu=Lu.unmount,$u=Lu.__;function Nu(e,t){Lu.__h&&Lu.__h(Pu,e,Fu||t),Fu=0;var n=Pu.__H||(Pu.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Bu(e){return Fu=1,function(e,t,n){var r=Nu(Eu++,2);if(r.t=e,!r.__c&&(r.__=[Yu(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Pu,!Pu.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,s=r.__c.props!==e;if(r.__c.__H.__.some((function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),o){var a=o.call(this,e,t,n);return i?a||s:a}return!i||s};Pu.__f=!0;var o=Pu.shouldComponentUpdate,s=Pu.componentWillUpdate;Pu.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},Pu.shouldComponentUpdate=i}return r.__N||r.__}(Yu,e)}function Hu(e,t){var n=Nu(Eu++,3);!Lu.__s&&Zu(n.__H,t)&&(n.__=e,n.u=t,Pu.__H.__h.push(n))}function ju(e){return Fu=5,Uu((function(){return{current:e}}),[])}function Uu(e,t){var n=Nu(Eu++,7);return Zu(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Vu(e){var t=Pu.context[e.__c],n=Nu(Eu++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Pu)),t.props.value):e.__}function zu(){for(var e;e=Ru.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Qu),t.__h.some(Ku),t.__h=[]}catch(n){t.__h=[],Lu.__e(n,e.__v)}}}Lu.__b=function(e){Pu=null,Au&&Au(e)},Lu.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$u&&$u(e,t)},Lu.__r=function(e){Ou&&Ou(e),Eu=0;var t=(Pu=e.__c).__H;t&&(Tu===Pu?(t.__h=[],Pu.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&zu(),Eu=0)),Tu=Pu},Lu.diffed=function(e){Mu&&Mu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ru.push(t)&&Iu===Lu.requestAnimationFrame||((Iu=Lu.requestAnimationFrame)||Gu)(zu)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),Tu=Pu=null},Lu.__c=function(e,t){t.some((function(e){try{e.__h.some(Qu),e.__h=e.__h.filter((function(e){return!e.__||Ku(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Lu.__e(n,e.__v)}})),Du&&Du(e,t)},Lu.unmount=function(e){qu&&qu(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some((function(e){try{Qu(e)}catch(e){t=e}})),n.__H=void 0,t&&Lu.__e(t,n.__v))};var Wu="function"==typeof requestAnimationFrame;function Gu(e){var t,n=function(){clearTimeout(r),Wu&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Wu&&(t=requestAnimationFrame(n))}function Qu(e){var t=Pu,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Pu=t}function Ku(e){var t=Pu;e.__c=e.__(),Pu=t}function Zu(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Yu(e,t){return"function"==typeof t?t(e):t}var Ju="gzip-js",Xu="base64",el="events",tl="cancelEvents",nl={Tab:"tab",Selector:"selector"},rl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},il={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},ol={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},sl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},al={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},ul="always",ll={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},cl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},dl="popover",fl=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],hl=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return fl.concat(t).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))};function pl(e,t){return-1!==e.indexOf(t)}var _l=function(e){return e.trim()},vl=function(e){return e.replace(/^\$/,"")};function gl(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 ml=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.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),yl=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),bl="min_length",wl="max_length",Sl=["$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"],kl=["token"],xl=Object.prototype,Cl=xl.hasOwnProperty,El=xl.toString,Pl=Array.isArray||function(e){return"[object Array]"===El.call(e)},Tl=function(e){return"function"==typeof e},Il=function(e){return e===Object(e)&&!Pl(e)},Fl=function(e){if(Il(e)){for(var t in e)if(Cl.call(e,t))return!1;return!0}return!1},Rl=function(e){return void 0===e},Ll=function(e){return"[object String]"==El.call(e)},Al=function(e){return Ll(e)&&0===e.trim().length},Ol=function(e){return null===e},Ml=function(e){return Rl(e)||Ol(e)},Dl=function(e){return"[object Number]"==El.call(e)&&e==e},ql=function(e){return Dl(e)&&e>0},$l=function(e){return"[object Boolean]"===El.call(e)},Nl=function(e){return e instanceof FormData},Bl=function(e){return pl(Sl,e)},Hl=function(e){return pl(kl,e)};function jl(e){return null===e||"object"!=typeof e}function Ul(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Vl(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 Wl(e,Error)}}function zl(e){return"u">typeof Event&&Wl(e,Event)}function Wl(e,t){try{return e instanceof t}catch(e){return!1}}var Gl=[!0,"true",1,"1","yes"],Ql=function(e){return pl(Gl,e)},Kl=[!1,"false",0,"0","no"];function Zl(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Dl(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),Zl(null!=i?i:n,t,n,r))}var Yl,Jl=function(){function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=Zl(e.bucketSize,0,100,e._logger),this._refillRate=Zl(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=Zl(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}(),Xl="Mobile",ec="iOS",tc="Android",nc="Tablet",rc=tc+" "+nc,ic="iPad",oc="Apple",sc=oc+" Watch",ac="Safari",uc="BlackBerry",lc="Samsung",cc=lc+"Browser",dc=lc+" Internet",fc="Chrome",hc=fc+" OS",pc=fc+" "+ec,_c="Internet Explorer",vc=_c+" "+Xl,gc="Opera",mc=gc+" Mini",yc="Edge",bc="Microsoft "+yc,wc="Firefox",Sc=wc+" "+ec,kc="Nintendo",xc="PlayStation",Cc="Xbox",Ec=tc+" "+Xl,Pc=Xl+" "+ac,Tc="Windows",Ic=Tc+" Phone",Fc="Nokia",Rc="Ouya",Lc="Generic",Ac=Lc+" "+Xl.toLowerCase(),Oc=Lc+" "+nc.toLowerCase(),Mc="Konqueror",Dc="Oculus Browser",qc="Vivaldi",$c="Yandex",Nc="Whale",Bc="DuckDuckGo",Hc="Pale Moon",jc="Waterfox",Uc="Brave",Vc="Claude",zc="Codex",Wc="ChatGPT",Gc="Google Search App",Qc="(\\d+(\\.\\d+)?)",Kc=new RegExp("Version/"+Qc),Zc=new RegExp("("+Vc+"|"+zc+"|"+Wc+")\\/"+Qc),Yc=new RegExp(Cc,"i"),Jc=new RegExp(xc+" \\w+","i"),Xc=new RegExp(kc+" \\w+","i"),ed=new RegExp(uc+"|PlayBook|BB10","i"),td={"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"},nd=function(e,t,n,r){t=t||"";var i=function(e){return null!=e&&e.brave?Uc:null}(n);return i||(null!=r&&r.detectGoogleSearchApp&&pl(e,"GSA/")?Gc:pl(e," OPR/")&&pl(e,"Mini")?mc:pl(e," OPR/")?gc:ed.test(e)?uc:pl(e,"IE"+Xl)||pl(e,"WPDesktop")?vc:pl(e,"OculusBrowser")?Dc:pl(e,cc)?dc:pl(e,yc)||pl(e,"Edg/")?bc:pl(e,qc+"/")?qc:pl(e,"YaBrowser/")?$c:pl(e,Nc+"/")?Nc:pl(e,Bc+"/")||pl(e,"Ddg/")?Bc:pl(e,Vc+"/")?Vc:pl(e,zc+"/")?zc:pl(e,Wc+"/")?Wc:pl(e,"FBIOS")?"Facebook "+Xl:pl(e,"UCWEB")||pl(e,"UCBrowser")?"UC Browser":pl(e,"CriOS")?pc:pl(e,"CrMo")||pl(e,fc)?fc:pl(e,tc)&&pl(e,ac)?Ec:pl(e,"FxiOS")?Sc:pl(e.toLowerCase(),Mc.toLowerCase())?Mc:pl(e,Uc+"/")?Uc:function(e,t){return t&&pl(t,oc)||function(e){return pl(e,ac)&&!pl(e,fc)&&!pl(e,tc)}(e)}(e,t)?pl(e,Xl)?Pc:ac:pl(e,"PaleMoon/")?Hc:pl(e,jc+"/")?jc:pl(e,wc)?wc:pl(e,"MSIE")||pl(e,"Trident/")?_c:pl(e,"Gecko")?wc:"")},rd=((Yl={})[vc]=[new RegExp("rv:"+Qc)],Yl[bc]=[new RegExp(yc+"?\\/"+Qc)],Yl[fc]=[new RegExp("("+fc+"|CrMo)\\/"+Qc)],Yl[pc]=[new RegExp("CriOS\\/"+Qc)],Yl["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/"+Qc)],Yl[ac]=[Kc],Yl[Pc]=[Kc],Yl[gc]=[new RegExp("(Opera|OPR)\\/"+Qc)],Yl[wc]=[new RegExp(wc+"\\/"+Qc)],Yl[Sc]=[new RegExp("FxiOS\\/"+Qc)],Yl[Mc]=[new RegExp("Konqueror[:/]?"+Qc,"i")],Yl[uc]=[new RegExp(uc+" "+Qc),Kc],Yl[Ec]=[new RegExp("android\\s"+Qc,"i")],Yl[dc]=[new RegExp(cc+"\\/"+Qc)],Yl[Dc]=[new RegExp("OculusBrowser\\/"+Qc)],Yl[qc]=[new RegExp(qc+"\\/"+Qc)],Yl[$c]=[new RegExp("YaBrowser\\/"+Qc)],Yl[Nc]=[new RegExp(Nc+"\\/"+Qc)],Yl[Uc]=[new RegExp(Uc+"\\/"+Qc)],Yl[Vc]=[Zc],Yl[zc]=[Zc],Yl[Wc]=[Zc],Yl[Bc]=[new RegExp("(DuckDuckGo|Ddg)\\/"+Qc)],Yl[Hc]=[new RegExp("PaleMoon\\/"+Qc)],Yl[jc]=[new RegExp(jc+"\\/"+Qc)],Yl[Gc]=[new RegExp("GSA\\/"+Qc)],Yl[_c]=[new RegExp("(rv:|MSIE )"+Qc)],Yl.Mozilla=[new RegExp("rv:"+Qc)],Yl),id=function(e,t,n,r){var i=nd(e,t,n,r),o=rd[i];if(Rl(o))return null;for(var s=0;o.length>s;s++){var a=e.match(o[s]);if(a)return parseFloat(a[a.length-2])}return null},od=[[new RegExp(Cc+"; "+Cc+" (.*?)[);]","i"),function(e){return[Cc,e&&e[1]||""]}],[new RegExp(kc,"i"),[kc,""]],[new RegExp(xc,"i"),[xc,""]],[ed,[uc,""]],[new RegExp(Tc,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ic,""];if(new RegExp(Xl).test(t)&&!/IEMobile\b/.test(t))return[Tc+" "+Xl,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=td[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Tc,r]}return[Tc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?[ec,[e[3],e[4],e[5]||"0"].join(".")]:[ec,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Rl(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+tc+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tc+")","i"),function(e){return e&&e[2]?[tc,[e[2],e[3],e[4]||"0"].join(".")]:[tc,""]}],[/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/,[hc,""]],[/Linux|debian/i,["Linux",""]]],sd=function(e){for(var t=0;od.length>t;t++){var n=od[t],r=n[1],i=n[0].exec(e),o=i&&(Tl(r)?r(i,e):r);if(o)return o}return["",""]},ad=function(e){return Xc.test(e)?kc:Jc.test(e)?xc:Yc.test(e)?Cc:new RegExp(Rc,"i").test(e)?Rc:new RegExp("("+Ic+"|WPDesktop)","i").test(e)?Ic:/iPad/.test(e)?ic:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?sc:ed.test(e)?uc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Fc,"i").test(e)?Fc:/(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(Xl).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)?tc:rc:new RegExp("(pda|"+Xl+")","i").test(e)?Ac:new RegExp(nc,"i").test(e)&&!new RegExp(nc+" pc","i").test(e)?Oc:""},ud=function(e,t){var n,r,i,o,s=ad(e);return s===ic||s===rc||"Kobo"===s||"Kindle Fire"===s||s===Oc?nc:s===kc||s===Cc||s===xc||s===Rc?"Console":s===sc?"Wearable":s?Xl:"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)?Xl:nc:"Desktop"},ld=20,cd=1e3,dd=1e4,fd="[Circular]",hd="[Truncated]",pd="[Unserializable]",_d="[Function]";function vd(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}var gd,md,yd,bd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function wd(e,t){return"string"==typeof(n=e)&&bd.test(n)?e:t();var n}function Sd(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 kd(e){return e?e.split("#")[0]:e}function xd(e,t){var n=setTimeout(e,t);return(null==n?void 0:n.unref)&&(null==n||n.unref()),n}function Cd(e,t,n){return Ed.apply(this,arguments)}function Ed(){return(Ed=Ca(Ra().m((function e(t,n,r){var i;return Ra().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=xd((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 Pd(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return yd&&n.length===md||(md=n.length,yd=n.reduce((function(n,r){gd||(gd={});var i=gd[r];if(i)n[i[0]]=i[1];else for(var o=e(r),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=t[r];if(u&&l){n[u]=l,gd[r]=[u,l];break}}return n}),{})),yd}}var Td=function(){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=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:n=Pa(t);case 1:if((r=n()).done){e.n=4;break}if(!((i=r.value).stacktrace&&i.stacktrace.frames&&Pl(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;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),Ta({},e,{cause:n,stack:r})},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=Pa(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=Ca(Ra().m((function e(t){var n,r,i,o;return Ra().w((function(e){for(;;)switch(e.n){case 0:n=t,r=Pa(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,i,o={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(r=t.handled)||void 0===r||r,synthetic:null!==(i=e.synthetic)&&void 0!==i&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var s=[o];return null!=e.cause&&s.push.apply(s,this.convertToExceptionList(e.cause,Ta({},t,{handled:!0}))),s},t.buildParsingContext=function(e){var t;return{chunkIdMap:Pd(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.buildCoercingContext=function(e,t,n){var r=this;void 0===n&&(n=0);var i=function(n,i){if(4>=i){var o=r.buildCoercingContext(e,t,i);return r.applyCoercers(n,o)}};return Ta({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:function(e){return i(e,n)},next:function(e){return i(e,n+1)}})},e}(),Id="?";function Fd(e,t,n,r,i){var o={platform:e,filename:t,function:"<anonymous>"===n?Id:n,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return Rl(r)||(o.lineno=r),Rl(i)||(o.colno=i),o}var Rd=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]:Id,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ld=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ad=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Od=/\((\S*)(?::(\d+))(?::(\d+))\)/,Md=function(e,t){var n=Ld.exec(e);if(n)return Fd(t,n[1],Id,+n[2],+n[3]);var r=Ad.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var i=Od.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var o=Rd(r[1]||Id,r[2]);return Fd(t,o[1],o[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Dd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$d=function(e,t){var n=Dd.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=qd.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]||Id,s=Rd(o,i);return Fd(t,i=s[1],o=s[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Nd=/\(error: (.*)\)/,Bd=50;var Hd=function(){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=Ll(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 Ul(e,"DOMException")},t.isDOMError=function(e){return Ul(e,"DOMError")},e}(),jd=function(){function e(){}var t=e.prototype;return t.match=function(e){return Vl(e)},t.coerce=function(e,t){var n,r=this.getStack(e),i=void 0===r;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:null==(n=t.syntheticException)?void 0:n.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:i}},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){return e.stacktrace||e.stack||void 0},e}(),Ud=function(){function e(){}var t=e.prototype;return t.match=function(e){return!!Ul(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 Ta({},r,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:r.stack,synthetic:!0})},t._hasUsableMessage=function(e){return Ll(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(Ll(r.filename)&&0!==r.filename.length&&0!==i)return"Error\n at "+r.filename+":"+i+":"+o},e}(),Vd=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,zd=function(){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(Vd);return r&&(t=r[1],n=r[2]),[t,n]},e}(),Wd=["fatal","error","warning","log","info","debug"];function Gd(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=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var Qd=function(){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(zl(e))return e.constructor.name;var t="name"in e?e.name:void 0;return Ll(t)&&!Al(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: "+Gd(e)},t.isSeverityLevel=function(e){return Ll(e)&&!Al(e)&&Wd.indexOf(e)>=0},t.getStack=function(e){try{return Ll(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Ll(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(Vl(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),Kd=function(){function e(){}var t=e.prototype;return t.match=function(e){return zl(e)},t.coerce=function(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Gd(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Zd=function(){function e(){}var t=e.prototype;return t.match=function(e){return jl(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}(),Yd=function(){function e(){}var t=e.prototype;return t.match=function(e){return Ul(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!zl(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 jl(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}(),Jd="$message",Xd="$timestamp",ef=new Set([Jd,Xd]),tf={enabled:!0,max_bytes:32768};function nf(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:tf.enabled,max_bytes:of(e.max_bytes,tf.max_bytes)}:Ta({},tf)}var rf=function(){function e(e){this._entries=[],this._totalBytes=0,this._config=nf(e)}var t=e.prototype;return t.setConfig=function(e){this._config=nf(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=gl(e)}catch(e){return}try{var n=JSON.parse(t);if(!Il(n))return;var r=n,i=r[Jd],o=r[Xd];if(!Ll(i)||0===i.trim().length)return;if(!Ll(o)&&!Dl(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 of(e,t){if(!Dl(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var sf=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function af(e){return"string"==typeof e||e}function uf(e){return"string"==typeof e?e:void 0}var lf,cf=["$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","irclid","_kx"],["$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"]),df="NativeGzipValidationError",ff=function(e){return e.length>=2&&31===e[0]&&139===e[1]},hf=function(e,t){return e===yl.GZipJS||t===yl.GZipJS||"gzip"===t},pf=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},_f=function(e){for(var t=function(){if(lf)return lf;lf=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;lf[e]=t>>>0}return lf}(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0},vf=function(e){throw Sd(df,"Native gzip produced invalid output: "+e)},gf=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s,a;return Ra().w((function(e){for(;;)switch(e.n){case 0:return 18>t.size&&vf("too-short"),s=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return r=new s(e.v),ff(r)&&8===r[2]||vf("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:(i=new a(e.v)).getUint32(0,!0)!==_f(n)&&vf("invalid-crc"),o=n.length>>>0,i.getUint32(4,!0)!==o&&vf("invalid-size");case 3:return e.a(2)}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function mf(e,t,n){return yf.apply(this,arguments)}function yf(){return yf=Ca(Ra().m((function e(t,n,r){var i,o,s,a,u,l,c;return Ra().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=Ca(Ra().m((function e(t){return Ra().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 l=e.v[0],e.n=3,gf(l,i);case 3:return e.a(2,l);case 4:if(e.p=4,c=e.v,null==r||!r.rethrow){e.n=5;break}throw c;case 5:return n&&console.error("Failed to gzip compress data",c),e.a(2,null)}}),e,null,[[1,4]])}))),yf.apply(this,arguments)}var bf=0x8000000000000000,wf="9223372036854775808",Sf={}.propertyIsEnumerable;function kf(e,t){try{return Ef(e,t,{ancestors:new WeakSet,remainingNodes:dd},0)}catch(e){return[]}}function xf(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:hd};if(n.remainingNodes--,$l(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),r=BigInt(wf);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>=bf||-bf>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:vd(e)};if("function"==typeof e)return{stringValue:_d};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(n.ancestors.has(e))return{stringValue:fd};if(r>=ld)return{stringValue:hd};if(e instanceof Date){var o=e.getTime(),s=Number.isFinite(o)?e.toISOString():String(e);return{stringValue:"string"==typeof s?vd(s):String(s)}}n.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return xf(a.call(e),t,n,r+1)}catch(e){}return Pl(e)?{arrayValue:{values:Cf(e,t,n,r+1)}}:{kvlistValue:{values:Ef(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:vd(String(e))}}function Cf(e,t,n,r){for(var i=[],o=Math.min(e.length,cd),s=0;o>s&&n.remainingNodes>0;s++)try{var a=s in e?e[s]:void 0;if(Ml(a))continue;i.push(xf(a,t,n,r))}catch(e){i.push({stringValue:pd})}return e.length>s&&i.push({stringValue:hd}),i}function Ef(e,t,n,r){var i=[];for(var o in e)if(Sf.call(e,o)){if(!o){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.length>=cd||0>=n.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var s=e[o];if(Ol(s)||Rl(s))continue;i.push({key:vd(o),value:xf(s,t,n,r)})}catch(e){i.push({key:vd(o),value:{stringValue:pd}})}}return i}function Pf(e,t,n){return Ta({},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 Tf={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var If={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Ff=If.info;function Rf(e){try{return vd(String(e))}catch(e){return pd}}function Lf(e,t,n,r){var i,o=If[e.level||"info"]||Ff,s=o.text,a=o.number,u=(void 0===(i=Dl(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),Ml(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ml(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=Ta({},l),d=e.attributes;if(d){var f=[];try{f=Object.keys(d)}catch(e){f=[]}for(var h,p=Pa(f);!(h=p()).done;){var _=h.value,v=void 0;try{v=d[_]}catch(e){v=pd}Object.defineProperty(c,_,{value:v,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:a,severityText:s,body:{stringValue:Rf(e.body)},attributes:kf(c,n)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),Rl(e.trace_flags)||(g.flags=e.trace_flags),g}function Af(e,t,n){return Pf(e,t,n)}function Of(e,t,n,r){return{resourceLogs:[{resource:{attributes:kf(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Mf=function(){function e(e,t,n,r,i,o,s){var a;void 0===o&&(o=function(){return Promise.resolve()}),this._instance=e,this._config=t,this._logger=n,this._getContext=r,this._onReady=i,this._waitForStoragePersist=o,this._scopeName=s,this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._consecutiveFlushFailures=0,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a: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(ml.LogsQueue,[])},t.reset=function(){this._clearFlushTimer(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,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:Lf(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=Pa(Pl(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=Ca(Ra().m((function e(){var t=this;return Ra().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=Ca(Ra().m((function e(){var t,n,r,i,o,s,a,u,l,c,d,f;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),0!==(n=null!==(t=this._instance.getPersistedProperty(ml.LogsQueue))&&void 0!==t?t:[]).length){e.n=1;break}return e.a(2);case 1:r=n.length,i=0;case 2:if(0>=n.length||i>=r){e.n=9;break}return a=this._queueGeneration,this._evictedSinceAdvance=0,u=Math.min(n.length,this._maxBatchRecordsPerPost),l=n.slice(0,u),c=l.map((function(e){return e.record})),d=Of(c,this._buildResourceAttributes(),null!==(o=this._scopeName)&&void 0!==o?o:this._instance.getLibraryId(),this._instance.getLibraryVersion()),e.n=3,this._instance._sendLogsBatch(d);case 3:if(f=e.v,this._queueGeneration===a){e.n=4;break}return e.a(2);case 4:if("too-large"!==f.kind||1>=l.length){e.n=5;break}return this._maxBatchRecordsPerPost=Math.max(1,Math.floor(l.length/2)),this._logger.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,2);case 5:if("retry-later"!==f.kind){e.n=6;break}throw f.error;case 6:return"too-large"===f.kind?this._logger.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===f.kind&&this._config.maxBatchRecordsPerPost>this._maxBatchRecordsPerPost&&(this._maxBatchRecordsPerPost=Math.min(this._config.maxBatchRecordsPerPost,this._maxBatchRecordsPerPost+1)),e.n=7,this._persistQueueAdvance(l.length);case 7:if(n=null!==(s=this._instance.getPersistedProperty(ml.LogsQueue))&&void 0!==s?s:[],i+=l.length,"fatal"!==f.kind){e.n=8;break}throw f.error;case 8:e.n=2;break;case 9:return e.a(2)}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t._persistQueueAdvance=function(){var e=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:return r=Math.max(0,t-this._evictedSinceAdvance),i=null!==(n=this._instance.getPersistedProperty(ml.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(ml.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 Af(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(ml.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(ml.LogsQueue,n),this._maxBufferSize>n.length?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(e){var t=this;void 0===e&&(e=this._flushIntervalMs),this._flushTimer||(this._flushTimer=xd((function(){t._flushTimer=void 0,t._flushInBackground()}),e))},t._nextFlushDelay=function(){var e=Math.min(Math.max(0,this._consecutiveFlushFailures-1),6);return this._flushIntervalMs*Math.pow(2,e)},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(ml.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=Ca(Ra().m((function e(t){var n;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),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,Cd(n,t);case 3:return e.a(2)}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=Ca(Ra().m((function e(t){var n;return Ra().w((function(e){for(;;)switch(e.n){case 0:return n=this.flush(),e.n=1,Cd(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;this.flush().then((function(){e._consecutiveFlushFailures=0}),(function(t){e._consecutiveFlushFailures++,e._logger.error("PostHog logs flush failed:",t)})).finally((function(){!e._instance.isDisabled&&e._hasQueuedRecords()&&e._armFlushTimer(e._nextFlushDelay())}))},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},e}(),Df=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function qf(e){return String(e)+"000000"}function $f(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 Nf=function(){function e(e,t,n){this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,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})},t.flush=function(){var e=this,t=this._flushPromise,n=function(){var n=Ca(Ra().m((function n(){return Ra().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)}}(),r=n().finally((function(){e._flushPromise===r&&(e._flushPromise=null)}));return this._flushPromise=r,r},t.drainWindow=function(){if(0===this._series.size)return null;var e=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(e)},t.reset=function(){this._generation++,this._clearFlushTimer(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=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&&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?Ta({},t.attributes):void 0,r=$f(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=this._series.get(r);if(!i){if(!this._admitNewSeries())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this._series.set(r,i)}var o=this._typeByName.get(t.name);void 0===o?this._typeByName.set(t.name,t.type):o===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+o+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(i,t.value),this._armFlushTimer()}else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}},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._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":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Df.length+1).fill(0)});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,Df)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=Pa(Pl(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(){var e=this;this._flushTimer||(this._flushTimer=xd((function(){e._flushTimer=void 0,e.flush().catch((function(t){e._logger.error("Metrics flush failed:",t)}))}),this._config.flushIntervalMs))},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},t._doFlush=function(){var e=Ca(Ra().m((function e(){var t,n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(0!==this._series.size){e.n=1;break}return e.a(2);case 1:return t=this._series,this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,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: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._armFlushTimer(),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 Pf(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:kf(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i},t._buildMetrics=function(e){for(var t,n=qf(Date.now()),r=new Map,i=Pa(e.values());!(t=i()).done;){var o,s=t.value,a=$f(s.type,s.name,s.unit,void 0),u=r.get(a);u||(u=Ta({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=kf(null!==(o=s.attributes)&&void 0!==o?o:{},this._logger),c=qf(s.windowStartMs);if("count"===s.type){var d,f={attributes:l,startTimeUnixNano:c,timeUnixNano:n,asDouble:null!==(d=s.total)&&void 0!==d?d:0};u.sum.dataPoints.push(f)}else if("gauge"===s.type){var h,p={attributes:l,timeUnixNano:n,asDouble:null!==(h=s.last)&&void 0!==h?h:0};u.gauge.dataPoints.push(p)}else s.hist&&u.histogram.dataPoints.push({attributes:l,startTimeUnixNano:c,timeUnixNano:n,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:Df})}return Array.from(r.values())},t._mergeWindowBack=function(e){for(var t,n,r,i=Pa(e);!(r=i()).done;){var o=r.value,s=o[0],a=o[1],u=this._series.get(s);if(u)switch(u.windowStartMs=Math.min(u.windowStartMs,a.windowStartMs),u.type){case"count":u.total=(null!==(t=u.total)&&void 0!==t?t:0)+(null!==(n=a.total)&&void 0!==n?n:0);break;case"gauge":break;case"histogram":if(a.hist)if(u.hist){u.hist.count+=a.hist.count,u.hist.sum+=a.hist.sum,u.hist.min=Math.min(u.hist.min,a.hist.min),u.hist.max=Math.max(u.hist.max,a.hist.max);for(var l=0;u.hist.bucketCounts.length>l;l++)u.hist.bucketCounts[l]+=a.hist.bucketCounts[l]}else u.hist=a.hist}else this._admitNewSeries()&&this._series.set(s,a)}},e}();function Bf(e,t){if(e){var n=e.find((function(e){return e.type===t}));return null==n?void 0:n.value}}function Hf(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&Tl(n.then)&&n.then(void 0,(function(){}))}}}}var jf={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"},Uf="u">typeof window?window:void 0,Vf="u">typeof globalThis?globalThis:Uf,zf=null==Vf?void 0:Vf.navigator,Wf=null==Vf?void 0:Vf.document,Gf=null==Vf?void 0:Vf.location,Qf=null==Vf?void 0:Vf.fetch,Kf=null!=Vf&&Vf.XMLHttpRequest&&"withCredentials"in new Vf.XMLHttpRequest?Vf.XMLHttpRequest:void 0,Zf=null==Vf?void 0:Vf.AbortController,Yf=null==Vf?void 0:Vf.CompressionStream,Jf=null==zf?void 0:zf.userAgent;function Xf(){return!(!Uf||!1===Uf.navigator.onLine)}var eh=function(e,t){var n=(void 0===t?{}:t).debugEnabled,r={_log:function(t){if(Uf&&(jf.DEBUG||Uf.POSTHOG_DEBUG||n)&&!Rl(Uf.console)&&Uf.console){for(var r=("__rrweb_original__"in Uf.console[t]?Uf.console[t].__rrweb_original__:Uf.console[t]),i=arguments.length,o=new Array(i>1?i-1:0),s=1;i>s;s++)o[s-1]=arguments[s];r.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 eh(e+" "+t,n)}};return r},th=eh("[PostHog.js]"),nh=th.createLogger;function rh(e,t){Pl(e)&&e.forEach(t)}function ih(e,t){if(!Ml(e))if(Pl(e))e.forEach(t);else if(Nl(e))e.forEach((function(e,n){return t(e,n)}));else for(var n in e)Cl.call(e,n)&&t(e[n],n)}var oh=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 sh(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 ah=function(e){try{return e()}catch(e){return}},uh=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){th.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),th.critical(e)}}},lh=function(e){var t={};return ih(e,(function(e,n){(Ll(e)&&e.length>0||Dl(e))&&(t[n]=e)})),t};var ch=["herokuapp.com","vercel.app","netlify.app"];function dh(e){var t=null==e?void 0:e.hostname;if(!Ll(t))return!1;for(var n,r=t.split(".").slice(-2).join("."),i=Pa(ch);!(n=i()).done;)if(r===n.value)return!1;return!0}function fh(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 hh(e){return"ph_toolbar_internal"===e.name}function ph(e){return"$survey_response_"+e}function _h(e,t){if(!t)return null;var n=e[ph(t)];return Pl(n)?[].concat(n):n}function vh(e,t,n){void 0===e&&(e={});var r={};return t.questions.forEach((function(t){if(!Rl(t.originalQuestionIndex)){var n,i=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,o=_h(e,t.id);Rl(o)||(r[i]=o)}})),Ta({$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:_h(e,t.id)}}))},e,r)}function gh(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 mh(e){return"string"==typeof e&&e.trim()?e.trim():null}function yh(e){return e.toLowerCase()}function bh(e,t,n){if(!e||!t)return null;var r=yh(t),i=Object.keys(e).find((function(e){return yh(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 yh(e)===o}));if(s)return null==n||n.debug("Found base language translation match: "+s+" (from "+t+")"),s}return null}var wh=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Sh(e,t,n){var r,i=bh(e.translations,t,n),o=Ta({},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),Rl(u.name)||(o.name=u.name,s=!0),o.appearance){for(var l,c=Ta({},o.appearance),d=Pa(wh);!(l=d()).done;){var f=l.value,h=u[f];Rl(h)||(c[f]=h,s=!0)}o.appearance=c}else(function(e){return wh.some((function(t){return!Rl(e[t])}))})(u)&&(s=!0)}var p=e.questions.map((function(e){return function(e,t,n){var r,i=bh(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=Ta({},e),a=!1;return Rl(o.question)||(s.question=o.question,a=!0),Rl(o.description)||(s.description=o.description,a=!0),Rl(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!Rl(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!Rl(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!Rl(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(e){return Pl(e.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:e,matchedKey:a?i:null,hasChanges:a}}(e,t,n)})),_=p.map((function(e){return e.question})),v=p.some((function(e){return e.hasChanges})),g=null;return i||(g=(null==(r=p.find((function(e){return e.matchedKey})))?void 0:r.matchedKey)||null),v&&(o.questions=_,s=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:s?i||g:null}}function kh(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function xh(e){var t;return kh(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Ch=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}},Eh=function(e){return e.toLowerCase()},Ph={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 Ch(t,e)}))}))},not_regex:function(e,t){return t.every((function(t){return e.every((function(e){return!Ch(t,e)}))}))},icontains:function(e,t){return t.map(Eh).some((function(t){return e.map(Eh).some((function(e){return t.includes(e)}))}))},not_icontains:function(e,t){return t.map(Eh).every((function(t){return e.map(Eh).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 Th(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=Ph[n.operator];return!!i&&i(n.values,[String(r)])}))}var Ih=nh("[Surveys]");function Fh(e){return!(!e.start_date||e.end_date)}function Rh(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Lh="seenSurvey_",Ah="inProgressSurvey_",Oh=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},Mh=function(e){return Oh(Lh,e)},Dh=function(e){try{var t=Mh(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Ih.error("Failed to persist survey seen state",e)}},qh=[ol.Popover,ol.Widget,ol.API],$h={ignoreConditions:!1,ignoreDelay:!1,displayType:dl},Nh="featureFlags",Bh="$people_distinct_id",Hh="distinct_id",jh="$device_id",Uh="$device_model",Vh="__alias",zh="$fbc",Wh="$fbc_persistence",Gh="__timers",Qh="$autocapture_disabled_server_side",Kh="$heatmaps_enabled_server_side",Zh="$exception_capture_enabled_server_side",Yh="$error_tracking_suppression_rules",Jh="$error_tracking_capture_extension_exceptions",Xh="$web_vitals_enabled_server_side",ep="$dead_clicks_enabled_server_side",tp="$product_tours_enabled_server_side",np="$logs_capture_enabled_server_side",rp="$web_vitals_allowed_metrics",ip="$session_recording_remote_config",op="$replay_sample_rate",sp="$replay_override_sampling",ap="$replay_override_linked_flag",up="$replay_override_url_trigger",lp="$replay_override_event_trigger",cp="$sesid",dp="$session_is_sampled",fp="$enabled_feature_flags",hp="$active_feature_flags",pp="$early_access_features",_p="$feature_flag_details",vp="$feature_flag_payloads",gp="$feature_flag_request_id",mp="$minimal_flag_called_events",yp="$override_feature_flags",bp="$override_feature_flag_payloads",wp="$stored_person_properties",Sp="$stored_group_properties",kp="$groups",xp="$surveys",Cp="$surveys_loaded_at",Ep="$surveys_activated",Pp="$surveys_activated_session",Tp="$surveys_activated_timestamps",Ip="ph_product_tours",Fp="$flag_call_reported",Rp="$flag_call_reported_session_id",Lp="$feature_flag_errors",Ap="$feature_flag_evaluated_at",Op="$user_state",Mp="$client_session_props",Dp="$capture_rate_limit",qp="$initial_campaign_params",$p="$initial_referrer_info",Np="$initial_person_info",Bp="$epp",Hp="$posthog_cookieless",jp="$cookieless_mode",Up="$sdk_debug_extensions_init_method",Vp="$sdk_debug_extensions_init_time_ms",zp="$sdk_debug_recording_script_not_loaded",Wp="PostHog loadExternalDependency extension not found.",Gp="on_reject",Qp="always",Kp="anonymous",Zp="identified",Yp="identified_only",Jp="visibilitychange",Xp="beforeunload",e_="$pageview",t_="$pageleave",n_="$identify",r_="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Dl(e)&&isFinite(e)&&Math.floor(e)===e});var i_=function(){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}(),o_=function(){function e(){this._timestamp=0,this._counter=0,this._random=new u_}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!Rl(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(Rl(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e=Date.now();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 i_.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}(),s_=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};Uf&&!Rl(Uf.crypto)&&crypto.getRandomValues&&(s_=function(e){return crypto.getRandomValues(e)});var a_,u_=function(){function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._buffer.length>this._cursor||(s_(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),l_=function(){return c_().toString()},c_=function(){return(a_||(a_=new o_)).generate()},d_=function(e,t){try{return JSON.stringify(e,(function(e,t){return"bigint"==typeof t?t.toString():t}),t)}catch(t){return gl(e)}},f_=function(e){var t=null==Wf?void 0:Wf.createElement("a");return Rl(t)?null:(t.href=e,t)},h_=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(!Pl(n)||2>n.length)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){th.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},p_=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++){var d=u[c].split("=");Pl(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(u[c]))}var f=a;return null!=s&&(f+="?"+l.join("&")),null!=i&&(f+="#"+i),f},__=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},v_=function(e,t){return e>=t&&Xf()},g_=function(e,t,n,r){if(0===e){if(Xf()){var i=t+1;return i===n&&r(),i}return t}return 0};function m_(e,t,n){return d_({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}function y_(e,t){var n,r=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!Tl(r))return t;try{var i=r(t);return Ll(i)&&i?i:t}catch(e){return th.error("Error in get_current_url, falling back to window.location.href",e),t}}function b_(e){var t,n=null==Uf||null==(t=Uf.location)?void 0:t.href;return Rl(n)?void 0:y_(e,n)}var w_=function(e){if(Wf){try{for(var t=e+"=",n=Wf.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}},S_="",k_=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var x_=null,C_={_is_supported:function(){if(!Ol(x_))return x_;if(x_=!1,Wf)try{var e="__ph_cookie_support_"+l_();C_._set(e,"xyz"),x_='"xyz"'===w_(e),C_._remove(e)}catch(e){x_=!1}return x_},_error:function(e){th.error("cookieStore error: "+e)},_get:w_,_parse:function(e){var t;try{t=JSON.parse(C_._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(!Wf)return!1;try{var o="",s="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Wf),S_)return S_;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_"+l_();!S_&&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",S_=o)}return S_}(e);if(!n){var r=function(e){var t=e.match(k_);return t?t[0]:""}(e);r!==n&&th.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(Wf.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&&th.warn("cookieStore warning: large cookie, len="+l.length),Wf.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Wf&&Wf.cookie)try{C_._set(e,"",-1,t)}catch(e){return}}},E_=null,P_={_is_supported:function(){if(!Ol(E_))return E_;var e=!0;if(Rl(Uf))e=!1;else try{var t="__mplssupport__";P_._set(t,"xyz"),'"xyz"'!==P_._get(t)&&(e=!1),P_._remove(t)}catch(t){e=!1}return e||th.error("localStorage unsupported; falling back to cookie store"),E_=e,e},_error:function(e){th.error("localStorage error: "+e)},_get:function(e){try{return null==Uf?void 0:Uf.localStorage.getItem(e)}catch(e){P_._error(e)}return null},_parse:function(e){try{return JSON.parse(P_._get(e))||{}}catch(e){}return null},_set:function(e,t){try{return null==Uf||Uf.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){P_._error(e)}return!1},_remove:function(e){try{null==Uf||Uf.localStorage.removeItem(e)}catch(e){P_._error(e)}}},T_=[wp,hp,fp,_p,vp,gp,Ap,Lp,Fp],I_=[jh,Hh,cp,dp,Bp,Np,Wh,Op],F_=function(e){return e+"_cpm"},R_=["__proto__","constructor","prototype"],L_=function(e){if(!Il(e))return{};var t={};return Object.keys(e).forEach((function(n){-1===R_.indexOf(n)&&(t[n]=e[n])})),t},A_=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(I_,t).forEach((function(t){var r=e[t];Rl(r)||Ol(r)||""===r||(n[t]=r)})),n},O_=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)},M_=function(e,t){return{p:t,f:O_(JSON.stringify(e))}},D_=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=C_._parse(F_(e)),r=(null==n?void 0:n.f)===O_(t)&&Pl(n.p);return{properties:r?n.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},q_=function(e,t){return t+"|"+(C_._get(F_(e))||"")},$_={},N_={_is_supported:function(){return!0},_error:function(e){th.error("memoryStorage error: "+e)},_get:function(e){return e in $_?$_[e]:null},_parse:function(e){return e in $_?$_[e]:null},_set:function(e,t){return $_[e]=t,!0},_remove:function(e){delete $_[e]}},B_=null,H_={_is_supported:function(){if(!Ol(B_))return B_;if(B_=!0,Rl(Uf))B_=!1;else try{var e="__support__";H_._set(e,"xyz"),'"xyz"'!==H_._get(e)&&(B_=!1),H_._remove(e)}catch(e){B_=!1}return B_},_error:function(e){th.error("sessionStorage error: ",e)},_get:function(e){try{return null==Uf?void 0:Uf.sessionStorage.getItem(e)}catch(e){H_._error(e)}return null},_parse:function(e){try{return JSON.parse(H_._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Uf||Uf.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){H_._error(e)}return!1},_remove:function(e){try{null==Uf||Uf.sessionStorage.removeItem(e)}catch(e){H_._error(e)}}},j_=nh("[Stylesheet Loader]"),U_=Uf,V_=Wf,z_="#020617",W_={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:rl.Right,widgetType:nl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:z_,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},G_=[rl.Center,rl.Left,rl.Right];function Q_(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 K_(e){var t;void 0===e&&(e=W_.backgroundColor),"#"===e[0]&&(t=Q_(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=Q_(n)),!t)return z_;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?z_:"white"}return z_}var Z_=function(e,t,n){var r=_v(e),i=V_.querySelector("."+r);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};var o=V_.createElement("div");!function(e,t,n){var r=Ta({},W_,n),i=e.style,o=!G_.includes(r.position)||t===ol.Widget&&(null==n?void 0:n.widgetType)===nl.Tab;i.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}(r.fontFamily)),i.setProperty("--ph-survey-box-padding",r.boxPadding),i.setProperty("--ph-survey-max-width",r.maxWidth),i.setProperty("--ph-survey-z-index",r.zIndex),i.setProperty("--ph-survey-border-color",r.borderColor),o?(i.setProperty("--ph-survey-border-radius",r.borderRadius),i.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(i.setProperty("--ph-survey-border-bottom","none"),i.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),i.setProperty("--ph-survey-background-color",r.backgroundColor),i.setProperty("--ph-survey-box-shadow",r.boxShadow),i.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),i.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),i.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||K_(r.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),i.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",K_(r.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||K_(r.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),i.setProperty("--ph-widget-color",r.widgetColor),i.setProperty("--ph-widget-text-color",K_(r.widgetColor)),i.setProperty("--ph-widget-z-index",r.zIndex);var s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),a=s||r.inputBackground;s||"white"!==r.backgroundColor||(a="#f8f8f8"),i.setProperty("--ph-survey-input-background",a);var u=(null==n?void 0:n.inputTextColor)||K_(a);i.setProperty("--ph-survey-input-text-color",u),i.setProperty("--ph-survey-rating-text-color",u),i.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),i.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),i.setProperty("--ph-survey-outline-color",r.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 Tl(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return i&&(r=i(r)),r||(j_.error("prepare_external_dependency_stylesheet returned null"),null)}(V_,':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)}}',e);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 V_.body.appendChild(o),{shadow:s,isNewlyCreated:!0}},Y_=function(e){var t,n,r,i=e.responses,o=e.survey,s=e.surveySubmissionId,a=e.posthog,u=e.isSurveyCompleted,l=e.properties,c=e.surveyLanguage,d=e.questionSnapshots;a?(Dh(o),a.capture(ll.SENT,Ta(((t={})[cl.SURVEY_NAME]=o.name,t[cl.SURVEY_ID]=o.id,t[cl.SURVEY_ITERATION]=o.current_iteration,t[cl.SURVEY_ITERATION_START_DATE]=o.current_iteration_start_date,t[cl.SURVEY_SUBMISSION_ID]=s,t[cl.SURVEY_COMPLETED]=u,t),c&&((n={})[cl.SURVEY_LANGUAGE]=c,n),{sessionRecordingUrl:null==a.get_session_replay_url?void 0:a.get_session_replay_url()},vh(i,o,d),l,{$set:(r={},r[gh(o,"responded")]=!0,r)})),u&&(U_.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:o.id}})),pv(o),a.reloadFeatureFlags())):Ih.error("[survey sent] event not captured, PostHog instance not found.")},J_=function(e,t,n){var r,i,o,s;return Ta(((r={})[cl.SURVEY_NAME]=e.name,r[cl.SURVEY_ID]=e.id,r[cl.SURVEY_ITERATION]=e.current_iteration,r[cl.SURVEY_ITERATION_START_DATE]=e.current_iteration_start_date,r[cl.SURVEY_PARTIALLY_COMPLETED]=(void 0===(s=null==t?void 0:t.responses)&&(s={}),Object.values(s).some((function(e){return!Ml(e)}))),r),(null==t?void 0:t.surveyLanguage)&&((i={})[cl.SURVEY_LANGUAGE]=t.surveyLanguage,i),((o={sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()})[cl.SURVEY_SUBMISSION_ID]=null==t?void 0:t.surveySubmissionId,o),vh(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots))},X_=function(e,t,n,r){var i,o;if(t){if(!n){var s=fv(e),a=s?s.surveyLanguage:r;t.capture(ll.DISMISSED,Ta({},J_(e,s,t),a&&((i={})[cl.SURVEY_LANGUAGE]=a,i),{$set:(o={},o[gh(e,"dismissed")]=!0,o)})),pv(e),Dh(e),U_.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ih.error("[survey dismissed] event not captured, PostHog instance not found.")},ev=function(e,t){if(t){var n=function(e){return Oh("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(n))return}catch(e){return}var r=fv(e);if(r){try{localStorage.setItem(n,"true")}catch(e){}t.capture(ll.ABANDONED,J_(e,r,t),{transport:"sendBeacon"})}}else Ih.error("[survey abandoned] event not captured, PostHog instance not found.")},tv=function(e){return e.map((function(e){return{sort:Math.floor(10*Math.random()),value:e}})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.value}))},nv=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},rv=function(e){var t=e.map((function(e){return e.id}));return t.every((function(e){return!!e}))?t:void 0},iv=function(e,t){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=Pa(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?nv(e.questions,tv(e.questions)):e.questions;var n},ov=function(e){return xh(e)||hv(e)},sv=function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__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,uu(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ka++,t.__={isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},onPreviewBack:function(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null},t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}(),av=function(){return Vu(sv)},uv=function(e){var t=e.children,n=e.style;return function(e,t,n){var r,i,o,s,a=eu({},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?Ma.call(arguments,2):n),ru(e.type,a,r||e.key,i||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n})};function lv(e,t){var n,r;if(null==(n=e.conditions)||!n.url)return!0;var i=b_(t);if(!i)return!1;var o=[e.conditions.url],s=function(e){return null!=e?e:"icontains"}(null==(r=e.conditions)?void 0:r.urlMatchType);return Ph[s](o,[i])}var cv=function(e){return Oh(Ah,e)},dv=function(e,t){try{localStorage.setItem(cv(e),JSON.stringify(t))}catch(e){Ih.error("Error setting in-progress survey state in localStorage",e)}},fv=function(e){try{var t=localStorage.getItem(cv(e));if(t)return JSON.parse(t)}catch(e){Ih.error("Error getting in-progress survey state from localStorage",e)}return null},hv=function(e){var t=fv(e);return!Ml(null==t?void 0:t.surveySubmissionId)},pv=function(e){try{localStorage.removeItem(cv(e))}catch(e){Ih.error("Error clearing in-progress survey state from localStorage",e)}};function _v(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function vv(e,t,n){if(void 0===t&&(t=rl.Right),e===ol.ExternalSurvey)return{};switch(t){case rl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case rl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case rl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case rl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case rl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case rl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case rl.Left:return{left:"30px"};case rl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===ol.Widget&&n===nl.Tab?"60px":"30px"}}}var gv=0;function mv(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:--gv,__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 Da.vnode&&Da.vnode(l),l}var yv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),bv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),wv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),Sv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),kv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),xv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:mv("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"})}),Cv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:mv("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"})}),Ev=function(e){var t=(void 0===e?{}:e).fill,n=void 0===t?"currentColor":t;return mv("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:n,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[mv("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),mv("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:n})]})},Pv=mv("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[mv("g",{"clip-path":"url(#clip0_2415_6911)",children:[mv("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:mv("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),mv("g",{mask:"url(#mask0_2415_6911)",children:[mv("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),mv("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),mv("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),mv("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),mv("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),mv("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),mv("defs",{children:mv("clipPath",{id:"clip0_2415_6911",children:mv("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Tv(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 mv("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Pv]})}function Iv(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=Vu(sv).isPreviewMode,d=!!u&&!!l,f=!a&&mv("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){o&&(null==Uf||Uf.open(o)),c?null==s||s():i()},children:t});return mv("div",{className:"bottom-section",children:[d?mv("div",{className:"form-buttons form-buttons-with-back",children:[mv("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:r.backButtonText||"Back"}),f]}):f,!r.whiteLabel&&mv(Tv,{urlParams:{utm_source:"survey-footer"}})]})}function Fv(e){var t=e.question,n=e.forceDisableHtml;return mv("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[mv(t.type===sl.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&uv({component:nu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function Rv(e){return mv("button",{className:"form-cancel",onClick:e.onClick,disabled:Vu(sv).isPreviewMode,"aria-label":"Close survey",type:"button",children:Ev({fill:"black"})})}mv("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:mv("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Lv=Uf;function Av(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=Vu(sv).isPopup;return Hu((function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),s())};return fh(Lv,"keydown",e),function(){Lv.removeEventListener("keydown",e)}}),[s]),mv("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&mv(Rv,{onClick:function(){return s()}}),mv("h3",{className:"thank-you-message-header",children:t}),n&&uv({component:nu("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&mv(Iv,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})}function Ov(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onStart,a=Vu(sv),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return mv("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==o.hideCancelButton&&mv(Rv,{onClick:function(){return l()}}),t&&mv("h3",{className:"intro-screen-header",children:t}),n&&uv({component:nu("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!i&&"text"!==r}),mv(Iv,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:s,onPreviewSubmit:function(){return u(null)}})]})}var Mv=function(e){return Pl(e)&&e.every((function(e){return Ll(e)}))};function Dv(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=av().isPreviewMode,d=ju(null),f=Bu((function(){return Ll(a)?a:""})),h=f[0],p=f[1],_=null==r?void 0:r.disableAutofocus;Hu((function(){_||setTimeout((function(){var e;c||null==(e=d.current)||e.focus()}),100)}),[c,_]);var v="surveyQuestion"+s,g=Uu((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=Pa(t);!(s=a()).done;){var u=s.value;switch(u.type){case bl: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 wl: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]),m=Bf(t.validation,bl),y=Bf(t.validation,wl),b=Uu((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}(m,y)}),[m,y]),w=function(){g||i(h.trim())},S=function(){g||o(h.trim())};return mv(iu,{children:[mv("div",{className:"question-container",children:[mv(Fv,{question:t,forceDisableHtml:n,htmlFor:v}),mv("textarea",{ref:d,id:v,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:m,maxLength:y,onInput:function(e){p(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||g||(e.preventDefault(),c?S():w())},value:h}),b&&mv("div",{className:"validation-hint",children:b})]}),mv(Iv,{text:t.buttonText||"Submit",submitDisabled:!!g,appearance:r,onSubmit:w,onPreviewSubmit:S,canGoBack:u,onBack:l})]})}function qv(e){var t=e.question,n=e.appearance,r=e.onSubmit,i=e.onPreviewSubmit,o=e.canGoBack,s=e.onBack;return mv(iu,{children:[mv("div",{className:"question-container",children:mv(Fv,{question:t,forceDisableHtml:e.forceDisableHtml})}),mv(Iv,{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 $v(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=Bu((function(){return Dl(u)?u:Pl(u)&&u.length>0&&Dl(parseInt(u[0]))?parseInt(u[0]):Ll(u)&&Dl(parseInt(u))?parseInt(u):null})),p=h[0],_=h[1],v="emoji"===n.display&&2===n.scale,g=av().isPreviewMode,m=function(e){return g?a(e):s(e)};return mv(iu,{children:[mv("div",{className:"question-container",children:[mv(Fv,{question:n,forceDisableHtml:r}),mv("div",{className:"rating-section",children:[mv("div",{className:"rating-options",children:["emoji"===n.display&&mv("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Vv[n.scale])?void 0:t.map((function(e,t){return mv("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&&mv("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-f+1)+", minmax(0, 1fr))"},children:zv(n.scale).map((function(e,t){return mv(Nv,{displayQuestionIndex:i,active:p===e,appearance:o,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)}))})]}),!v&&mv("div",{className:"rating-text",children:[mv("div",{children:n.lowerBoundLabel}),mv("div",{children:n.upperBoundLabel})]})]})]}),mv(Iv,{text:n.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Ol(p)&&!n.optional,appearance:o,onSubmit:function(){return s(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function Nv(e){var t=e.num,n=e.setActiveNumber;return mv("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 Bv(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=ju(null),d=Uu((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=nv(t,tv(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),f=Bu((function(){return function(e,t){return Ll(e)||Mv(e)?e:t===sl.SingleChoice?null:[]}(a,t.type)})),h=f[0],p=f[1],_=Bu((function(){return function(e,t){if(Ll(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Mv(e)){var n=e.find((function(e){return!t.includes(e)}));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}}(a,d)})),v=_[0],g=_[1],m=av().isPreviewMode,y=t.type===sl.SingleChoice,b=t.type===sl.MultipleChoice,w=t.skipSubmitButton&&y&&!t.hasOpenChoice,S=function(e,t){if(t){var n=!v.isSelected;return g((function(e){return Ta({},e,{isSelected:n,inputValue:n?e.inputValue:""})})),y&&p(""),void(n&&setTimeout((function(){var e;return null==(e=c.current)?void 0:e.focus()}),75))}if(y)return p(e),g((function(e){return Ta({},e,{isSelected:!1,inputValue:""})})),void(w&&(o(e),m&&s(e)));b&&Pl(h)&&(h.includes(e)?p(h.filter((function(t){return t!==e}))):p([].concat(h,[e])))},k=function(e){e.stopPropagation();var t=e.currentTarget.value;g((function(e){return Ta({},e,{inputValue:t})})),y&&p(t)},x=function(e){e.stopPropagation(),"Enter"!==e.key||C()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),g((function(e){return Ta({},e,{isSelected:!1,inputValue:""})})),y&&p(null))},C=function(){return!(t.optional||!Ol(h)&&(!Pl(h)||v.isSelected||0!==h.length)&&(!v.isSelected||""!==v.inputValue.trim()))},E=function(){v.isSelected&&b?Pl(h)&&(m?s([].concat(h,[v.inputValue])):o([].concat(h,[v.inputValue]))):m?s(h):o(h)};return mv(iu,{children:[mv("div",{className:"question-container",children:[mv(Fv,{question:t,forceDisableHtml:n}),mv("fieldset",{className:"multiple-choice-options limit-height",children:[mv("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),d.map((function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,o="surveyQuestion"+r+"Choice"+n,s=o+"Open",a=i?v.isSelected:y?h===e:Pl(h)&&h.includes(e);return mv("label",{className:i?"choice-option-open":"",children:[mv("div",{className:"response-choice",children:[mv("input",{type:y?"radio":"checkbox",name:o,checked:a,onChange:function(){return S(e,i)},id:o,"aria-controls":s}),mv("span",{children:i?e+":":e})]}),i&&mv("input",{type:"text",ref:c,id:s,name:"question"+r+"Open",value:v.inputValue,onKeyDown:x,onInput:k,onClick:function(t){v.isSelected||S(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)}))]})]}),mv(Iv,{text:t.buttonText||"Submit",submitDisabled:C(),appearance:i,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:w,canGoBack:u,onBack:l})]})}var Hv=[1,2,3,4,5],jv=[1,2,3,4,5,6,7],Uv=[0,1,2,3,4,5,6,7,8,9,10],Vv={2:[xv,Cv],3:[wv,bv,yv],5:[Sv,wv,bv,yv,kv]};function zv(e){switch(e){case 5:default:return Hv;case 7:return jv;case 10:return Uv}}var Wv=nh("[Surveys]");function Gv(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?al.End:o;if(i.branching.type===al.End)return al.End;if(i.branching.type===al.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===al.ResponseBased){if(i.type===sl.SingleChoice){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];return Number.isInteger(u)?u:u===al.End?al.End:o}}else if(i.type===sl.Rating){var l;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];return Number.isInteger(d)?d:d===al.End?al.End:o}}return o}return Wv.warn("Falling back to next question index due to unexpected branching type"),o}var Qv="__POSTHOG_TOOLBAR__",Kv="https?://(.*)",Zv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Yv=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Zv),Jv="<masked>",Xv=["li_fat_id"];function eg(e,t,n){if(!Wf)return{};var r,i=t?[].concat(Zv,n||[]):[],o=tg(p_(Wf.URL,i,Jv),e),s=(r={},ih(Xv,(function(e){var t=w_(e);r[e]=t||null})),r);return oh(s,o)}function tg(e,t){var n=Yv.concat(t||[]),r={};return ih(n,(function(t){var n=h_(e,t);r[t]=n||null})),r}function ng(e){var t=function(e){return e?0===e.search(Kv+"google.([^/?]*)")?"google":0===e.search(Kv+"bing.com")?"bing":0===e.search(Kv+"yahoo.com")?"yahoo":0===e.search(Kv+"duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!Ol(t)){r.$search_engine=t;var i=Wf?h_(Wf.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function rg(){return navigator.language||navigator.userLanguage}var ig="$direct";function og(){return(null==Wf?void 0:Wf.referrer)||ig}function sg(e,t,n){void 0===n&&(n=!1);var r=e?[].concat(Zv,t||[]):[],i=n?kd(null==Gf?void 0:Gf.href):null==Gf?void 0:Gf.href,o=null==i?void 0:i.substring(0,1e3);return{r:og().substring(0,1e3),u:o?p_(o,r,Jv):void 0}}function ag(e,t){var n;void 0===t&&(t=!1);var r=e.r,i=e.u,o=t?kd(i):i,s={$referrer:r,$referring_domain:null==r?void 0:r==ig?ig:null==(n=f_(r))?void 0:n.host};if(o){s.$current_url=o;var a=f_(o);s.$host=null==a?void 0:a.host,s.$pathname=null==a?void 0:a.pathname;var u=tg(o);oh(s,u)}if(r){var l=ng(r);oh(s,l)}return s}function ug(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function lg(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var cg=nh("[SurveyTranslations]");function dg(e,t){var n=function(e){return function(e,t){var n=e.storedPersonProperties,r=e.locale,i=mh(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?mh(e.language):null}(n);if(o)return null==t||t.info("Using person property language: "+o),o;var s=mh(r);return s?(null==t||t.info("Using detected locale: "+s),s):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Tl(e.get_property)?e.get_property(wp):void 0,locale:rg()},cg)}(t);if(!n)return cg.info("No user language detected"),{survey:e,language:null};var r=Sh(e,n,cg);return{survey:r.survey,language:r.matchedKey}}var fg=-1,hg=Uf,pg=Wf,_g="ph:show_survey_widget",vg="PHWidgetSurveyClickListener";function gg(e,t){try{var n=e.getBoundingClientRect(),r=hg.innerHeight,i=hg.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:W_.zIndex}}catch(e){return Ih.warn("Failed to calculate trigger position:",e),null}}var mg=function(){function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTargets=new Map,this._prefillHandledSurveys=new Set,this._currentLanguage=null,this._surveyIsRendered=!1,this._languageChangeListener=null,this._unsubscribeFeatureFlags=null,this._surveyPopupProps=null,this.handlePageUnload=function(){var e=t._posthog.get_property(xp);if(e)for(var n,r=Pa(e);!(n=r()).done;){var i=n.value;hv(i)&&ev(i,t._posthog)}},this.handlePopoverSurvey=function(e,n,r){var i,o,s,a,u,l=(void 0===r?{}:r).resumeDelayFromActivation,c=void 0!==l&&l,d=t._translateSurveyForRendering(e),f=d.survey,h=d.language;t._currentLanguage=h,t._surveyPopupProps=null,t._displayOptions=n;var p=t._applyDisplayOverrides(f,n);t._clearSurveyTimeout(p.id);var _=null!=n?n:{},v=_.properties,g=_.initialResponses,m=!(!g||0>=Object.keys(g).length)&&t._handleInitialResponses(p,g,v,h);if(!m||null!=(i=p.appearance)&&i.displayThankYouMessage){t._addSurveyToFocus(p);var y={};if((null==(o=p.appearance)?void 0:o.position)===rl.NextToTrigger&&null!=(s=p.appearance)&&s.widgetSelector){var b,w=pg.querySelector(p.appearance.widgetSelector);w&&(y=gg(w,parseInt((null==(b=p.appearance)?void 0:b.maxWidth)||W_.maxWidth))||{})}var S=(null==(a=p.appearance)?void 0:a.surveyPopupDelaySeconds)||0,k=Z_(p,t._posthog).shadow;t._renderedTargets.set(k,k.host);var x={posthog:t._posthog,survey:p,removeSurveyFromFocus:t._removeSurveyFromFocus,properties:v,style:y,isSurveyCompleted:m,skipShownEvent:null==n?void 0:n.skipShownEvent,surveyLanguage:h};if(t._surveyPopupProps=x,0>=S)return t._surveyIsRendered=!0,Cu(mv(kg,Ta({},x)),k);var C=function(){if(!t._shouldDisplaySurvey(p))return Ih.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),t._removeSurveyFromFocus(p);!function(){t._surveyIsRendered=!0;var r=t._translateSurveyForRendering(e),i=r.survey,o=r.language;t._currentLanguage=o;var s=t._applyDisplayOverrides(i,n),a=Ta({},x,{survey:s,surveyLanguage:o});t._surveyPopupProps=a,Cu(mv(kg,Ta({},a,{survey:Ta({},s,{appearance:Ta({},s.appearance,{surveyPopupDelaySeconds:0})})})),k)}()},E=c?null==(u=t._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,P=Dl(E)?Math.max(0,Date.now()-E):0,T=Math.max(0,1e3*S-P);if(0>=T)return C();var I=hg.setTimeout((function(){t._surveyTimeouts.delete(p.id),C()}),T);t._surveyTimeouts.set(p.id,I)}},this._handleWidget=function(e){var n=t._translateSurveyForRendering(e),r=n.survey,i=n.language,o=Z_(r,t._posthog),s=o.shadow,a=o.isNewlyCreated;t._renderedTargets.set(s,s.host),a&&Cu(mv(Cg,{posthog:t._posthog,survey:r,surveyLanguage:i},e.id),s)},this._detachWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute(vg),t._widgetSelectorListeners.delete(e),Ih.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._detachWidgetSelectorListener(e.id))},this._isWidgetSurveyOpen=function(e){try{var t,n=pg.querySelector(_v(e,!0));return!(null==n||null==(t=n.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,n){var r=pg.querySelector(n),i=t._widgetSelectorListeners.get(e.id);if(r){if(t._handleWidget(e),i){if(r===i.element)return;Ih.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._detachWidgetSelectorListener(e.id)}if(!r.hasAttribute(vg)){var o=function(t){var n,r;t.stopPropagation();var i=(null==(n=e.appearance)?void 0:n.position)===rl.NextToTrigger?gg(t.currentTarget,parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||W_.maxWidth)):{};hg.dispatchEvent(new CustomEvent(_g,{detail:{surveyId:e.id,position:i}}))};fh(r,"click",o),r.setAttribute(vg,"true"),t._widgetSelectorListeners.set(e.id,{element:r,listener:o,survey:e}),Ih.info("Attached click listener for feedback button survey "+e.id)}}else i&&t._removeWidgetSelectorListener(e)},this.renderPopover=function(e){var n=t._translateSurveyForRendering(e),r=n.survey,i=n.language,o=Z_(r,t._posthog).shadow;t._renderedTargets.set(o,o.host),Cu(mv(kg,{posthog:t._posthog,survey:r,removeSurveyFromFocus:t._removeSurveyFromFocus,surveyLanguage:i}),o)},this.renderSurvey=function(e,n,r){var i,o=t._translateSurveyForRendering(e),s=o.survey,a=o.language,u=!1;null!=(i=t._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(u=t._handleUrlPrefill(s,a,r)),Cu(mv(kg,{posthog:t._posthog,survey:s,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:u,surveyLanguage:a}),n)},this.getActiveMatchingSurveys=function(e,n){var r;void 0===n&&(n=!1),null==(r=t._posthog)||null==(r=r.surveys)||r.getSurveys((function(n){var r=n.filter((function(e){return t._shouldDisplaySurvey(e)}));e(r)}),n)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((function(e){for(var n=e.filter((function(e){return e.type===ol.Popover||e.type===ol.Widget})),r=new Set(n.map((function(e){return e.id}))),i=0,o=Array.from(t._surveyTimeouts.keys());o.length>i;i++){var s=o[i];r.has(s)||t.cancelSurvey(s)}var a=t._sortSurveysByAppearanceDelay(n),u=new Set;a.forEach((function(e){if(e.type===ol.Widget){var n,r,i,o;if((null==(n=e.appearance)?void 0:n.widgetType)===nl.Tab)return void t._handleWidget(e);(null==(r=e.appearance)?void 0:r.widgetType)===nl.Selector&&null!=(i=e.appearance)&&i.widgetSelector&&(u.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector))}Ol(t._surveyInFocus)&&e.type===ol.Popover&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})})),t._widgetSelectorListeners.forEach((function(e){var n=e.survey;u.has(n.id)||t._removeWidgetSelectorListener(n)}))}),e)},this._addSurveyToFocus=function(e){Ol(t._surveyInFocus)||Ih.error("Survey "+t._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&Ih.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),t._clearSurveyTimeout(e.id),t._surveyInFocus=null,t._currentLanguage=null,t._surveyIsRendered=!1,t._surveyPopupProps=null,t._displayOptions=void 0,t._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null,this._languageChangeListener=function(){return t._onLanguageChange()},fh(hg,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=e.onFeatureFlags((function(){return t._onLanguageChange()}))}var t=e.prototype;return t._onLanguageChange=function(){var e=this;if(!Ol(this._surveyInFocus)){var t=this._posthog.get_property(xp),n=null==t?void 0:t.find((function(t){return t.id===e._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=Z_(s,this._posthog).shadow;Cu(mv(kg,Ta({},this._surveyPopupProps,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:o})),a)}}}},t._applyDisplayOverrides=function(e,t){return null!=t&&t.position||null!=t&&t.selector?Ta({},e,{appearance:Ta({},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)&&(Ih.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.setAutomaticDisplayDispose=function(e){this._automaticDisplayDispose=e},t.dispose=function(){var e,t=this;null==(e=this._automaticDisplayDispose)||e.call(this),this._automaticDisplayDispose=void 0,this._languageChangeListener&&(hg.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){Cu(null,t),null==e||e.remove()})),this._renderedTargets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort((function(e,t){var n,r,i=hv(e),o=hv(t);if(i&&!o)return-1;if(!i&&o)return 1;var s=e.schedule===ul,a=t.schedule===ul;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 dg(e,this._posthog)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(e){var t={},n=!1,r=e.replace(/^\?/,"");if(!r)return{params:t,autoSubmit:n};for(var i,o=Pa(r.split("&"));!(i=o()).done;){var s=i.value.split("="),a=s[0],u=s[1];if(a&&!Rl(u)){var l=decodeURIComponent(a),c=decodeURIComponent(u);if("auto_submit"!==l||"true"!==c){var d=l.match(/^q(\d+)$/);if(d){var f=parseInt(d[1],10);t[f]||(t[f]=[]),t[f].push(c)}}else n=!0}}return{params:t,autoSubmit:n}}(hg.location.search),i=r.params;if(0===Object.keys(i).length)return!1;Ih.info("[Survey Prefill] Detected URL prefill parameters");var o=this._processPrefillData(e,i,t);return!!o&&(this._autoSubmitPrefilledResponses(e,o,n,t),this._prefillHandledSurveys.add(e.id),o.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)&&Y_({responses:s?i:a,survey:e,surveySubmissionId:o,posthog:this._posthog,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])]=Pl(u)?u.map(String):[String(u)]}Ih.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=ph(e.id);try{switch(e.type){case sl.SingleChoice:if(!e.choices||0===e.choices.length)return void th.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 th.warn("[Survey Prefill] Invalid choice index for q"+r+": "+i[0]);n[o]=e.choices[s];break;case sl.MultipleChoice:if(!e.choices||0===e.choices.length)return void th.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 th.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&&th.warn("[Survey Prefill] Removed duplicate choices for q"+r),n[o]=u;break;case sl.Rating:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void th.warn("[Survey Prefill] Invalid rating for q"+r+": "+i[0]+" (scale: 0-"+c+")");n[o]=l;break;default:th.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){th.error("[Survey Prefill] Error converting q"+r+":",e)}}})),n}(e,t);if(0===Object.keys(r).length)return Ih.warn("[Survey Prefill] No valid responses after conversion"),null;var i=l_(),o=Object.keys(t).map((function(e){return parseInt(e,10)})),s=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=ph(u.id);Rl(n[l])||(i[l]=n[l])}o.push(r);var c=Gv(e,r,u.id?n[ph(u.id)]:null);if(c===al.End)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:o};r=c}return{startQuestionIndex:r,skippedResponses:i,skippedIndices:o}}(e,o,r),a=s.startQuestionIndex,u=s.skippedResponses,l=s.skippedIndices,c=a>=e.questions.length;return dv(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:a,questionOrder:rv(e.questions),visitedIndices:l,surveyLanguage:n}),Ih.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:a,isSurveyCompleted:c,skippedResponses:u}}catch(e){return Ih.error("[Survey Prefill] Error handling prefill:",e),null}},t._isSurveyFeatureFlagEnabled=function(e,t){if(void 0===t&&(t=void 0),!e)return!0;var n=this._featureFlags,r=!(null==n||!n.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),i=!0;return t&&(i=(null==n?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),r&&i},t._isSurveyConditionMatched=function(e){return!e.conditions||lv(e,this._posthog)&&function(e){var t,n;return function(e,t){var n,r,i;if(!e||0===e.length)return!0;if(!Jf)return!1;var o=ud(Jf,{userAgentDataPlatform:null==zf||null==(n=zf.userAgentData)?void 0:n.platform,maxTouchPoints:null==zf?void 0:zf.maxTouchPoints,screenWidth:null==Uf||null==(r=Uf.screen)?void 0:r.width,screenHeight:null==Uf||null==(i=Uf.screen)?void 0:i.height,devicePixelRatio:null==Uf?void 0:Uf.devicePixelRatio});return Ph[null!=t?t:"icontains"](e,[o])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==V_||!V_.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return ov(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._featureFlags)&&t.hasLoadedFlags?{satisfied:this._isSurveyFeatureFlagEnabled(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(!Fh(e))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+e.end_date,r;if(!qh.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,t){if(!e||!t)return!0;var n="string"==typeof t?new Date(t):t,r=new Date,i=Math.abs(r.getTime()-n.getTime());return Math.ceil(i/864e5)>e}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays,P_._get("lastSeenSurveyDate"))?function(e){return!!P_._get(Mh(e))&&!ov(e)}(e)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(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.checkSurveyRenderability=function(e){var t=this.checkSurveyEligibility(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;if(!kh(e)&&!Rh(e))return!0;var n=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==n||!n.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=pg.querySelector(_v(e,!0));null!=t&&t.shadowRoot&&(Cu(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Ih.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,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this),onLanguageChange:this._onLanguageChange.bind(this),currentLanguage:this._currentLanguage,surveyIsRendered:this._surveyIsRendered}},Ea(e,[{key:"_featureFlags",get:function(){var e,t,n;return null!==(e=null==(t=(n=this._posthog).getExtension)?void 0:t.call(n,Nh))&&void 0!==e?e:this._posthog.featureFlags}}])}();function yg(e,t){if(pg&&hg){var n,r=new mg(e);if(e.config.disable_surveys_automatic_display)return Ih.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===t)return Ih.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var i=function(){Rl(n)&&(n=setInterval((function(){r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},o=function(){Rl(n)||(clearInterval(n),n=void 0)};i();var s=function(){pg.hidden?o():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return fh(pg,"visibilitychange",s),r.setAutomaticDisplayDispose((function(){o(),pg.removeEventListener("visibilitychange",s)})),r}}function bg(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;Hu((function(){var e;if(!s&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===ol.Widget,o=lv(t,a),s=(null==(e=t.appearance)?void 0:e.widgetType)===nl.Tab&&n;if(!o)return Ih.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(Ih.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};fh(hg,"popstate",n),fh(hg,"hashchange",n);var o=hg.history.pushState,u=hg.history.replaceState;return hg.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()},hg.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(){hg.removeEventListener("popstate",n),hg.removeEventListener("hashchange",n),hg.history.pushState=o,hg.history.replaceState=u}}}),[s,t,r,i,a])}var wg=200;function Sg(e){switch(void 0===e&&(e=il.Right),e){case il.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case il.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case il.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function kg(e){var t,n,r,i,o,s,a,u,l,c,d,f,h=e.survey,p=e.forceDisableHtml,_=e.posthog,v=e.style,g=void 0===v?{}:v,m=e.previewPageIndex,y=e.removeSurveyFromFocus,b=void 0===y?function(){}:y,w=e.isPopup,S=void 0===w||w,k=e.onPreviewSubmit,x=void 0===k?function(){}:k,C=e.onPreviewBack,E=void 0===C?function(){}:C,P=e.onPopupSurveyDismissed,T=void 0===P?function(){}:P,I=e.onCloseConfirmationMessage,F=void 0===I?function(){}:I,R=e.properties,L=e.isSurveyCompleted,A=e.skipShownEvent,O=e.surveyLanguage,M=ju(null),D=Number.isInteger(m),q=null!=(t=h.appearance)&&t.surveyPopupDelaySeconds?1e3*h.appearance.surveyPopupDelaySeconds:0,N=function(e,t,n,r,i,o,s,a,u){var l=Bu(r||0===n||e.type===ol.ExternalSurvey),c=l[0],d=l[1],f=Bu(!1),h=f[0],p=f[1],_=ju(!1),v=function(){var t=function(){o&&i(e),d(!1)};if(!_.current){var n=null==s?void 0:s.current;n?(_.current=!0,n.style.transition="opacity "+wg+"ms ease-out",n.style.opacity="0",setTimeout((function(){_.current=!1,t()}),wg+50)):t()}},g=function(t){t.detail.surveyId===e.id&&v()};return Hu((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 v();p(!0),null!=(r=e.appearance)&&r.autoDisappear&&(i&&clearTimeout(i),i=setTimeout(v,5e3))}},s=function(){if(lv(e,t)){var n,r;d(!0),hg.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(ll.SHOWN,Ta(((n={})[cl.SURVEY_NAME]=e.name,n[cl.SURVEY_ID]=e.id,n[cl.SURVEY_ITERATION]=e.current_iteration,n[cl.SURVEY_ITERATION_START_DATE]=e.current_iteration_start_date,n),u&&((r={})[cl.SURVEY_LANGUAGE]=u,r),{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};fh(hg,"PHSurveyClosed",g),fh(hg,"PHSurveySent",o);var l=n>0?setTimeout(s,n):void 0;return Rl(l)&&s(),function(){Rl(l)||clearTimeout(l),Rl(i)||clearTimeout(i),hg.removeEventListener("PHSurveyClosed",g),hg.removeEventListener("PHSurveySent",o)}}}else Ih.error("usePopupVisibility hook called without a PostHog instance.")}),[]),bg({survey:e,removeSurveyFromFocus:i,setSurveyVisible:d,isPreviewMode:r,posthog:t}),{isPopupVisible:c,isSurveySent:h,setIsPopupVisible:d,hidePopupWithAnimation:v}}(h,_,q,D,b,S,M,A,O),B=N.isPopupVisible,H=N.hidePopupWithAnimation,j=N.isSurveySent||m===h.questions.length||!0===L,U=Bu(!1),V=U[0],z=U[1],W=Uu((function(){return!!fv(h)}),[h]),G=!!(null!=(n=h.appearance)&&n.introScreenHeader||null!=(r=h.appearance)&&r.introScreenDescription),Q=D?m===fg:!(null==(i=h.appearance)||!i.displayIntroScreen)&&G&&!V&&!W,K=Uu((function(){var e=fv(h),t=(null==e?void 0:e.surveySubmissionId)||l_();return{isPreviewMode:D,previewPageIndex:m,onPopupSurveyDismissed:function(){O?X_(h,_,D,O):X_(h,_,D),T()},isPopup:S||!1,surveySubmissionId:t,onPreviewSubmit:x,onPreviewBack:E,posthog:_,properties:R,surveyLanguage:O}}),[D,m,S,_,h,T,x,E,R,O]);return B?mv(sv.Provider,{value:K,children:mv("div",{className:"ph-survey",style:Ta({},vv(h.type,null==(o=h.appearance)?void 0:o.position,null==(s=h.appearance)?void 0:s.widgetType),g),ref:M,children:j?mv(Av,{header:(null==(a=h.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(u=h.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=h.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:h.appearance||W_,onClose:function(){H(),F()}}):Q?mv(Ov,{header:(null==(c=h.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=h.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(f=h.appearance)?void 0:f.introScreenDescriptionContentType,appearance:h.appearance||W_,onStart:function(){return z(!0)}}):mv(xg,{survey:h,forceDisableHtml:!!p,posthog:_})})}):null}function xg(e){var t,n,r=e.survey,i=e.forceDisableHtml,o=e.posthog,s=Uu((function(){var e=fv(r);if(!e)return null;var t=Dl(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&r.questions.length>e.lastQuestionIndex?e:(pv(r),null)}),[r]),a=Bu((function(){return null!=s&&s.responses&&Ih.info("Survey is already in progress, filling in initial responses"),(null==s?void 0:s.responses)||{}})),u=a[0],l=a[1],c=Vu(sv),d=c.previewPageIndex,f=c.onPopupSurveyDismissed,h=c.isPopup,p=c.onPreviewSubmit,_=c.onPreviewBack,v=c.surveySubmissionId,g=c.isPreviewMode,m=c.properties,y=c.surveyLanguage,b=Bu((function(){var e=null==s?void 0:s.lastQuestionIndex,t=Dl(e)&&e>=0&&r.questions.length>e?e:0;return Dl(d)&&d>=0?d:t})),w=b[0],S=b[1],k=Bu((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}))})),x=k[0],C=k[1],E=Bu((function(){var e,t=fv(r);return null!==(e=null==t?void 0:t.questionSnapshots)&&void 0!==e?e:{}})),P=E[0],T=E[1],I=Uu((function(){return rv(iv(r,s))}),[r.id,s]),F=Uu((function(){if(!I||new Set(I).size!==I.length)return iv(r,s);var e=new Map(r.questions.map((function(e){return[e.id,e]}))),t=I.map((function(t){return e.get(t)})).filter((function(e){return!!e}));return t.length===I.length?t:r.questions}),[I,r.questions,r,s]);Hu((function(){!g||Rl(d)||0>d||S(d)}),[d,g]);var R=!(null==(t=r.appearance)||!t.allowGoBack)&&(g?(null!=d?d:0)>0:x.length>0),L=F.at(w);return L?mv("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(n=r.appearance)?void 0:n.hideCancelButton)&&mv(Rv,{onClick:function(){f()}}),mv("div",{className:"survey-box","data-question-index":w,children:Eg({question:L,forceDisableHtml:i,displayQuestionIndex:w,appearance:r.appearance||W_,onSubmit:function(e){return function(e){var t,n,i=e.res,s=e.displayQuestionIndex,a=e.questionId;if(o)if(a){var c=ph(a),d=Ta({},u,((t={})[c]=i,t));l(d);var f=F[s],h=null!=f&&f.id?Ta({},P,((n={})[f.id]=f.question,n)):P;T(h);var p=Gv(r,s,i),_=p===al.End,g=[].concat(x,[s]);if(_||(C(g),S(p),dv(r,{surveySubmissionId:v,responses:d,lastQuestionIndex:p,questionOrder:rv(F),visitedIndices:g,surveyLanguage:y,questionSnapshots:h})),r.enable_partial_responses||_){var b=new Set(g.map((function(e){var t;return null==(t=F[e])?void 0:t.id})).filter((function(e){return!!e})).map((function(e){return ph(e)}))),w=Object.fromEntries(Object.entries(d).filter((function(e){return b.has(e[0])})));Y_({responses:w,survey:r,surveySubmissionId:v,isSurveyCompleted:_,posthog:o,properties:m,surveyLanguage:y,questionSnapshots:h})}}else Ih.error("onNextButtonClick called without a questionId.");else Ih.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:w,questionId:L.id})},onPreviewSubmit:p,initialValue:L.id?u[ph(L.id)]:void 0,canGoBack:R,onBack:function(){if(g)_();else if(0!==x.length){var e=x[x.length-1],t=x.slice(0,-1);C(t),S(e),dv(r,{surveySubmissionId:v,responses:u,lastQuestionIndex:e,questionOrder:rv(F),visitedIndices:t,surveyLanguage:y,questionSnapshots:P})}}})})]}):null}function Cg(e){var t,n,r,i,o,s,a,u=e.survey,l=e.forceDisableHtml,c=e.posthog,d=e.readOnly,f=e.surveyLanguage,h=Bu(!0),p=h[0],_=h[1],v=Bu(!1),g=v[0],m=v[1],y=Bu({}),b=y[0],w=y[1],S=ju(void 0),k=function(){m(!g)};if(Hu((function(){var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&w({top:"50%",bottom:"auto"});var t=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===u.id&&(Ih.info("Received show event for feedback button survey "+u.id),w(n.detail.position||{}),k())};return fh(hg,_g,t),function(){Rl(S.current)||(clearTimeout(S.current),S.current=void 0),hg.removeEventListener(_g,t)}}}else Ih.error("FeedbackWidget called without a PostHog instance.")}),[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(n=u.appearance)?void 0:n.widgetSelector,null==(r=u.appearance)?void 0:r.borderColor]),bg({survey:u,setSurveyVisible:_,posthog:c}),!p)return null;var x=function(){u.schedule!==ul&&_(!1),Rl(S.current)||clearTimeout(S.current),S.current=setTimeout((function(){S.current=void 0,m(!1)}),200)};return mv(iu,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&mv("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===il.Top?"widget-tab-top":""),onClick:k,disabled:d,style:Sg(null==(s=u.appearance)?void 0:s.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),g&&mv(kg,{posthog:c,survey:u,forceDisableHtml:l,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:f})]})}var Eg=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 sl.Open:return nu(Dv,Ta({},i,{question:t,key:t.id}));case sl.Link:return nu(qv,Ta({},i,{question:t,key:t.id}));case sl.Rating:return nu($v,Ta({},i,{question:t,key:t.id}));case sl.SingleChoice:case sl.MultipleChoice:return nu(Bv,Ta({},i,{question:t,key:t.id}));default:return Ih.error("Unsupported question type: "+t.type),null}},Pg="undefined"!=typeof globalThis?globalThis:Uf;Pg&&"undefined"==typeof self&&(Pg.self=Pg),Pg&&"undefined"==typeof File&&(Pg.File=function(){});var Tg=null!=Uf?Uf:{};Tg.__PosthogExtensions__=Tg.__PosthogExtensions__||{},Tg.__PosthogExtensions__.generateSurveys=yg,Tg.extendPostHogWithSurveys=yg;var Ig=nh("[Error tracking]"),Fg="webkit-masked-url:",Rg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Fg],Lg=["__firefox__","__gCrWeb"];function Ag(){return new Td([new Hd,new Yd,new Ud,new jd,new Kd,new Qd,new zd,new Zd],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=r;o.length>s;s++){var a=o[s];if(1024>=a.length){var u=Nd.test(a)?a.replace(Nd,"$1"):a;if(!u.match(/\S*Error: /)){for(var l=0,c=n;c.length>l;l++){var d=(0,c[l])(u,e);if(d){i.push(d);break}}if(i.length>=Bd)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Bd).map((function(e){return Ta({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Id});var n}))}(i)}}("web:javascript",Md,$d))}var Og=function(){function e(e){var t,n;this._suppressionRules=[],this._errorPropertiesBuilder=Ag(),this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property(Yh))&&void 0!==t?t:[],this._exceptionStepsConfig=nf(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new rf(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=nf(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,r;if(e.ok){var i=e.config;if("errorTracking"in i){var o,s=null!==(t=null==(n=i.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[],a=null==(r=i.errorTracking)?void 0:r.captureExtensionExceptions;this._suppressionRules=s,this._instance.persistence&&this._instance.persistence.register(((o={})[Yh]=this._suppressionRules,o[Jh]=a,o))}}},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(!Ll(e)||0===e.trim().length)return void Ig.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 ef.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&&Ig.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this._exceptionStepsBuffer.add(Ta(((n={})[Jd]=e,n[Xd]=(new Date).toISOString(),n),i))}catch(e){Ig.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 Ig.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 Ig.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 Ig.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 Ig.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this._exceptionStepsConfig.enabled&&Ml(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,r="string"==typeof(o=globalThis._posthogReleaseId)&&o.length>0?o: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 Ig.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void Ig.error("Failed to process exception event. Ignoring this exception.",e)}var o},t._addBufferedExceptionSteps=function(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:Ta({},e,{$exception_steps:t})}catch(t){return Ig.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={})[Jd]=e,t[Xd]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return Il(e)?Ta({},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 Ll(n)&&n.length>0&&e.$exception_types.push(n),Ll(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=Ph[e.operator],r=t[e.key];if(!n||!r)return!1;var i=Pl(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 Ig.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&&Rg.some((function(e){return t.startsWith(e)}))}));return 0!==n.length&&(!n.every((function(e){var t=e.filename;return!!t&&t.startsWith(Fg)}))||e.some((function(e){var t=e.value;return Ll(t)&&t.includes("isolatedAPI.contexts.topHostname")}))&&!t.some((function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(Fg))})))},t._isInjectedBrowserScriptException=function(e){return e.some((function(e){var t=e.value;return Ll(t)&&Lg.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:[],s=o[o.length-1];return null!==(r=null==s||null==(i=s.filename)?void 0:i.includes("posthog.com/static"))&&void 0!==r&&r}return!1},t._isExceptionList=function(e){return!Ml(e)&&Pl(e)},Ea(e,[{key:"_captureExtensionExceptions",get:function(){var e,t=!!this._instance.get_property(Jh),n=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=n?n:t)&&void 0!==e&&e}}])}(),Mg=nh("[ExceptionAutocapture]"),Dg=Ag(),qg=function(e){var t=Uf;t||Mg.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];var s=Dg.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(Ll(t)&&Ll(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}});return e(s),!!Tl(n)&&null!==(t=n.apply(void 0,i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},$g=function(e,t){void 0===t&&(t=!1);var n=Uf;n||Mg.info("window not available, cannot wrap onUnhandledRejection");var r=n.onunhandledrejection;return n.onunhandledrejection=function(n){var i,o=Dg.buildFromUnknown(n,{mechanism:{handled:!1}});return e(o),Tl(r)?null!==(i=r(n))&&void 0!==i&&i:t},n.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=n.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,n.onunhandledrejection=r}},Ng={wrapOnError:qg,wrapUnhandledRejection:$g,wrapConsoleError:function(e){var t=console;t||Mg.info("console not available, cannot wrap console.error");var n=t.error;return t.error=function(){for(var t,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];t=1==i.length?i[0]:i.join(" ");var s=i.find((function(e){return e instanceof Error})),a=Dg.buildFromUnknown(s||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(a),Tl(n)&&n.apply(void 0,i)},t.error.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=n}}};Tg.__PosthogExtensions__=Tg.__PosthogExtensions__||{},Tg.__PosthogExtensions__.errorWrappingFunctions=Ng,Tg.posthogErrorWrappingFunctions=Ng;var Bg=function(e,t){if(Tl(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,r=!Ol(n)&&"object"==typeof n&&Pl(n.errors_to_ignore)?n.errors_to_ignore.reduce((function(e,t){try{e.push(new RegExp(t))}catch(e){Mg.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){Mg.error("Failed to capture exception for a legacy client",e)}};qg((function(e){r.some((function(t){return e.$exception_list.some((function(e){return t.test(e.value||"")}))}))||i(e)})),$g(i,!0)}};Tg.extendPostHogWithExceptionAutoCapture=Bg,Tg.extendPostHogWithExceptionAutocapture=Bg;var Hg=function(){},jg=function(e){var t;if(Tl(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function Ug(e,t,n){try{if(!(t in e))return Hg;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 Tl(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=jg(n);o;){if(o.next===i)return void(o.next=r.next);o=jg(n=o.next)}else e[t]=r.next}}catch(e){return Hg}}var Vg="X-POSTHOG-SESSION-ID",zg="X-POSTHOG-WINDOW-ID",Wg="X-POSTHOG-DISTINCT-ID",Gg=[Vg,zg,Wg],Qg=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Kg=function(e,t){return{}.hasOwnProperty.call(e,t)},Zg=function(e){return"object"==typeof e&&!Ol(e)||Tl(e)},Yg=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},Jg=function(e){try{var t;return Yg(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Uf||null==(t=Uf.location)?void 0:t.href).toString()}catch(e){return}},Xg=function(e,t,n,r,i){var o;try{o=new URL(r).hostname}catch(e){return!1}if(!e)return!1;if(Pl(e)&&!e.includes(o))return!1;var s=!1;if(n){var a=n.checkAndGetSessionAndWindowId(!0),u=a.windowId;i.set(Vg,a.sessionId),i.set(zg,u),s=!0}var l=function(e){return Tl(e)?e():e}(t);return l&&l!==Hp&&(i.set(Wg,l),s=!0),s};Tg.__PosthogExtensions__=Tg.__PosthogExtensions__||{};var em={_patchFetch:function(e,t,n){return Ug(Uf,"fetch",(function(r){return function(i,o){var s=arguments.length>1?[i,o]:[i],a=s;try{var u=Jg(i);if(u)if(Yg(i)){var l=new Request(i,o);Xg(e,t,n,l.url,l.headers),a=[l]}else{var c=new Headers(Zg(o)?o.headers:void 0);if(Xg(e,t,n,u,c)){var d=function(e,t){if(Rl(e)||Ol(e))return{headers:t};if(Zg(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 Kg(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return Kg(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)})),Qg.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&&Qg.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?Ta({},i,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(o,c);d&&(a=[i,d])}}}catch(e){a=s}return r.apply(this,a)}}))},_patchXHR:function(e,t,n){return Ug(Uf.XMLHttpRequest.prototype,"open",(function(r){return function(i,o,s,a,u){void 0===s&&(s=!0);var l=this,c=new Headers,d=Jg(o);d&&Xg(e,t,n,d,c);var f=r.call(l,i,o,s,a,u);return Gg.forEach((function(e){var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),f}}))}};Tg.__PosthogExtensions__.tracingHeadersPatchFns=em,Tg.postHogTracingHeadersPatchFns=em;jf.DEBUG=!1,jf.LIB_VERSION="1.426.3",jf.LIB_NAME="web";var tm=function(){function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return this._config.cookieless_mode===Qp||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===Gp},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==zf?void 0:zf.doNotTrack,null==zf?void 0:zf.msDoNotTrack,Tg.doNotTrack,null==zf?void 0:zf.globalPrivacyControl].some((function(e){return Ql(e)}))},Ea(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 Ql(e)?1:pl(Kl,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?P_:C_,n=t._is_supported()?t:N_;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var r="localStorage"===e?C_:P_;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Ql(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}(),nm=1,rm=3,im=11;function om(e){return e instanceof Element&&(e.id===Qv||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sm(e){return!!e&&e.nodeType===nm}function am(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function um(e){return!!e&&e.nodeType===rm}function lm(e){return!!e&&e.nodeType===im&&sm(e.host)}var cm=1e3;function dm(e){return e?_l(e).split(/\s+/):[]}function fm(e,t){var n=b_(t);return!!(n&&e&&e.some((function(e){return n.match(e)})))}function hm(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 dm(t)}function pm(e){return Ml(e)?null:_l(e).split(/(\s+)/).filter((function(e){return $m(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function _m(e){var t="";return Im(e)&&!Fm(e)&&e.childNodes&&e.childNodes.length&&ih(e.childNodes,(function(e){var n;um(e)&&e.textContent&&(t+=null!==(n=pm(e.textContent))&&void 0!==n?n:"")})),_l(t)}function vm(e){var t;return Rl(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var gm=["a","button","form","input","select","textarea","label"];function mm(e,t){if(Rl(t))return!0;for(var n,r,i=function(){var e=r.value;if(t.some((function(t){return function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch(e){return!1}}(e,t)})))return{v:!0}},o=Pa(e);!(r=o()).done;)if(n=i())return n.v;return!1}function ym(e){var t=e.parentNode;return!(!t||!sm(t))&&t}var bm=[".ph-no-autocapture","[data-ph-no-autocapture]"],wm=["next","previous","prev",">","<"],Sm=[].concat(wm,["+","-","−","–"]),km=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},xm=[".ph-no-rageclick",".ph-no-capture"],Cm=["","text","search","email","password","url","tel","number"];function Em(e,t){if(!Uf||Pm(e))return!1;var n,r,i,o,s;if($l(t)?(n=!!t&&xm,r=void 0,i=!1):(n=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:xm,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||!sm(e))&&(!!am(e,"textarea")||(am(e,"input")?pl(Cm,(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=Tm(e,!1).targetElementList;return!function(e,t){if(!1===e||Rl(e))return!1;var n;if(!0===e)n=wm;else{if(!Pl(e))return!1;if(e.length>10)return th.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map((function(e){return e.toLowerCase()}))}return t.some((function(e){var t=e.safeText,r=e.ariaLabel;return n.some((function(e){return km(t,e)||km(r,e)}))}))}(r,a.map((function(e){var t;return{safeText:_m(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!mm(a,n)}var Pm=function(e){return!e||am(e,"html")||!sm(e)},Tm=function(e,t){if(!Uf||Pm(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!am(i,"body");)if(lm(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var o=ym(i);if(!o)break;if(t||gm.indexOf(o.tagName.toLowerCase())>-1)n=!0;else try{var s=Uf.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(n=!0)}catch(e){}r.push(o),i=o}return{parentIsUsefulElement:n,targetElementList:r}};function Im(e){for(var t=new Set,n=0,r=e;r.parentNode&&!am(r,"body");r=r.parentNode){if(n++>=cm||t.has(r))return!1;t.add(r);var i=hm(r);if(pl(i,"ph-sensitive")||pl(i,"ph-no-capture"))return!1}if(pl(hm(e),"ph-include"))return!0;var o=e.type||"";if(Ll(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!Ll(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function Fm(e){return!!(am(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||am(e,"select")||am(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Rm=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}))$"),Lm=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Am=[16,15,14,13],Om=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Mm=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Dm=/[0-9A-Za-z_]/;function qm(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 $m(e,t){if(void 0===t&&(t=!0),Ml(e))return!1;if(Ll(e)){e=_l(e);var n=t?Rm.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(Lm.lastIndex=0;t=Lm.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,""),i=0;r.length>i;i++)for(var o,s=Pa(Am);!(o=s()).done;){var a=i+o.value;if(r.length>=a){var u=r.slice(i,a);if(Rm.test(u)&&qm(u))return!0}}}return!1}(e);if(n)return!1;var r=t?Om.test(e):function(e){var t;for(Mm.lastIndex=0;t=Mm.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&Dm.test(n)&&Dm.test(r)))return!0}return!1}(e);if(r)return!1}return!0}function Nm(e){var t=_m(e);return $m(t=(t+" "+Bm(e)).trim())?t:""}function Bm(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ih(e.childNodes,(function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=_m(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Bm(e)).trim())}catch(e){th.error("[AutoCapture]",e)}})),t}function Hm(e){return e.replace(/"|\\"/g,'\\"')}function jm(e){var t=e.attr__class;if(t)return Pl(t)?t:dm(t)}var Um=nh("[Dead Clicks]"),Vm=function(){return!0},zm=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(ep)),r=e.instance.config.capture_dead_clicks;return $l(r)?r:!!Il(r)||n},Wm=function(){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){if(e.ok){var t,n=e.config;if("captureDeadClicks"in n)this.instance.persistence&&this.instance.persistence.register(((t={})[ep]=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=Tg.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(function(t){t?Um.error("failed to load script",t):e()}))},t._start=function(){var e;if(Wf){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=Tg.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Il(this.instance.config.capture_dead_clicks)?Ta({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=Tg.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Wf),Um.info("starting...")}}else Um.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Um.info("stopping..."))},Ea(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Gm=nh("[SegmentIntegration]");function Qm(e,t,n){void 0===n&&(n=!0);var r=e.config.segment;if(!r)return t();!function(e,t,n){var r=e.config.segment;if(!r)return t();var i=function(r){var i=function(){return r.anonymousId()||l_()};e.config.get_device_id=i,n&&r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(Op,Zp)),t(n?void 0:r.anonymousId()||void 0)},o=r.user();"then"in o&&Tl(o.then)?o.then(i):i(o)}(e,(function(n){r.register(function(e,t){"undefined"!=typeof Promise&&Promise.resolve||Gm.warn("This browser does not have Promise support, and can not use the segment integration");var n=function(n,r){if(!r)return n;var i=!!t&&n.event.anonymousId===t&&!n.event.userId;i||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Gm.info("No userId set, resetting PostHog"),e.reset()),i||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Gm.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var o=e.calculateEventProperties(r,n.event.properties);return n.event.properties=Object.assign({},o,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 n(e,e.event.event)},page:function(e){return n(e,e_)},identify:function(e){return n(e,n_)},screen:function(e){return n(e,"$screen")}}}(e,n)).then((function(){t()}),(function(e){Gm.error("Failed to register the Segment integration",e),t()}))}),n)}var Km="posthog-js";function Zm(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,d;if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var f=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=f,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h,p=(null==(n=t.exception)?void 0:n.values)||[],_=p.map((function(e){return Ta({},e,{stacktrace:e.stacktrace?Ta({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((function(e){return Ta({},e,{platform:"web:javascript"})}))}):void 0})})),v={$exception_message:(null==(s=p[0])?void 0:s.value)||t.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:t.level,$exception_list:_,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:t.tags};return r&&i&&(v.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),l&&(null==(h=e.exceptions)||h.sendExceptionEvent(v)),t}}var Ym,Jm=function(e,t,n,r,i,o){this.name=Km,this.setupOnce=function(s){s(Zm(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==o||o}))}},Xm=function(){function e(e){var t=this;this._onSessionIdChange=function(e,n,r){r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(th.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==Uf?void 0:Uf.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(!(Rl(o)||Rl(s)||Rl(a)||Rl(u)||Rl(l)||Rl(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?Zl(s/o,0,1,th):1,f=o>1?Zl(a/o,0,1,th):1,h=u>1?Zl(l/u,0,1,th):1,p=u>1?Zl(c/u,0,1,th):1;r=oh(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}(),ey=["flags","surveys"],ty=((Ym={})[Bh]={exposure:"hidden"},Ym[Vh]={exposure:"hidden"},Ym.__cmpns={exposure:"hidden"},Ym[Gh]={exposure:"hidden"},Ym[Wh]={exposure:"hidden"},Ym[Qh]={exposure:"event"},Ym[Kh]={exposure:"hidden"},Ym[np]={exposure:"hidden"},Ym[Zh]={exposure:"event"},Ym[Yh]={exposure:"hidden"},Ym[Jh]={exposure:"event"},Ym[Xh]={exposure:"event"},Ym[ep]={exposure:"event"},Ym[tp]={exposure:"hidden"},Ym[rp]={exposure:"event"},Ym[ip]={exposure:"hidden"},Ym.$session_recording_enabled_server_side={exposure:"hidden"},Ym[cp]={exposure:"hidden"},Ym[dp]={exposure:"event"},Ym[op]={exposure:"event",shouldSkipFromEventProperties:function(e){return Ol(e)}},Ym.$session_past_minimum_duration={exposure:"event"},Ym.$session_recording_url_trigger_activated_session={exposure:"event"},Ym.$session_recording_event_trigger_activated_session={exposure:"event"},Ym.$debug_first_full_snapshot_timestamp={exposure:"event"},Ym.$sess_rec_flush_size={exposure:"hidden"},Ym[fp]={exposure:"hidden",storageGroup:"flags"},Ym[hp]={exposure:"hidden",storageGroup:"flags"},Ym[pp]={exposure:"hidden"},Ym[_p]={exposure:"hidden",storageGroup:"flags"},Ym[vp]={exposure:"hidden",storageGroup:"flags"},Ym[gp]={exposure:"hidden",storageGroup:"flags",volatile:!0},Ym[mp]={exposure:"hidden",storageGroup:"flags"},Ym[yp]={exposure:"hidden"},Ym[bp]={exposure:"hidden"},Ym[wp]={exposure:"hidden"},Ym[Sp]={exposure:"hidden"},Ym[xp]={exposure:"hidden",storageGroup:"surveys"},Ym[Cp]={exposure:"hidden",storageGroup:"surveys",volatile:!0},Ym[Ep]={exposure:"event"},Ym[Pp]={exposure:"hidden"},Ym[Tp]={exposure:"hidden"},Ym[Ip]={exposure:"hidden"},Ym.$product_tours_activated={exposure:"hidden"},Ym.$product_tours_activated_session={exposure:"hidden"},Ym.$conversations_widget_session_id={exposure:"event"},Ym.$conversations_ticket_id={exposure:"event"},Ym.$conversations_widget_state={exposure:"event"},Ym.$conversations_user_traits={exposure:"event"},Ym[Fp]={exposure:"hidden"},Ym[Rp]={exposure:"hidden"},Ym[kp]={exposure:"event"},Ym[Lp]={exposure:"hidden"},Ym[Ap]={exposure:"hidden",storageGroup:"flags",volatile:!0},Ym[Op]={exposure:"hidden"},Ym[Mp]={exposure:"hidden"},Ym[Dp]={exposure:"hidden"},Ym[qp]={exposure:"hidden"},Ym[$p]={exposure:"hidden"},Ym[Np]={exposure:"hidden"},Ym[Bp]={exposure:"hidden"},Ym[sp]={exposure:"event"},Ym[ap]={exposure:"event"},Ym[up]={exposure:"event"},Ym[lp]={exposure:"event"},Ym[Up]={exposure:"event"},Ym[Vp]={exposure:"event"},Ym[zp]={exposure:"event"},Ym.$sdk_debug_replay_event_trigger_status={exposure:"event"},Ym.$sdk_debug_replay_linked_flag_trigger_status={exposure:"event"},Ym.$sdk_debug_replay_matched_recording_trigger_groups={exposure:"event"},Ym.$sdk_debug_replay_pending_trigger_conditions={exposure:"event"},Ym.$sdk_debug_replay_remote_trigger_matching_config={exposure:"event"},Ym.$sdk_debug_replay_trigger_groups_count={exposure:"event"},Ym.$sdk_debug_replay_url_trigger_status={exposure:"event"},Ym.$session_recording_start_reason={exposure:"event"},Ym),ny=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ry=function(e){var t=ty[e];if(t)return t;for(var n=0,r=ny;r.length>n;n++){var i=r[n],o=i[1];if(0===e.indexOf(i[0]))return o}},iy={flags:Ap,surveys:Cp},oy=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sy=function(e){return e+"_cookie_identity_change_pending"},ay=function(e){for(var t,n="",r=0,i=Pa(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},uy="main",ly=[fp,hp,_p,vp,gp,Ap,mp,wp],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 Il(t)?t:{}},hy=function(e,t){ih(e,(function(n,r){var i=ry(r);i&&"event"!==i.exposure||{}.hasOwnProperty.call(t,r)||delete e[r]}))},py=function(){function e(e,t,n){var r=this;if(void 0===n&&(n=!0),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._facebookClickIdChangePending=!1,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._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),this._markLoadedCrossTabFeatureFlagChangesPending(),e.debug&&th.info("Persistence loaded",e.persistence,Ta({},this.props)),this.update_config(e,e,t),this.save(),Uf){var i=function(){return r.flush()};fh(Uf,"beforeunload",i,{capture:!1}),fh(Uf,"pagehide",i,{capture:!1}),this._onStorage=function(e){if(r._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Uf?void 0:Uf.localStorage))&&e.key)if(e.key!==r._name){if(r._splitStorage){var t=ey.find((function(t){return e.key===r._groupEntryName(t)}));t&&r._syncCrossTabFeatureFlagProperties(e.key,t)}}else r._syncCrossTabFeatureFlagProperties(e.key,uy)},fh(Uf,"storage",this._onStorage)}}var t=e.prototype;return 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(cy(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&&Uf&&(Uf.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=P_._get(e),Ol(i)){var o=this._slotWriteState(t);return o.storageValue=null,t!==uy&&(o.persisted=!1),!1}r=fy(i)}catch(e){return!1}var s=t===uy?r:P_._parse(this._name);if(s&&this._hasCrossTabFeatureFlagIdentityMismatch(s))return!1;var a=this._mergeCrossTabFeatureFlagProperties(r,t,n);return t===uy&&this._splitStorage&&!dy(this._partitionProps().main,r)||this._rememberCrossTabStorageFingerprint(r,t,!0,i),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[Hh],n=e[Hh];return!Rl(t)&&!Rl(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,r){var i=this._slotWriteState(t);i.storageValue=r,t!==uy&&(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 ly.forEach((function(n){var o,s=null==(o=ry(n))?void 0:o.storageGroup;if(!(t===uy&&r._splitStorage&&s||t!==uy&&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._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=P_._get(this._name),r=this._slotWriteState(uy),i=!1,o=!1;if(n!==r.storageValue)if(Ol(n))r.storageValue=null;else{if(t=fy(n),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;o=this._mergeCrossTabFeatureFlagProperties(t,uy,!1),!this._splitStorage||dy(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,uy,!0,n):r.storageValue=n,i=!0}return this._splitStorage&&ey.forEach((function(n){var r=P_._get(e._groupEntryName(n)),s=e._slotWriteState(n),a=t||{},u=i&&ly.some((function(e){var t;return(null==(t=ry(e))?void 0:t.storageGroup)===n&&e in a}));if(r!==s.storageValue||u){if(Ol(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=ry(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||uy).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;ly.forEach((function(t){return e._pendingCrossTabFeatureFlagChanges.set(t,!0)}))},t._markLoadedCrossTabFeatureFlagChangesPending=function(){var e=this;if(this._splitStorageEligible)try{var t=P_._get(this._name),n=fy(t);this._slotWriteState(uy).storageValue=t,ly.forEach((function(t){var r,i=e._splitStorage?null==(r=ry(t))?void 0:r.storageGroup:void 0,o=i?P_._get(e._groupEntryName(i)):null;if(i){var s=e._slotWriteState(i);s.storageValue=o,s.persisted=!Ol(o)}var a=i&&!Ol(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(e===hp){var r=new Set(Pl(t)?t:[]),i=new Set(Pl(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=Il(t)?Ta({},t):{},s=Il(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(cy(e)){var r=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==r){var i=t;if(this._splitStorageEligible)try{var o,s=this._splitStorage?null==(o=ry(e))?void 0:o.storageGroup:void 0,a=s?this._groupEntryName(s):this._name;i=fy(P_._get(a))[e]}catch(e){}var u=new Set(r||[]);if(e===hp){if(!Rl(t)&&!Pl(t)||!Rl(i)&&!Pl(i)||!Pl(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(!Il(n))return void(dy(i,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!Rl(t)&&!Il(t)||Rl(t)&&Fl(n)&&Rl(i))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var f=Il(t)?t:{},h=Il(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 Dl(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=A_(e,this._config.cookie_persisted_properties||[]),n=M_(t,this._config.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),i=C_._get(this._name)||void 0;i&&q_(this._name,i)===r&&(this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i)}catch(e){}else try{var o=C_._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=o?q_(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=C_._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var i,o=q_(this._name,n);try{i=L_(JSON.parse(n))}catch(e){return!1}if((C_._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=o,this._lastSeenMainCookieValue=n;var s=D_(this._name,n),a=[].concat(I_,s.properties),u={};if(Object.keys(i).forEach((function(e){var t=i[e];(Rl(t)||Ol(t)||""===t||e===Op&&t!==Kp&&t!==Zp)&&(u[e]=!0,delete i[e])})),Fl(i))return!1;var l=Hh in i||i[Op]===Kp||i[Op]===Zp,c=this.props,d=c[Hh],f=c[Op],h=oh({},c);[].concat(I_,e.cookie_persisted_properties||[]).forEach((function(e){if(-1!==a.indexOf(e)&&!(e in i)&&!u[e]&&(l||e!==Hh&&e!==Op)){var t=h[e];!s.isValid&&-1!==I_.indexOf(e)&&(!1===t||0===t)||delete h[e]}})),this.props=oh(h,i),ly.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||Op in i||Op in this.props||this._setProp(Op,Kp);var p=this.props[Hh],_=this.props[Op];return!l||p===d&&_===f||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,H_._set(sy(this._name),!0),this._deleteProp(wp),this._deleteProp(hp),this._deleteProp(fp),this._deleteProp(_p),this._deleteProp(vp),this._deleteProp(gp),this._deleteProp(Ap),this._deleteProp(Lp),this._deleteProp(Fp),_===Kp&&(f===Zp||i[Op]===Kp||!Rl(d)&&p!==d)&&(hy(this.props,i),this._deleteProp(Sp)),_===Zp?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(Vh)),!0},t.consumeCookieIdentityChange=function(){var e=sy(this._name),t=this._cookieIdentityChangePending||!!H_._get(e);return this._cookieIdentityChangePending=!1,t&&H_._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&&(Rl(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[uy],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():Rl(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){-1===oy.indexOf(e.persistence.toLowerCase())&&(th.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,n=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var n=[].concat(I_,e);return Ta({},P_,{_parse:function(e){try{var r,i={};try{r=C_._get(e)||void 0,i=r?L_(JSON.parse(r)):{}}catch(e){}var o,s=JSON.parse(P_._get(e)||"{}");if(t){var a=D_(e,r),u=[].concat(I_,a.properties),l={};Object.keys(i).forEach((function(e){var t=i[e];Ol(t)||""===t||e===Op&&t!==Kp&&t!==Zp||(l[e]=t)}));var c=Hh in l||l[Op]===Kp||l[Op]===Zp;if(Object.keys(l).length>0){var d,f=s[Hh],h=null!==(d=s[Op])&&void 0!==d?d:Kp;n.forEach((function(e){if(-1!==u.indexOf(e)&&!(e in i)&&(c||e!==Hh&&e!==Op)){var t=s[e];!a.isValid&&-1!==I_.indexOf(e)&&(!1===t||0===t)||delete s[e]}})),!c||Op in i||Op in s||(s[Op]=Kp),!c||(Hh in l?l[Hh]:s[Hh])===f&&(Op in l?l[Op]:s[Op])===h||(T_.forEach((function(e){return delete s[e]})),l[Op]===Zp&&Hh in l?s.$user_id=l[Hh]:delete s.$user_id,l[Op]!==Zp&&(delete s[kp],delete s[Sp]),delete s.__alias)}o=oh(s,l)}else o=oh(i,s);return P_._set(e,o),o}catch(e){}return null},_set:function(n,r,i,o,s,a){var u=P_._set(n,r,void 0,void 0,a);try{var l=A_(r,e);if(Object.keys(l).length){if(t){var c=F_(n),d=M_(l,e);if(C_._set(c,d,i,o,s,a),C_._get(c)!==JSON.stringify(d)){C_._remove(c,o);var f=A_(r);return C_._set(n,f,i,o,s,a),u}}C_._set(n,l,i,o,s,a)}}catch(e){P_._error(e)}return u},_remove:function(e,t){try{null==Uf||Uf.localStorage.removeItem(e),C_._remove(e,t),C_._remove(F_(e),t)}catch(e){P_._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,i=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&P_._is_supported()?(t=P_,i=!0):"localstorage+cookie"===o&&n._is_supported()?(t=n,i=!0,r=!0):"sessionstorage"===o&&H_._is_supported()?t=H_:"memory"===o?t=N_:"cookie"===o&&C_._is_supported()?(t=C_,r=!0):n._is_supported()?(t=n,i=!0,r=!0):C_._is_supported()?(t=C_,r=!0):t=N_,this._splitStorageEligible=i,this._storesIdentityInCookie=r,t},t._groupEntryName=function(e){return this._name+"__"+e},t._resolveSplitStorage=function(e){return this._splitStorageEligible&&!!e.split_storage},t.properties=function(){var e={};return ih(this.props,(function(t,n){var r=ry(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?P_._parse(this._name):null,i={};if(n)try{ih(i=L_(C_._parse(this._name)),(function(e,t){(Rl(e)||Ol(e)||""===e)&&delete i[t]}))}catch(e){}var o=this._storage._parse(this._name);if(o&&(this.props=oh({},o)),this._splitStorage&&this._loadGroupEntries(),n&&o){var s,a,u=null==r?void 0:r[Hh],l=null!==(s=null==r?void 0:r[Op])&&void 0!==s?s:Kp,c=o[Hh],d=null!==(a=o[Op])&&void 0!==a?a:Kp;if(c!==u||d!==l){this._cookieIdentityChangePending=!0,H_._set(sy(this._name),!0);var f=oh({},this.props);T_.forEach((function(e){return delete f[e]})),d===Kp&&(l===Zp||i[Op]===Kp||!Rl(u)&&c!==u)&&(hy(f,i),delete f[Sp]),this.props=f;var h=new Set;T_.forEach((function(e){var t,n=null==(t=ry(e))?void 0:t.storageGroup;n&&h.add(n)})),h.forEach((function(e){var n={};ih(t.props,(function(t,r){var i;(null==(i=ry(r))?void 0:i.storageGroup)===e&&(n[r]=t)})),Fl(n)?(P_._remove(t._groupEntryName(e)),t._slotState[e]={}):P_._set(t._groupEntryName(e),n)&&(t._slotState[e]={persisted:!0,fingerprint:t._entryFingerprint(n,e)})}))}}H_._get(sy(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e,t=Pa(ey);!(e=t()).done;){var n=e.value,r=P_._parse(this._groupEntryName(n));if(r&&!Fl(r)){var i=this._slotWriteState(n);i.persisted=!0,this._mainCarriesGroupKey(n)||(i.fingerprint=this._entryFingerprint(r,n)),this._groupEntryIsStale(n,r)||oh(this.props,r)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some((function(t){var n;return(null==(n=ry(t))?void 0:n.storageGroup)===e}))},t._groupEntryIsStale=function(e,t){var n=iy[e];if(!n)return!1;var r=t[n],i=this.props[n];return Dl(r)&&Dl(i)&&i>r},t.refreshKey=function(e){var t;if(!(this._disabled||e===Wh&&this._facebookClickIdChangePending)){var n=this._splitStorage?null==(t=ry(e))?void 0:t.storageGroup:void 0,r=n?P_._parse(this._groupEntryName(n)):this._storage._parse(this._name);if(r&&e in r)this._setProp(e,r[e],!1);else{if(n){var i=this._storage._parse(this._name);if(i&&e in i)return void this._setProp(e,i[e],!1)}this._deleteProp(e,!1)}}},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?Rl(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout((function(){e._pendingSaveTimer=void 0,e._writeNow()}),t)):this._writeNow()}},t.flush=function(){Rl(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._facebookClickIdChangePending||this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase()||this.refreshKey(Wh));var t=!e&&!this._storageMigrationInProgress;t||(this._crossTabFeatureFlagIdentityMismatch=!1);var n=!!t&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&th.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this._splitStorage)return this._writeNowSplit(),void(n&&this._crossTabFeatureFlagHandlers.forEach((function(e){return e()})));var r=this._writeEntry(this._storage,this._name,this.props,uy);"written"===r&&this._rememberCurrentCookieProperties(this.props),"failed"!==r&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1),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,uy);"written"===i&&this._rememberCurrentCookieProperties(n),"failed"!==i&&(this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1,ly.forEach((function(t){var n;null!=(n=ry(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)})));for(var o,s=function(){var t,n=o.value,i=r[n];if(Fl(i)&&(null==(t=e._slotState[n])||!t.persisted))return ly.forEach((function(t){var r;(null==(r=ry(t))?void 0:r.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)})),1;var s=e._writeEntry(P_,e._groupEntryName(n),i,n);"failed"!==s&&ly.forEach((function(t){var r=ry(t);(null==r?void 0:r.storageGroup)!==n||"written"!==s&&r.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)}))},a=Pa(ey);!(o=a()).done;)s()},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return ih(this.props,(function(n,r){var i,o=null==(i=ry(r))?void 0:i.storageGroup;o?t[o][r]=n:e[r]=n})),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===uy)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return ih(e,(function(e,t){var r;n[t]=null!=(r=ry(t))&&r.volatile?"__volatile__":e})),JSON.stringify(n)},t._writeEntry=function(e,t,n,r){var i,o=this._slotWriteState(r);if(r!==uy&&!o.dirty&&!Rl(o.fingerprint))return"skipped";try{if((i=this._entryFingerprint(n,r))===o.fingerprint)return o.dirty=!1,"skipped"}catch(e){i=void 0}return e._set(t,n,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(o.dirty=!1,r!==uy&&(o.persisted=!0),Rl(i)||(o.fingerprint=i),this._splitStorageEligible&&(o.storageValue=P_._get(t)),"written"):(this._config.debug&&th.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(),Rl(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,i=Pa(ey);!(r=i()).done;)P_._remove(this._groupEntryName(r.value));n?delete this._slotState[uy]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0},t.clear=function(){this.remove(),this.props={}},t.register_once=function(e,t,n){var r=this;if(Il(e)){this.syncCookieProperties(),Rl(t)&&(t="None"),this._expire_days=Rl(n)?this._default_expiry:n;var i=!1;if(ih(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(Il(e)){this.syncCookieProperties(),this._expire_days=Rl(t)?this._default_expiry:t;var r=!1;if(ih(e,(function(t,i){e.hasOwnProperty(i)&&(n.props[i]!==t||Il(t)||Pl(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=Pa("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==Wf?void 0:Wf.URL;if(e!==this._campaign_params_url){var t=eg(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!Fl(lh(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==Wf?void 0:Wf.referrer)?ng(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:og(),$referring_domain:null!=Wf&&Wf.referrer&&(null==(e=f_(Wf.referrer))?void 0:e.host)||ig},void 0)},t.set_initial_person_info=function(){var e;if(!this.props[qp]&&!this.props[$p]){var t=sg(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[Np]=this._storesIdentityInCookie?{r:ay(t.r),u:t.u?ay(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};ih([$p,qp],(function(n){var r=e.props[n];r&&ih(r,(function(e,n){t["$initial_"+vl(n)]=e}))}));var n=this.props[Np];if(n){var r=function(e,t){void 0===t&&(t=!1);var n=ag(e,t),r={};return ih(n,(function(e,t){r["$initial_"+vl(t)]=e})),r}(n,this._config.disable_capture_url_hashes);oh(t,r)}return t},t.safe_merge=function(e){return ih(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._syncCookieProperties(Ta({},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),d=o||c!==this._splitStorage,f=!a&&(d||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(u);this._storageMigrationInProgress=d;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),d){var h=this.props;this.clear(),this._storage=l,this._splitStorage=c,this.props=h,this.save()}else s&&(this._storage=l,a||(delete this._slotState[uy],this._writeNow()))}finally{this._storageMigrationInProgress=!1,f&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[Np];if(this._storesIdentityInCookie&&Il(e)&&"string"==typeof e.r){var t=ay(e.r),n="string"==typeof e.u?ay(e.u):e.u;t===e.r&&n===e.u||this._setProp(Np,Ta({},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[Gh]||{};n[e]=t,this._setProp(Gh,n),this.save()},t.remove_event_timer=function(e){var t=this.props[Gh]||{},n=t[e];return Rl(n)||(delete t[e],this._setProp(Gh,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&&(e!==Hh&&e!==Op||i===t||(this._localIdentityChangePending=!0),e!==Wh||dy(i,t)||(this._facebookClickIdChangePending=!0),this._markPendingCrossTabFeatureFlagChanges(e,i,t),null!=(r=ry(e))&&r.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(cy(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),e===Wh&&(this._facebookClickIdChangePending=!0),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=ry(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),_y=nh("[RateLimiter]"),vy=function(){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,n,r;void 0===e&&(e=!1);var i=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,s=(new Date).getTime(),a=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property(Dp))&&void 0!==t?t:{tokens:i,last:s};a.tokens+=(s-a.last)/1e3*o,a.last=s,a.tokens>i&&(a.tokens=i);var u=1>a.tokens;if(u||e||(a.tokens=Math.max(0,a.tokens-1)),u&&!e){var l=(Dl(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this._captureWarning(l)&&(a.dropped=0)}return this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Dp,a),{isRateLimited:u,remainingTokens:a.tokens}},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Pl(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Gf&&Gf.pathname)return""+(null!==(e=Gf.origin)&&void 0!==e?e:"")+Gf.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},Ea(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)}}])}(),gy=nh("[RemoteConfig]"),my=function(){function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,r=this;null!=(t=Tg.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",(function(){return e(r.remoteConfig)})):e()},t._loadRemoteConfigJSON=function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback: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.");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)}},Ea(e,[{key:"remoteConfig",get:function(){var e;return null==(e=Tg._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),yy=Uint8Array,by=Uint16Array,wy=Uint32Array,Sy=new yy([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]),ky=new yy([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]),xy=new yy([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cy=function(e,t){for(var n=new by(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new wy(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]},Ey=Cy(Sy,2),Py=Ey[1];Ey[0][28]=258,Py[258]=28;for(var Ty=Cy(ky,0)[1],Iy=new by(32768),Fy=0;32768>Fy;++Fy){var Ry=(43690&Fy)>>>1|(21845&Fy)<<1;Iy[Fy]=((65280&(Ry=(61680&(Ry=(52428&Ry)>>>2|(13107&Ry)<<2))>>>4|(3855&Ry)<<4))>>>8|(255&Ry)<<8)>>>1}var Ly=function(e,t,n){for(var r=e.length,i=0,o=new by(t);r>i;++i)++o[e[i]-1];var s,a=new by(t);for(i=0;t>i;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new by(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[Iy[d]>>>u]=l}else for(s=new by(r),i=0;r>i;++i)s[i]=Iy[a[e[i]-1]++]>>>15-e[i];return s},Ay=new yy(288);for(Fy=0;144>Fy;++Fy)Ay[Fy]=8;for(Fy=144;256>Fy;++Fy)Ay[Fy]=9;for(Fy=256;280>Fy;++Fy)Ay[Fy]=7;for(Fy=280;288>Fy;++Fy)Ay[Fy]=8;var Oy=new yy(32);for(Fy=0;32>Fy;++Fy)Oy[Fy]=5;var My=Ly(Ay,9,0),Dy=Ly(Oy,5,0),qy=function(e){return(e/8>>0)+(7&e&&1)},$y=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof by?by:e instanceof wy?wy:yy)(n-t);return r.set(e.subarray(t,n)),r},Ny=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},By=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Hy=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 yy(0),0];if(1==i){var s=new yy(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 by(f+1),p=jy(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 yy(h),p]},jy=function(e,t,n){return-1==e.s?Math.max(jy(e.l,t,n+1),jy(e.r,t,n+1)):t[e.s]=n},Uy=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new by(++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]},Vy=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},zy=function(e,t,n){var r=n.length,i=qy(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)},Wy=function(e,t,n,r,i,o,s,a,u,l,c){Ny(t,c++,n),++i[256];for(var d=Hy(i,15),f=d[0],h=d[1],p=Hy(o,15),_=p[0],v=p[1],g=Uy(f),m=g[0],y=g[1],b=Uy(_),w=b[0],S=b[1],k=new by(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=Hy(k,7),E=C[0],P=C[1],T=19;T>4&&!E[xy[T-1]];--T);var I,F,R,L,A=l+5<<3,O=Vy(i,Ay)+Vy(o,Oy)+s,M=Vy(i,f)+Vy(o,_)+s+14+3*T+Vy(k,E)+(2*k[16]+3*k[17]+7*k[18]);if(O>=A&&M>=A)return zy(t,c,e.subarray(u,u+l));if(Ny(t,c,1+(O>M)),c+=2,O>M){I=Ly(f,h,0),F=f,R=Ly(_,v,0),L=_;var D=Ly(E,P,0);for(Ny(t,c,y-257),Ny(t,c+5,S-1),Ny(t,c+10,T-4),c+=14,x=0;T>x;++x)Ny(t,c+3*x,E[xy[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)Ny(t,c,D[H=31&B[x]]),c+=E[H],H>15&&(Ny(t,c,B[x]>>>5&127),c+=B[x]>>>12)}}else I=My,F=Ay,R=Dy,L=Oy;for(x=0;a>x;++x)if(r[x]>255){var H;By(t,c,I[257+(H=r[x]>>>18&31)]),c+=F[H+257],H>7&&(Ny(t,c,r[x]>>>23&31),c+=Sy[H]);var j=31&r[x];By(t,c,R[j]),c+=L[j],j>3&&(By(t,c,r[x]>>>5&8191),c+=ky[j])}else By(t,c,I[r[x]]),c+=F[r[x]];return By(t,c,I[256]),c+F[256]},Gy=new wy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qy=function(){for(var e=new wy(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ky=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Zy(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=Qy[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=(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 yy(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=zy(u,l,e.subarray(c,d)):(u[c]=!0,l=zy(u,l,e.subarray(c,s)))}else{for(var f=Gy[t-1],h=f>>>13,p=8191&f,_=(1<<n)-1,v=new by(32768),g=new by(_+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 wy(25e3),S=new by(288),k=new by(32),x=0,C=0,E=(c=0,0),P=0,T=0;s>c;++c){var I=b(c),F=32767&c,R=g[I];if(v[F]=R,g[I]=F,c>=P){var L=s-c;if((x>7e3||E>24576)&&L>423){l=Wy(e,u,0,w,S,k,C,E,T,c-T,l),E=x=C=0,T=c;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)k[A]=0}var O=2,M=0,D=p,q=F-R&32767;if(L>2&&I==b(c-q))for(var N=Math.min(h,L)-1,B=Math.min(32767,c),H=Math.min(258,L);B>=q&&--D&&F!=R;){if(e[c+O]==e[c+O-q]){for(var j=0;H>j&&e[c+j]==e[c+j-q];++j);if(j>O){if(O=j,M=q,j>N)break;var U=Math.min(q,j-2),V=0;for(A=0;U>A;++A){var z=c-q+A+32768&32767,W=z-v[z]+32768&32767;W>V&&(V=W,R=z)}}}q+=(F=R)-(R=v[F])+32768&32767}if(M){w[E++]=268435456|Py[O]<<18|Ty[M];var G=31&Py[O],Q=31&Ty[M];C+=Sy[G]+ky[Q],++S[257+G],++k[Q],P=c+O,++x}else w[E++]=e[c],++S[e[c]]}}l=Wy(e,u,!0,w,S,k,C,E,T,c-T,l)}return $y(a,0,r+qy(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)),l=u.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&&Ky(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)}}(u,t),Ky(u,l-8,n.d()),Ky(u,l-4,r),u}var Yy=!!Kf||!!Qf,Jy="text/plain",Xy=!1,eb=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:"")},tb=function(e,t,n){var r;void 0===n&&(n=!0);var i=e.split("?"),o=i[0],s=i[1],a=Ta({},t),u=null!==(r=null==s?void 0:s.split("&").map((function(e){var t,r=e.split("="),i=r[0],o=n&&null!==(t=a[i])&&void 0!==t?t:r[1];return delete a[i],i+"="+o})))&&void 0!==r?r:[],l=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return ih(e,(function(e,t){Rl(e)||Rl(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)}(a);return l&&u.push(l),u.length>0?o+"?"+u.join("&"):o},nb=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===Ju){var r=Zy(function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new yy(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;n>s;++s){if(i+5>r.length){var a=new yy(i+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);128>u?o(u):2048>u?(o(192|u>>>6),o(128|63&u)):u>55295&&57344>u?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return $y(r,0,i)}(d_(t)),{mtime:0});return{contentType:Jy,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Xu){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}(d_(t)),o=function(e){return"data="+encodeURIComponent("string"==typeof e?e:d_(e))}(i);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var s=d_(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},rb=function(e){var t,n,r=function(){return"sendBeacon"===e.transport?{url:tb(e.url,{compression:Xu}),encodedBody:nb(Ta({},e,{compression:Xu,_encodedBody:void 0}))}:{url:eb(e.url,"compression"),encodedBody:nb(Ta({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=nb(e)}catch(t){if(hf(e.compression,h_(e.url,"compression")))return th.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&hf(e.compression,h_(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?ff(new Uint8Array(n)):ArrayBuffer.isView(n)&&ff(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Xy=!0,r()):{url:e.url,encodedBody:t}},ib=function(e){try{return rb(e)}catch(t){return th.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},ob=function(){var e=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:return n=d_(t.data),e.n=1,mf(n,jf.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,Ta({},t,{_encodedBody:{contentType:Jy,body:i=e.v,estimatedSize:i.byteLength}}))}}),e)})));return function(t){return e.apply(this,arguments)}}(),sb=/Failed to fetch|NetworkError|Load failed/i,ab=function(e){return"TypeError"===(null==e?void 0:e.name)&&sb.test((null==e?void 0:e.message)||"")},ub=function(e){var t=ib(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;ih(e.headers,(function(e,t){u.append(t,e)})),o&&u.append("Content-Type",o);var l=null,c=!1;if(Zf){var d=new Zf;l={signal:d.signal,timeout:setTimeout((function(){var t;c=!0,d.abort(Sd("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}),e.timeout)}}var f=function(t){c&&"AbortError"===(null==t?void 0:t.name)||ab(t)?th.warn(t):th.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var h;Qf(n,Ta({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(a||0),body:s,signal:null==(h=l)?void 0:h.signal},e.fetchOptions)).then((function(t){return t.text().then((function(n){var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){th.error(e)}null==e.callback||e.callback(r)}))})).catch(f).finally((function(){return l?clearTimeout(l.timeout):null}))}catch(e){l&&clearTimeout(l.timeout),f(e)}}},lb=function(e){try{var t,n=rb(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(zf.sendBeacon(r,u))return;var l=Pl(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Pl(l)&&l.length>1&&(null!=a?a:0)>16384){var c=Math.ceil(l.length/2),d=function(t){return Pl(e.data)?t:Ta({},e.data,{batch:t})};return lb(Ta({},e,{data:d(l.slice(0,c))})),void lb(Ta({},e,{data:d(l.slice(c))}))}th.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to fetch"),ub(Ta({},e,{_keepaliveDisabled:!0}))}catch(e){th.warn("Beacon send failed",e)}},cb=function(e,t,n,r){var i,o="query"===r?"POST"===t?"sent_at":"_":void 0;return tb(n===Ju?eb(e,"compression"):e,Ta({},o?((i={})[o]=Date.now().toString(),i):{},n===Ju?{}:{compression:n}))},db=[];Qf&&db.push({transport:"fetch",method:ub}),Kf&&db.push({transport:"XHR",method:function(e){var t=ib(e);if(t){var n=new Kf,r=t.encodedBody;n.open(e.method||"GET",t.url,!0);var i=null!=r?r:{},o=i.contentType,s=i.body;ih(e.headers,(function(e,t){n.setRequestHeader(t,e)})),o&&n.setRequestHeader("Content-Type",o),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=function(){if(4===n.readyState){var t={statusCode:n.status,text:n.responseText};if(200===n.status)try{t.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(t)}},n.send(s)}}}),null!=zf&&zf.sendBeacon&&db.push({transport:"sendBeacon",method:lb});var fb=3e3,hb=function(){function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=Zl((null==t?void 0:t.flush_interval_ms)||fb,250,5e3,th.createLogger("flush interval"),fb),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),r=[].concat(n.filter((function(e){return 0===e.url.indexOf("/e")})),n.filter((function(e){return 0!==e.url.indexOf("/e")})));r.map((function(t){e._sendRequestSafely(Ta({},t,{transport:"sendBeacon"}))}))},t.enable=function(){this._isPaused=!1,this._setFlushTimeout()},t._setFlushTimeout=function(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((function(){if(e._clearFlushTimeout(),e._queue.length>0){var t=e._formatQueue(),n=function(){var n=t[r],i=(new Date).getTime();n.data&&Pl(n.data)&&ih(n.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e._sendRequestSafely(n)};for(var r in t)n()}}),this._flushTimeoutMs))},t._sendRequestSafely=function(e){try{this._sendRequest(e)}catch(e){th.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return ih(this._queue,(function(t){var n,r=t,i=(r?r.batchKey:null)||r.url;Rl(e[i])&&(e[i]=Ta({},r,{data:[]})),null==(n=e[i].data)||n.push(r.data)})),this._queue=[],e},e}(),pb=["retriesPerformedSoFar"],_b=function(){function e(e){var t=this;this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!Rl(Uf)&&"onLine"in Uf.navigator&&(this._areWeOnline=Uf.navigator.onLine,this._onlineListener=function(){t._areWeOnline=!0,t._flush()},this._offlineListener=function(){t._areWeOnline=!1},fh(Uf,"online",this._onlineListener),fh(Uf,"offline",this._offlineListener))}var t=e.prototype;return t.retriableRequest=function(e){var t=this,n=e.retriesPerformedSoFar,r=Fa(e,pb);ql(n)&&(r.url=tb(r.url,{retry_count:n})),this._instance._send_request(Ta({},r,{callback:function(e){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=n?n:0))return void t._enqueue(Ta({retriesPerformedSoFar:n},r));0===e.statusCode&&th.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!=n?n:0)+" retries.")}null==r.callback||r.callback(e)}}))},t._enqueue=function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this._queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in "+n;navigator.onLine||(i+=" (Browser is offline)"),th.warn(i),this._isPolling||(this._isPolling=!0,this._poll())},t._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)},t._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=Pa(n);!(r=i()).done;)this.retriableRequest(r.value.requestOptions)},t.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,Rl(Uf)||(this._onlineListener&&(Uf.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Uf.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=Pa(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(Ta({},n,{transport:"sendBeacon"}))}catch(e){th.error(e)}}this._queue=[]},Ea(e,[{key:"length",get:function(){return this._queue.length}}])}(),vb=function(){function e(e){var t=this;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)},this._instance=e}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){fh(Uf,"scroll",this._updateScrollData,{capture:!0}),fh(Uf,"scrollend",this._updateScrollData,{capture:!0}),fh(Uf,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Uf||null==(e=Uf.document)?void 0:e.documentElement;for(var t,n=Pa(Pl(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var r,i=null==Uf||null==(r=Uf.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 Uf?"y"===e?Uf.scrollY||Uf.pageYOffset||(null==(t=Uf.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Uf.scrollX||Uf.pageXOffset||(null==(n=Uf.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")},Ea(e,[{key:"_scrollRoot",get:function(){return this._instance.config.scroll_root_selector}}])}(),gb=function(e){return sg(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)},mb=function(){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={})[Mp]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||gb,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Mp]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ag(t,this._instance.config.disable_capture_url_hashes):{$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 ih(lh(this.getSetOnceProps()),(function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+vl(n)]=t})),e},e}(),yb=function(){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=Pa(this._events[e]||[]);!(n=r()).done;)(0,n.value)(t);for(var i,o=Pa(this._events["*"]||[]);!(i=o()).done;)(0,i.value)(e,t)},e}(),bb=nh("[SessionId]"),wb=864e5,Sb=function(){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 yb,this._sessionHasBeenIdleTooLong=function(e,t){return!(!ql(e)||!ql(t))&&Math.abs(e-t)>i.sessionTimeoutMs},!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Qp)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||l_,this._windowIdGenerator=n||l_;var o=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*Zl(this._config.session_idle_timeout_seconds||1800,60,36e3,bb.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=H_._parse(this._window_id_storage_key),a=H_._parse(this._primary_window_exists_storage_key);s&&!a?this._windowId=s:H_._remove(this._window_id_storage_key),H_._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 Rl(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&&H_._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&H_._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?H_._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!Ol(t)&&!Ol(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={})[cp]=[t,e,n],r)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return ql(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(cp):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!Ol(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={})[cp]=[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=ql(e)?e:0,n=ql(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[cp];return Pl(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 bb.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void bb.error("Invalid sessionID in bootstrap",e)}}(e);return!Rl(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&&Uf&&(Uf.removeEventListener(Xp,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&H_._remove(e._primary_window_exists_storage_key)},fh(Uf,Xp,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),this._config.cookieless_mode===Qp)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(Ol(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=!Rl(i)&&u!==i,d=this._freshestActivityTimestamp(),f=this._getWindowId(),h=this._pendingBootstrapSession,p=!!h&&(h.sessionStartTimestamp>r+6e4||r-h.sessionStartTimestamp>wb),_=h?p:ql(l)&&Math.abs(r-l)>wb,v=!1,g=c,m=!u||!!h,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(r,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(r))||bb.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2]}if(m||b||_){g=!1;var S=h&&!p;u=S?h.sessionId:this._sessionIdGenerator(),f=this._windowIdGenerator(),bb.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)&&(bb.info("adopted cross-tab session id",{sessionId:u,windowId:f}),v=!0);var k=ql(d)&&e&&!_?d:r,x=ql(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))},Ea(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),kb=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&hl(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((function(e){return hl(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver};function xb(){return(xb=Ca(Ra().m((function e(){var t,n,r;return Ra().w((function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==zf?void 0:zf.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:return e.a(2,Ll(r=null==(n=e.v)?void 0:n.model)&&r.length>0?r:void 0);case 3:return e.p=3,th.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}}),e,null,[[1,3]])})))).apply(this,arguments)}var Cb="custom",Eb="i.posthog.com",Pb=/^\/static\//,Tb=["/s/","/e/","/i/"],Ib=function(){function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(Pb.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=f_(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=f_(n))?void 0:o.href)||n;r=i(new URL(s)).toString()}if(i&&"api"===e&&Tb.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||(c={apiHost:l,rewriteRequestPath:i,urls:new Set},this._ingestionEndpoints=c),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===Cb)return this._prepareEndpoint(e,t,this.apiHost+t);var r=Eb+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)}},Ea(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("."+Eb,".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":Cb),this._regionCache[this.apiHost]}}])}(),Fb=nh("[PostHog ExternalIntegrations]"),Rb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Lb=function(){function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,(function(e){if(e)return Fb.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=Tg.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(Rb[a],(function(){var t;null==(t=Tg.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)})),!u&&null!=(i=Tg.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[a]&&(null==(o=Tg.__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}(),Ab=function(){function e(e,t){this._logger=e,this._client=t,this._extensions=new Map,this._disposed=!1}var t=e.prototype;return t.add=function(){var e=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.p=e.n){case 0:if(!this._disposed){e.n=1;break}throw new Error("Cannot add an extension to a disposed ExtensionRuntime");case 1:if(!this._extensions.has(t.name)){e.n=2;break}throw new Error('Browser extension "'+t.name+'" is already registered');case 2:if(this._extensions.set(t.name,t),e.p=3,!(n=t.setup(this._client))){e.n=4;break}return e.n=4,n;case 4:e.n=6;break;case 5:e.p=5,i=e.v,(r=this._extensions.get(t.name)===t)&&this._extensions.delete(t.name),this._logger.error('Failed to set up browser extension "'+t.name+'"',i),r&&this._disposeExtension(t);case 6:return e.a(2)}}),e,this,[[3,5]])})));return function(t){return e.apply(this,arguments)}}(),t.getExtension=function(e){return this._extensions.get(e)},t.dispose=function(){if(!this._disposed){this._disposed=!0;var e=Array.from(this._extensions.values()).reverse();this._extensions.clear();for(var t,n=Pa(e);!(t=n()).done;)this._disposeExtension(t.value)}},t._disposeExtension=function(e){var t=this;try{var n=null==e.dispose?void 0:e.dispose();n&&Tl(n.then)&&n.then(void 0,(function(n){t._logger.error('Failed to dispose browser extension "'+e.name+'"',n)}))}catch(t){this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}},e}(),Ob=function(){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=Pa(e);!(n=i()).done;){var o=n.value,s=null==t?void 0:t.get_property(o);Rl(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}(),Mb="extensionsRemoteConfig",Db=function(){function e(e){var t=this;this._disposed=!1,this.instance=e,this._logger=th,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new Ob(e),this.onEvent=function(e){return Hf(t.instance.on("eventCaptured",(function(n){try{e({event:n.event,properties:n.properties})}catch(e){t._logger.error("Browser extension event listener failed",e)}})))},this.onRemoteConfig=function(e){if(t._disposed)return Hf((function(){}));var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},r=t.instance._internalEventEmitter.on(Mb,n);return t._latestRemoteConfigResult&&n(t._latestRemoteConfigResult),Hf(r)},this._runtime=new Ab(th.createLogger("[BrowserExtensions]"),this)}var t=e.prototype;return t.add=function(e){return this._runtime.add(e)},t.getExtension=function(e){return this._runtime.getExtension(e)},t.capture=function(){var e=Ca(Ra().m((function e(t,n,r){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(r){e.n=1;break}return this.instance.capture(t,n),e.a(2);case 1:this.instance.capture(t,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce});case 2:return e.a(2)}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.registerDynamicEventProperties=function(e){return Hf(this.instance._registerExtensionEventProperties(e))},t.handleRemoteConfig=function(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(Mb,e))},t.sendRequest=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s=this;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),i=this.instance.requestRouter.endpointFor(null!==(r=n.target)&&void 0!==r?r:"api",t),o={method:n.method,url:n.query?tb(i,n.query):i,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?yl.Base64:void 0,timestampMode:n.sentAt},"sendBeacon"!==n.transport){e.n=1;break}return this.instance._send_request(o),e.a(2,{statusCode:202});case 1:return e.a(2,new Promise((function(e){o.callback=e,s.instance._send_request(o)})))}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.dispose=function(){this._disposed||(this._disposed=!0,this._runtime.dispose())},Ea(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(jh))&&void 0!==e?e:this.distinctId}},{key:"deviceId",get:function(){var e=this.instance.get_property(jh);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:jf.LIB_NAME,version:jf.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=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==i?void 0:i.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==i?void 0:i.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(r=null==i?void 0:i.sessionStartTimestamp)&&void 0!==r?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}},{key:"canCapture",get:function(){return this.instance.is_capturing()}},{key:"projectToken",get:function(){return this.instance.config.token}}])}(),qb={},$b=0,Nb=function(){},Bb='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Hb="Surveys module not available",jb="sanitize_properties is deprecated. Use before_send instead",Ub="Invalid value for property_denylist config: ",Vb=/^[A-Za-z0-9_-]{1,400}$/,zb=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Wb=["token","distinct_id",jp],Gb="posthog",Qb=!Yy&&-1===(null==Jf?void 0:Jf.indexOf("MSIE"))&&-1===(null==Jf?void 0:Jf.indexOf("Mozilla")),Kb=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},Zb=function(e){var t;return Ta({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:dh(null==Wf?void 0:Wf.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Nb,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Gf&&Ll(null==Gf?void 0:Gf.search)&&-1!==Gf.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Uf||null==(t=Uf.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,surveys_request_timeout_ms:1e4,on_request_error:function(e){th.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:Yp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:fb},error_tracking:{},_onCapture:Nb},function(e){return{rageclick:e&&e>="2026-05-30"?{content_ignorelist:Sm,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:Kb(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))},Yb=[["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"]],Jb=function(e){for(var t={},n=0,r=Yb;r.length>n;n++){var i=r[n],o=i[0],s=i[1];Rl(e[o])||(t[s]=e[o])}var a=oh({},t,e),u=e.__preview_external_dependency_versioned_paths;return Rl(u)||(Rl(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),Ll(u)&&Rl(e.asset_host)&&(a.asset_host=u)),Pl(e.property_blacklist)&&(Rl(e.property_denylist)?a.property_denylist=e.property_blacklist:Pl(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):th.error(Ub+e.property_denylist)),a},Xb=function(){return Ea((function(){this.__forceAllowLocalhost=!1}),[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){th.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),ew=function(){function e(){var t,n=this;this.webPerformance=new Xb,this._personProcessingSetOncePropertiesSent=!1,this.version=jf.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new yb,this._extensions=[],this._extensionEventPropertyProducers=[],this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Zb(),this.SentryIntegration=Jm,this.sentryIntegration=function(e){return function(e,t){var n=Zm(e,t);return{name:Km,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 vb(this),this.pageViewManager=new Xm(this),this.rateLimiter=new vy(this),this.requestRouter=new Ib(this),this.consent=new tm(this),this.externalIntegrations=new Lb(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=Ll(e)?((i={})[e]=t,i):e;n.setPersonProperties(o),null==r||r({})},set_once:function(e,t,r){var i,o=Ll(e)?((i={})[e]=t,i):e;n.setPersonProperties(void 0,o),null==r||r({})}},this.on("eventCaptured",(function(e){return th.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 this.config.cookieless_mode===Qp||this.config.cookieless_mode===Gp&&this.consent.isRejected()},t._warnIfVolatileIdentityWithoutStableId=function(){if(!this._hasWarnedAboutVolatileIdentity&&!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', or keep this persistence and pass a stable ID through bootstrap.distinctID."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",n="Either set disable_persistence to false, or keep persistence disabled and pass a stable ID through bootstrap.distinctID."),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._healCookielessSentinelDistinctId=function(){if(!this._inCookielessMode()&&this.get_distinct_id()===Hp){var e=this.persistence;if(e){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||t===Hp){var n=this.config.get_device_id(l_());this.register({distinct_id:n,$device_id:n}),e.set_property(Op,Kp)}this._sync_opt_out_with_persistence()}}},t.init=function(t,n,r){if(r&&r!==Gb){var i,o=null!==(i=qb[r])&&void 0!==i?i:new e;return o._init(t,n,r),qb[r]=o,qb[Gb][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=Ll(e)?e.trim():"";if(!u)return th.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=Zb(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=Zb(t.defaults),c=Jb(t),d=oh({},l,c,{name:n,token:u});Il(l.rageclick)&&Il(c.rageclick)&&(d.rageclick=oh({},l.rageclick,c.rageclick)),Il(l.session_recording)&&Il(c.session_recording)&&(d.session_recording=oh({},l.session_recording,c.session_recording)),this.set_config(d),this.config.on_xhr_error&&th.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ju;var f=this._is_persistence_disabled();if(this.persistence=new py(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new py(Ta({},this.config,{persistence:"sessionStorage"}),f,!1),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!f&&H_._is_supported()){var h=H_._parse(this._sessionRegisteredPropertiesStorageKey);Pl(h)&&h.forEach((function(e){Ll(e)&&s._sessionRegisteredPropKeys.add(e)}))}else H_._remove(this._sessionRegisteredPropertiesStorageKey);var p=Ta({},this.persistence.props),_=Ta({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new hb((function(e){return s._send_retriable_request(e)}),this.config.request_queue_config),this._retryQueue=new _b(this),this.__request_queue=[];var v=this._inCookielessMode();v||(this.sessionManager=new Sb(this),this.sessionPropsManager=new mb(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?(th.info("Deferring extension initialization to improve startup performance"),setTimeout((function(){s._initExtensions(v)}),0)):(th.info("Initializing extensions synchronously"),this._initExtensions(v)),jf.DEBUG=jf.DEBUG||this.config.debug,jf.DEBUG&&th.info("Starting in debug mode",{this:this,config:t,thisC:Ta({},this.config),p:p,s:_}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=Ta({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var g=null==(i=t.bootstrap)?void 0:i.distinctID;if(this._hasStableInitialDistinctId=!!g&&!Al(g),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var m=t.bootstrap.distinctID,y=this.get_distinct_id(),b=this.persistence.get_property(Op);if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Kp)this.identify(m);else if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Zp)th.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 w=this.config.get_device_id(l_()),S=t.bootstrap.isIdentifiedID?w:m;this.persistence.set_property(Op,t.bootstrap.isIdentifiedID?Zp:Kp),this.register({distinct_id:m,$device_id:S})}}if(v)this.register_once({distinct_id:Hp,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(l_());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Op,Kp)}return fh(Uf,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?Qm(this,(function(){return s._loaded()})):this._loaded(),Tl(this.config._onCapture)&&this.config._onCapture!==Nb&&(th.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(function(e){return s.config._onCapture(e.event,e)}))),this.config.ip&&th.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 xb.apply(this,arguments)}().then((function(e){var t;e&&s.register(((t={})[Uh]=e,t))})).catch(Nb),this},t._isSharedExtension=function(e){var t=e;return Ll(t.name)&&Tl(t.setup)},t._enrollExtension=function(e,t){var n=this;this._isSharedExtension(e)?t.push((function(){n._getBrowserClientAdapter().add(e).catch((function(){return null==e.dispose?void 0:e.dispose()})).catch((function(t){th.error('Failed to dispose browser extension "'+e.name+'"',t)}))})):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;u&&(this.featureFlags&&this.featureFlags instanceof u||(null==(i=this._featureFlagsReloadingUnsubscribe)||i.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),Tl(this.featureFlags.onReloading)&&Tl(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading((function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)})),this._getBrowserClientAdapter().add(this.featureFlags)):null==(o=(s=this.featureFlags).initialize)||o.call(s))},t._initExtensions=function(t){var n,r,i,o,s,a,u,l=this,c=performance.now(),d=Ta({},e.__defaultExtensionClasses,this.config.__extensionClasses),f=[];d.exceptions&&this._extensions.push(this.exceptions=null!==(n=this.exceptions)&&void 0!==n?n:new d.exceptions(this)),d.historyAutocapture&&this._extensions.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this._extensions.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this._extensions.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this._extensions.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||f.push((function(){l.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this._enrollExtension(this.autocapture=new d.autocapture(this),f),d.surveys&&this._enrollExtension(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),f),d.logs&&this._enrollExtension(this.logs=null!==(i=this.logs)&&void 0!==i?i:new d.logs(this),f),d.metrics&&this._extensions.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this._extensions.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new d.conversations(this)),d.productTours&&this._extensions.push(this.productTours=new d.productTours(this)),d.heatmaps&&this._extensions.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this._extensions.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,zm)),d.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new d.toolbar(this)),d.experiments&&this._extensions.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this._extensions.forEach((function(e){e.initialize&&f.push((function(){null==e.initialize||e.initialize()}))})),f.push((function(){if(l._pendingRemoteConfig){var e=l._pendingRemoteConfig;l._pendingRemoteConfig=void 0,l._extensions.forEach((function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)}))}})),this._processInitTaskQueue(f,c)},t._processInitTaskQueue=function(e,t){for(var n,r=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((function(){r._processInitTaskQueue(e,t)}),0);var i=e.shift();if(i)try{i()}catch(e){th.error("Error initializing extension:",e)}}var o=Math.round(performance.now()-t);this.register_for_session(((n={})[Up]=this.config.__preview_deferred_init_extensions?"deferred":"synchronous",n[Vp]=o,n)),this.config.__preview_deferred_init_extensions&&th.info("PostHog extensions initialized ("+o+"ms)")},t._onRemoteConfig=function(e){var t,n=this;if(!Wf||!Wf.body)return th.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n._onRemoteConfig(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var r,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=pl(i.supportedCompression,Ju)?Ju:pl(i.supportedCompression,Xu)?Xu:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Yp}),null==(t=this._browserClientAdapter)||t.handleRemoteConfig(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){th.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Gf&&Gf.hostname){var t=Gf.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()&&rh(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;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(t_),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(t_,null,{transport:"sendBeacon"})},t._send_request=function(e){var t,n=this;this.__loaded?Qb?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=Ta({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(Rl(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,r,i=Ta({},e);i.timeout=i.timeout||6e4;var o,s,a,u,l,c=null!==(t=i.transport)&&void 0!==t?t:"fetch";"sendBeacon"===c&&Rl(i.compression)&&i.data&&(i.compression=Xu),"POST"===i.method&&i.data&&("capture-body"===i.timestampMode?i.data={api_key:null!==(s=null==(l=(u=(Pl(o=i.data)?o:[o]).map((function(e){return Ta({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})})))[0])||null==(a=l.properties)?void 0:a.token)&&void 0!==s?s:null==l?void 0:l.token,batch:u,sent_at:(new Date).toISOString()}:"body"===i.timestampMode&&(i.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Pl(e)?e.map((function(e){return Ta({},e,{sent_at:t})})):Ta({},e,{sent_at:t})}(i.data))),i.url=cb(i.url,i.method,i.compression,i.timestampMode);var d=db.filter((function(e){return!i.disableTransport||!e.transport||!i.disableTransport.includes(e.transport)})),f=null!==(n=null==(r=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(d,(function(e){return e.transport===c})))?void 0:r.method)&&void 0!==n?n:d[0].method;if(!f)throw new Error("No available transport method");var h=function(e){try{f(e)}catch(e){ab(e)?th.warn(e):th.error(e),null==i.callback||i.callback({statusCode:0,error:e})}};"sendBeacon"!==c&&i.data&&i.compression===Ju&&Yf&&"undefined"!=typeof Promise&&!Xy?ob(i).then((function(e){h(e)})).catch((function(t){if(pf(t))return Xy=!0,void h(Ta({},i,{compression:void 0,url:cb(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 pf(e)||t===df})(t)&&(Xy=!0),h(i)})):f(i)}(Ta({},e,{callback:function(t){n.rateLimiter.checkForLimiting(t),400>t.statusCode||null==n.config.on_request_error||n.config.on_request_error(t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))},t._send_retriable_request=function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)},t._execute_array=function(e){var t=this;$b++;try{var n,r=[],i=[],o=[];rh(e,(function(e){if(e)if(Pl(n=e[0]))o.push(e);else if(Tl(e))try{e.call(t)}catch(t){th.error("Error executing queued PostHog call",e,t)}else Pl(e)&&"alias"===n?r.push(e):Pl(e)&&-1!==n.indexOf("capture")&&Tl(t[n])?o.push(e):i.push(e)}));var s=function(e,t){rh(e,(function(e){try{if(Pl(e[0])){var n=t;ih(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){th.error("Error executing queued PostHog call",e,t)}}))};s(r,this),s(i,this),s(o,this)}finally{$b--}},t.push=function(t){if($b>0&&Pl(t)&&Ll(t[0])){var n=e.prototype[t[0]];Tl(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedFacebookClickId=function(){var e,t=null==(e=this.persistence)?void 0:e.get_property(Wh);return Ll(t)&&zb.test(t)?{value:t,delivered:!1}:Il(t)&&Ll(t.value)&&zb.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0},t._updateFacebookClickId=function(e,t,n,r){if(this.persistence){this.persistence.refreshKey(Wh);var i=this._getPersistedFacebookClickId();if(!r){var o;if(n)return Ll(t)&&zb.test(t)?(t!==(null==i?void 0:i.value)&&this.persistence.register(((o={})[Wh]={value:t,delivered:!1},o)),{value:t,pending:t!==(null==i?void 0:i.value)||!i.delivered}):void this.persistence.unregister(Wh);if(Ll(e)&&Vb.test(e)){var s;if((null==i?void 0:i.value.split(".")[3])===e)return{value:i.value,pending:!i.delivered};var a="fb.1."+Date.now()+"."+e;return this.persistence.register(((s={})[Wh]={value:a,delivered:!1},s)),{value:a,pending:!0}}return i?{value:i.value,pending:!i.delivered}:void 0}this.persistence.unregister(Wh)}},t._markFacebookClickIdDelivered=function(e){if(this.persistence){this.persistence.refreshKey(Wh);var t,n=this._getPersistedFacebookClickId();(null==n?void 0:n.value)!==e||n.delivered||this.persistence.register(((t={})[Wh]={value:e,delivered:!0},t))}},t.capture=function(e,t,n){var r,i,o,s,a,u,l,c,d,f,h=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Rl(e)&&Ll(e)){this._healCookielessSentinelDistinctId();var p=!this.config.opt_out_useragent_filter&&this._is_bot();if(!p||this.config.__preview_capture_bot_pageviews){var _=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==_||!_.isRateLimited){var v;null!=t&&t.$current_url&&!Ll(null==t?void 0:t.$current_url)&&(th.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||th.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(v=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 g=new Date,m=(null==n?void 0:n.timestamp)||g,y=wd(null==n?void 0:n.uuid,l_),b={uuid:y,event:e,properties:this.calculateEventProperties(e,t||{},m,y)};e===e_&&this.config.__preview_capture_bot_pageviews&&p&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),_&&(b.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var w="$feature_flag_called"===e&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(mp);(null==n?void 0:n.$set)&&!w&&(b.$set=null==n?void 0:n.$set);var S,k=Il(null==t?void 0:t.$set)?t.$set:void 0,x=!(null==n||!n.$set)&&zh in n.$set,C=x||!!k&&zh in k,E=x?null==n||null==(r=n.$set)?void 0:r[zh]:null==k?void 0:k[zh],P=Pl(null==t?void 0:t.$unset)?t.$unset:[],T=(null==n?void 0:n.$unset)||[],I=-1!==P.indexOf(zh)||-1!==T.indexOf(zh),F=this._updateFacebookClickId(null==(i=v)?void 0:i.fbclid,E,C,I);F&&!0===b.properties.$process_person_profile&&F.pending&&!C&&!w&&(b.$set=Ta(((S={})[zh]=F.value,S),b.$set));var R=null==n?void 0:n.$unset;R&&(b.$unset=R);var L=w?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==r_,e===n_);if(L&&(b.$set_once=L),null!=n&&n._noTruncate||(l=this.config.properties_string_max_length,c=b,d=function(e){return Ll(e)?e.slice(0,l):e},f=new Set,b=function e(t,n){if(t!==Object(t))return d?d(t):t;if(!f.has(t)){var r;if(f.add(t),Pl(t))r=[],rh(t,(function(t){r.push(e(t))}));else{var i={};ih(t,(function(t,n){f.has(t)||(i[n]=e(t,n))})),r=i}return r}}(c)),b.timestamp=m,Rl(null==n?void 0:n.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),w&&(b.properties=function(e,t){void 0===t&&(t=[]);var n={},r=function(t){void 0!==e[t]&&(n[t]=e[t])};return cf.forEach(r),t.forEach(r),n}(b.properties,Wb)),e===ll.DISMISSED||e===ll.SENT){var A,O=null==t?void 0:t[cl.SURVEY_ID],M=null==t?void 0:t[cl.SURVEY_ITERATION];Dh({id:O,current_iteration:M}),b.$set=Ta({},b.$set,((A={})[gh({id:O,current_iteration:M},e===ll.SENT?"responded":"dismissed")]=!0,A))}else if(e===ll.SHOWN){var D;b.$set=Ta({},b.$set,((D={})[cl.SURVEY_LAST_SEEN_DATE]=(new Date).toISOString(),D))}if("product tour shown"===e){var q,N=null==t?void 0:t.$product_tour_type;N&&(b.$set=Ta({},b.$set,((q={})["$product_tour_last_seen_date/"+N]=(new Date).toISOString(),q)))}var B=Ta({},b.properties.$set,b.$set);if(Fl(B)||this.setPersonPropertiesForFlags(B),!Ml(this.config.before_send)){var H=this._runBeforeSend(b);if(!H)return;(b=H).uuid=wd(b.uuid,l_)}var j=null!==(o=null==(s=b.$set)?void 0:s[zh])&&void 0!==o?o:Il(null==(a=b.properties)?void 0:a.$set)?b.properties.$set[zh]:void 0,U=null!=F&&F.pending&&j===F.value?F.value:void 0;this._internalEventEmitter.emit("eventCaptured",b);var V=null!==(u=null==n?void 0:n._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),z=Ta({method:"POST",url:V,data:b,compression:"best-available",timestampMode:"recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(V)?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},null!=n&&n.transport?{transport:n.transport}:{},U?{fireCallbackOnDrop:!0,callback:function(e){e.statusCode>=200&&300>e.statusCode&&h._markFacebookClickIdDelivered(U)}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly||U?this._send_retriable_request(z):this._requestQueue.enqueue(z),b}th.critical("This capture call is ignored due to client rate limiting.")}}else th.error("No event name provided to posthog.capture")}else th.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 Db(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,n,r;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,this.persistence.get_property(Op)===Kp&&(null==(r=this.sessionPersistence)||r.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags(),!0)},t.calculateEventProperties=function(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var o=i?void 0:this.persistence.remove_event_timer(e),s=Ta({},t);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,this._inCookielessMode()&&(s[jp]=!0),"$snapshot"===e){var a=Ta({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!Ll(s.distinct_id)&&!Dl(s.distinct_id)||Al(s.distinct_id))&&th.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,l=function(e,t,n,r){var i,o,s,a;if(void 0===r&&(r=!1),!Jf)return{};var u,l=e?[].concat(Zv,t||[]):[],c=sd(Jf),d=c[0],f=c[1],h=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},p={};Rl(n)||(p.detectGoogleSearchApp=n);var _={},v=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,g=null==(o=navigator)?void 0:o.maxTouchPoints,m=null==Uf||null==(s=Uf.screen)?void 0:s.width,y=null==Uf||null==(a=Uf.screen)?void 0:a.height,b=null==Uf?void 0:Uf.devicePixelRatio;Rl(v)||(_.userAgentDataPlatform=v),Rl(g)||(_.maxTouchPoints=g),Rl(m)||(_.screenWidth=m),Rl(y)||(_.screenHeight=y),Rl(b)||(_.devicePixelRatio=b);var w,S=oh(lh({$os:d,$os_version:f,$browser:nd(Jf,navigator.vendor,h,p),$device:ad(Jf),$device_type:ud(Jf,_),$timezone:ug(),$timezone_offset:lg()}),{$current_url:p_(r?kd(null==Gf?void 0:Gf.href):null==Gf?void 0:Gf.href,l,Jv),$host:null==Gf?void 0:Gf.host,$pathname:null==Gf?void 0:Gf.pathname,$raw_user_agent:Jf.length>1e3?Jf.substring(0,997)+"...":Jf,$browser_version:id(Jf,navigator.vendor,h,p),$browser_language:rg(),$browser_language_prefix:(w=rg(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==Uf?void 0:Uf.screen.height,$screen_width:null==Uf?void 0:Uf.screen.width,$viewport_height:null==Uf?void 0:Uf.innerHeight,$viewport_width:null==Uf?void 0:Uf.innerWidth,$lib:jf.LIB_NAME,$lib_version:jf.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return jf.SDK_DIST_CHANNEL&&(S.$sdk_dist_channel=jf.SDK_DIST_CHANNEL),S}(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 c=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime(),!0),d=c.windowId;s.$session_id=c.sessionId,s.$window_id=d}this.sessionPropsManager&&oh(s,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&oh(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=null==(f=this._retryQueue)?void 0:f.length}catch(e){s.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Cb&&(s.$lib_custom_api_host=this.config.api_host),u=e!==e_||i?e!==t_||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=oh(s,u),e===e_&&Wf&&(s.title=Wf.title),!Rl(o)){var h=n.getTime()-o;s.$duration=parseFloat((h/1e3).toFixed(3))}Jf&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),_=this.sessionPersistence.properties(),v=s.$groups,g=p.$groups;Il(v)&&!Fl(v)&&(s.$groups=Ta({},Il(g)?g:{},v)),ih(["$referrer","$referring_domain"],(function(e){e in p&&delete _[e]}));var m={};if(this._extensionEventPropertyProducers.length>0)for(var y,b=Pa(this._extensionEventPropertyProducers.slice());!(y=b()).done;){var w=y.value;try{oh(m,w())}catch(e){th.error("Failed to produce browser extension event properties",e)}}(s=oh({},l,p,_,Ta({},m,s))).$is_identified=this._isIdentified(),Pl(this.config.property_denylist)?ih(this.config.property_denylist,(function(e){delete s[e]})):th.error(Ub+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(th.error(jb),s=S(s,e));var k=this._hasPersonProcessing();return s.$process_person_profile=k,k&&!i&&this._requirePersonProcessing("_calculate_event_properties"),s},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=this.persistence.get_initial_props(),o=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=oh({},i,o||{},e||{}),a=this.config.sanitize_properties;return a&&(th.error(jb),s=a(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Fl(s)?void 0:s},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||!H_._is_supported())H_._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach((function(e){return t.push(e)})),t.length>0?H_._set(this._sessionRegisteredPropertiesStorageKey,t):H_._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:Hb}),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:Hb})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Hb})},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=$h),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:Hb}},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:Hb})},t._validateIdentifyId=function(e){return!e||Al(e)?(th.critical("Unique user id has not been set in posthog.identify"),!1):e===Hp?(th.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())||(th.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 th.uninitializedWarning("posthog.identify");if(Dl(e)&&(e=e.toString(),th.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._healCookielessSentinelDistinctId();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(jh)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(Vh)&&(this.unregister(Vh),this.register({distinct_id:e}));var l,c=(this.persistence.get_property(Op)||Kp)===Kp,d=e!==u,f=!d&&c;if(d&&c)this.persistence.set_property(Op,Zp),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture(n_,{distinct_id:e,$anon_distinct_id:u},{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=m_(e,t,n),null==(l=this.featureFlags)||l.setAnonymousDistinctId(u);else if(f){this.persistence.set_property(Op,Zp);var h=t||{},p=n||{};this.setPersonPropertiesForFlags({$set:h,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:h,$set_once:p}),this._cachedPersonProperties=m_(e,t,n)}else(t||n)&&this.setPersonProperties(t,n);d||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Fp)):f&&(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=m_(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):th.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Pl(e)?e:[e]).filter((function(e){return Ll(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;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var o,s=this.getGroups(),a=s[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Ta({},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(r_,u)}n&&this.setGroupPropertiesForFlags(((o={})[e]=n,o)),a&&!n&&this.reloadFeatureFlags()}else th.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=$l(e)?e:null==e?void 0:e.resetDeviceID,n=$l(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var r,i,o;if(void 0===t&&(t=!1),th.info("reset"),!this.__loaded)return th.uninitializedWarning("posthog.reset");var s=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 a=this.get_property(jh),u=this.get_property(Uh),l=this.get_property(ip),c=this.is_capturing();this.consent.reset(),t||!c||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var d=null==(o=this.persistence)||null==o._beginCookieSyncSuppression?void 0:o._beginCookieSyncSuppression(),f=!1;try{var h,p,_,v,g,m,y,b,w,S,k,x,C,E;if(null==(h=this.persistence)||h.clear(),null==(p=this.sessionPersistence)||p.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),Rl(l)||null==(S=this.persistence)||S.register(((k={})[ip]=l,k)),null==(_=this.surveys)||_.reset(),null==(v=this.featureFlags)||v.reset(),null==(g=this.conversations)||g.reset(),null==(m=this.logs)||m.reset(),null==(y=this.metrics)||y.reset(),null==(b=this.persistence)||b.set_property(Op,Kp),null==(w=this.sessionManager)||w.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===Qp)this.register_once({distinct_id:Hp,$device_id:null},"");else{var P,T=this.config.get_device_id(l_());this.register_once({distinct_id:T,$device_id:e?T:a},""),e||Rl(u)||this.register(((P={})[Uh]=u,P))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(void 0===n.distinctID||this._inCookielessMode()||(null==(E=this.persistence)||E.set_property(Op,n.isIdentifiedID?Zp:Kp),this.register({distinct_id:n.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(Rl(s)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(s,!0))){var I=Ta({},n);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var F;d&&(null==(F=this.persistence)||null==F._endCookieSyncSuppression||F._endCookieSyncSuppression(f))}this.reloadFeatureFlags()},t.shutdown=function(){var e=Ca(Ra().m((function e(t){var n,r,i,o,s,a,u,l;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return th.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:this._getBrowserClientAdapter().dispose(),null==(n=this.sessionRecording)||n.dispose(),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.metrics)||i.flush("sendBeacon"),null==(o=this._requestQueue)||o.unload(),null==(s=this._retryQueue)||s.unload();try{null==(l=this.featureFlags)||l.destroy()}catch(e){th.error("Error while destroying feature flags",e)}null==(a=this.persistence)||a.destroy(),null==(u=this.sessionPersistence)||u.destroy();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(Bh)?(th.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Rl(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Vh,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(th.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t=Ta({},this.config);if(Il(e)){var n,r,i,o,s,a,u,l,c,d,f,h;oh(this.config,Jb(e));var p=this._is_persistence_disabled();null==(n=this.persistence)||n.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new py(Ta({},this.config,{persistence:"sessionStorage"}),p,!1);var _,v=this._checkLocalStorageForDebug(this.config.debug);$l(v)&&(this.config.debug=v),$l(this.config.debug)&&(this.config.debug?(jf.DEBUG=!0,P_._is_supported()&&P_._set("ph_debug",!0),th.info("set_config",{config:e,oldConfig:t,newConfig:Ta({},this.config)})):(jf.DEBUG=!1,P_._is_supported()&&P_._remove("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(i=this.exceptionObserver)||i.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(_=this.historyAutocapture)||_.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Qm(this,Nb,!1)}},t._overrideSDKInfo=function(e,t){jf.LIB_NAME=e,jf.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){if(this.exceptions){var n=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(Ta({},r,t))}},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:Gb;return t!==Gb&&(t=Gb+"."+t),t},t._isIdentified=function(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(Op))===Zp||(null==(t=this.sessionPersistence)?void 0:t.get_property(Op))===Zp},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===Yp&&!this._isIdentified()&&Fl(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Vh])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Bp]))},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?(th.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(Bp,!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&&this.config.cookieless_mode!==Gp)},t._sync_opt_out_with_persistence=function(){var e,t,n,r,i,o=this._is_persistence_disabled();return this.is_capturing()||null==(n=this.logs)||n._onOptOut(),(null==(e=this.persistence)?void 0:e._disabled)!==o&&(null==(r=this.persistence)||r.set_disabled(o)),(null==(t=this.sessionPersistence)?void 0:t._disabled)!==o&&(null==(i=this.sessionPersistence)||i.set_disabled(o)),o&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),o},t.opt_in_capturing=function(t){var n;if(this.config.cookieless_mode!==Qp){if(this._inCookielessMode()){var r,i,o,s,a,u;null==(r=this.sessionRecording)||r.dispose({discardBufferedEvents:!0}),this._reset(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new Sb(this),this.pageViewManager=new Xm(this),this.persistence&&(this.sessionPropsManager=new mb(this,this.sessionManager,this.persistence));var l,c=null!==(s=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==s?s:null==(u=e.__defaultExtensionClasses)?void 0:u.sessionRecording;c&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new c(this)),this._lastRemoteConfig&&(null==(l=this.sessionRecording)||null==l.onRemoteConfig||l.onRemoteConfig(this._lastRemoteConfig)))}var d,f;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),this.config.cookieless_mode==Gp&&(null==(d=this.surveys)||d.loadIfEnabled()),(Rl(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(f=null==t?void 0:t.captureEventName)&&void 0!==f?f:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else th.warn(Bb)},t.opt_out_capturing=function(){if(this.config.cookieless_mode!==Qp){var e,t,n=this.config.cookieless_mode===Gp?this.sessionRecording:void 0;null==n||n.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===Gp&&this.consent.isOptedIn()&&this._reset(!0,!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===Gp&&(this.register({distinct_id:Hp,$device_id:null}),this._removeExtension(n),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())}else th.warn(Bb)},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.config.cookieless_mode===Qp||(this.config.cookieless_mode===Gp?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 zf?kb(zf,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Wf&&("visible"===Wf.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(e_,{title:Wf.title},{send_instantly:!0}),this._visibilityStateListener&&(Wf.removeEventListener(Jp,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),fh(Wf,Jp,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Uf||Uf.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Uf||Uf.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?(th.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&&!Ml(e[t]),s=n in e&&!Ml(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,th)},t._runBeforeSend=function(e){var t;if(Ml(this.config.before_send))return e;for(var n,r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Hl),i=e,o=Pa(Pl(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(n=o()).done;){var s=n.value;try{if(i=s(i),Ml(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return Bl(e.event)?th.warn(a+". This can cause unexpected behavior."):th.info(a),null}i.properties&&!Fl(i.properties)||th.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return th.error("Error in beforeSend function for event '"+e.event+"':",t),null}}for(var u,l=Pa(r);!(u=l()).done;){var c=u.value;if(i.properties&&Ml(i.properties[c]))return th.warn("Event '"+e.event+"' had its '"+c+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null}return i},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=$l(e)&&!e,n=P_._is_supported()&&"true"===P_._get("ph_debug");return!t&&(!!n||e)},Ea(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:"logger",get:function(){var t,n;return null!==(t=null==(n=this.logs)?void 0:n.logger)&&void 0!==t?t:e._noopLogger}}])}();ew.__defaultExtensionClasses={},ew._noopLogger=function(){var e=function(){};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}}(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=uh(e.prototype[t[n]])}(ew,["identify"]);var tw=function(){function e(e){this.disabled=!1===e;var t=Il(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}(),nw="$copy_autocapture",rw=nh("[AutoCapture]");function iw(e,t){return t.length>e?t.slice(0,e)+"...":t}function ow(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!sm(t));return t}function sw(e,t){var n,r,i=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=t.disableCaptureUrlHashes;if(!sm(e))return{props:{}};for(var c=[e],d=new Set([e]),f=e;f.parentNode&&!am(f,"body")&&cm>c.length;)if(lm(f.parentNode)){var h=f.parentNode.host;if(d.has(h))break;d.add(h),c.push(h),f=h}else{if(!sm(f.parentNode))break;if(d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var p,_,v=[],g={},m=!1,y=!1;if(ih(c,(function(e){var t=Im(e);if(am(e,"a")){var n=e.getAttribute("href");m=!!(t&&n&&$m(n))&&(l?kd(n):n)}pl(hm(e),"ph-no-capture")&&(y=!0),v.push(function(e,t,n,r,i){void 0===i&&(i=!1);var o=e.tagName.toLowerCase(),s={tag_name:o};gm.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?iw(1024,Nm(e)):iw(1024,_m(e)));var a=hm(e);a.length>0&&(s.classes=a.filter((function(e){return""!==e}))),ih(e.attributes,(function(n){var o;if((!Fm(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&$m(n.value)&&(!Ll(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){var a=n.value;"class"===n.name&&(a=dm(a).join(" ")),s["attr__"+n.name]=iw(1024,"href"===n.name&&i?kd(a):a)}}));for(var u=1,l=1,c=e;c=ow(c);)u++,c.tagName===e.tagName&&l++;return s.nth_child=u,s.nth_of_type=l,s}(e,o,s,a,l));var r=function(e){if(!Im(e))return{};var t={};return ih(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&&$m(r)&&(t[n]=r)}})),t}(e);ih(r,(function(e,t){({}).hasOwnProperty.call(g,t)||(g[t]=e)}))})),y)return{props:{},explicitNoCapture:y};if(s||(v[0].$el_text=am(e,"a")||am(e,"button")?Nm(e):_m(e)),m){var b,w;v[0].attr__href=m;var S=null==(b=f_(m))?void 0:b.host,k=null==Uf||null==(w=Uf.location)?void 0:w.host;S&&k&&S!==k&&(p=m)}return{props:oh({$event_type:i.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:(_=v,Pl(_)?function(e){var t=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=Pa(e.attr_class);!(i=o()).done;)r+="."+i.value.replace(/"/g,"")}var s=Ta({},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 sh(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[Hm(e[0].toString())]=Hm(t.toString())})),(r+=":")+sh(a).map((function(e){return e[0]+'="'+e[1]+'"'})).join("")}));return t.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:jm(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sh(e).filter((function(e){return 0===e[0].indexOf("attr__")})).forEach((function(e){return r.attributes[e[0]]=e[1]})),r}))}(_)):"")},null!=(n=v[0])&&n.$el_text?{$el_text:null==(r=v[0])?void 0:r.$el_text}:{},p&&"click"===i.type?{$external_click_url:p}:{},g)}}var aw=function(){function e(e){this.name="autocapture",this._initialized=!1,this._isDisabledServerSide=null,this._hasReceivedConfigResponse=!1,this._elementsChainAsString=!1,this._config={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this._disposed=!1,this._configSource=e,this._configSource.refresh(this._config),this.rageclicks=new tw(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return 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._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;if(this.isBrowserSupported()){if(Uf&&Wf){var t=this._domEventHandler=function(t){t=t||(null==Uf?void 0:Uf.event);try{e._captureEvent(t)}catch(e){rw.error("Failed to capture event",e)}};if(fh(Wf,"submit",t,{capture:!0}),fh(Wf,"change",t,{capture:!0}),fh(Wf,"click",t,{capture:!0}),this._refreshConfig().capture_copied_text){var n=this._copiedTextHandler=function(t){t=t||(null==Uf?void 0:Uf.event);try{e._captureEvent(t,nw)}catch(e){rw.error("Failed to capture clipboard event",e)}};fh(Wf,"copy",n,{capture:!0}),fh(Wf,"cut",n,{capture:!0}),fh(Wf,"paste",n,{capture:!0})}}}else rw.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){this._domEventHandler&&(null==Wf||Wf.removeEventListener("submit",this._domEventHandler,!0),null==Wf||Wf.removeEventListener("change",this._domEventHandler,!0),null==Wf||Wf.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==Wf||Wf.removeEventListener("copy",this._copiedTextHandler,!0),null==Wf||Wf.removeEventListener("cut",this._copiedTextHandler,!0),null==Wf||Wf.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._initialized=!1},t.startIfEnabled=function(){!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;$l(r)&&(null==(n=this._client)||n.kv.set(Qh,r),this._isDisabledServerSide=r),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e){this._elementSelectors=e},t.getElementSelectors=function(e){var t,n=[];return null==(t=this._elementSelectors)||t.forEach((function(t){var r=null==Wf?void 0:Wf.querySelectorAll(t);null==r||r.forEach((function(r){e===r&&n.push(t)}))})),n},t._captureEvent=function(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n=vm(e);um(n)&&(n=n.parentNode||null);var r,i=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&i.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Em(n,i.rageclick)&&this._captureEvent(e,"$rageclick");var o=t===nw,s=o?Ta({},i,{dom_event_allowlist:void 0}):i;if(n&&function(e,t,n,r,i,o){var s;if(!Uf||Pm(e))return!1;if(null!=n&&n.url_allowlist&&!fm(n.url_allowlist,o))return!1;if(null!=n&&n.url_ignorelist&&fm(n.url_ignorelist,o))return!1;if(null!=n&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some((function(e){return t.type===e})))return!1}var u=Tm(e,r),l=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Rl(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=Pa(e);!(i=s()).done;)if(r=o())return r.v;return!1}(c,n))return!1;if(!mm(c,null==n?void 0:n.css_selector_allowlist))return!1;if(mm(c,null!==(s=null==n?void 0:n.css_selector_ignorelist)&&void 0!==s?s:bm))return!1;try{var d=Uf.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){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 l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(gm.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(n,e,s,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:i.getCurrentUrl}})){var a,u=sw(n,{e:e,maskAllElementAttributes:i.maskAllElementAttributes,maskAllText:i.maskAllText,elementAttributeIgnoreList:i.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:i.disableCaptureUrlHashes}),l=u.props;if(u.explicitNoCapture)return!1;var c=this.getElementSelectors(n);if(c&&c.length>0&&(l.$element_selectors=c),t===nw){var d=e.type||"clipboard";if("paste"!==d){var f,h,p=null==Uf||null==(f=Uf.getSelection())?void 0:f.toString(),_=pm(p);if(!_)return!1;l.$selected_content=_,l.$clipboard_text_length=null!==(h=null==p?void 0:p.length)&&void 0!==h?h:0}l.$copy_type=d}return null==(a=this._client)||a.capture(t,l).catch((function(e){return rw.error("Failed to capture event",e)})),!0}}},t.isBrowserSupported=function(){return Tl(null==Wf?void 0:Wf.querySelectorAll)},Ea(e,[{key:"isEnabled",get:function(){var e,t;if(this._disposed)return!1;var n=null==(e=this._client)?void 0:e.kv.get(Qh),r=this._isDisabledServerSide,i=this._refreshConfig(),o=i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if(Ol(r)&&!$l(n)&&!o)return!1;var s=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!i.enabled&&!s}}])}(),uw=function(){function e(e){this._instance=e}return e.prototype.refresh=function(e){var t=this._instance.config,n=Il(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance._shouldDisableFlags(),e.url_allowlist=null==n?void 0:n.url_allowlist,e.url_ignorelist=null==n?void 0:n.url_ignorelist,e.dom_event_allowlist=null==n?void 0:n.dom_event_allowlist,e.element_allowlist=null==n?void 0:n.element_allowlist,e.css_selector_allowlist=null==n?void 0:n.css_selector_allowlist,e.css_selector_ignorelist=null==n?void 0:n.css_selector_ignorelist,e.element_attribute_ignorelist=null==n?void 0:n.element_attribute_ignorelist,e.capture_copied_text=null==n?void 0:n.capture_copied_text},e}(),lw=function(e){function t(t){var n;return(n=e.call(this,new uw(t))||this).instance=t,n}return Ia(t,e),t}(aw),cw=nh("[ExceptionAutocapture]"),dw=function(){function e(e){var t,n=this;this._startCapturing=function(){var e;if(Uf&&n.isEnabled&&null!=(e=Tg.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=Tg.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Tg.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Tg.__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){cw.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Zh]),this._rateLimiter=new Jl(Ta({},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:cw})),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 Il(e)?t=Ta({},t,e):(Rl(e)?this._remoteEnabled:e)&&(t=Ta({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(cw.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=Tg.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",(function(t){if(t)return cw.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){if(e.ok){var t,n=e.config;if("autocaptureExceptions"in n)this._remoteEnabled=!!n.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register(((t={})[Zh]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){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";this._rateLimiter.consumeRateLimit(i)?cw.info("Skipping exception capture because of client rate limiting.",{exception:i}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)},Ea(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),fw=function(){function e(e){this._instance=e,this._lastLocation=this._getCurrentLocation()}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){this.isEnabled&&(th.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,th.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Uf&&Uf.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Uf&&(null==(t=Uf.history[e])||!t.__posthog_wrapped__)){var n=this;Ug(Uf.history,e,(function(t){return function(r,i,o){t.call(this,r,i,o),n._capturePageview(e)}}))}},t._getCurrentLocation=function(){var e=null==Uf?void 0:Uf.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}:Il(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){try{var t=this._getCurrentLocation();if(!t)return;this._hasLocationChanged(t)&&this._instance.capture(e_,{navigation_type:e}),this._lastLocation=t}catch(t){th.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};fh(Uf,"popstate",t),this._popstateListener=function(){Uf&&Uf.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};fh(Uf,"hashchange",t),this._hashchangeListener=function(){Uf&&Uf.removeEventListener("hashchange",t)}}},Ea(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),hw=nh("[TracingHeaders]"),pw=function(){function e(e){var t=this;this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._startCapturing=function(){var e,n,r=t._syncHostnamesForPatch();r?(Rl(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=Tg.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,(function(){return t._instance.get_distinct_id()}),t._instance.sessionManager)),Rl(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=Tg.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(r,(function(){return t._instance.get_distinct_id()}),t._instance.sessionManager))):t._stopCapturing()},this._instance=e}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t._loadScript=function(e){var t,n;null!=(t=Tg.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",(function(t){if(t)return hw.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 Pl(t)?(Pl(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):(Pl(this._hostnamesForPatch)&&this._hostnamesForPatch.splice(0),this._hostnamesForPatch=t||void 0,this._hostnamesForPatch)},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(){this._syncHostnamesForPatch()?this._loadScript(this._startCapturing):this._stopCapturing()},e}(),_w=nh("[Web Vitals]"),vw=9e5,gw=["CLS","FCP","INP","LCP"],mw=["INP","LCP"],yw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],bw=function(){function e(e){var t,n=this;this._enabledServerSide=!1,this._initialized=!1,this._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(){clearTimeout(n._delayedFlushTimer),n._delayedFlushTimer=void 0,0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",Ta({$current_url:n._buffer.url},n._buffer.metrics.reduce((function(e,t){var n;return Ta({},e,((n={})["$web_vitals_"+t.name+"_event"]=Ta({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))}),{}))),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},Ml(null==e?void 0:e.name)||Ml(null==e?void 0:e.value))_w.error("Invalid metric received",e);else{var r="string"==typeof e.navigationURL?e.navigationURL:void 0,i=n._maskedURL(r);if(!Rl(i)){var o=Dl(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)),Rl(n._buffer.navigationKey)&&(n._buffer.navigationKey=o,n._buffer.url=i),n._buffer.firstMetricTimestamp=Rl(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var s=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=Ta({},e,r?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete a.entries,Il(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var u,l={},c=Pa(yw);!(u=c()).done;){var d=u.value,f="url"===d&&"string"==typeof e.attribution[d]?n._maskedURL(e.attribution[d]):e.attribution[d];Rl(f)||(l[d]=f)}a.attribution=l}else delete a.attribution;Rl(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 _w.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,r,i,o=!1,s=Tg.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,u=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&Rl(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!Rl(u)){var l=u.withoutAttribution,c=n.attributionMetrics;o=!Rl(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 d={reportSoftNavs:n.useSoftNavs},f=o&&n.attributionMetrics.indexOf("INP")>-1?Ta({},d,{includeProcessedEventEntries:!1}):d;n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n),d),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n),d),n.allowedMetrics.indexOf("FCP")>-1&&r(n._addToBuffer.bind(n),d),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n),f),n._initialized=!0}else _w.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Xh]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(_w.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=Il(t.capturePerformance)&&!!t.capturePerformance.web_vitals,o=Il(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[Xh]=i,n)),this._instance.persistence.register(((r={})[rp]=o,r))),this._enabledServerSide=i,this.startIfEnabled()}}},t._loadScript=function(e){var t=Tg.__PosthogExtensions__,n=this._callbackFlavor,r=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=r&&r[n]||"web-vitals"===n&&Rl(r)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,n,(function(t){t?_w.error("failed to load script",t):e()}))},t._maskedURL=function(e){var t=e||(null==Uf?void 0:Uf.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?kd(t):t,r=this._instance.config.mask_personal_data_properties?[].concat(Zv,this._instance.config.custom_personal_data_properties||[]):[];return p_(n,r,Jv)}_w.error("Could not determine current URL")},Ea(e,[{key:"_perfConfig",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=Il(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Ml(n)?(null==(t=this._instance.persistence)?void 0:t.props[rp])||gw:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(Il(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=Il(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return $l(e)?e?gw:[]:Pl(e)?e:mw}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e=Il(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}},{key:"_maxAllowedValue",get:function(){var e=Il(this._perfConfig)&&Dl(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:vw;return e>0&&6e4>=e?vw:e}},{key:"isEnabled",get:function(){var e=null==Gf?void 0:Gf.protocol;if("http:"!==e&&"https:"!==e)return _w.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Il(this._perfConfig)?this._perfConfig.web_vitals:$l(this._perfConfig)?this._perfConfig:void 0;return $l(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"}}])}(),ww="disabled",Sw="lazy_loading",kw="awaiting_config",xw="missing_config";nh("[SessionRecording]"),nh("[SessionRecording]");var Cw="[SessionRecording]",Ew=nh(Cw),Pw=function(){function e(e){var t=this;if(this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=ww,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._documentWasEverVisible=function(){var e;if(null==Wf||!Wf.visibilityState||"visible"===Wf.visibilityState)return!0;var t=null==Uf||null==(e=Uf.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==Wf?void 0:Wf.visibilityState)&&(t._documentWasEverVisible=!0,null==(e=t._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Ew.error("started without valid sessionManager"),new Error(Cw+" started without valid sessionManager. This is a bug.");if(this._config.cookieless_mode===Qp)throw new Error(Cw+' cannot be used with cookieless_mode="always"');null!=Wf&&Wf.addEventListener&&fh(Wf,"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==Wf||null==Wf.removeEventListener||Wf.removeEventListener("visibilitychange",this._onVisibilityChange),n?this._discardRecording(!0):this.stopRecording()},t.startIfEnabledOrStop=function(e){var t;if(!(this._sessionRecordingDisposed||this._isRecordingEnabled&&null!=(t=this._lazyLoadedSessionRecording)&&t.isStarted)){var n=!Rl(Object.assign)&&!Rl(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Ew.info("starting")):(this._recordingStatus=ww,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,r=this;if(this._isRecordingEnabled)if(this._recordingStatus!==kw&&this._recordingStatus!==xw&&(this._recordingStatus=Sw),null!=Tg&&null!=(t=Tg.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=Tg.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var i,o=this._instance.sessionManager;null==(i=Tg.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(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={})[zp]=!0,n)),Ew.error("could not load recorder",t);r._onScriptLoaded(e)}else r._recordingStatus=ww}))}},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;void 0===e&&(e=!1),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=void 0,null==(n=this._lazyLoadedSessionRecording)||n.discard({discardProducerEvents:e})},t._resetSampling=function(){var e,t;null==(e=this._persistence)||e.unregister(dp),null==(t=this._persistence)||t.unregister(op)},t._validateSampleRate=function(e,t){if(Ml(e))return null;var n,r=Dl(e)?e:parseFloat(e);return"number"!=typeof(n=r)||!Number.isFinite(n)||0>n||n>1?(Ew.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;Ml(u)&&t._resetSampling();var l=null==o?void 0:o.minimumDurationMilliseconds;i.register(((r={})[ip]=Ta({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:Ta({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:Rl(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;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this._persistRemoteConfig(t),void this._discardRecording()):(this._persistRemoteConfig(t),void this.startIfEnabledOrStop()):(this._recordingStatus===kw&&(this._recordingStatus=xw,Ew.warn("config refresh failed, recording will not start until page reload")),void 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):Ew.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(ip);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Ew.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!Ml(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._onScriptLoaded=function(e){var t,n,r;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var i,o;if(null==(t=Tg.__PosthogExtensions__)||!t.initSessionRecording)return Ew.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((i={},i[zp]=!0,i));if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(o=Tg.__PosthogExtensions__)?void 0:o.initSessionRecording(this._instance,this._documentWasEverVisible),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if(this._recordingStatus===xw||this._recordingStatus===kw)return;return this._recordingStatus=kw,Ew.info("persisted remote config is stale, requesting fresh config before starting"),void new my(this._instance).load()}this._recordingStatus=Sw,null==(n=(r=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(r,this._documentWasEverVisible),this._lazyLoadedSessionRecording.start(e)}else this._recordingStatus=ww},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==(t=this._persistence)||t.register(((n={})[ap]=!0,n)),null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})[sp]=!0,n)),null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()},t.overrideTrigger=function(e){var t,n,r;this._lazyLoadedSessionRecording||null==(n=this._persistence)||n.register(((r={})["url"===e?up:lp]=!0,r)),null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)},t.tryAddCustomEvent=function(e,t){var n;return!(null==(n=this._lazyLoadedSessionRecording)||!n.tryAddCustomEvent(e,t))},Ea(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._recordingStatus===kw||this._recordingStatus===xw?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(ip))||!e.enabled),n=!this._config.disable_session_recording,r=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Uf&&t&&n&&!r}},{key:"_scriptName",get:function(){var e,t,n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(ip);return(null==n||null==(t=n.scriptConfig)?void 0:t.script)||"lazy-recorder"}},{key:"sdkDebugProperties",get:function(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}}])}(),Tw=nh("[Heatmaps]");function Iw(e){return Il(e)&&"clientX"in e&&"clientY"in e&&Dl(e.clientX)&&Dl(e.clientY)}var Fw=function(){function e(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Kh]),this.rageclicks=new tw(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Tw.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){if(e.ok){var t=e.config;if("heatmaps"in t){var n,r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register(((n={})[Kh]=r,n)),this._enabledServerSide=r,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){Iw(e.originalEvent)&&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)}(Wf)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Uf&&Wf&&(this._flushHandler=this._flush.bind(this),fh(Uf,Xp,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Uf?void 0:Uf.event))},fh(Wf,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Uf?void 0:Uf.event))},fh(Wf,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Wm(this.instance,Vm,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),fh(Wf,Jp,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Uf&&Wf&&(this._flushHandler&&Uf.removeEventListener(Xp,this._flushHandler),this._onClickHandler&&Wf.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Wf.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Wf.removeEventListener(Jp,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),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&&sm(r)&&!am(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:Uf)?void 0:o.getComputedStyle(r).position}catch(e){return!1}if(pl(t,i))return!0;r=ym(r)}return!1}(vm(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"),!om(e.target)&&Iw(e)){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&Em(vm(e),this.instance.config.rageclick)&&this._capture(Ta({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!om(e.target)&&Iw(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))},t._capture=function(e){if(Uf){var t=this._config.disable_capture_url_hashes?kd(Uf.location.href):Uf.location.href,n=this._config.mask_personal_data_properties?[].concat(Zv,this._config.custom_personal_data_properties||[]):[],r=p_(t,n,Jv);this._buffer=this._buffer||{},this._buffer[r]||(this._buffer[r]=[]),this._buffer[r].push(e)}},t._flush=function(){this._buffer&&!Fl(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},Ea(e,[{key:"_config",get:function(){return this.instance.config}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return Il(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 Ml(this._config.capture_heatmaps)?Ml(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),Rw=nh("[Product Tours]"),Lw=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(tp))},Aw=function(){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){if(e.ok){var t=e.config;if("productTours"in t){var n,r,i;if(this._persistence&&this._persistence.register(((n={})[tp]=!!t.productTours,n)),!Lw(this._instance))return!this._productTourManager&&Ml(null==(r=this._persistence)?void 0:r.props[Ip])||Rw.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&&Lw(this._instance)&&this._loadScript((function(){return e._startProductTours()}))},t._loadScript=function(e){var t,n;null!=(t=Tg.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",(function(t){t?Rw.error("Could not load product tours script",t):e()}))},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=Tg.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=Tg.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Pl(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[Ip];if(Pl(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){if(Lw(n._instance)){var i=t.statusCode;if(200!==i||!t.json){var o="Product Tours API could not be loaded, status: "+i;return 0===i?t.error||Rw.warn(o):Rw.error(o),void e([],{isLoaded:!1,error:o})}var s,a=Pl(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,r&&r.register(((s={})[Ip]=a,s)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){Ml(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(Ip)},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)},Ea(e,[{key:"_persistence",get:function(){return this._instance.persistence}}])}(),Ow=["$set_once","$set"],Mw=nh("[SiteApps]"),Dw="Error while initializing PostHog app with config id ",qw=function(){function e(e){this._siteAppElementPatchCount=0,this._instance=e,this._bufferedInvocations=[],this.apps={}}var t=e.prototype;return t._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))}},t.initialize=function(){var e=this;if(this.isEnabled){var t=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=function(){t(),e._bufferedInvocations=[],e._stopBuffering=void 0}}},t.globalsForEvent=function(e){var t,n,r,i,o,s,a;if(!e)throw new Error("Event payload is required");for(var u={},l=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{},d=0,f=Object.entries(c);f.length>d;d++){var h=f[d],p=h[0];u[p]={id:l[p],type:p,properties:h[1]}}var _=e.$set_once,v=e.$set;return{event:Ta({},Fa(e,Ow),{properties:Ta({},e.properties,v?{$set:Ta({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},v)}:{},_?{$set_once:Ta({},null!==(r=null==(i=e.properties)?void 0:i.$set_once)&&void 0!==r?r:{},_)}:{}),elements_chain:null!==(o=null==(s=e.properties)?void 0:s.$elements_chain)&&void 0!==o?o:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}},t._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)||(Mw.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)||(Mw.error("prepare_external_dependency_script returned null"),null):e},t._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==Wf?void 0:Wf.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!Ol(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()},t._releaseSiteAppElementPatches=function(){var e=this,t=!1;return function(){t||(t=!0,e._siteAppElementPatchCount--,0===e._siteAppElementPatchCount&&(null==e._restoreSiteAppElementPatches||e._restoreSiteAppElementPatches()))}},t._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}},t.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(Mw.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,Mw.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){Mw.error(Dw+e.id,t),o(!1)}if(i&&n.loaded)try{r()}catch(t){Mw.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}},t._setupSiteApps=function(){for(var e,t=this.siteAppLoaders||[],n=Pa(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=Pa(t);!(i=o()).done;)this.setupSiteApp(i.value)},t._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){Mw.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()},t.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 Mw.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;Tg["__$$ph_site_app_"+n]=i._instance,null==(e=Tg.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,(function(e){if(e)return Mw.error(Dw+n,e)}))},u=Pa(o.siteApps);!(s=u()).done;)a();else Mw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Ea(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"siteAppLoaders",get:function(){var e;return null==(e=Tg._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),$w=function(e,t){return null!=e&&e.then?e.then(t):t(e)},Nw="SDK is not enabled or survey functionality is not yet loaded",Bw="Disabled. Not loading surveys.",Hw=function(){function e(e,t){var n=this;this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._disposed=!1,this._renderTimeouts=new Set,this.onRemoteConfig=function(e){if(!n._disposed&&!n._config.disableSurveys){if(!e.ok)return Ih.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Ml(t))return Ih.warn("Flags not loaded yet. Not loading surveys.");n._isSurveysEnabled=$l(t)?t:t.length>0,Ih.info("flags response received, isSurveysEnabled: "+n._isSurveysEnabled),n.loadIfEnabled()}},this._configSource=e,this._initialClientState=t}var t=e.prototype;return t.setup=function(e){var t=this;if(!this._disposed)return this._initializingClient=e,$w(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;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._getSurveysInFlightPromise=null,this._renderTimeouts.forEach((function(e){return clearTimeout(e)})),this._renderTimeouts.clear())},t.initialize=function(){this.loadIfEnabled()},t.reset=function(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(null!=r&&r.startsWith(Lh)||null!=r&&r.startsWith(Ah))&&t.push(r)}t.forEach((function(e){return localStorage.removeItem(e)}))}catch(e){}},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._client){var t=this._config;if(!this._surveyManager)if(this._isInitializingSurveys)Ih.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Ih.info(Bw);else if(t.cookielessMode&&this._configSource.isOptedOut())Ih.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!Rl(this._isSurveysEnabled)||t.advancedEnableSurveys){var r=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0;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(Wp),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 Ih.error("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){this._disposed||(this._surveyManager=e(t),this._surveyEventReceiver=this._configSource.createEventReceiver(),Ih.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0}))},t._handleSurveyLoadError=function(e,t){Ih.error(e,t),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,r=this;void 0===t&&(t=!1);var i=null!==(n=this._client)&&void 0!==n?n:this._initialClientState;if(i&&!this._disposed){if(this._config.disableSurveys)return Ih.info(Bw),e([]);var o=i.kv.get(xp);if(o&&!t)return e(o,{isLoaded:!0}),void(this._shouldBackgroundRefreshSurveys()&&this.getSurveys((function(){}),!0));if(this._getSurveysInFlightPromise)this._getSurveysInFlightPromise.then((function(t){r._disposed||e(t.surveys,t.context)})).catch((function(e){return Ih.error("Error in survey callback",e)}));else{var s=this._sendSurveysRequest("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then((function(e){try{return r._handleSurveyResponse(i,e)}catch(e){return Ih.error("Error processing surveys response",e),r._handleSurveyResponse(i,{statusCode:0,error:e})}}),(function(e){return r._handleSurveyResponse(i,{statusCode:0,error:e})}));this._getSurveysInFlightPromise=s;var a=function(){r._getSurveysInFlightPromise===s&&(r._getSurveysInFlightPromise=null)};s.then((function(t){a(),r._disposed||e(t.surveys,t.context)}),a).catch((function(e){return Ih.error("Error in survey callback",e)}))}}},t._sendSurveysRequest=function(e,t){var n=this._client;return n?n.sendRequest(e,t):new Promise((function(e){return e({statusCode:0,error:new Error(Nw)})}))},t._handleSurveyResponse=function(e,t){var n;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:Nw}};var r=t.statusCode;if(200!==r||!t.json){var i="Surveys API could not be loaded, status: "+r;return 0!==r?Ih.error(i):t.error||Ih.warn(i),this._lastSurveyRefreshFailedAt=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this._lastSurveyRefreshFailedAt=null;var o,s=t.json.surveys||[],a=s.filter((function(e){return Fh(e)&&(kh(e)||Rh(e))}));return a.length>0&&(null==(o=this._surveyEventReceiver)||o.register(a)),e.kv.set(((n={})[xp]=s,n[Cp]=Date.now(),n)),{surveys:s,context:{isLoaded:!0}}},t._shouldBackgroundRefreshSurveys=function(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()},t._isSurveyCacheStale=function(){var e,t,n=null==(e=null!==(t=this._client)&&void 0!==t?t:this._initialClientState)?void 0:e.kv.get(Cp);return Dl(n)&&Date.now()-n>3e5},t._isSurveyRefreshBackingOff=function(){return Dl(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n,r={id:e,current_iteration:null!==(n=null==t?void 0:t.iteration)&&void 0!==n?n:null};Dh(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}},t._notifySurveyCallbacks=function(e){for(var t,n=Pa(this._surveyCallbacks);!(t=n()).done;){var r=t.value;try{if(!e.isLoaded)return r([],e);this.getSurveys(r)}catch(e){Ih.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!Ml(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ih.warn("init was not called")},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(Ml(this._surveyManager))return{eligible:!1,reason:Nw};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){if(Ml(this._surveyManager))return{eligible:!1,reason:Nw};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(Ml(this._surveyManager))return Ih.warn("init was not called"),{visible:!1,disabledReason:Nw};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return Ml(this._surveyManager)?(Ih.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Nw})):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=this;if(Ml(this._surveyManager))Ih.warn("init was not called");else{var o="string"==typeof e?this._getSurveyById(e):e;if(null!=o&&o.id)if(qh.includes(o.type)){var s=null==Wf?void 0:Wf.querySelector(t);if(s)if(null!=(r=o.appearance)&&r.surveyPopupDelaySeconds){Ih.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout((function(){var e,t;i._renderTimeouts.delete(a),i._disposed||(Ih.info("Rendering survey "+o.id+" with delay of "+(null==(e=o.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=i._surveyManager)||t.renderSurvey(o,s,n),Ih.info("Survey "+o.id+" rendered"))}),1e3*o.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(a)}else this._surveyManager.renderSurvey(o,s,n);else Ih.warn("Survey element not found")}else Ih.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Ih.warn("Survey not found")}},t.displaySurvey=function(e,t){var n;if(Ml(this._surveyManager))Ih.warn("init was not called");else{var r=this._getSurveyById(e);if(r){var i=r;if(null!=(n=r.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=Ta({},r,{appearance:Ta({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==dl&&t.initialResponses&&Ih.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this._checkSurveyEligibility(r);if(!o.eligible)return void Ih.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else Ih.warn("Survey not found")}},t.cancelPendingSurvey=function(e){Ml(this._surveyManager)?Ih.warn("init was not called"):this._surveyManager.cancelSurvey(e)},t.handlePageUnload=function(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()},Ea(e,[{key:"_config",get:function(){return this._configSource.get()}}])}();function jw(e,t,n){if(Ml(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 Uw=function(){function e(e){var t=this;this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new yb,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)},this._instance=e}var t=e.prototype;return t.init=function(){var e,t,n=this;Rl(null==(e=this._instance)?void 0:e._addCaptureHook)||(this._captureHookUnsubscribe=null==(t=this._instance)?void 0:t._addCaptureHook((function(e,t){n.on(e,t)})))},t.dispose=function(){var e;null==(e=this._captureHookUnsubscribe)||e.call(this),this._captureHookUnsubscribe=void 0,this._debugEventEmitter=new yb},t.register=function(e){var t,n,r=this;if(!Rl(null==(t=this._instance)?void 0:t._addCaptureHook)&&(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._instance)&&n.autocapture)){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._instance.autocapture.setElementSelectors(i)}},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=Pa(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(!r||"string"!=typeof r)return!1;if(!jw(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 jw(e.href,t.href,t.href_matching||"exact")}));var i,o=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!o&&jw((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 jw(e.text,t.text,t.text_matching||"exact")||jw(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;!Ml(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 jw(e,o,s)})))},t._checkStepSelector=function(e,t){var n,r;if(null==t||!t.selector)return!0;var i=null==e||null==(n=e.properties)?void 0:n.$element_selectors;if(null!=i&&i.includes(t.selector))return!0;var o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch(e){return!1}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||Th(t.properties.reduce((function(e,t){var n=Pl(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}(),Vw=function(){function e(e){var t,n=this;this._pendingActivatedItems=[],this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map,this._sessionIdUnsubscribe=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId((function(e){return n._onSessionIdChanged(e)}))}var t=e.prototype;return 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&&Th(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===el?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){var n;Rl(null==(n=this._instance)?void 0:n._addCaptureHook)||(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 Uw(this._instance),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=this,o=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})),s=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})),a=this._buildEventToItemMap(e,el),u=this._buildEventToItemMap(e,tl);t?(this._eventToItems=a,this._cancelEventToItems=u):(this._mergeItemMaps(this._eventToItems,a),this._mergeItemMaps(this._cancelEventToItems,u)),(0!==o.length||0!==s.length)&&(null!==(n=this._captureHookUnsubscribe)&&void 0!==n||(this._captureHookUnsubscribe=null==(r=this._instance)?void 0:r._addCaptureHook((function(e,t){i.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);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,tl);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,el);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){var t;if(0!==e.length){for(var n,r=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),i=[],o=Pa(e);!(n=o()).done;){var s=n.value;r&&this._shouldPersistArmedActivation(s)?this._persistActivation(s)&&this._recordActivationTimestamp(s):i.push(s)}i.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,i)))),this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()})}},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)},t._getRawActivationTimestamps=function(){var e,t=this._getActivationTimestampsKey();if(!t)return{};var n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return n&&"object"==typeof n?n:{}},t._recordActivationTimestamp=function(e){var t;if(this._getActivationTimestampsKey()){var n=this._getRawActivationTimestamps();this._writeActivationTimestamps(Ta({},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&&(Fl(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 Dl(t)?t:void 0}},t._getRawPersistedActivatedIds=function(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]},t._getPersistedActivatedIds=function(){var e,t,n=this._getRawPersistedActivatedIds();if(0===n.length)return[];var r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._getActivatedSessionKey()],i=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return i&&r===i?n:[]},t._stampActivationSession=function(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this._setActivatedSession(t)},t._clearActivationSession=function(){this._clearActivatedSession()},t._onSessionIdChanged=function(e){var t,n=this,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._getActivatedSessionKey()];if(r&&r!==e){var i=this._getRawPersistedActivatedIds(),o=this._getRawActivationTimestamps();i.length>0&&(this._setActivatedItems([]),i.filter((function(e){return Dl(o[e])})).forEach((function(e){return n._cancelPendingItem(e)}))),this._clearActivationSession(),this._clearAllActivationTimestamps()}},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()},t.getEventToItemsMap=function(){return this._eventToItems},t._getActionMatcher=function(){return this._actionMatcher},e}(),zw=function(e){function t(t){return e.call(this,t)||this}Ia(t,e);var n=t.prototype;return n._getActivatedKey=function(){return Ep},n._getActivatedSessionKey=function(){return Pp},n._getActivationTimestampsKey=function(){return Tp},n._writeActivationTimestamps=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Tp]=e,n))},n._clearActivationTimestampsStore=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Tp)},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 Dl(r)&&r>0},n._getShownEventName=function(){return ll.SHOWN},n._getItems=function(e){var t;null==(t=this._instance)||t.getSurveys(e)},n._cancelPendingItem=function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)},n._getLogger=function(){return Ih},n._setActivatedItems=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Ep]=e,n))},n._setActivatedSession=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Pp]=e,n))},n._clearActivatedSession=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Pp)},n._isItemPermanentlyIneligible=function(){return!1},n._activationOutcome=function(e,t){var n;return this._getItems((function(e){n=e.find((function(e){return e.id===t}))})),!n||xh(n)?e===ll.SHOWN?"consume":"ignore":e===ll.SHOWN?"persist":e===ll.DISMISSED||e===ll.SENT?"consume":"ignore"},n.getSurveys=function(){return this.getActivatedIds()},n.getEventToSurveys=function(){return this.getEventToItemsMap()},t}(Vw),Ww=function(){function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){if("string"==typeof e)return this._instance.get_property(e);for(var t,n={},r=Pa(e);!(t=r()).done;){var i=t.value,o=this._instance.get_property(i);Rl(o)||(n[i]=o)}return n},t.set=function(e,t){var n;this._instance.register("string"==typeof e?((n={})[e]=t,n):e)},t.remove=function(e){var t=this;"string"!=typeof e?e.forEach((function(e){return t._instance.unregister(e)})):this._instance.unregister(e)},e}(),Gw=function(){function e(e){this._instance=e}var t=e.prototype;return t.get=function(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}},t.isOptedOut=function(){return this._instance.consent.isOptedOut()},t.getExtensions=function(){var e=this,t=null==Tg?void 0:Tg.__PosthogExtensions__;if(t){var n=t.generateSurveys,r=t.loadExternalDependency;return{generateSurveys:n?function(t){return n(e._instance,t)}:void 0,loadExternalDependency:r?function(t){return r(e._instance,"surveys",t)}:void 0}}},t.createEventReceiver=function(){return new zw(this._instance)},e}(),Qw=function(e){function t(t){var n,r;return(n=e.call(this,new Gw(t),{get projectToken(){return r.config.token},kv:new Ww(r=t)})||this)._instance=t,n}return Ia(t,e),t.prototype._sendSurveysRequest=function(e,t){var n=this,r=t.query?tb(e,t.query):e;return new Promise((function(e){var i;n._instance._send_request({method:t.method,url:n._instance.requestRouter.endpointFor(null!==(i=t.target)&&void 0!==i?i:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})}))},t}(Hw),Kw=null!=Uf&&Uf.location?__(Uf.location.hash,"__posthog")||__(location.hash,"state"):null,Zw="_postHogToolbarParams",Yw=nh("[Toolbar]"),Jw=function(){function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){Tg.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=Tg.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),hh(this.instance.config))return!1;if(!Uf||!Wf)return!1;e=null!=e?e:Uf.location,n=null!=n?n:Uf.history;try{if(!t){try{Uf.localStorage.setItem("test","test"),Uf.localStorage.removeItem("test")}catch(e){return!1}t=null==Uf?void 0:Uf.localStorage}var r,i=Kw||__(e.hash,"__posthog")||__(e.hash,"state"),o=i?ah((function(){return JSON.parse(atob(decodeURIComponent(i)))}))||ah((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(Zw)||"{}")).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=Tg.ph_load_toolbar||Tg.ph_load_editor;!Ml(t)&&Tl(t)?t(e,this.instance):Yw.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Wf||!Wf.getElementById(Qv));if(!Uf||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=Ta({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Uf.localStorage.setItem(Zw,JSON.stringify(Ta({},i,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(i);else if(0===this._getToolbarState()){var o;this._setToolbarState(1),null==(o=Tg.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(function(e){if(e)return Yw.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(i)})),fh(Uf,"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}(),Xw=nh("[FeatureFlags]"),eS=function(){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;return{bootstrap:{featureFlags:null==(n=e.bootstrap)?void 0:n.featureFlags,featureFlagPayloads:null==(r=e.bootstrap)?void 0:r.featureFlagPayloads},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!==(i=e.remote_config_refresh_interval_ms)&&void 0!==i?i:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(o=null!==(s=e.evaluation_contexts)&&void 0!==s?s:e.evaluation_environments)&&void 0!==o?o:[],flagKeys:Pl(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(Xw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),Rl(e.flag_keys)||Pl(e.flag_keys)||Xw.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),tS=nh("[FeatureFlags]"),nS=nh("[FeatureFlags]",{debugEnabled:!0}),rS="\" failed. Feature flags didn't load in time.",iS="connection_error",oS=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},sS=function(e){for(var t,n={},r=Pa(sh(e||{}));!(t=r()).done;){var i=t.value,o=i[1];o&&(n[i[0]]=o)}return n},aS=function(){function e(e){var t=this;this.name=Nh,this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=tS,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._reloadingHandlers=[],this._hasLoadedFlags=!1,this._requestInFlight=!1,this._requestGeneration=0,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n=t._refreshIntervalMs;Rl(n)||t._config.remoteRequestsDisabled||!Wf||"hidden"===Wf.visibilityState||Date.now()-(null!==(e=t._lastRefreshAt)&&void 0!==e?e:0)<n||(t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onVisibilityChange=function(){"visible"===(null==Wf?void 0:Wf.visibilityState)&&t._refreshIfDue()},"get"in e?this._configSource=e:(this._instance=e,this._mutableConfigSource=new eS(e.config,e._shouldDisableFlags()),this._configSource=this._mutableConfigSource)}var t=e.prototype;return t.updateConfig=function(e,t){var n;null==(n=this._mutableConfigSource)||n.update(e,t),this._client&&this._syncAutomaticRefresh()},t.setup=function(e){var t=this;return this._initializingClient=e,this._logger=e.logger.createLogger("[FeatureFlags]"),$w(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 Uf&&fh(Uf,"online",this._onOnline),this._syncAutomaticRefresh(),this._dynamicProperties=e.registerDynamicEventProperties((function(){return n._isCacheStale()?n._baseEventProperties:n._eventPropertiesWithFlagValues})),this._crossTabPersistenceUnsubscribe=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange((function(){n._rebuildEventProperties(),n._fireFeatureFlagsCallbacks()})),this._rebuildEventProperties(),this.initialize()},t._syncAutomaticRefresh=function(){var e=this._config.refreshIntervalMs,t=!this._config.remoteRequestsDisabled&&Wf&&!Rl(e)&&e>0?e:void 0;t!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),Rl(t)||(this._refreshIntervalMs=t,this._scheduleNextRefresh(),null!=Wf&&Wf.addEventListener&&fh(Wf,Jp,this._onVisibilityChange)))},t._scheduleNextRefresh=function(){Rl(this._refreshIntervalMs)||(Rl(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){Rl(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==Wf||null==Wf.removeEventListener||Wf.removeEventListener(Jp,this._onVisibilityChange)),this._refreshIntervalMs=void 0,this._lastRefreshAt=void 0},t.destroy=function(){this._dispose()},t.dispose=function(){this._dispose()},t._dispose=function(){var e,t;this._stopAutomaticRefresh(),this._requestGeneration++,this._additionalReloadRequested=!1,this._initializingClient=void 0,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==Uf||Uf.removeEventListener("online",this._onOnline),this._client=void 0)},t._prop=function(e){var t;return null==(t=this._client)?void 0:t.kv.get(e)},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,i;if(null!=(r=this._instance)&&r.persistence&&e[fp]){var o=this._prop(fp)||{},s=e[fp]||{},a=t.flags||t.featureFlags,u=t.flags?Object.entries(t.flags).filter((function(e){var t=e[1];return!(null!=t&&t.failed)})).map((function(e){return e[0]})):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,c=l?u:n&&!Pl(a)?Object.keys(a||{}):Array.from(new Set([].concat(Object.keys(o),Object.keys(s)))),d=this._prop(vp)||{},f=e[vp]||{},h=l||n?c:Array.from(new Set([].concat(Object.keys(d),Object.keys(f)))),p=!l&&!n,_=!!p||c,v=!!p||h,g=((i={})[hp]=_,i[fp]=_,i[vp]=v,i);e[_p]&&(g[_p]=_);for(var m,y=Pa([gp,Ap,mp]);!(m=y()).done;){var b=m.value;Rl(e[b])||(g[b]=!0)}this._instance.persistence.markCrossTabFeatureFlagChanges(g)}},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={},n=Pa([hp,vp,gp,yp]);!(e=n()).done;){var r=e.value,i=this._prop(r);Rl(i)||(t[r]=i)}this._baseEventProperties=t;var o=Ta({},t),s=this._prop(fp);if(s)for(var a=0,u=Object.entries(s);u.length>a;a++){var l=u[a];o["$feature/"+l[0]]=l[1]}this._eventPropertiesWithFlagValues=o},t._isCacheStale=function(){var e=this._config.cacheTtlMs;if(!e||0>=e)return!1;var t=this._prop(Ap);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(!Rl(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!Rl(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]=s[t],e}),{});return this._receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u})}},t.updateFlags=function(e,t,n){for(var r,i,o=null!=n&&n.merge&&null!==(r=this._prop(fp))&&void 0!==r?r:{},s=null!=n&&n.merge&&null!==(i=this._prop(vp))&&void 0!==i?i:{},a=Ta({},o,e),u=Ta({},s,t),l={},c=0,d=Object.entries(a);d.length>c;c++){var f=d[c],h=f[0],p=f[1];l[h]={key:h,enabled:af(p),variant:uf(p),reason:void 0,metadata:Rl(null==u?void 0:u[h])?void 0:{id:0,version:void 0,description:void 0,payload:u[h]}}}this._receivedFeatureFlags({flags:l})},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._prop(_p),t=this._prop(yp),n=this._prop(bp);if(!n&&!t)return e||{};for(var r,i=oh({},e||{}),o=Pa([].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],d=Rl(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,f=Rl(c)?null==l?void 0:l.variant:"string"==typeof c?c:void 0,h=null==n?void 0:n[u],p=Ta({},l,{enabled:d,variant:d?null!=f?f:null==l?void 0:l.variant:void 0});d!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),f!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),h&&(p.metadata=Ta({},null==l?void 0:l.metadata,{payload:h,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),i[u]=p}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:af(r),variant:uf(r),payload:sf(t[n])}}))},t.getFlagVariants=function(){var e=this._prop(fp),t=this._prop(yp);if(!t)return e||{};for(var n=oh({},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=this._prop(vp),t=this._prop(bp);if(!t)return e||{};for(var n=oh({},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._requestInFlight&&(this._additionalReloadRequested=!0),this._reloadDebouncer||(this._reloadingHandlers.slice().forEach((function(t){try{t()}catch(t){e._logger.error("Error while running feature flags reloading callback",t)}})),this._reloadDebouncer=setTimeout((function(){e._callFlagsEndpoint()}),5)))},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(Fp)},t._callFlagsEndpoint=function(e){var t=this;this._clearDebouncer();var n=this._client;if(n&&!this._config.remoteRequestsDisabled&&!this._hasStatusZeroCircuitBreakerTripped())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:Ta({},n.initialPersonProperties,this._prop(wp)||{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this._prop(Sp),timezone:ug()};Rl(n.deviceId)||(r.$device_id=n.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(r.disable_flags=!0);var i=this._getValidEvaluationEnvironments();i.length&&(r.evaluation_contexts=i);var o=this._getValidFlagKeys();Rl(o)||(r.flag_keys=o);var s=this._config.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),u=this._requestGeneration;this._requestInFlight=!0;var l=function(){t._additionalReloadRequested&&(t._additionalReloadRequested=!1,t._callFlagsEndpoint())},c=function(e){var n;t._requestInFlight=!1,u===t._requestGeneration?(t._set(((n={})[Lp]=[iS],n)),t._logger.error("Feature flag request failed",e),l()):l()};try{n.sendRequest(a,{target:"flags",method:"POST",body:r,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs}).then((function(e){var n,i,o,a=null!==(n=e.json)&&void 0!==n?n:{},c=200!==e.statusCode;if(t._requestInFlight=!1,u===t._requestGeneration){if(t._trackStatusZeroReachability(e.statusCode),c||t._additionalReloadRequested||(t.$anon_distinct_id=void 0),!r.disable_flags||t._additionalReloadRequested){t._flagsLoadedFromRemote=!c;var d=[];e.error?d.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?iS:"unknown_error"):200!==e.statusCode&&d.push("api_error_"+e.statusCode),a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var f=!(null==(i=a.quotaLimited)||!i.includes("feature_flags"));f&&d.push("quota_limited"),t._set(((o={})[Lp]=d,o)),f?t._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."):r.disable_flags||t._receivedFeatureFlags(a,c,{partialResponse:s}),l()}}else l()})).catch(c)}catch(e){c(e)}}},t._hasStatusZeroCircuitBreakerTripped=function(){return v_(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=g_(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.getFeatureFlag=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){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}}else this._logger.warn('getFeatureFlag for key "'+e+rS)},t.getFeatureFlagDetails=function(e){return this.getFlagsWithDetails()[e]},t.getFeatureFlagPayload=function(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload},t.getFeatureFlagResult=function(e,t){if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var n,r=this.getFlagVariants(),i=e in r,o=r[e],s=this.getFlagPayloads()[e],a=String(o),u=this._prop(gp)||void 0,l=this._prop(Ap)||void 0,c=this._prop(Fp)||{};if(this._config.deduplicateCallsPerSession){var d,f=null==(d=this._client)?void 0:d.session.sessionId,h=this._prop(Rp);f&&f!==h&&(c={},n=f)}if(t.send_event||!("send_event"in t))if(e in c&&c[e].includes(a)){if(n){var p;this._set(((p={})[Fp]=c,p[Rp]=n,p))}}else{var _,v,g,m,y,b,w,S,k,x,C,E,P,T;Pl(c[e])?c[e].push(a):c[e]=[a],this._set(Ta(((_={})[Fp]=c,_),n?((v={})[Rp]=n,v):{}));var I=this.getFeatureFlagDetails(e),F=[].concat(null!==(g=this._prop(Lp))&&void 0!==g?g:[]);Rl(o)&&F.push("flag_missing");var R={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:null!=s?s:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:null!==(m=null==(y=this._config.bootstrap)||null==(y=y.featureFlags)?void 0:y[e])&&void 0!==m?m:null,$feature_flag_bootstrapped_payload:null!==(b=null==(w=this._config.bootstrap)||null==(w=w.featureFlagPayloads)?void 0:w[e])&&void 0!==b?b:null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Rl(null==I||null==(S=I.metadata)?void 0:S.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Rl(null==I||null==(k=I.metadata)?void 0:k.version)||(R.$feature_flag_version=I.metadata.version);var L,A=null!==(x=null==I||null==(C=I.reason)?void 0:C.description)&&void 0!==x?x:null==I||null==(E=I.reason)?void 0:E.code;A&&(R.$feature_flag_reason=A),null!=I&&null!=(P=I.metadata)&&P.id&&(R.$feature_flag_id=I.metadata.id),Rl(null==I?void 0:I.original_variant)&&Rl(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Rl(I.original_variant)?I.original_enabled:I.original_variant),null!=I&&null!=(T=I.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==I||null==(L=I.metadata)?void 0:L.original_payload),F.length&&(R.$feature_flag_error=F.join(",")),this._captureFeatureFlagCalled(R)}else if(n){var O;this._set(((O={})[Fp]=c,O[Rp]=n,O))}if(i)return{key:e,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:sf(s)}}}else this._logger.warn('getFeatureFlagResult for key "'+e+rS)},t._captureFeatureFlagCalled=function(e){var t=this;try{var n;null==(n=this._client)||n.capture("$feature_flag_called",e).catch((function(e){t._logger.error("Failed to capture feature flag call",e)}))}catch(e){this._logger.error("Failed to capture feature flag call",e)}},t.getRemoteConfigPayload=function(e,t){this._getRemoteConfigPayload(e,t)},t._getRemoteConfigPayload=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s,a,u,l;return Ra().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(),Rl(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:l=null==(u=e.v.json)?void 0:u.featureFlagPayloads,a=(null==l?void 0:l[t])||void 0,e.n=5;break;case 4:return e.p=4,this._logger.error("Remote config feature flag request failed",e.v),e.a(2);case 5:try{n(a)}catch(e){this._logger.error("Remote config feature flag callback failed",e)}case 6:return e.a(2)}}),e,this,[[2,4]])})));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._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0))return this._logger.warn('isFeatureEnabled for key "'+e+rS),t.defaultValue;var n=this.getFeatureFlag(e,t);return Rl(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){this._hasLoadedFlags=!0;var r=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=tS);var l=function(e,t){var n=e.flags;return n?Ta({},e,{featureFlags:Object.fromEntries(Object.keys(n).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].enabled})).filter((function(e){var t;return!Rl(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)}(e,o),c=l.flags,d=l.featureFlags,f=l.featureFlagPayloads;if(d){var h=e.requestId,p=e.evaluatedAt;if(Pl(d)){var _;o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(d)for(var g=0;d.length>g;g++)v[d[g]]=!0;return(_={})[hp]=d,_[fp]=v,_[mp]=!1,_}var m=d,y=f,b=c;if(null!=i&&i.partialResponse){var w=Object.keys(m),S=y||{};m=Ta({},t,m),y=Ta({},n,S),w.forEach((function(e){var t;e in S||null==(t=y)||delete t[e]})),b=Ta({},r,b)}else if(e.errorsWhileComputingFlags)if(c){var k=new Set(Object.keys(c).filter((function(e){var t;return!(null!=(t=c[e])&&t.failed)})));m=Ta({},t,Object.fromEntries(Object.entries(m).filter((function(e){return k.has(e[0])}))));var x=Object.fromEntries(Object.entries(y||{}).filter((function(e){return k.has(e[0])})));y=Ta({},n,x),k.forEach((function(e){var t;e in x||null==(t=y)||delete t[e]})),b=Ta({},r,Object.fromEntries(Object.entries(b||{}).filter((function(e){return k.has(e[0])}))))}else m=Ta({},t,m),y=Ta({},n,y),b=Ta({},r,b);return Ta(((s={})[hp]=Object.keys(sS(m)),s[fp]=m||{},s[vp]=y||{},s[_p]=b||{},s[mp]=!0===e.minimalFlagCalledEvents,s),h?((a={})[gp]=h,a):{},p?((u={})[Ap]=p,u):{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this._logger);r&&(this._markCrossTabFeatureFlagSnapshot(r,e,!(null==n||!n.partialResponse)),this._set(r)),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([yp,bp]),this._fireFeatureFlagsCallbacks(),void nS.info("All overrides cleared");var t,n;if(Pl(e))return this._set(((t={})[yp]=oS(e),t)),this._fireFeatureFlagsCallbacks(),void nS.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[yp]=Pl(s)?oS(s):s),a&&(o[bp]=a),Object.keys(o).length&&this._set(o),!1===s&&!1===a?this._remove([yp,bp]):!1===s?this._remove(yp):!1===a&&this._remove(bp),this._fireFeatureFlagsCallbacks(),!1===s?nS.info("Flag overrides cleared"):s&&nS.info("Flag overrides set",{flags:s}),void(!1===a?nS.info("Payload overrides cleared"):a&&nS.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[yp]=e,n)),this._fireFeatureFlagsCallbacks(),void nS.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=this,l=(this._prop(pp)||[]).find((function(t){return t.flagKey===e})),c=((r={})["$feature_enrollment/"+e]=t,r),d={$feature_flag:e,$feature_enrollment:t,$set:c};l&&(d.$early_access_feature_name=l.name),n&&(d.$feature_enrollment_stage=n);var f=Ta({},this.getFlagVariants(),((i={})[e]=t,i));null==(o=this._instance)||null==(o=o.persistence)||o.markCrossTabFeatureFlagChanges(((s={})[hp]=[e],s[fp]=[e],s[wp]=Object.keys(c),s)),this._set(((a={})[hp]=Object.keys(sS(f)),a[fp]=f,a[wp]=Ta({},this._prop(wp)||{},c),a)),this._fireFeatureFlagsCallbacks();try{var h;null==(h=this._client)||h.capture("$feature_enrollment_update",d).catch((function(e){u._logger.error("Failed to capture early access feature enrollment",e)}))}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(pp);!r||t?this._getEarlyAccessFeatures(e,n):e(r)},t._getEarlyAccessFeatures=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s,a;return Ra().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={})[pp]=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;this.featureFlagEventHandlers.forEach((function(n){try{n(r,i,{errorsLoading:e})}catch(e){t._logger.error("Error while running feature flags callback",e)}}))},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(wp)||{},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={})[wp]=Ta({},r,s,i),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=Ta({},this._prop(wp)||{});e.forEach((function(e){delete r[e]})),this._set(((n={})[wp]=r,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(wp),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var r=this._prop(Sp)||{},i=Ta({},r),o=0,s=Object.keys(e);s.length>o;o++){var a=s[o];i[a]=Ta({},r[a],e[a])}this._set(((n={})[Sp]=i,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._prop(Sp)||{};this._set(((n={})[Sp]=Ta({},r,((t={})[e]={},t)),n))}else this._remove(Sp)},t.reset=function(){this._requestGeneration++,this._additionalReloadRequested=!1,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._hasLoadedFlags=!1,this._reloadingDisabled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1,this._consecutiveStatusZeroFailures=0},Ea(e,[{key:"_config",get:function(){return this._configSource.get()}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),uS="Refusing to render web experiment since the viewer is a likely bot",lS={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 Ch(t,e)},not_regex:function(e,t){return!Ch(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},cS=function(){function e(t){var n=this;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);Ll(i)&&t.variants[i]&&n._applyTransforms(t.name,i,t.variants[i].transforms)}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=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(uS);else if(!this._config.disable_web_experiments){if(Ml(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._applyTransforms(o.name,i,o.variants[i].transforms)}}))}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var r=h_(null==n?void 0:n.search,"__experiment_id"),i=h_(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))},e._matchesTestVariant=function(t,n){return!Ml(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var r;if(Ml(t.conditions)||Ml(null==(r=t.conditions)?void 0:r.url))return!0;var i=e.getWindowLocation();if(i){var o,s,a,u=y_(n,i.href);return null==(o=t.conditions)||!o.url||lS[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==Uf?void 0:Uf.location},e._matchUTMConditions=function(e){var t;if(Ml(e.conditions)||Ml(null==(t=e.conditions)?void 0:t.utm))return!0;var n=eg();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];th.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo(uS):"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);null==o||o.forEach((function(e){var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return zf&&this._instance?kb(zf,this._config.custom_blocked_useragents):void 0},Ea(e,[{key:"_config",get:function(){return this._instance.config}}])}(),dS=nh("[Conversations]"),fS="Conversations not available yet.",hS=function(){function e(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._loadFailed=!1,this._instance=e}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){if(!this._instance.config.disable_conversations&&(this._remoteConfigSuccessful=e.ok,e.ok)){var t=e.config.conversations;Ml(t)||($l(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}},t.reset=function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null,this._remoteConfigSuccessful=void 0,this._loadFailed=!1},t.loadIfEnabled=function(){var e=this;if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||hh(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Tg?void 0:Tg.__PosthogExtensions__;if(t&&!Rl(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=t.loadExternalDependency;if(!r)return void this._handleLoadError(Wp);r(this._instance,"conversations",(function(n){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 dS.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,dS.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else dS.error("Cannot complete initialization: remote config is null")},t._handleLoadError=function(e,t){dS.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():dS.warn("Conversations not loaded yet.")},t.hide=function(){this._conversationsManager&&this._conversationsManager.hide()},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!Ol(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":hh(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":Rl(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?Ml(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=Tg&&Tg.__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=Ca(Ra().m((function e(t,n,r){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t,n){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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 pS(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,d=null!=t&&t.consoleCapture?void 0:null!==(i=null==e?void 0:e.maxLogsPerInterval)&&void 0!==i?i:1e3,f=Rl(d)?Math.max(c,2048):Math.max(c,d),h=Ta({},function(){var e="",t="";try{var n=null==zf?void 0:zf.userAgent;if(n){var r=sd(n);e=r[0],t=r[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(Tf,e)?Tf[e]:e}(e);return Ta({},n?{"os.name":n}:{},t?{"os.version":t}:{})}(e,t)}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(o=null!==(s=null==h?void 0:h["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==h?void 0:h["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(u=null==h?void 0:h["deployment.environment"])&&void 0!==u?u:null==e?void 0:e.environment,resourceAttributes:h,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:l,maxBufferSize:c,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var _S=["debug","log","warn","error","info"],vS="console",gS="__posthogHandledLogsRequestError",mS=function(e,t){var n=e instanceof Error?e:new Error(t);return n[gS]=!0,n},yS=function(e){return!!e&&"object"==typeof e&&!0===e[gS]},bS=function(){function e(e){var t,n=this;this.name="logs",this._isLogsEnabled=!1,this._isLoaded=!1,this._isLoading=!1,this._logger=nh("[logs]"),this._coreLogger=Ta({},this._logger,{error:function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];var i;t.some(yS)||(i=n._logger).error.apply(i,t)}}),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._disposed=!1,this._consoleBuffer=[],this._consoleRecorderUnpatchers=[],this._isRecordingConsole=!1,this._isRecordingConsoleEntry=!1,this._onReconnect=function(){var e,t;n._disposed||(n._consecutiveStatusZeroFailures=0,null==(e=n._core)||e.onReconnect(),null==(t=n._consoleCore)||t.onReconnect())},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),Uf&&fh(Uf,"online",this._onReconnect)}var t=e.prototype;return t._buildCore=function(e,t,n,r){var i,o=this,s=pS(null==(i=this._instance)||null==(i=i.config)?void 0:i.logs,n);return[new Mf(this._createHost(e,t),s,this._coreLogger,(function(){return o._getSdkContext()}),(function(e){return e()}),void 0,r),s]},t._getCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._core||this._resolvedFrom!==n){var r;null==(r=this._core)||r.reset(),this._resolvedFrom=n;var i=this._buildCore((function(){return t._queue}),(function(e){t._queue=e}));this._core=i[0],this._resolvedConfig=i[1]}return this._core},t._getConsoleCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._consoleCore||this._consoleResolvedFrom!==n){var r;null==(r=this._consoleCore)||r.reset(),this._consoleResolvedFrom=n;var i=this._buildCore((function(){return t._consoleQueue}),(function(e){t._consoleQueue=e}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},vS);this._consoleCore=i[0],this._consoleResolvedConfig=i[1]}return this._consoleCore},t.setup=function(e){var t,n=this;if(!this._disposed){this._client=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),(this._isLogsEnabled||this._remoteConfigWillArrive()&&this._persistedCaptureHint())&&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;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==Uf||Uf.removeEventListener("online",this._onReconnect),null==(t=this._consoleLogsDispose)||t.call(this),this._consoleLogsDispose=void 0,null==(n=this._core)||n.reset(),null==(r=this._consoleCore)||r.reset())},t.onRemoteConfig=function(e){var t,n,r;if(!this._disposed){var i=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Ml(i)?this._stopRecorderStartedByPersistedHint():(null==(n=this._instance)||null==(n=n.persistence)||n.register(((r={})[np]=!!i,r)),i?(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._getCore().captureLog(e)},t.captureConsoleLog=function(e){this._disposed||this._getConsoleCore().captureLog(e)},t.captureBufferedConsoleLog=function(e,t,n){this._disposed||this._getConsoleCore().captureLog(e,{context:t,occurredAtMs:n})},t._persistedCaptureHint=function(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[np])},t._remoteConfigWillArrive=function(){var e,t;return null==(e=this._instance)||null==e._shouldDisableFlags||!e._shouldDisableFlags()||!(null==(t=Tg._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)},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!=Tg&&Tg.console){for(var n,r=pS(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,i=function(){var e,i=n.value;try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(Tg.console[i])}catch(e){return 0}if(!e)return 0;t._consoleRecorderUnpatchers.push(Ug(Tg.console,i,(function(n){var o=function(){for(var e=arguments.length,o=new Array(e),s=0;e>s;s++)o[s]=arguments[s];try{t._recordConsoleEntry(i,o,r)}catch(e){}return n.apply(Tg.console,o)};return o.__rrweb_original__=e,o})))},o=Pa(_S);!(n=o()).done;)i();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._instance)&&r.is_capturing()){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=Pa(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;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._logFlushError=function(e){yS(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=null==Tg?void 0:Tg.__PosthogExtensions__;if(!t)return this._logger.error("PostHog Extensions not found."),void this._stopConsoleRecorder();var n=t.loadExternalDependency;if(!n)return this._logger.error(Wp),void this._stopConsoleRecorder();this._isLoading=!0;try{n(this._instance,"logs",(function(n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled){var r=t.logs;if(n||null==r||!r.initializeLogs)e._logger.error("Could not load logs script",n),e._stopConsoleRecorder();else{var i,o,s=e._takeConsoleBuffer();e._consoleLogsDispose=r.initializeLogs(null!==(i=e._client)&&void 0!==i?i:e._instance),e._isLoaded=!0,s.length>0&&(null==r.replayConsoleBuffer||r.replayConsoleBuffer(null!==(o=e._client)&&void 0!==o?o:e._instance,s))}}}))}catch(e){throw this._isLoading=!1,e}}},t._createHost=function(e,t){var n=this,r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:function(t){return t===ml.LogsQueue?e():void 0},setPersistedProperty:function(e,n){var r;e===ml.LogsQueue&&t(null!==(r=n)&&void 0!==r?r:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return jf.LIB_NAME},getLibraryVersion:function(){return jf.LIB_VERSION}}},t._sendLogsBatch=function(e){var t=this;return new Promise((function(n){if(v_(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:mS(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:mS(void 0,"logs request timed out")})}),9e4);t._instance._send_request({method:"POST",url:t._logsUrl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:function(e){var n=e.statusCode;if(t._trackEndpointReachability(n),n>=200&&300>n)i({kind:"ok"});else if(413===n)i({kind:"too-large"});else if(0!==n&&408!==n&&429!==n&&500>n)i({kind:"fatal",error:new Error("logs request failed with status "+n)});else{var r;0===n?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:mS(e.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+n)})}}})}}))},t._trackEndpointReachability=function(e){var t=this;(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=g_(e,this._consecutiveStatusZeroFailures,3,(function(){return t._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,jf.LIB_NAME,(function(e){t._queue=e})),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,vS,(function(e){t._consoleQueue=e}))},t._drainQueueViaTransport=function(e,t,n,r,i){if(0!==t.length){var o=t.map((function(e){return e.record}));i([]);var s=Of(o,Af(n,jf.LIB_NAME,jf.LIB_VERSION),r,jf.LIB_VERSION);this._instance._send_request({method:"POST",url:this._logsUrl(),data:s,compression:"best-available",batchKey:"logs",transport:e})}},t._logsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)},t._getSdkContext=function(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,o=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,Ml(i)||(t.sessionStartTimestamp=i),Ml(o)||(t.lastActivityTimestamp=o)}if(null!=Tg&&null!=(e=Tg.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?kd(Tg.location.href):Tg.location.href),this._instance.featureFlags){var s=this._instance.featureFlags.getFlags();s&&s.length>0&&(t.activeFeatureFlags=s)}return t},Ea(e,[{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}}])}(),wS=function(){function e(e){this._logger=nh("[metrics]"),this._instance=e}var t=e.prototype;return t.initialize=function(){},t._getCore=function(){var e,t,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this._core&&this._resolvedFrom===n||(null==(t=this._core)||t.reset(),this._resolvedFrom=n,this._core=new Nf(this._createHost(),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}}(n),this._logger)),this._core},t.count=function(e,t,n){void 0===t&&(t=1),this._getCore().count(e,t,n)},t.gauge=function(e,t,n){this._getCore().gauge(e,t,n)},t.histogram=function(e,t,n){this._getCore().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._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 jf.LIB_NAME},getLibraryVersion:function(){return jf.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(Ta({method:"POST",url:n._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback:function(e){var t=e.statusCode;if(t>=200&&300>t)o({kind:"ok"});else if(413===t)o({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)o({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var n;o({kind:"retry-later",error:null!==(n=e.error)&&void 0!==n?n:new Error("metrics request failed with status "+t)})}}}))}))},t._metricsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)},e}(),SS={featureFlags:aS},kS={sessionRecording:Pw},xS={autocapture:lw,historyAutocapture:fw,heatmaps:Fw,deadClicksAutocapture:Wm,webVitalsAutocapture:bw},CS={exceptionObserver:dw,exceptions:Og},ES=Ta({productTours:Aw},SS),PS={siteApps:qw},TS={tracingHeaders:pw},IS=Ta({surveys:Qw},SS),FS={toolbar:Jw},RS=Ta({experiments:cS},SS),LS=Ta({},SS,kS,xS,CS,ES,PS,IS,TS,FS,RS,{conversations:hS},{logs:bS},{metrics:wS});if(ew.__defaultExtensionClasses=Ta({},LS),function(){jf.SDK_DIST_CHANNEL="cdn";var e=Tg.posthog;if(!e||Pl(e._i)){var t=qb[Gb]=new ew;if(e){var n=[];ih(e._i,(function(r){if(r&&Pl(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))}}))}t.__SV=1,Tg.posthog=t,function(){function e(){e.done||(e.done=!0,Qb=!1,ih(qb,(function(e){e._dom_loaded()})))}null!=Wf&&Wf.addEventListener?"complete"===Wf.readyState?e():fh(Wf,"DOMContentLoaded",e,{capture:!1}):Uf&&th.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var AS="undefined"!=typeof performance?performance:{};AS.now=AS.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=AS)}}();
|
|
1
|
+
!function(){"use strict";var e,t,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={};function i(){if(t)return e;t=1;var r=function(e){return e&&e.Math===Math&&e};return e=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")()}var o,s,a,u,l,c,d,f,h={};function p(){return s?o:(s=1,o=function(e){try{return!!e()}catch(e){return!0}})}function _(){if(u)return a;u=1;var e=p();return a=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function v(){if(c)return l;c=1;var e=p();return l=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function g(){if(f)return d;f=1;var e=v(),t=function(){}.call;return d=e?t.bind(t):function(){return t.apply(t,arguments)},d}var m,y,b,w,S,k,x,C,E,P,T,I,F,R,L,A,O,M,D,q,N,B,H,j,U,V,z,W,G,Q,K,Z,Y,J,X,ee,te,ne,re,ie,oe,se={};function ae(){if(m)return se;m=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return se.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,se}function ue(){return b?y:(b=1,y=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function le(){if(S)return w;S=1;var e=v(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return w=e?r:function(e){return function(){return n.apply(e,arguments)}},w}function ce(){if(x)return k;x=1;var e=le(),t=e({}.toString),n=e("".slice);return k=function(e){return n(t(e),8,-1)}}function de(){return T?P:(T=1,P=function(e){return null==e})}function fe(){if(F)return I;F=1;var e=de(),t=TypeError;return I=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function he(){if(L)return R;L=1;var e=function(){if(E)return C;E=1;var e=le(),t=p(),n=ce(),r=Object,i=e("".split);return C=t((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?i(e,""):r(e)}:r}(),t=fe();return R=function(n){return e(t(n))}}function pe(){if(O)return A;O=1;var e="object"==typeof document&&document.all;return A=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function _e(){if(D)return M;D=1;var e=pe();return M=function(t){return"object"==typeof t?null!==t:e(t)}}function ve(){if(N)return q;N=1;var e=i(),t=pe();return q=function(n,r){return 2>arguments.length?t(i=e[n])?i:void 0:e[n]&&e[n][r];var i},q}function ge(){if(H)return B;H=1;var e=le();return B=e({}.isPrototypeOf)}function me(){if(U)return j;U=1;var e=i().navigator,t=e&&e.userAgent;return j=t?String(t):""}function ye(){if(z)return V;z=1;var e,t,n=i(),r=me(),o=n.process,s=n.Deno,a=o&&o.versions||s&&s.version,u=a&&a.v8;return u&&(t=(e=u.split("."))[0]>0&&4>e[0]?1:+(e[0]+e[1])),!t&&r&&((e=r.match(/Edge\/(\d+)/))&&74>e[1]||(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1])),V=t}function be(){if(G)return W;G=1;var e=ye(),t=p(),n=i().String;return W=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&41>e}))}function we(){if(K)return Q;K=1;var e=be();return Q=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function Se(){if(Y)return Z;Y=1;var e=ve(),t=pe(),n=ge(),r=we(),i=Object;return Z=r?function(e){return"symbol"==typeof e}:function(r){var o=e("Symbol");return t(o)&&n(o.prototype,i(r))}}function ke(){if(X)return J;X=1;var e=String;return J=function(t){try{return e(t)}catch(e){return"Object"}}}function xe(){if(te)return ee;te=1;var e=pe(),t=ke(),n=TypeError;return ee=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function Ce(){if(re)return ne;re=1;var e=xe(),t=de();return ne=function(n,r){var i=n[r];return t(i)?void 0:e(i)},ne}function Ee(){if(oe)return ie;oe=1;var e=g(),t=pe(),n=_e(),r=TypeError;return ie=function(i,o){var s,a;if("string"===o&&t(s=i.toString)&&!n(a=e(s,i)))return a;if(t(s=i.valueOf)&&!n(a=e(s,i)))return a;if("string"!==o&&t(s=i.toString)&&!n(a=e(s,i)))return a;throw new r("Can't convert object to primitive value")}}var Pe,Te,Ie,Fe,Re,Le,Ae,Oe,Me,De,qe,$e,Ne,Be,He,je,Ue,Ve,ze,We,Ge,Qe,Ke,Ze,Ye={exports:{}};function Je(){return Te?Pe:(Te=1,Pe=!1)}function Xe(){if(Fe)return Ie;Fe=1;var e=i(),t=Object.defineProperty;return Ie=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function et(){if(Re)return Ye.exports;Re=1;var e=Je(),t=i(),n=Xe(),r="__core-js_shared__",o=Ye.exports=t[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.49.0",mode:e?"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"}),Ye.exports}function tt(){if(Ae)return Le;Ae=1;var e=et();return Le=function(t,n){return e[t]||(e[t]=n||{})}}function nt(){if(Me)return Oe;Me=1;var e=fe(),t=Object;return Oe=function(n){return t(e(n))}}function rt(){if(qe)return De;qe=1;var e=le(),t=nt(),n=e({}.hasOwnProperty);return De=Object.hasOwn||function(e,r){return n(t(e),r)}}function it(){if(Ne)return $e;Ne=1;var e=le(),t=0,n=Math.random(),r=e(1.1.toString);return $e=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function ot(){if(He)return Be;He=1;var e=i(),t=tt(),n=rt(),r=it(),o=be(),s=we(),a=e.Symbol,u=t("wks"),l=s?a.for||a:a&&a.withoutSetter||r;return Be=function(e){return n(u,e)||(u[e]=o&&n(a,e)?a[e]:l("Symbol."+e)),u[e]}}function st(){if(Ue)return je;Ue=1;var e=g(),t=_e(),n=Se(),r=Ce(),i=Ee(),o=ot(),s=TypeError,a=o("toPrimitive");return je=function(o,u){if(!t(o)||n(o))return o;var l,c=r(o,a);if(c){if(void 0===u&&(u="default"),l=e(c,o,u),!t(l)||n(l))return l;throw new s("Can't convert object to primitive value")}return void 0===u&&(u="number"),i(o,u)}}function at(){if(ze)return Ve;ze=1;var e=st(),t=Se();return Ve=function(n){var r=e(n,"string");return t(r)?r:r+""}}function ut(){if(Ge)return We;Ge=1;var e=i(),t=_e(),n=e.document,r=t(n)&&t(n.createElement);return We=function(e){return r?n.createElement(e):{}}}function lt(){if(Ke)return Qe;Ke=1;var e=_(),t=p(),n=ut();return Qe=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function ct(){if(Ze)return h;Ze=1;var e=_(),t=g(),n=ae(),r=ue(),i=he(),o=at(),s=rt(),a=lt(),u=Object.getOwnPropertyDescriptor;return h.f=e?u:function(e,l){if(e=i(e),l=o(l),a)try{return u(e,l)}catch(e){}if(s(e,l))return r(!t(n.f,e,l),e[l])},h}var dt,ft,ht,pt,_t,vt,gt,mt={};function yt(){if(ft)return dt;ft=1;var e=_(),t=p();return dt=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function bt(){if(pt)return ht;pt=1;var e=_e(),t=String,n=TypeError;return ht=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function wt(){if(_t)return mt;_t=1;var e=_(),t=lt(),n=yt(),r=bt(),i=at(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return mt.f=e?n?function(e,t,n){if(r(e),t=i(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var o=a(e,t);o&&o[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:o[l],enumerable:u in n?n[u]:o[u],writable:!1})}return s(e,t,n)}:s:function(e,n,a){if(r(e),n=i(n),r(a),t)try{return s(e,n,a)}catch(e){}if("get"in a||"set"in a)throw new o("Accessors not supported");return"value"in a&&(e[n]=a.value),e},mt}function St(){if(gt)return vt;gt=1;var e=_(),t=wt(),n=ue();return vt=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}var kt,xt,Ct,Et,Pt,Tt,It,Ft,Rt,Lt,At,Ot,Mt,Dt,qt,$t={exports:{}};function Nt(){if(xt)return kt;xt=1;var e=_(),t=rt(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,i=t(n,"name"),o=i&&"something"===function(){}.name,s=i&&(!e||e&&r(n,"name").configurable);return kt={EXISTS:i,PROPER:o,CONFIGURABLE:s}}function Bt(){if(Et)return Ct;Et=1;var e=le(),t=pe(),n=et(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Ct=n.inspectSource}function Ht(){if(Ft)return It;Ft=1;var e=tt(),t=it(),n=e("keys");return It=function(e){return n[e]||(n[e]=t(e))}}function jt(){return Lt?Rt:(Lt=1,Rt={})}function Ut(){if(Ot)return At;Ot=1;var e,t,n,r=function(){if(Tt)return Pt;Tt=1;var e=i(),t=pe(),n=e.WeakMap;return Pt=t(n)&&/native code/.test(String(n))}(),o=i(),s=_e(),a=St(),u=rt(),l=et(),c=Ht(),d=jt(),f="Object already initialized",h=o.TypeError;if(r||l.state){var p=l.state||(l.state=new(0,o.WeakMap));p.get=p.get,p.has=p.has,p.set=p.set,e=function(e,t){if(p.has(e))throw new h(f);return t.facade=e,p.set(e,t),t},t=function(e){return p.get(e)||{}},n=function(e){return p.has(e)}}else{var _=c("state");d[_]=!0,e=function(e,t){if(u(e,_))throw new h(f);return t.facade=e,a(e,_,t),t},t=function(e){return u(e,_)?e[_]:{}},n=function(e){return u(e,_)}}return At={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!s(n)||(r=t(n)).type!==e)throw new h("Incompatible receiver, "+e+" required");return r}}}}function Vt(){if(Mt)return $t.exports;Mt=1;var e=le(),t=p(),n=pe(),r=rt(),i=_(),o=Nt().CONFIGURABLE,s=Bt(),a=Ut(),u=a.enforce,l=a.get,c=String,d=Object.defineProperty,f=e("".slice),h=e("".replace),v=e([].join),g=i&&!t((function(){return 8!==d((function(){}),"length",{value:8}).length})),m=String(String).split("String"),y=$t.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+h(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||o&&e.name!==t)&&(i?d(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&r(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=u(e);return r(s,"source")||(s.source=v(m,"string"==typeof t?t:"")),e};return Function.prototype.toString=y((function(){return n(this)&&l(this).source||s(this)}),"toString"),$t.exports}function zt(){if(qt)return Dt;qt=1;var e=pe(),t=wt(),n=Vt(),r=Xe();return Dt=function(i,o,s,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:o;if(e(s)&&n(s,l,a),a.global)u?i[o]=s:r(o,s);else{try{a.unsafe?i[o]&&(u=!0):delete i[o]}catch(e){}u?i[o]=s:t.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},Dt}var Wt,Gt,Qt,Kt,Zt,Yt,Jt,Xt,en,tn,nn,rn,on,sn,an,un,ln,cn={};function dn(){if(Kt)return Qt;Kt=1;var e=function(){if(Gt)return Wt;Gt=1;var e=Math.ceil,t=Math.floor;return Wt=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},Wt}();return Qt=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function fn(){if(Yt)return Zt;Yt=1;var e=dn(),t=Math.max,n=Math.min;return Zt=function(r,i){var o=e(r);return 0>o?t(o+i,0):n(o,i)}}function hn(){if(Xt)return Jt;Xt=1;var e=dn(),t=Math.min;return Jt=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function pn(){if(tn)return en;tn=1;var e=hn();return en=function(t){return e(t.length)}}function _n(){if(sn)return on;sn=1;var e=le(),t=rt(),n=he(),r=function(){if(rn)return nn;rn=1;var e=he(),t=fn(),n=pn(),r=function(r){return function(i,o,s){var a=e(i),u=n(a);if(0===u)return!r&&-1;var l,c=t(s,u);if(r&&o!=o){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((r||c in a)&&a[c]===o)return r||c||0;return!r&&-1}};return nn={includes:r(!0),indexOf:r(!1)}}().indexOf,i=jt(),o=e([].push);return on=function(e,s){var a,u=n(e),l=0,c=[];for(a in u)!t(i,a)&&t(u,a)&&o(c,a);for(;s.length>l;)t(u,a=s[l++])&&(~r(c,a)||o(c,a));return c},on}function vn(){return un?an:(un=1,an=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var gn,mn,yn,bn,wn,Sn,kn,xn,Cn,En,Pn,Tn,In,Fn,Rn,Ln,An,On,Mn,Dn,qn,$n,Nn,Bn,Hn,jn,Un,Vn,zn,Wn={};function Gn(){if(yn)return mn;yn=1;var e=ve(),t=le(),n=function(){if(ln)return cn;ln=1;var e=_n(),t=vn().concat("length","prototype");return cn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},cn}(),r=(gn||(gn=1,Wn.f=Object.getOwnPropertySymbols),Wn),i=bt(),o=t([].concat);return mn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),s=r.f;return s?o(t,s(e)):t}}function Qn(){if(wn)return bn;wn=1;var e=rt(),t=Gn(),n=ct(),r=wt();return bn=function(i,o,s){for(var a=t(o),u=r.f,l=n.f,c=0;a.length>c;c++){var d=a[c];e(i,d)||s&&e(s,d)||u(i,d,l(o,d))}},bn}function Kn(){if(kn)return Sn;kn=1;var e=p(),t=pe(),n=/#|\.prototype\./,r=function(n,r){var u=o[i(n)];return u===a||u!==s&&(t(r)?e(r):!!r)},i=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return Sn=r}function Zn(){if(Cn)return xn;Cn=1;var e=i(),t=ct().f,n=St(),r=zt(),o=Xe(),s=Qn(),a=Kn();return xn=function(i,u){var l,c,d,f,h,p=i.target,_=i.global,v=i.stat;if(l=_?e:v?e[p]||o(p,{}):e[p]&&e[p].prototype)for(c in u){if(f=u[c],d=i.dontCallGetSet?(h=t(l,c))&&h.value:l[c],!a(_?c:p+(v?".":"#")+c,i.forced)&&void 0!==d){if(typeof f==typeof d)continue;s(f,d)}(i.sham||d&&d.sham)&&n(f,"sham",!0),r(l,c,f,i)}}}function Yn(){if(In)return Tn;In=1;var e=rt(),t=pe(),n=nt(),r=Ht(),i=function(){if(Pn)return En;Pn=1;var e=p();return En=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Tn=i?s.getPrototypeOf:function(r){var i=n(r);if(e(i,o))return i[o];var u=i.constructor;return t(u)&&i instanceof u?u.prototype:i instanceof s?a:null},Tn}function Jn(){if(Rn)return Fn;Rn=1;var e=_n(),t=vn();return Fn=Object.keys||function(n){return e(n,t)},Fn}function Xn(){if(Dn)return Mn;Dn=1;var e=i();return Mn=e}function er(){if(Bn)return Nn;Bn=1;var e=function(){if($n)return qn;$n=1,function(){if(On)return r;On=1;var $=Zn(),e=function(){if(An)return Ln;An=1;var e=_(),t=p(),n=le(),r=Yn(),i=Jn(),o=he(),s=n(ae().f),a=n([].push),u=e&&t((function(){var e=Object.create(null);return e[2]=2,!s(e,2)})),l=function(t){return function(n){for(var l,c=o(n),d=i(c),f=u&&null===r(c),h=d.length,p=0,_=[];h>p;)l=d[p++],e&&!(f?l in c:s(c,l))||a(_,t?[l,c[l]]:c[l]);return _}};return Ln={entries:l(!0),values:l(!1)}}().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}();var e=Xn();return qn=e.Object.entries}();return Nn=e}zn||(zn=1,function(){if(Vn)return Un;Vn=1;var e=function(){if(jn)return Hn;jn=1;var e=er();return Hn=e}();Un=e}());var tr,nr,rr,ir,or,sr,ar,ur,lr,cr,dr,fr,hr,pr,_r,vr,gr,mr,yr,br,wr,Sr,kr,xr,Cr,Er,Pr,Tr,Ir,Fr={};function Rr(){if(rr)return nr;rr=1;var e=ve();return nr=e("document","documentElement")}function Lr(){if(or)return ir;or=1;var e,t=bt(),n=function(){if(tr)return Fr;tr=1;var e=_(),t=yt(),n=wt(),r=bt(),i=he(),o=Jn();return Fr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var s,a=i(t),u=o(t),l=u.length,c=0;l>c;)n.f(e,s=u[c++],a[s]);return e},Fr}(),r=vn(),i=jt(),o=Rr(),s=ut(),a=Ht(),u="prototype",l="script",c=a("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+"</"+l+">"},h=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},p=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;p="undefined"!=typeof document?document.domain&&e?h(e):(n=s("iframe"),i="java"+l+":",n.style.display="none",o.appendChild(n),n.src=String(i),(t=n.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F):h(e);for(var a=r.length;a--;)delete p[u][r[a]];return p()};return i[c]=!0,ir=Object.create||function(e,r){var i;return null!==e?(d[u]=t(e),i=new d,d[u]=null,i[c]=e):i=p(),void 0===r?i:n.f(i,r)},ir}function Ar(){if(ar)return sr;ar=1;var e=ot(),t=Lr(),n=wt().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),sr=function(e){i[r][e]=!0}}function Or(){return lr?ur:(lr=1,ur={})}function Mr(){if(dr)return cr;dr=1;var e,t,n,r=p(),i=pe(),o=_e(),s=Lr(),a=Yn(),u=zt(),l=ot(),c=Je(),d=l("iterator"),f=!1;return[].keys&&("next"in(n=[].keys())?(t=a(a(n)))!==Object.prototype&&(e=t):f=!0),!o(e)||r((function(){var t={};return e[d].call(t)!==t}))?e={}:c&&(e=s(e)),i(e[d])||u(e,d,(function(){return this})),cr={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:f}}function Dr(){if(hr)return fr;hr=1;var e=wt().f,t=rt(),n=ot()("toStringTag");return fr=function(r,i,o){r&&!o&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function qr(){if(yr)return mr;yr=1;var e=_e();return mr=function(t){return e(t)||null===t}}function $r(){if(wr)return br;wr=1;var e=qr(),t=String,n=TypeError;return br=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function Nr(){if(kr)return Sr;kr=1;var e=function(){if(gr)return vr;gr=1;var e=le(),t=xe();return vr=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}(),t=_e(),n=fe(),r=$r();return Sr=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,s={};try{(i=e(Object.prototype,"__proto__","set"))(s,[]),o=s instanceof Array}catch(e){}return function(e,s){return n(e),r(s),t(e)?(o?i(e,s):e.__proto__=s,e):e}}():void 0),Sr}function Br(){if(Cr)return xr;Cr=1;var $=Zn(),e=g(),t=Je(),n=Nt(),r=pe(),i=function(){if(_r)return pr;_r=1;var e=Mr().IteratorPrototype,t=Lr(),n=ue(),r=Dr(),i=Or(),o=function(){return this};return pr=function(s,a,u,l){var c=a+" Iterator";return s.prototype=t(e,{next:n(+!l,u)}),r(s,c,!1,!0),i[c]=o,s},pr}(),o=Yn(),s=Nr(),a=Dr(),u=St(),l=zt(),c=ot(),d=Or(),f=Mr(),h=n.PROPER,p=n.CONFIGURABLE,_=f.IteratorPrototype,v=f.BUGGY_SAFARI_ITERATORS,m=c("iterator"),y="keys",b="values",w="entries",S=function(){return this};return xr=function(n,c,f,g,k,x,C){i(f,c,g);var E,P,T,I=function(e){if(e===k&&O)return O;if(!v&&e&&e in L)return L[e];switch(e){case y:case b:case w:return function(){return new f(this,e)}}return function(){return new f(this)}},F=c+" Iterator",R=!1,L=n.prototype,A=L[m]||L["@@iterator"]||k&&L[k],O=!v&&A||I(k),M="Array"===c&&L.entries||A;if(M&&(E=o(M.call(new n)))!==Object.prototype&&E.next&&(t||o(E)===_||(s?s(E,_):r(E[m])||l(E,m,S)),a(E,F,!0,!0),t&&(d[F]=S)),h&&k===b&&A&&A.name!==b&&(!t&&p?u(L,"name",b):(R=!0,O=function(){return e(A,this)})),k)if(P={values:I(b),keys:x?O:I(y),entries:I(w)},C)for(T in P)(v||R||!(T in L))&&l(L,T,P[T]);else $({target:c,proto:!0,forced:v||R},P);return t&&!C||L[m]===O||l(L,m,O,{name:k}),d[c]=O,P},xr}function Hr(){return Pr?Er:(Pr=1,Er=function(e,t){return{value:e,done:t}})}function jr(){if(Ir)return Tr;Ir=1;var e=he(),t=Ar(),n=Or(),r=Ut(),i=wt().f,o=Br(),s=Hr(),a=Je(),u=_(),l="Array Iterator",c=r.set,d=r.getterFor(l);Tr=o(Array,"Array",(function(t,n){c(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,s(void 0,!0);switch(e.kind){case"keys":return s(n,!1);case"values":return s(t[n],!1)}return s([n,t[n]],!1)}),"values");var f=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!a&&u&&"values"!==f.name)try{i(f,"name",{value:"values"})}catch(e){}return Tr}var Ur,Vr,zr,Wr,Gr,Qr,Kr,Zr,Yr,Jr,Xr,ei,ti,ni,ri,ii,oi,si,ai,ui,li,ci,di,fi={};function hi(){if(Wr)return zr;Wr=1;var e=function(){if(Vr)return Ur;Vr=1;var e=ce(),t=le();return Ur=function(n){if("Function"===e(n))return t(n)}}(),t=xe(),n=v(),r=e(e.bind);return zr=function(e,i){return t(e),void 0===i?e:n?r(e,i):function(){return e.apply(i,arguments)}},zr}function pi(){if(Qr)return Gr;Qr=1;var e=ot(),t=Or(),n=e("iterator"),r=Array.prototype;return Gr=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function _i(){if(Zr)return Kr;Zr=1;var e={};return e[ot()("toStringTag")]="z",Kr="[object z]"===String(e)}function vi(){if(Jr)return Yr;Jr=1;var e=_i(),t=pe(),n=ce(),r=ot()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Yr=e?n:function(e){var s,a,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(a=function(e,t){try{return e[t]}catch(e){}}(s=i(e),r))?a:o?n(s):"Object"===(u=n(s))&&t(s.callee)?"Arguments":u},Yr}function gi(){if(ei)return Xr;ei=1;var e=vi(),t=Ce(),n=de(),r=Or(),i=ot()("iterator");return Xr=function(o){if(!n(o))return t(o,i)||t(o,"@@iterator")||r[e(o)]}}function mi(){if(ni)return ti;ni=1;var e=g(),t=xe(),n=bt(),r=ke(),i=gi(),o=TypeError;return ti=function(s,a){var u=2>arguments.length?i(s):a;if(t(u))return n(e(u,s));throw new o(r(s)+" is not iterable")},ti}function yi(){if(ii)return ri;ii=1;var e=g(),t=bt(),n=Ce();return ri=function(r,i,o){var s,a;t(r);try{if(!(s=n(r,"return"))){if("throw"===i)throw o;return o}s=e(s,r)}catch(e){a=!0,s=e}if("throw"===i)throw o;if(a)throw s;return t(s),o}}function bi(){if(si)return oi;si=1;var e=hi(),t=g(),n=bt(),r=ke(),i=pi(),o=pn(),s=ge(),a=mi(),u=gi(),l=yi(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return oi=function(h,p,_){var v,g,m,y,b,w,S,k=!(!_||!_.AS_ENTRIES),x=!(!_||!_.IS_RECORD),C=!(!_||!_.IS_ITERATOR),E=!(!_||!_.INTERRUPTED),P=e(p,_&&_.that),T=function(e){var t=v;return v=void 0,t&&l(t,"normal"),new d(!0,e)},I=function(e){return k?(n(e),E?P(e[0],e[1],T):P(e[0],e[1])):E?P(e,T):P(e)};if(x)v=h.iterator;else if(C)v=h;else{if(!(g=u(h)))throw new c(r(h)+" is not iterable");if(i(g)){for(m=0,y=o(h);y>m;m++)if((b=I(h[m]))&&s(f,b))return b;return new d(!1)}v=a(h,g)}for(w=x?h.next:v.next;!(S=t(w,v)).done;){var F=S.value;try{b=I(F)}catch(e){if(!v)throw e;l(v,"throw",e)}if("object"==typeof b&&b&&s(f,b))return b}return new d(!1)}}function wi(){if(ui)return ai;ui=1;var e=_(),t=wt(),n=ue();return ai=function(r,i,o){e?t.f(r,i,n(0,o)):r[i]=o}}var Si,ki,xi,Ci,Ei,Pi,Ti,Ii,Fi,Ri,Li,Ai,Oi={};function Mi(){if(Ei)return Oi;Ei=1;var e=i(),t=ki?Si:(ki=1,Si={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}),n=function(){if(Ci)return xi;Ci=1;var e=ut()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return xi=t===Object.prototype?void 0:t}(),r=jr(),o=St(),s=Dr(),a=ot()("iterator"),u=r.values,l=function(e,n){if(e){if(e[a]!==u)try{o(e,a,u)}catch(t){e[a]=u}if(s(e,n,!0),t[n])for(var i in r)if(e[i]!==r[i])try{o(e,i,r[i])}catch(t){e[i]=r[i]}}};for(var c in t)l(e[c]&&e[c].prototype,c);return l(n,"DOMTokenList"),Oi}function Di(){if(Fi)return Ii;Fi=1;var e=function(){if(Ti)return Pi;Ti=1;var e=function(){if(di)return ci;di=1,jr(),function(){if(li)return fi;li=1;var $=Zn(),e=bi(),t=wi();$({target:"Object",stat:!0},{fromEntries:function(n){var r={};return e(n,(function(e,n){t(r,e,n)}),{AS_ENTRIES:!0}),r}})}();var e=Xn();return ci=e.Object.fromEntries}();return Mi(),Pi=e}();return Ii=e}Ai||(Ai=1,function(){if(Li)return Ri;Li=1;var e=Di();Ri=e}());var qi,$i,Ni,Bi,Hi,ji,Ui,Vi,zi,Wi,Gi,Qi,Ki,Zi,Yi={},Ji={};function Xi(){if($i)return qi;$i=1;var e=_e(),t=St();return qi=function(n,r){e(r)&&"cause"in r&&t(n,"cause",r.cause)},qi}function eo(){if(Wi)return zi;Wi=1;var e=vi(),t=String;return zi=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function to(){if(Qi)return Gi;Qi=1;var e=eo();return Gi=function(t,n){return void 0===t?2>arguments.length?"":n:e(t)},Gi}function no(){return Zi||(Zi=1,function(){if(Ki)return Ji;Ki=1;var $=Zn(),e=ge(),t=Yn(),n=Nr(),r=Qn(),i=Lr(),o=St(),s=ue(),a=Xi(),u=function(){if(Vi)return Ui;Vi=1;var e=St(),t=function(){if(Bi)return Ni;Bi=1;var e=le(),t=Error,n=e("".replace),r=String(new t("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(r);return Ni=function(e,r){if(o&&"string"==typeof e&&!t.prepareStackTrace)for(;r--;)e=n(e,i,"");return e}}(),n=function(){if(ji)return Hi;ji=1;var e=p(),t=ue();return Hi=!e((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",t(1,7)),7!==e.stack)}))}(),r=Error.captureStackTrace;return Ui=function(i,o,s,a){n&&(r?r(i,o):e(i,"stack",t(s,a)))},Ui}(),l=bi(),c=to(),d=ot()("toStringTag"),f=Error,h=[].push,_=function(r,s){var p,g=e(v,this);n?p=n(new f,g?t(this):v):(p=g?this:i(v),o(p,d,"Error")),void 0!==s&&o(p,"message",c(s)),u(p,_,p.stack,1),arguments.length>2&&a(p,arguments[2]);var m=[];return l(r,h,{that:m}),o(p,"errors",m),p};n?n(_,f):r(_,f,{name:!0});var v=_.prototype=i(f.prototype,{constructor:s(1,_),message:s(1,""),name:s(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:_})}()),Yi}var ro,io,oo,so={};var ao,uo,lo,co,fo,ho,po,_o,vo,go,mo,yo,bo,wo,So,ko,xo,Co,Eo,Po,To,Io,Fo,Ro,Lo,Ao,Oo,Mo,Do,qo,$o,No,Bo,Ho,jo,Uo,Vo,zo,Wo,Go,Qo,Ko,Zo,Yo,Jo={},Xo={};function es(){if(uo)return ao;uo=1;var e=i(),t=me(),n=ce(),r=function(e){return t.slice(0,e.length)===e};return ao=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":e.Bun&&"string"==typeof Bun.version?"BUN":e.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(e.process)?"NODE":e.window&&e.document?"BROWSER":"REST"}function ts(){if(co)return lo;co=1;var e=es();return lo="NODE"===e}function ns(){if(ho)return fo;ho=1;var e=Vt(),t=wt();return fo=function(n,r,i){return i.get&&e(i.get,r,{getter:!0}),i.set&&e(i.set,r,{setter:!0}),t.f(n,r,i)}}function rs(){if(_o)return po;_o=1;var e=ve(),t=ns(),n=ot(),r=_(),i=n("species");return po=function(n){var o=e(n);r&&o&&!o[i]&&t(o,i,{configurable:!0,get:function(){return this}})}}function is(){if(go)return vo;go=1;var e=ge(),t=TypeError;return vo=function(n,r){if(e(r,n))return n;throw new t("Incorrect invocation")}}function os(){if(yo)return mo;yo=1;var e=le(),t=p(),n=pe(),r=vi(),i=ve(),o=Bt(),s=function(){},a=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=e(u.exec),c=!u.test(s),d=function(e){if(!n(e))return!1;try{return a(s,[],e),!0}catch(e){return!1}},f=function(e){if(!n(e))return!1;switch(r(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,o(e))}catch(e){return!0}};return f.sham=!0,mo=!a||t((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?f:d}function ss(){if(wo)return bo;wo=1;var e=os(),t=ke(),n=TypeError;return bo=function(r){if(e(r))return r;throw new n(t(r)+" is not a constructor")}}function as(){if(ko)return So;ko=1;var e=bt(),t=ss(),n=de(),r=ot()("species");return So=function(i,o){var s,a=e(i).constructor;return void 0===a||n(s=e(a)[r])?o:t(s)},So}function us(){if(Co)return xo;Co=1;var e=v(),t=Function.prototype,n=t.apply,r=t.call;return xo="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),xo}function ls(){if(Po)return Eo;Po=1;var e=le();return Eo=e([].slice)}function cs(){if(Io)return To;Io=1;var e=TypeError;return To=function(t,n){if(n>t)throw new e("Not enough arguments");return t}}function ds(){if(Ro)return Fo;Ro=1;var e=me();return Fo=/ipad|iphone|ipod/i.test(e)&&/applewebkit/i.test(e)}function fs(){if(Ao)return Lo;Ao=1;var e,t,n,r,o=i(),s=us(),a=hi(),u=pe(),l=rt(),c=p(),d=Rr(),f=ls(),h=ut(),_=cs(),v=ds(),g=ts(),m=o.setImmediate,y=o.clearImmediate,b=o.process,w=o.Dispatch,S=o.Function,k=o.MessageChannel,x=o.String,C=0,E={},P="onreadystatechange";c((function(){e=o.location}));var T=function(e){if(l(E,e)){var t=E[e];delete E[e],t()}},I=function(e){return function(){T(e)}},F=function(e){T(e.data)},R=function(t){o.postMessage(x(t),e.protocol+"//"+e.host)};return m&&y||(m=function(e){_(arguments.length,1);var n=u(e)?e:S(e),r=f(arguments,1);return E[++C]=function(){s(n,void 0,r)},t(C),C},y=function(e){delete E[e]},g?t=function(e){b.nextTick(I(e))}:w&&w.now?t=function(e){w.now(I(e))}:k&&!v?(r=(n=new k).port2,n.port1.onmessage=F,t=a(r.postMessage,r)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&e&&"file:"!==e.protocol&&!c(R)?(t=R,o.addEventListener("message",F,!1)):t=P in h("script")?function(e){d.appendChild(h("script"))[P]=function(){d.removeChild(this),T(e)}}:function(e){setTimeout(I(e),0)}),Lo={set:m,clear:y}}function hs(){if(Mo)return Oo;Mo=1;var e=i(),t=_(),n=Object.getOwnPropertyDescriptor;return Oo=function(r){if(!t)return e[r];var i=n(e,r);return i&&i.value}}function ps(){if(qo)return Do;qo=1;var e=function(){this.head=null,this.tail=null};return e.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}},Do=e}function _s(){return zo||(zo=1,Vo=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}),Vo}function vs(){return Go?Wo:(Go=1,Wo=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}})}function gs(){if(Ko)return Qo;Ko=1;var e=i();return Qo=e.Promise}function ms(){if(Yo)return Zo;Yo=1;var e=i(),t=gs(),n=pe(),r=Kn(),o=Bt(),s=ot(),a=es(),u=Je(),l=ye(),c=t&&t.prototype,d=s("species"),f=!1,h=n(e.PromiseRejectionEvent),p=r("Promise",(function(){var e=o(t),n=e!==String(t);if(!n&&66===l)return!0;if(u&&(!c.catch||!c.finally))return!0;if(!l||51>l||!/native code/.test(e)){var r=new t((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((r.constructor={})[d]=i,!(f=r.then((function(){}))instanceof i))return!0}return!(n||"BROWSER"!==a&&"DENO"!==a||h)}));return Zo={CONSTRUCTOR:p,REJECTION_EVENT:h,SUBCLASSING:f}}var ys,bs,ws={};function Ss(){if(ys)return ws;ys=1;var e=xe(),t=TypeError,n=function(n){var r,i;this.promise=new n((function(e,n){if(void 0!==r||void 0!==i)throw new t("Bad Promise constructor");r=e,i=n})),this.resolve=e(r),this.reject=e(i)};return ws.f=function(e){return new n(e)},ws}var ks,xs,Cs,Es,Ps,Ts={};function Is(){if(xs)return ks;xs=1;var e=ot()("iterator"),t=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){t=!0}};r[e]=function(){return this},Array.from(r,(function(){throw 2}))}catch(e){}return ks=function(n,r){try{if(!r&&!t)return!1}catch(e){return!1}var i=!1;try{var o={};o[e]=function(){return{next:function(){return{done:i=!0}}}},n(o)}catch(e){}return i}}function Fs(){if(Es)return Cs;Es=1;var e=gs(),t=Is(),n=ms().CONSTRUCTOR;return Cs=n||!t((function(t){e.all(t).then(void 0,(function(){}))}))}var Rs,Ls,As,Os,Ms,Ds,qs,$s={},Ns={},Bs={},Hs={};function js(){if(Ms)return Os;Ms=1;var e=bt(),t=_e(),n=Ss();return Os=function(r,i){if(e(r),t(i)&&i.constructor===r)return i;var o=n.f(r);return(0,o.resolve)(i),o.promise},Os}function Us(){return qs||(qs=1,function(){if(bs)return Xo;bs=1;var e,t,n,r,$=Zn(),o=Je(),s=ts(),a=i(),u=Xn(),l=g(),c=zt(),d=Nr(),f=Dr(),h=rs(),p=xe(),_=pe(),v=_e(),m=is(),y=as(),b=fs().set,w=function(){if(Uo)return jo;Uo=1;var e,t,n,r,o,s=i(),a=hs(),u=hi(),l=fs().set,c=ps(),d=ds(),f=function(){if(No)return $o;No=1;var e=me();return $o=/ipad|iphone|ipod/i.test(e)&&"undefined"!=typeof Pebble}(),h=function(){if(Ho)return Bo;Ho=1;var e=me();return Bo=/web0s(?!.*chrome)/i.test(e)}(),p=ts(),_=s.MutationObserver||s.WebKitMutationObserver,v=s.document,g=s.process,m=s.Promise,y=a("queueMicrotask");if(!y){var b=new c,w=function(){var t,n;for(p&&(t=g.domain)&&t.exit();n=b.get();)try{n()}catch(t){throw b.head&&e(),t}t&&t.enter()};d||p||h||!_||!v?!f&&m&&m.resolve?((r=m.resolve(void 0)).constructor=m,o=u(r.then,r),e=function(){o(w)}):p?e=function(){g.nextTick(w)}:(l=u(l,s),e=function(){l(w)}):(t=!0,n=v.createTextNode(""),new _(w).observe(n,{characterData:!0}),e=function(){n.data=t=!t}),y=function(t){b.head||e(),b.add(t)}}return jo=y}(),S=_s(),k=vs(),x=ps(),C=Ut(),E=gs(),P=ms(),T=Ss(),I="Promise",F=P.CONSTRUCTOR,R=P.REJECTION_EVENT,L=P.SUBCLASSING,A=C.getterFor(I),O=C.set,M=E&&E.prototype,D=E,q=M,N=a.TypeError,B=a.document,H=a.process,j=T.f,U=j,V=!!(B&&B.createEvent&&a.dispatchEvent),z="unhandledrejection",W=function(e){var t;return!(!v(e)||!_(t=e.then))&&t},G=function(e,t){var n,r,i,o=t.value,s=1===t.state,a=s?e.ok:e.fail,u=e.resolve,c=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&J(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=W(n))?l(r,n,u,c):u(n)):c(o)}catch(e){d&&!i&&d.exit(),c(e)}},Q=function(e,t){e.notified||(e.notified=!0,w((function(){for(var n,r=e.reactions;n=r.get();)G(n,e);e.notified=!1,t&&!e.rejection&&Z(e)})))},K=function(e,t,n){var r,i;V?((r=B.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),a.dispatchEvent(r)):r={promise:t,reason:n},!R&&(i=a["on"+e])?i(r):e===z&&S("Unhandled promise rejection",n)},Z=function(e){l(b,a,(function(){var t,n=e.facade,r=e.value;if(Y(e)&&(t=k((function(){s?H.emit("unhandledRejection",r,n):K(z,n,r)})),e.rejection=s||Y(e)?2:1,t.error))throw t.value}))},Y=function(e){return 1!==e.rejection&&!e.parent},J=function(e){l(b,a,(function(){var t=e.facade;s?H.emit("rejectionHandled",t):K("rejectionhandled",t,e.value)}))},X=function(e,t,n){return function(r){e(t,r,n)}},ee=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Q(e,!0))},te=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=W(t);r?w((function(){var n={done:!1};try{l(r,t,X(te,n,e),X(ee,n,e))}catch(t){ee(n,t,e)}})):(e.value=t,e.state=1,Q(e,!1))}catch(t){ee({done:!1},t,e)}}};if(F&&(D=function(t){m(this,q),p(t),l(e,this);var n=A(this);try{t(X(te,n),X(ee,n))}catch(e){ee(n,e)}},(e=function(e){O(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:null})}).prototype=c(q=D.prototype,"then",(function(e,t){var n=A(this),r=j(y(this,D));return n.parent=!0,r.ok=!_(e)||e,r.fail=_(t)&&t,r.domain=s?H.domain:void 0,0===n.state?n.reactions.add(r):w((function(){G(r,n)})),r.promise})),t=function(){var t=new e,n=A(t);this.promise=t,this.resolve=X(te,n),this.reject=X(ee,n)},T.f=j=function(e){return e===D||e===n?new t(e):U(e)},!o&&_(E)&&M!==Object.prototype)){r=M.then,L||c(M,"then",(function(e,t){var n=this;return new D((function(e,t){l(r,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete M.constructor}catch(e){}d&&d(M,q)}$({global:!0,constructor:!0,wrap:!0,forced:F},{Promise:D}),n=u.Promise,f(D,I,!1,!0),h(I)}(),function(){if(Ps)return Ts;Ps=1;var $=Zn(),e=g(),t=xe(),n=Ss(),r=vs(),i=bi();$({target:"Promise",stat:!0,forced:Fs()},{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}})}(),function(){if(Rs)return $s;Rs=1;var $=Zn(),e=Je(),t=ms().CONSTRUCTOR,n=gs(),r=ve(),i=pe(),o=zt(),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})}}(),function(){if(Ls)return Ns;Ls=1;var $=Zn(),e=g(),t=xe(),n=Ss(),r=vs(),i=bi();$({target:"Promise",stat:!0,forced:Fs()},{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}})}(),function(){if(As)return Bs;As=1;var $=Zn(),e=Ss();$({target:"Promise",stat:!0,forced:ms().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(Ds)return Hs;Ds=1;var $=Zn(),e=ve(),t=Je(),n=gs(),r=ms().CONSTRUCTOR,i=js(),o=e("Promise"),s=t&&!r;$({target:"Promise",stat:!0,forced:t||r},{resolve:function(e){return i(s&&this===o?n:this,e)}})}()),Jo}var Vs,zs={};function Ws(){if(Vs)return zs;Vs=1;var $=Zn(),e=g(),t=xe(),n=Ss(),r=vs(),i=bi();return $({target:"Promise",stat:!0,forced:Fs()},{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}}),zs}var Gs,Qs={};function Ks(){if(Gs)return Qs;Gs=1;var $=Zn(),e=g(),t=xe(),n=ve(),r=Ss(),i=vs(),o=bi(),s=Fs(),a="No one promise resolved";return $({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}}),Qs}var Zs,Ys={};function Js(){if(Zs)return Ys;Zs=1;var $=Zn(),e=i(),t=us(),n=ls(),r=Ss(),o=xe(),s=vs(),a=e.Promise,u=!1;return $({target:"Promise",stat:!0,forced:!a||!a.try||s((function(){a.try((function(e){u=8===e}),8)})).error||!u},{try:function(e){var i=arguments.length>1?n(arguments,1):[],a=r.f(this),u=s((function(){return t(o(e),void 0,i)}));return(u.error?a.reject:a.resolve)(u.value),a.promise}}),Ys}var Xs,ea={};function ta(){if(Xs)return ea;Xs=1;var $=Zn(),e=Ss();return $({target:"Promise",stat:!0},{withResolvers:function(){var t=e.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}}),ea}var na,ra,ia,oa,sa,aa,ua,la,ca,da,fa,ha,pa,_a,va,ga,ma,ya,ba={},wa={};function Sa(){if(aa)return sa;aa=1,no(),jr(),function(){if(oo)return so;oo=1;var e=_i(),t=zt(),n=function(){if(io)return ro;io=1;var e=_i(),t=vi();return ro=e?{}.toString:function(){return"[object "+t(this)+"]"}}();e||t(Object.prototype,"toString",n,{unsafe:!0})}(),Us(),Ws(),Ks(),Js(),ta(),function(){if(na)return ba;na=1;var $=Zn(),e=Je(),t=gs(),n=p(),r=ve(),i=pe(),o=as(),s=js(),a=zt(),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})}}(),function(){if(oa)return wa;oa=1;var e=function(){if(ia)return ra;ia=1;var e=le(),t=dn(),n=eo(),r=fe(),i=e("".charAt),o=e("".charCodeAt),s=e("".slice),a=function(e){return function(a,u){var l,c,d=n(r(a)),f=t(u),h=d.length;return 0>f||f>=h?e?"":void 0:55296>(l=o(d,f))||l>56319||f+1===h||56320>(c=o(d,f+1))||c>57343?e?i(d,f):l:e?s(d,f,f+2):c-56320+(l-55296<<10)+65536}};return ra={codeAt:a(!1),charAt:a(!0)}}().charAt,t=eo(),n=Ut(),r=Br(),i=Hr(),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)}))}();var e=Xn();return sa=e.Promise}function ka(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 xa(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 Ca(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){xa(o,r,i,s,a,"next",e)}function a(e){xa(o,r,i,s,a,"throw",e)}s(void 0)}))}}function Ea(e,t,n){return t&&function(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,Oa(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pa(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 ka(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)?ka(e,t):void 0}}(e))||t){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 Ta(){return Ta=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},Ta.apply(null,arguments)}function Ia(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Aa(e,t)}function Fa(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 Ra(){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 La(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 l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(La(t={},r,(function(){return this})),t),d=l.prototype=a.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,La(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=l,La(d,"constructor",l),La(l,"constructor",u),u.displayName="GeneratorFunction",La(l,i,"GeneratorFunction"),La(d),La(d,i,"Generator"),La(d,r,(function(){return this})),La(d,"toString",(function(){return"[object Generator]"})),(Ra=function(){return{w:o,m:f}})()}function La(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}La=function(e,t,n,r){function o(t,n){La(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))},La(e,t,n,r)}function Aa(e,t){return Aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Aa(e,t)}function Oa(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}ya||(ya=1,function(){if(ma)return ga;ma=1;var e=function(){if(ha)return fa;ha=1;var e=function(){if(la)return ua;la=1;var e=Sa();return Mi(),ua=e}();return ca||(ca=1,Js()),da||(da=1,ta()),fa=e}();pa||(pa=1,no()),_a||(_a=1,Ws()),va||(va=1,Ks()),ga=e}());var Ma,Da,qa,$a,Na,Ba,Ha,ja,Ua,Va,za,Wa,Ga,Qa,Ka,Za={},Ya=[],Ja=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xa=Array.isArray;function eu(e,t){for(var n in t)e[n]=t[n];return e}function tu(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function nu(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?Ma.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 ru(e,s,r,i,null)}function ru(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?++qa:i,__i:-1,__u:0};return null==i&&null!=Da.vnode&&Da.vnode(o),o}function iu(e){return e.children}function ou(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 su(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=eu({},t);o.__v=t.__v+1,Da.vnode&&Da.vnode(o),gu(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,yu(r,o,i),t.__e=t.__=null,o.__e!=n&&au(o)}}function au(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})),au(e)}function uu(e){(!e.__d&&(e.__d=!0)&&$a.push(e)&&!lu.__r++||Na!=Da.debounceRendering)&&((Na=Da.debounceRendering)||Ba)(lu)}function lu(){try{for(var e,t=1;$a.length;)$a.length>t&&$a.sort(Ha),e=$a.shift(),t=$a.length,su(e)}finally{$a.length=lu.__r=0}}function cu(e,t,n,r,i,o,s,a,u,l,c){var d,f,h,p,_,v,g,m=r&&r.__k||Ya,y=t.length;for(u=du(n,t,m,u,y),d=0;y>d;d++)null!=(h=n.__k[d])&&(f=-1!=h.__i&&m[h.__i]||Za,h.__i=d,v=gu(e,h,f,i,o,s,a,u,l,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Su(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=fu(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 du(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]=ru(null,s,null,null,null):Xa(s)?s=e.__k[o]=ru(iu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=ru(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=hu(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])&&0==(2&a.__u)&&(a.__e==r&&(r=$(a)),ku(a,a));return r}function fu(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=fu(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 hu(e,t,n,r){var i,o,s,a=e.key,u=e.type,l=t[n],c=null!=l&&0==(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--])&&0==(2&l.__u)&&a==l.key&&u==l.type)return s;return-1}function pu(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ja.test(t)?n:n+"px"}function _u(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||pu(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||pu(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(za,"$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[Va]=r[Va]:(n[Va]=Wa,e.addEventListener(t,o?Qa:Ga,o)):e.removeEventListener(t,o?Qa:Ga,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 vu(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[Ua])t[Ua]=Wa++;else if(n[Va]>t[Ua])return;return n(Da.event?Da.event(t):t)}}}function gu(e,t,n,r,i,o,s,a,u,l){var c,d,f,h,p,_,v,g,m,y,$,b,w,S,k,x,C=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=Da.__b)&&c(t);e:if("function"==typeof C){d=s.length;try{if(m=t.props,y=C.prototype&&C.prototype.render,$=(c=C.contextType)&&r[c.__c],b=c?$?$.props.value:c.__:r,n.__c?g=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new C(m,b):(t.__c=f=new ou(m,b),f.constructor=C,f.render=xu),$&&$.sub(f),f.state||(f.state={}),f.__n=r,h=f.__d=!0,f.__h=[],f._sb=[]),y&&null==f.__s&&(f.__s=f.state),y&&null!=C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=eu({},f.__s)),eu(f.__s,C.getDerivedStateFromProps(m,f.__s))),p=f.props,_=f.state,f.__v=t,h)y&&null==C.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),y&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(y&&null==C.getDerivedStateFromProps&&m!==p&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(m,b),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(m,f.__s,b)){t.__v!=n.__v&&(f.props=m,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),Ya.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(m,f.__s,b),y&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(p,_,v)}))}if(f.context=b,f.props=m,f.__P=e,f.__e=!1,w=Da.__r,S=0,y)f.state=f.__s,f.__d=!1,w&&w(t),c=f.render(f.props,f.state,f.context),Ya.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,w&&w(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++S);f.state=f.__s,null!=f.getChildContext&&(r=eu(eu({},r),f.getChildContext())),y&&!h&&null!=f.getSnapshotBeforeUpdate&&(v=f.getSnapshotBeforeUpdate(p,_)),k=null!=c&&c.type===iu&&null==c.key?bu(c.props.children):c,a=cu(e,Xa(k)?k:[k],t,n,r,i,o,s,a,u,l),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),g&&(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(x=o.length;x--;)tu(o[x]);mu(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||mu(t);Da.__e(e,t,n)}}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=wu(n.__e,t,n,r,i,o,s,u,l);return(c=Da.diffed)&&c(t),128&t.__u?void 0:a}function mu(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(mu))}function yu(e,t,n){for(var r=0;n.length>r;r++)Su(n[r],n[++r],n[++r]);Da.__c&&Da.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Da.__e(e,t.__v)}}))}function bu(e){return"object"!=typeof e||null==e||e.__b>0?e:Xa(e)?e.map(bu):void 0!==e.constructor?null:eu({},e)}function wu(e,t,n,r,i,o,s,a,u){var l,c,d,f,h,p,_,v=n.props||Za,g=t.props,m=t.type;if("svg"==m?i="http://www.w3.org/2000/svg":"math"==m?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==!!m&&(m?h.localName==m:3==h.nodeType)){e=h,o[l]=null;break}if(null==e){if(null==m)return document.createTextNode(g);e=document.createElementNS(i,m,g.is&&g),a&&(Da.__m&&Da.__m(t,o),a=!1),o=null}if(null==m)v===g||a&&e.data==g||(e.data=g);else{if(o="textarea"==m&&null!=g.defaultValue?null:o&&Ma.call(e.childNodes),!a&&null!=o)for(v={},l=0;e.attributes.length>l;l++)v[(h=e.attributes[l]).name]=h.value;for(l in v)h=v[l],"dangerouslySetInnerHTML"==l?d=h:"children"==l||l in g||"value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g||_u(e,l,null,h,i);for(l in g)h=g[l],"children"==l?f=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?p=h:"checked"==l?_=h:a&&"function"!=typeof h||v[l]===h||_u(e,l,h,v[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=""),cu("template"==t.type?e.content:e,Xa(f)?f:[f],t,n,r,"foreignObject"==m?"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--;)tu(o[l]);a&&"textarea"!=m||(l="value","progress"==m&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[l]||"progress"==m&&!p||"option"==m&&p!=v[l])&&_u(e,l,p,v[l],i),l="checked",null!=_&&_!=e[l]&&_u(e,l,_,v[l],i))}return e}function Su(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){Da.__e(e,n)}}function ku(e,t,n){var r,i;if(Da.unmount&&Da.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Su(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Da.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;r.length>i;i++)r[i]&&ku(r[i],t,n||"function"!=typeof e.type);n||tu(e.__e),e.__c=e.__=e.__e=void 0}function xu(e,t,n){return this.constructor(e,n)}function Cu(e,t,n){var r,i,o;t==document&&(t=document.documentElement),Da.__&&Da.__(e,t),r=t.__k,i=[],o=[],gu(t,e=t.__k=nu(iu,null,[e]),r||Za,Za,t.namespaceURI,r?null:t.firstChild?Ma.call(t.childNodes):null,i,r?r.__e:t.firstChild,!1,o),yu(i,e,o),e.props.children=null}Ma=Ya.slice,Da={__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}},qa=0,ou.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=eu({},this.state),"function"==typeof e&&(e=e(eu({},n),this.props)),e&&eu(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),uu(this))},ou.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),uu(this))},ou.prototype.render=iu,$a=[],Ba="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ha=function(e,t){return e.__v.__b-t.__v.__b},lu.__r=0,ja=Math.random().toString(8),Ua="__d"+ja,Va="__a"+ja,za=/(PointerCapture)$|Capture$/i,Wa=0,Ga=vu(!1),Qa=vu(!0),Ka=0;var Eu,Pu,Tu,Iu,Fu=0,Ru=[],Lu=Da,Au=Lu.__b,Ou=Lu.__r,Mu=Lu.diffed,Du=Lu.__c,qu=Lu.unmount,$u=Lu.__;function Nu(e,t){Lu.__h&&Lu.__h(Pu,e,Fu||t),Fu=0;var n=Pu.__H||(Pu.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Bu(e){return Fu=1,function(e,t,n){var r=Nu(Eu++,2);if(r.t=e,!r.__c&&(r.__=[Yu(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Pu,!Pu.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,s=r.__c.props!==e;if(r.__c.__H.__.some((function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),o){var a=o.call(this,e,t,n);return i?a||s:a}return!i||s};Pu.__f=!0;var o=Pu.shouldComponentUpdate,s=Pu.componentWillUpdate;Pu.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},Pu.shouldComponentUpdate=i}return r.__N||r.__}(Yu,e)}function Hu(e,t){var n=Nu(Eu++,3);!Lu.__s&&Zu(n.__H,t)&&(n.__=e,n.u=t,Pu.__H.__h.push(n))}function ju(e){return Fu=5,Uu((function(){return{current:e}}),[])}function Uu(e,t){var n=Nu(Eu++,7);return Zu(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Vu(e){var t=Pu.context[e.__c],n=Nu(Eu++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Pu)),t.props.value):e.__}function zu(){for(var e;e=Ru.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Qu),t.__h.some(Ku),t.__h=[]}catch(n){t.__h=[],Lu.__e(n,e.__v)}}}Lu.__b=function(e){Pu=null,Au&&Au(e)},Lu.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$u&&$u(e,t)},Lu.__r=function(e){Ou&&Ou(e),Eu=0;var t=(Pu=e.__c).__H;t&&(Tu===Pu?(t.__h=[],Pu.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&zu(),Eu=0)),Tu=Pu},Lu.diffed=function(e){Mu&&Mu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ru.push(t)&&Iu===Lu.requestAnimationFrame||((Iu=Lu.requestAnimationFrame)||Gu)(zu)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),Tu=Pu=null},Lu.__c=function(e,t){t.some((function(e){try{e.__h.some(Qu),e.__h=e.__h.filter((function(e){return!e.__||Ku(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Lu.__e(n,e.__v)}})),Du&&Du(e,t)},Lu.unmount=function(e){qu&&qu(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some((function(e){try{Qu(e)}catch(e){t=e}})),n.__H=void 0,t&&Lu.__e(t,n.__v))};var Wu="function"==typeof requestAnimationFrame;function Gu(e){var t,n=function(){clearTimeout(r),Wu&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Wu&&(t=requestAnimationFrame(n))}function Qu(e){var t=Pu,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Pu=t}function Ku(e){var t=Pu;e.__c=e.__(),Pu=t}function Zu(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Yu(e,t){return"function"==typeof t?t(e):t}var Ju="gzip-js",Xu="base64",el="events",tl="cancelEvents",nl={Tab:"tab",Selector:"selector"},rl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},il={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},ol={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},sl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},al={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},ul="always",ll={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},cl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},dl="popover",fl=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],hl=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return fl.concat(t).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))};function pl(e,t){return-1!==e.indexOf(t)}var _l=function(e){return e.trim()},vl=function(e){return e.replace(/^\$/,"")};function gl(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 ml=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.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),yl=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),bl="min_length",wl="max_length",Sl=["$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"],kl=["token"],xl=Object.prototype,Cl=xl.hasOwnProperty,El=xl.toString,Pl=Array.isArray||function(e){return"[object Array]"===El.call(e)},Tl=function(e){return"function"==typeof e},Il=function(e){return e===Object(e)&&!Pl(e)},Fl=function(e){if(Il(e)){for(var t in e)if(Cl.call(e,t))return!1;return!0}return!1},Rl=function(e){return void 0===e},Ll=function(e){return"[object String]"==El.call(e)},Al=function(e){return Ll(e)&&0===e.trim().length},Ol=function(e){return null===e},Ml=function(e){return Rl(e)||Ol(e)},Dl=function(e){return"[object Number]"==El.call(e)&&e==e},ql=function(e){return Dl(e)&&e>0},$l=function(e){return"[object Boolean]"===El.call(e)},Nl=function(e){return e instanceof FormData},Bl=function(e){return pl(Sl,e)},Hl=function(e){return pl(kl,e)};function jl(e){return null===e||"object"!=typeof e}function Ul(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Vl(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 Wl(e,Error)}}function zl(e){return"u">typeof Event&&Wl(e,Event)}function Wl(e,t){try{return e instanceof t}catch(e){return!1}}var Gl=[!0,"true",1,"1","yes"],Ql=function(e){return pl(Gl,e)},Kl=[!1,"false",0,"0","no"];function Zl(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Dl(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),Zl(null!=i?i:n,t,n,r))}var Yl,Jl=function(){function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=Zl(e.bucketSize,0,100,e._logger),this._refillRate=Zl(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=Zl(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}(),Xl="Mobile",ec="iOS",tc="Android",nc="Tablet",rc=tc+" "+nc,ic="iPad",oc="Apple",sc=oc+" Watch",ac="Safari",uc="BlackBerry",lc="Samsung",cc=lc+"Browser",dc=lc+" Internet",fc="Chrome",hc=fc+" OS",pc=fc+" "+ec,_c="Internet Explorer",vc=_c+" "+Xl,gc="Opera",mc=gc+" Mini",yc="Edge",bc="Microsoft "+yc,wc="Firefox",Sc=wc+" "+ec,kc="Nintendo",xc="PlayStation",Cc="Xbox",Ec=tc+" "+Xl,Pc=Xl+" "+ac,Tc="Windows",Ic=Tc+" Phone",Fc="Nokia",Rc="Ouya",Lc="Generic",Ac=Lc+" "+Xl.toLowerCase(),Oc=Lc+" "+nc.toLowerCase(),Mc="Konqueror",Dc="Oculus Browser",qc="Vivaldi",$c="Yandex",Nc="Whale",Bc="DuckDuckGo",Hc="Pale Moon",jc="Waterfox",Uc="Brave",Vc="Claude",zc="Codex",Wc="ChatGPT",Gc="Google Search App",Qc="(\\d+(\\.\\d+)?)",Kc=new RegExp("Version/"+Qc),Zc=new RegExp("("+Vc+"|"+zc+"|"+Wc+")\\/"+Qc),Yc=new RegExp(Cc,"i"),Jc=new RegExp(xc+" \\w+","i"),Xc=new RegExp(kc+" \\w+","i"),ed=new RegExp(uc+"|PlayBook|BB10","i"),td={"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"},nd=function(e,t,n,r){t=t||"";var i=function(e){return null!=e&&e.brave?Uc:null}(n);return i||(null!=r&&r.detectGoogleSearchApp&&pl(e,"GSA/")?Gc:pl(e," OPR/")&&pl(e,"Mini")?mc:pl(e," OPR/")?gc:ed.test(e)?uc:pl(e,"IE"+Xl)||pl(e,"WPDesktop")?vc:pl(e,"OculusBrowser")?Dc:pl(e,cc)?dc:pl(e,yc)||pl(e,"Edg/")?bc:pl(e,qc+"/")?qc:pl(e,"YaBrowser/")?$c:pl(e,Nc+"/")?Nc:pl(e,Bc+"/")||pl(e,"Ddg/")?Bc:pl(e,Vc+"/")?Vc:pl(e,zc+"/")?zc:pl(e,Wc+"/")?Wc:pl(e,"FBIOS")?"Facebook "+Xl:pl(e,"UCWEB")||pl(e,"UCBrowser")?"UC Browser":pl(e,"CriOS")?pc:pl(e,"CrMo")||pl(e,fc)?fc:pl(e,tc)&&pl(e,ac)?Ec:pl(e,"FxiOS")?Sc:pl(e.toLowerCase(),Mc.toLowerCase())?Mc:pl(e,Uc+"/")?Uc:function(e,t){return t&&pl(t,oc)||function(e){return pl(e,ac)&&!pl(e,fc)&&!pl(e,tc)}(e)}(e,t)?pl(e,Xl)?Pc:ac:pl(e,"PaleMoon/")?Hc:pl(e,jc+"/")?jc:pl(e,wc)?wc:pl(e,"MSIE")||pl(e,"Trident/")?_c:pl(e,"Gecko")?wc:"")},rd=((Yl={})[vc]=[new RegExp("rv:"+Qc)],Yl[bc]=[new RegExp(yc+"?\\/"+Qc)],Yl[fc]=[new RegExp("("+fc+"|CrMo)\\/"+Qc)],Yl[pc]=[new RegExp("CriOS\\/"+Qc)],Yl["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/"+Qc)],Yl[ac]=[Kc],Yl[Pc]=[Kc],Yl[gc]=[new RegExp("(Opera|OPR)\\/"+Qc)],Yl[wc]=[new RegExp(wc+"\\/"+Qc)],Yl[Sc]=[new RegExp("FxiOS\\/"+Qc)],Yl[Mc]=[new RegExp("Konqueror[:/]?"+Qc,"i")],Yl[uc]=[new RegExp(uc+" "+Qc),Kc],Yl[Ec]=[new RegExp("android\\s"+Qc,"i")],Yl[dc]=[new RegExp(cc+"\\/"+Qc)],Yl[Dc]=[new RegExp("OculusBrowser\\/"+Qc)],Yl[qc]=[new RegExp(qc+"\\/"+Qc)],Yl[$c]=[new RegExp("YaBrowser\\/"+Qc)],Yl[Nc]=[new RegExp(Nc+"\\/"+Qc)],Yl[Uc]=[new RegExp(Uc+"\\/"+Qc)],Yl[Vc]=[Zc],Yl[zc]=[Zc],Yl[Wc]=[Zc],Yl[Bc]=[new RegExp("(DuckDuckGo|Ddg)\\/"+Qc)],Yl[Hc]=[new RegExp("PaleMoon\\/"+Qc)],Yl[jc]=[new RegExp(jc+"\\/"+Qc)],Yl[Gc]=[new RegExp("GSA\\/"+Qc)],Yl[_c]=[new RegExp("(rv:|MSIE )"+Qc)],Yl.Mozilla=[new RegExp("rv:"+Qc)],Yl),id=function(e,t,n,r){var i=nd(e,t,n,r),o=rd[i];if(Rl(o))return null;for(var s=0;o.length>s;s++){var a=e.match(o[s]);if(a)return parseFloat(a[a.length-2])}return null},od=[[new RegExp(Cc+"; "+Cc+" (.*?)[);]","i"),function(e){return[Cc,e&&e[1]||""]}],[new RegExp(kc,"i"),[kc,""]],[new RegExp(xc,"i"),[xc,""]],[ed,[uc,""]],[new RegExp(Tc,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ic,""];if(new RegExp(Xl).test(t)&&!/IEMobile\b/.test(t))return[Tc+" "+Xl,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=td[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Tc,r]}return[Tc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?[ec,[e[3],e[4],e[5]||"0"].join(".")]:[ec,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Rl(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+tc+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tc+")","i"),function(e){return e&&e[2]?[tc,[e[2],e[3],e[4]||"0"].join(".")]:[tc,""]}],[/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/,[hc,""]],[/Linux|debian/i,["Linux",""]]],sd=function(e){for(var t=0;od.length>t;t++){var n=od[t],r=n[1],i=n[0].exec(e),o=i&&(Tl(r)?r(i,e):r);if(o)return o}return["",""]},ad=function(e){return Xc.test(e)?kc:Jc.test(e)?xc:Yc.test(e)?Cc:new RegExp(Rc,"i").test(e)?Rc:new RegExp("("+Ic+"|WPDesktop)","i").test(e)?Ic:/iPad/.test(e)?ic:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?sc:ed.test(e)?uc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Fc,"i").test(e)?Fc:/(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(Xl).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)?tc:rc:new RegExp("(pda|"+Xl+")","i").test(e)?Ac:new RegExp(nc,"i").test(e)&&!new RegExp(nc+" pc","i").test(e)?Oc:""},ud=function(e,t){var n,r,i,o,s=ad(e);return s===ic||s===rc||"Kobo"===s||"Kindle Fire"===s||s===Oc?nc:s===kc||s===Cc||s===xc||s===Rc?"Console":s===sc?"Wearable":s?Xl:"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)?Xl:nc:"Desktop"},ld=20,cd=1e3,dd=1e4,fd="[Circular]",hd="[Truncated]",pd="[Unserializable]",_d="[Function]";function vd(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}var gd,md,yd,bd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function wd(e,t){return"string"==typeof(n=e)&&bd.test(n)?e:t();var n}function Sd(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 kd(e){return e?e.split("#")[0]:e}function xd(e,t){var n=setTimeout(e,t);return(null==n?void 0:n.unref)&&(null==n||n.unref()),n}function Cd(e,t,n){return Ed.apply(this,arguments)}function Ed(){return(Ed=Ca(Ra().m((function e(t,n,r){var i;return Ra().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=xd((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 Pd(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return yd&&n.length===md||(md=n.length,yd=n.reduce((function(n,r){gd||(gd={});var i=gd[r];if(i)n[i[0]]=i[1];else for(var o=e(r),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=t[r];if(u&&l){n[u]=l,gd[r]=[u,l];break}}return n}),{})),yd}}var Td=function(){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=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:n=Pa(t);case 1:if((r=n()).done){e.n=4;break}if(!((i=r.value).stacktrace&&i.stacktrace.frames&&Pl(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;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),Ta({},e,{cause:n,stack:r})},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=Pa(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=Ca(Ra().m((function e(t){var n,r,i,o;return Ra().w((function(e){for(;;)switch(e.n){case 0:n=t,r=Pa(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,i,o={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(r=t.handled)||void 0===r||r,synthetic:null!==(i=e.synthetic)&&void 0!==i&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var s=[o];return null!=e.cause&&s.push.apply(s,this.convertToExceptionList(e.cause,Ta({},t,{handled:!0}))),s},t.buildParsingContext=function(e){var t;return{chunkIdMap:Pd(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.buildCoercingContext=function(e,t,n){var r=this;void 0===n&&(n=0);var i=function(n,i){if(4>=i){var o=r.buildCoercingContext(e,t,i);return r.applyCoercers(n,o)}};return Ta({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:function(e){return i(e,n)},next:function(e){return i(e,n+1)}})},e}(),Id="?";function Fd(e,t,n,r,i){var o={platform:e,filename:t,function:"<anonymous>"===n?Id:n,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return Rl(r)||(o.lineno=r),Rl(i)||(o.colno=i),o}var Rd=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]:Id,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ld=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ad=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Od=/\((\S*)(?::(\d+))(?::(\d+))\)/,Md=function(e,t){var n=Ld.exec(e);if(n)return Fd(t,n[1],Id,+n[2],+n[3]);var r=Ad.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var i=Od.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var o=Rd(r[1]||Id,r[2]);return Fd(t,o[1],o[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Dd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$d=function(e,t){var n=Dd.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=qd.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]||Id,s=Rd(o,i);return Fd(t,i=s[1],o=s[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Nd=/\(error: (.*)\)/,Bd=50;var Hd=function(){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=Ll(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 Ul(e,"DOMException")},t.isDOMError=function(e){return Ul(e,"DOMError")},e}(),jd=function(){function e(){}var t=e.prototype;return t.match=function(e){return Vl(e)},t.coerce=function(e,t){var n,r=this.getStack(e),i=void 0===r;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:null==(n=t.syntheticException)?void 0:n.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:i}},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){return e.stacktrace||e.stack||void 0},e}(),Ud=function(){function e(){}var t=e.prototype;return t.match=function(e){return!!Ul(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 Ta({},r,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:r.stack,synthetic:!0})},t._hasUsableMessage=function(e){return Ll(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(Ll(r.filename)&&0!==r.filename.length&&0!==i)return"Error\n at "+r.filename+":"+i+":"+o},e}(),Vd=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,zd=function(){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(Vd);return r&&(t=r[1],n=r[2]),[t,n]},e}(),Wd=["fatal","error","warning","log","info","debug"];function Gd(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=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var Qd=function(){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(zl(e))return e.constructor.name;var t="name"in e?e.name:void 0;return Ll(t)&&!Al(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: "+Gd(e)},t.isSeverityLevel=function(e){return Ll(e)&&!Al(e)&&Wd.indexOf(e)>=0},t.getStack=function(e){try{return Ll(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Ll(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(Vl(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),Kd=function(){function e(){}var t=e.prototype;return t.match=function(e){return zl(e)},t.coerce=function(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Gd(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Zd=function(){function e(){}var t=e.prototype;return t.match=function(e){return jl(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}(),Yd=function(){function e(){}var t=e.prototype;return t.match=function(e){return Ul(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!zl(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 jl(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}(),Jd="$message",Xd="$timestamp",ef=new Set([Jd,Xd]),tf={enabled:!0,max_bytes:32768};function nf(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:tf.enabled,max_bytes:of(e.max_bytes,tf.max_bytes)}:Ta({},tf)}var rf=function(){function e(e){this._entries=[],this._totalBytes=0,this._config=nf(e)}var t=e.prototype;return t.setConfig=function(e){this._config=nf(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=gl(e)}catch(e){return}try{var n=JSON.parse(t);if(!Il(n))return;var r=n,i=r[Jd],o=r[Xd];if(!Ll(i)||0===i.trim().length)return;if(!Ll(o)&&!Dl(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 of(e,t){if(!Dl(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var sf=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function af(e){return"string"==typeof e||e}function uf(e){return"string"==typeof e?e:void 0}var lf,cf=["$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","irclid","_kx"],["$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"]),df="NativeGzipValidationError",ff=function(e){return e.length>=2&&31===e[0]&&139===e[1]},hf=function(e,t){return e===yl.GZipJS||t===yl.GZipJS||"gzip"===t},pf=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},_f=function(e){for(var t=function(){if(lf)return lf;lf=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;lf[e]=t>>>0}return lf}(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0},vf=function(e){throw Sd(df,"Native gzip produced invalid output: "+e)},gf=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s,a;return Ra().w((function(e){for(;;)switch(e.n){case 0:return 18>t.size&&vf("too-short"),s=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return r=new s(e.v),ff(r)&&8===r[2]||vf("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:(i=new a(e.v)).getUint32(0,!0)!==_f(n)&&vf("invalid-crc"),o=n.length>>>0,i.getUint32(4,!0)!==o&&vf("invalid-size");case 3:return e.a(2)}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function mf(e,t,n){return yf.apply(this,arguments)}function yf(){return yf=Ca(Ra().m((function e(t,n,r){var i,o,s,a,u,l,c;return Ra().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=Ca(Ra().m((function e(t){return Ra().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 l=e.v[0],e.n=3,gf(l,i);case 3:return e.a(2,l);case 4:if(e.p=4,c=e.v,null==r||!r.rethrow){e.n=5;break}throw c;case 5:return n&&console.error("Failed to gzip compress data",c),e.a(2,null)}}),e,null,[[1,4]])}))),yf.apply(this,arguments)}var bf=0x8000000000000000,wf="9223372036854775808",Sf={}.propertyIsEnumerable;function kf(e,t){try{return Ef(e,t,{ancestors:new WeakSet,remainingNodes:dd},0)}catch(e){return[]}}function xf(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:hd};if(n.remainingNodes--,$l(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),r=BigInt(wf);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>=bf||-bf>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:vd(e)};if("function"==typeof e)return{stringValue:_d};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(n.ancestors.has(e))return{stringValue:fd};if(r>=ld)return{stringValue:hd};if(e instanceof Date){var o=e.getTime(),s=Number.isFinite(o)?e.toISOString():String(e);return{stringValue:"string"==typeof s?vd(s):String(s)}}n.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return xf(a.call(e),t,n,r+1)}catch(e){}return Pl(e)?{arrayValue:{values:Cf(e,t,n,r+1)}}:{kvlistValue:{values:Ef(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:vd(String(e))}}function Cf(e,t,n,r){for(var i=[],o=Math.min(e.length,cd),s=0;o>s&&n.remainingNodes>0;s++)try{var a=s in e?e[s]:void 0;if(Ml(a))continue;i.push(xf(a,t,n,r))}catch(e){i.push({stringValue:pd})}return e.length>s&&i.push({stringValue:hd}),i}function Ef(e,t,n,r){var i=[];for(var o in e)if(Sf.call(e,o)){if(!o){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.length>=cd||0>=n.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var s=e[o];if(Ol(s)||Rl(s))continue;i.push({key:vd(o),value:xf(s,t,n,r)})}catch(e){i.push({key:vd(o),value:{stringValue:pd}})}}return i}function Pf(e,t,n){return Ta({},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 Tf={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var If={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Ff=If.info;function Rf(e){try{return vd(String(e))}catch(e){return pd}}function Lf(e,t,n,r){var i,o=If[e.level||"info"]||Ff,s=o.text,a=o.number,u=(void 0===(i=Dl(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),Ml(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ml(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=Ta({},l),d=e.attributes;if(d){var f=[];try{f=Object.keys(d)}catch(e){f=[]}for(var h,p=Pa(f);!(h=p()).done;){var _=h.value,v=void 0;try{v=d[_]}catch(e){v=pd}Object.defineProperty(c,_,{value:v,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:a,severityText:s,body:{stringValue:Rf(e.body)},attributes:kf(c,n)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),Rl(e.trace_flags)||(g.flags=e.trace_flags),g}function Af(e,t,n){return Pf(e,t,n)}function Of(e,t,n,r){return{resourceLogs:[{resource:{attributes:kf(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Mf=function(){function e(e,t,n,r,i,o,s){var a;void 0===o&&(o=function(){return Promise.resolve()}),this._instance=e,this._config=t,this._logger=n,this._getContext=r,this._onReady=i,this._waitForStoragePersist=o,this._scopeName=s,this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._consecutiveFlushFailures=0,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a: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(ml.LogsQueue,[])},t.reset=function(){this._clearFlushTimer(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,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:Lf(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=Pa(Pl(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=Ca(Ra().m((function e(){var t=this;return Ra().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=Ca(Ra().m((function e(){var t,n,r,i,o,s,a,u,l,c,d,f;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),0!==(n=null!==(t=this._instance.getPersistedProperty(ml.LogsQueue))&&void 0!==t?t:[]).length){e.n=1;break}return e.a(2);case 1:r=n.length,i=0;case 2:if(0>=n.length||i>=r){e.n=9;break}return a=this._queueGeneration,this._evictedSinceAdvance=0,u=Math.min(n.length,this._maxBatchRecordsPerPost),l=n.slice(0,u),c=l.map((function(e){return e.record})),d=Of(c,this._buildResourceAttributes(),null!==(o=this._scopeName)&&void 0!==o?o:this._instance.getLibraryId(),this._instance.getLibraryVersion()),e.n=3,this._instance._sendLogsBatch(d);case 3:if(f=e.v,this._queueGeneration===a){e.n=4;break}return e.a(2);case 4:if("too-large"!==f.kind||1>=l.length){e.n=5;break}return this._maxBatchRecordsPerPost=Math.max(1,Math.floor(l.length/2)),this._logger.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,2);case 5:if("retry-later"!==f.kind){e.n=6;break}throw f.error;case 6:return"too-large"===f.kind?this._logger.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===f.kind&&this._config.maxBatchRecordsPerPost>this._maxBatchRecordsPerPost&&(this._maxBatchRecordsPerPost=Math.min(this._config.maxBatchRecordsPerPost,this._maxBatchRecordsPerPost+1)),e.n=7,this._persistQueueAdvance(l.length);case 7:if(n=null!==(s=this._instance.getPersistedProperty(ml.LogsQueue))&&void 0!==s?s:[],i+=l.length,"fatal"!==f.kind){e.n=8;break}throw f.error;case 8:e.n=2;break;case 9:return e.a(2)}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t._persistQueueAdvance=function(){var e=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:return r=Math.max(0,t-this._evictedSinceAdvance),i=null!==(n=this._instance.getPersistedProperty(ml.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(ml.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 Af(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(ml.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(ml.LogsQueue,n),this._maxBufferSize>n.length?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(e){var t=this;void 0===e&&(e=this._flushIntervalMs),this._flushTimer||(this._flushTimer=xd((function(){t._flushTimer=void 0,t._flushInBackground()}),e))},t._nextFlushDelay=function(){var e=Math.min(Math.max(0,this._consecutiveFlushFailures-1),6);return this._flushIntervalMs*Math.pow(2,e)},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(ml.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=Ca(Ra().m((function e(t){var n;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),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,Cd(n,t);case 3:return e.a(2)}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=Ca(Ra().m((function e(t){var n;return Ra().w((function(e){for(;;)switch(e.n){case 0:return n=this.flush(),e.n=1,Cd(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;this.flush().then((function(){e._consecutiveFlushFailures=0}),(function(t){e._consecutiveFlushFailures++,e._logger.error("PostHog logs flush failed:",t)})).finally((function(){!e._instance.isDisabled&&e._hasQueuedRecords()&&e._armFlushTimer(e._nextFlushDelay())}))},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},e}(),Df=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function qf(e){return String(e)+"000000"}function $f(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 Nf=function(){function e(e,t,n){this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,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})},t.flush=function(){var e=this,t=this._flushPromise,n=function(){var n=Ca(Ra().m((function n(){return Ra().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)}}(),r=n().finally((function(){e._flushPromise===r&&(e._flushPromise=null)}));return this._flushPromise=r,r},t.drainWindow=function(){if(0===this._series.size)return null;var e=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(e)},t.reset=function(){this._generation++,this._clearFlushTimer(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=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&&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?Ta({},t.attributes):void 0,r=$f(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=this._series.get(r);if(!i){if(!this._admitNewSeries())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this._series.set(r,i)}var o=this._typeByName.get(t.name);void 0===o?this._typeByName.set(t.name,t.type):o===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+o+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(i,t.value),this._armFlushTimer()}else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}},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._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":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Df.length+1).fill(0)});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,Df)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=Pa(Pl(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(){var e=this;this._flushTimer||(this._flushTimer=xd((function(){e._flushTimer=void 0,e.flush().catch((function(t){e._logger.error("Metrics flush failed:",t)}))}),this._config.flushIntervalMs))},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},t._doFlush=function(){var e=Ca(Ra().m((function e(){var t,n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(0!==this._series.size){e.n=1;break}return e.a(2);case 1:return t=this._series,this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,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: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._armFlushTimer(),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 Pf(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:kf(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i},t._buildMetrics=function(e){for(var t,n=qf(Date.now()),r=new Map,i=Pa(e.values());!(t=i()).done;){var o,s=t.value,a=$f(s.type,s.name,s.unit,void 0),u=r.get(a);u||(u=Ta({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=kf(null!==(o=s.attributes)&&void 0!==o?o:{},this._logger),c=qf(s.windowStartMs);if("count"===s.type){var d,f={attributes:l,startTimeUnixNano:c,timeUnixNano:n,asDouble:null!==(d=s.total)&&void 0!==d?d:0};u.sum.dataPoints.push(f)}else if("gauge"===s.type){var h,p={attributes:l,timeUnixNano:n,asDouble:null!==(h=s.last)&&void 0!==h?h:0};u.gauge.dataPoints.push(p)}else s.hist&&u.histogram.dataPoints.push({attributes:l,startTimeUnixNano:c,timeUnixNano:n,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:Df})}return Array.from(r.values())},t._mergeWindowBack=function(e){for(var t,n,r,i=Pa(e);!(r=i()).done;){var o=r.value,s=o[0],a=o[1],u=this._series.get(s);if(u)switch(u.windowStartMs=Math.min(u.windowStartMs,a.windowStartMs),u.type){case"count":u.total=(null!==(t=u.total)&&void 0!==t?t:0)+(null!==(n=a.total)&&void 0!==n?n:0);break;case"gauge":break;case"histogram":if(a.hist)if(u.hist){u.hist.count+=a.hist.count,u.hist.sum+=a.hist.sum,u.hist.min=Math.min(u.hist.min,a.hist.min),u.hist.max=Math.max(u.hist.max,a.hist.max);for(var l=0;u.hist.bucketCounts.length>l;l++)u.hist.bucketCounts[l]+=a.hist.bucketCounts[l]}else u.hist=a.hist}else this._admitNewSeries()&&this._series.set(s,a)}},e}();function Bf(e,t){if(e){var n=e.find((function(e){return e.type===t}));return null==n?void 0:n.value}}function Hf(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&Tl(n.then)&&n.then(void 0,(function(){}))}}}}var jf={DEBUG:!1,LIB_VERSION:"0.7.2",LIB_NAME:"browser-common"},Uf="u">typeof window?window:void 0,Vf="u">typeof globalThis?globalThis:Uf,zf=null==Vf?void 0:Vf.navigator,Wf=null==Vf?void 0:Vf.document,Gf=null==Vf?void 0:Vf.location,Qf=null==Vf?void 0:Vf.fetch,Kf=null!=Vf&&Vf.XMLHttpRequest&&"withCredentials"in new Vf.XMLHttpRequest?Vf.XMLHttpRequest:void 0,Zf=null==Vf?void 0:Vf.AbortController,Yf=null==Vf?void 0:Vf.CompressionStream,Jf=null==zf?void 0:zf.userAgent;function Xf(){return!(!Uf||!1===Uf.navigator.onLine)}var eh=function(e,t){var n=(void 0===t?{}:t).debugEnabled,r={_log:function(t){if(Uf&&(jf.DEBUG||Uf.POSTHOG_DEBUG||n)&&!Rl(Uf.console)&&Uf.console){for(var r=("__rrweb_original__"in Uf.console[t]?Uf.console[t].__rrweb_original__:Uf.console[t]),i=arguments.length,o=new Array(i>1?i-1:0),s=1;i>s;s++)o[s-1]=arguments[s];r.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 eh(e+" "+t,n)}};return r},th=eh("[PostHog.js]"),nh=th.createLogger;function rh(e,t){Pl(e)&&e.forEach(t)}function ih(e,t){if(!Ml(e))if(Pl(e))e.forEach(t);else if(Nl(e))e.forEach((function(e,n){return t(e,n)}));else for(var n in e)Cl.call(e,n)&&t(e[n],n)}var oh=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 sh(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 ah=function(e){try{return e()}catch(e){return}},uh=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){th.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),th.critical(e)}}},lh=function(e){var t={};return ih(e,(function(e,n){(Ll(e)&&e.length>0||Dl(e))&&(t[n]=e)})),t};var ch=["herokuapp.com","vercel.app","netlify.app"];function dh(e){var t=null==e?void 0:e.hostname;if(!Ll(t))return!1;for(var n,r=t.split(".").slice(-2).join("."),i=Pa(ch);!(n=i()).done;)if(r===n.value)return!1;return!0}function fh(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 hh(e){return"ph_toolbar_internal"===e.name}function ph(e){return"$survey_response_"+e}function _h(e,t){if(!t)return null;var n=e[ph(t)];return Pl(n)?[].concat(n):n}function vh(e,t,n){void 0===e&&(e={});var r={};return t.questions.forEach((function(t){if(!Rl(t.originalQuestionIndex)){var n,i=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,o=_h(e,t.id);Rl(o)||(r[i]=o)}})),Ta({$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:_h(e,t.id)}}))},e,r)}function gh(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 mh(e){return"string"==typeof e&&e.trim()?e.trim():null}function yh(e){return e.toLowerCase()}function bh(e,t,n){if(!e||!t)return null;var r=yh(t),i=Object.keys(e).find((function(e){return yh(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 yh(e)===o}));if(s)return null==n||n.debug("Found base language translation match: "+s+" (from "+t+")"),s}return null}var wh=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Sh(e,t,n){var r,i=bh(e.translations,t,n),o=Ta({},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),Rl(u.name)||(o.name=u.name,s=!0),o.appearance){for(var l,c=Ta({},o.appearance),d=Pa(wh);!(l=d()).done;){var f=l.value,h=u[f];Rl(h)||(c[f]=h,s=!0)}o.appearance=c}else(function(e){return wh.some((function(t){return!Rl(e[t])}))})(u)&&(s=!0)}var p=e.questions.map((function(e){return function(e,t,n){var r,i=bh(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=Ta({},e),a=!1;return Rl(o.question)||(s.question=o.question,a=!0),Rl(o.description)||(s.description=o.description,a=!0),Rl(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!Rl(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!Rl(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!Rl(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(e){return Pl(e.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:e,matchedKey:a?i:null,hasChanges:a}}(e,t,n)})),_=p.map((function(e){return e.question})),v=p.some((function(e){return e.hasChanges})),g=null;return i||(g=(null==(r=p.find((function(e){return e.matchedKey})))?void 0:r.matchedKey)||null),v&&(o.questions=_,s=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:s?i||g:null}}function kh(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function xh(e){var t;return kh(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Ch=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}},Eh=function(e){return e.toLowerCase()},Ph={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 Ch(t,e)}))}))},not_regex:function(e,t){return t.every((function(t){return e.every((function(e){return!Ch(t,e)}))}))},icontains:function(e,t){return t.map(Eh).some((function(t){return e.map(Eh).some((function(e){return t.includes(e)}))}))},not_icontains:function(e,t){return t.map(Eh).every((function(t){return e.map(Eh).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 Th(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=Ph[n.operator];return!!i&&i(n.values,[String(r)])}))}var Ih=nh("[Surveys]");function Fh(e){return!(!e.start_date||e.end_date)}function Rh(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Lh="seenSurvey_",Ah="inProgressSurvey_",Oh=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},Mh=function(e){return Oh(Lh,e)},Dh=function(e){try{var t=Mh(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Ih.error("Failed to persist survey seen state",e)}},qh=[ol.Popover,ol.Widget,ol.API],$h={ignoreConditions:!1,ignoreDelay:!1,displayType:dl},Nh="featureFlags",Bh="$people_distinct_id",Hh="distinct_id",jh="$device_id",Uh="$device_model",Vh="__alias",zh="$fbc",Wh="$fbc_persistence",Gh="__timers",Qh="$autocapture_disabled_server_side",Kh="$heatmaps_enabled_server_side",Zh="$exception_capture_enabled_server_side",Yh="$error_tracking_suppression_rules",Jh="$error_tracking_capture_extension_exceptions",Xh="$web_vitals_enabled_server_side",ep="$dead_clicks_enabled_server_side",tp="$product_tours_enabled_server_side",np="$logs_capture_enabled_server_side",rp="$web_vitals_allowed_metrics",ip="$session_recording_remote_config",op="$replay_sample_rate",sp="$replay_override_sampling",ap="$replay_override_linked_flag",up="$replay_override_url_trigger",lp="$replay_override_event_trigger",cp="$sesid",dp="$session_is_sampled",fp="$enabled_feature_flags",hp="$active_feature_flags",pp="$early_access_features",_p="$feature_flag_details",vp="$feature_flag_payloads",gp="$feature_flag_request_id",mp="$minimal_flag_called_events",yp="$override_feature_flags",bp="$override_feature_flag_payloads",wp="$stored_person_properties",Sp="$stored_group_properties",kp="$groups",xp="$surveys",Cp="$surveys_loaded_at",Ep="$surveys_activated",Pp="$surveys_activated_session",Tp="$surveys_activated_timestamps",Ip="ph_product_tours",Fp="$flag_call_reported",Rp="$flag_call_reported_session_id",Lp="$feature_flag_errors",Ap="$feature_flag_evaluated_at",Op="$user_state",Mp="$client_session_props",Dp="$capture_rate_limit",qp="$initial_campaign_params",$p="$initial_referrer_info",Np="$initial_person_info",Bp="$epp",Hp="$posthog_cookieless",jp="$cookieless_mode",Up="$sdk_debug_extensions_init_method",Vp="$sdk_debug_extensions_init_time_ms",zp="$sdk_debug_recording_script_not_loaded",Wp="PostHog loadExternalDependency extension not found.",Gp="on_reject",Qp="always",Kp="anonymous",Zp="identified",Yp="identified_only",Jp="visibilitychange",Xp="beforeunload",e_="$pageview",t_="$pageleave",n_="$identify",r_="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Dl(e)&&isFinite(e)&&Math.floor(e)===e});var i_=function(){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}(),o_=function(){function e(){this._timestamp=0,this._counter=0,this._random=new u_}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!Rl(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(Rl(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e=Date.now();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 i_.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}(),s_=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};Uf&&!Rl(Uf.crypto)&&crypto.getRandomValues&&(s_=function(e){return crypto.getRandomValues(e)});var a_,u_=function(){function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._buffer.length>this._cursor||(s_(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),l_=function(){return c_().toString()},c_=function(){return(a_||(a_=new o_)).generate()},d_=function(e,t){try{return JSON.stringify(e,(function(e,t){return"bigint"==typeof t?t.toString():t}),t)}catch(t){return gl(e)}},f_=function(e){var t=null==Wf?void 0:Wf.createElement("a");return Rl(t)?null:(t.href=e,t)},h_=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(!Pl(n)||2>n.length)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){th.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},p_=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++){var d=u[c].split("=");Pl(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(u[c]))}var f=a;return null!=s&&(f+="?"+l.join("&")),null!=i&&(f+="#"+i),f},__=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},v_=function(e,t){return e>=t&&Xf()},g_=function(e,t,n,r){if(0===e){if(Xf()){var i=t+1;return i===n&&r(),i}return t}return 0};function m_(e,t,n){return d_({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}function y_(e,t){var n,r=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!Tl(r))return t;try{var i=r(t);return Ll(i)&&i?i:t}catch(e){return th.error("Error in get_current_url, falling back to window.location.href",e),t}}function b_(e){var t,n=null==Uf||null==(t=Uf.location)?void 0:t.href;return Rl(n)?void 0:y_(e,n)}var w_=function(e){if(Wf){try{for(var t=e+"=",n=Wf.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}},S_="",k_=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var x_=null,C_={_is_supported:function(){if(!Ol(x_))return x_;if(x_=!1,Wf)try{var e="__ph_cookie_support_"+l_();C_._set(e,"xyz"),x_='"xyz"'===w_(e),C_._remove(e)}catch(e){x_=!1}return x_},_error:function(e){th.error("cookieStore error: "+e)},_get:w_,_parse:function(e){var t;try{t=JSON.parse(C_._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(!Wf)return!1;try{var o="",s="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Wf),S_)return S_;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_"+l_();!S_&&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",S_=o)}return S_}(e);if(!n){var r=function(e){var t=e.match(k_);return t?t[0]:""}(e);r!==n&&th.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(Wf.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&&th.warn("cookieStore warning: large cookie, len="+l.length),Wf.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Wf&&Wf.cookie)try{C_._set(e,"",-1,t)}catch(e){return}}},E_=null,P_={_is_supported:function(){if(!Ol(E_))return E_;var e=!0;if(Rl(Uf))e=!1;else try{var t="__mplssupport__";P_._set(t,"xyz"),'"xyz"'!==P_._get(t)&&(e=!1),P_._remove(t)}catch(t){e=!1}return e||th.error("localStorage unsupported; falling back to cookie store"),E_=e,e},_error:function(e){th.error("localStorage error: "+e)},_get:function(e){try{return null==Uf?void 0:Uf.localStorage.getItem(e)}catch(e){P_._error(e)}return null},_parse:function(e){try{return JSON.parse(P_._get(e))||{}}catch(e){}return null},_set:function(e,t){try{return null==Uf||Uf.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){P_._error(e)}return!1},_remove:function(e){try{null==Uf||Uf.localStorage.removeItem(e)}catch(e){P_._error(e)}}},T_=[wp,hp,fp,_p,vp,gp,Ap,Lp,Fp],I_=[jh,Hh,cp,dp,Bp,Np,Wh,Op],F_=function(e){return e+"_cpm"},R_=["__proto__","constructor","prototype"],L_=function(e){if(!Il(e))return{};var t={};return Object.keys(e).forEach((function(n){-1===R_.indexOf(n)&&(t[n]=e[n])})),t},A_=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(I_,t).forEach((function(t){var r=e[t];Rl(r)||Ol(r)||""===r||(n[t]=r)})),n},O_=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)},M_=function(e,t){return{p:t,f:O_(JSON.stringify(e))}},D_=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=C_._parse(F_(e)),r=(null==n?void 0:n.f)===O_(t)&&Pl(n.p);return{properties:r?n.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},q_=function(e,t){return t+"|"+(C_._get(F_(e))||"")},$_={},N_={_is_supported:function(){return!0},_error:function(e){th.error("memoryStorage error: "+e)},_get:function(e){return e in $_?$_[e]:null},_parse:function(e){return e in $_?$_[e]:null},_set:function(e,t){return $_[e]=t,!0},_remove:function(e){delete $_[e]}},B_=null,H_={_is_supported:function(){if(!Ol(B_))return B_;if(B_=!0,Rl(Uf))B_=!1;else try{var e="__support__";H_._set(e,"xyz"),'"xyz"'!==H_._get(e)&&(B_=!1),H_._remove(e)}catch(e){B_=!1}return B_},_error:function(e){th.error("sessionStorage error: ",e)},_get:function(e){try{return null==Uf?void 0:Uf.sessionStorage.getItem(e)}catch(e){H_._error(e)}return null},_parse:function(e){try{return JSON.parse(H_._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Uf||Uf.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){H_._error(e)}return!1},_remove:function(e){try{null==Uf||Uf.sessionStorage.removeItem(e)}catch(e){H_._error(e)}}},j_=nh("[Stylesheet Loader]"),U_=Uf,V_=Wf,z_="#020617",W_={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:rl.Right,widgetType:nl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:z_,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},G_=[rl.Center,rl.Left,rl.Right];function Q_(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 K_(e){var t;void 0===e&&(e=W_.backgroundColor),"#"===e[0]&&(t=Q_(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=Q_(n)),!t)return z_;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?z_:"white"}return z_}var Z_=function(e,t,n){var r=_v(e),i=V_.querySelector("."+r);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};var o=V_.createElement("div");!function(e,t,n){var r=Ta({},W_,n),i=e.style,o=!G_.includes(r.position)||t===ol.Widget&&(null==n?void 0:n.widgetType)===nl.Tab;i.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}(r.fontFamily)),i.setProperty("--ph-survey-box-padding",r.boxPadding),i.setProperty("--ph-survey-max-width",r.maxWidth),i.setProperty("--ph-survey-z-index",r.zIndex),i.setProperty("--ph-survey-border-color",r.borderColor),o?(i.setProperty("--ph-survey-border-radius",r.borderRadius),i.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(i.setProperty("--ph-survey-border-bottom","none"),i.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),i.setProperty("--ph-survey-background-color",r.backgroundColor),i.setProperty("--ph-survey-box-shadow",r.boxShadow),i.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),i.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),i.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||K_(r.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),i.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",K_(r.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||K_(r.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),i.setProperty("--ph-widget-color",r.widgetColor),i.setProperty("--ph-widget-text-color",K_(r.widgetColor)),i.setProperty("--ph-widget-z-index",r.zIndex);var s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),a=s||r.inputBackground;s||"white"!==r.backgroundColor||(a="#f8f8f8"),i.setProperty("--ph-survey-input-background",a);var u=(null==n?void 0:n.inputTextColor)||K_(a);i.setProperty("--ph-survey-input-text-color",u),i.setProperty("--ph-survey-rating-text-color",u),i.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),i.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),i.setProperty("--ph-survey-outline-color",r.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 Tl(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return i&&(r=i(r)),r||(j_.error("prepare_external_dependency_stylesheet returned null"),null)}(V_,':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)}}',e);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 V_.body.appendChild(o),{shadow:s,isNewlyCreated:!0}},Y_=function(e){var t,n,r,i=e.responses,o=e.survey,s=e.surveySubmissionId,a=e.posthog,u=e.isSurveyCompleted,l=e.properties,c=e.surveyLanguage,d=e.questionSnapshots;a?(Dh(o),a.capture(ll.SENT,Ta(((t={})[cl.SURVEY_NAME]=o.name,t[cl.SURVEY_ID]=o.id,t[cl.SURVEY_ITERATION]=o.current_iteration,t[cl.SURVEY_ITERATION_START_DATE]=o.current_iteration_start_date,t[cl.SURVEY_SUBMISSION_ID]=s,t[cl.SURVEY_COMPLETED]=u,t),c&&((n={})[cl.SURVEY_LANGUAGE]=c,n),{sessionRecordingUrl:null==a.get_session_replay_url?void 0:a.get_session_replay_url()},vh(i,o,d),l,{$set:(r={},r[gh(o,"responded")]=!0,r)})),u&&(U_.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:o.id}})),pv(o),a.reloadFeatureFlags())):Ih.error("[survey sent] event not captured, PostHog instance not found.")},J_=function(e,t,n){var r,i,o,s;return Ta(((r={})[cl.SURVEY_NAME]=e.name,r[cl.SURVEY_ID]=e.id,r[cl.SURVEY_ITERATION]=e.current_iteration,r[cl.SURVEY_ITERATION_START_DATE]=e.current_iteration_start_date,r[cl.SURVEY_PARTIALLY_COMPLETED]=(void 0===(s=null==t?void 0:t.responses)&&(s={}),Object.values(s).some((function(e){return!Ml(e)}))),r),(null==t?void 0:t.surveyLanguage)&&((i={})[cl.SURVEY_LANGUAGE]=t.surveyLanguage,i),((o={sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()})[cl.SURVEY_SUBMISSION_ID]=null==t?void 0:t.surveySubmissionId,o),vh(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots))},X_=function(e,t,n,r){var i,o;if(t){if(!n){var s=fv(e),a=s?s.surveyLanguage:r;t.capture(ll.DISMISSED,Ta({},J_(e,s,t),a&&((i={})[cl.SURVEY_LANGUAGE]=a,i),{$set:(o={},o[gh(e,"dismissed")]=!0,o)})),pv(e),Dh(e),U_.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Ih.error("[survey dismissed] event not captured, PostHog instance not found.")},ev=function(e,t){if(t){var n=function(e){return Oh("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(n))return}catch(e){return}var r=fv(e);if(r){try{localStorage.setItem(n,"true")}catch(e){}t.capture(ll.ABANDONED,J_(e,r,t),{transport:"sendBeacon"})}}else Ih.error("[survey abandoned] event not captured, PostHog instance not found.")},tv=function(e){return e.map((function(e){return{sort:Math.floor(10*Math.random()),value:e}})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.value}))},nv=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},rv=function(e){var t=e.map((function(e){return e.id}));return t.every((function(e){return!!e}))?t:void 0},iv=function(e,t){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=Pa(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?nv(e.questions,tv(e.questions)):e.questions;var n},ov=function(e){return xh(e)||hv(e)},sv=function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__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,uu(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ka++,t.__={isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},onPreviewBack:function(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null},t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}(),av=function(){return Vu(sv)},uv=function(e){var t=e.children,n=e.style;return function(e,t,n){var r,i,o,s,a=eu({},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?Ma.call(arguments,2):n),ru(e.type,a,r||e.key,i||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n})};function lv(e,t){var n,r;if(null==(n=e.conditions)||!n.url)return!0;var i=b_(t);if(!i)return!1;var o=[e.conditions.url],s=function(e){return null!=e?e:"icontains"}(null==(r=e.conditions)?void 0:r.urlMatchType);return Ph[s](o,[i])}var cv=function(e){return Oh(Ah,e)},dv=function(e,t){try{localStorage.setItem(cv(e),JSON.stringify(t))}catch(e){Ih.error("Error setting in-progress survey state in localStorage",e)}},fv=function(e){try{var t=localStorage.getItem(cv(e));if(t)return JSON.parse(t)}catch(e){Ih.error("Error getting in-progress survey state from localStorage",e)}return null},hv=function(e){var t=fv(e);return!Ml(null==t?void 0:t.surveySubmissionId)},pv=function(e){try{localStorage.removeItem(cv(e))}catch(e){Ih.error("Error clearing in-progress survey state from localStorage",e)}};function _v(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function vv(e,t,n){if(void 0===t&&(t=rl.Right),e===ol.ExternalSurvey)return{};switch(t){case rl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case rl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case rl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case rl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case rl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case rl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case rl.Left:return{left:"30px"};case rl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===ol.Widget&&n===nl.Tab?"60px":"30px"}}}var gv=0;function mv(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:--gv,__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 Da.vnode&&Da.vnode(l),l}var yv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),bv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),wv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),Sv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),kv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:mv("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"})}),xv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:mv("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"})}),Cv=mv("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:mv("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"})}),Ev=function(e){var t=(void 0===e?{}:e).fill,n=void 0===t?"currentColor":t;return mv("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:n,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[mv("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),mv("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:n})]})},Pv=mv("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[mv("g",{"clip-path":"url(#clip0_2415_6911)",children:[mv("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:mv("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),mv("g",{mask:"url(#mask0_2415_6911)",children:[mv("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),mv("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),mv("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),mv("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),mv("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),mv("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),mv("defs",{children:mv("clipPath",{id:"clip0_2415_6911",children:mv("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Tv(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 mv("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Pv]})}function Iv(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=Vu(sv).isPreviewMode,d=!!u&&!!l,f=!a&&mv("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){o&&(null==Uf||Uf.open(o)),c?null==s||s():i()},children:t});return mv("div",{className:"bottom-section",children:[d?mv("div",{className:"form-buttons form-buttons-with-back",children:[mv("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:r.backButtonText||"Back"}),f]}):f,!r.whiteLabel&&mv(Tv,{urlParams:{utm_source:"survey-footer"}})]})}function Fv(e){var t=e.question,n=e.forceDisableHtml;return mv("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[mv(t.type===sl.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&uv({component:nu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function Rv(e){return mv("button",{className:"form-cancel",onClick:e.onClick,disabled:Vu(sv).isPreviewMode,"aria-label":"Close survey",type:"button",children:Ev({fill:"black"})})}mv("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:mv("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Lv=Uf;function Av(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=Vu(sv).isPopup;return Hu((function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),s())};return fh(Lv,"keydown",e),function(){Lv.removeEventListener("keydown",e)}}),[s]),mv("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==o.hideCancelButton&&mv(Rv,{onClick:function(){return s()}}),mv("h3",{className:"thank-you-message-header",children:t}),n&&uv({component:nu("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&mv(Iv,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})}function Ov(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onStart,a=Vu(sv),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return mv("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==o.hideCancelButton&&mv(Rv,{onClick:function(){return l()}}),t&&mv("h3",{className:"intro-screen-header",children:t}),n&&uv({component:nu("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!i&&"text"!==r}),mv(Iv,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:s,onPreviewSubmit:function(){return u(null)}})]})}var Mv=function(e){return Pl(e)&&e.every((function(e){return Ll(e)}))};function Dv(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=av().isPreviewMode,d=ju(null),f=Bu((function(){return Ll(a)?a:""})),h=f[0],p=f[1],_=null==r?void 0:r.disableAutofocus;Hu((function(){_||setTimeout((function(){var e;c||null==(e=d.current)||e.focus()}),100)}),[c,_]);var v="surveyQuestion"+s,g=Uu((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=Pa(t);!(s=a()).done;){var u=s.value;switch(u.type){case bl: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 wl: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]),m=Bf(t.validation,bl),y=Bf(t.validation,wl),b=Uu((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}(m,y)}),[m,y]),w=function(){g||i(h.trim())},S=function(){g||o(h.trim())};return mv(iu,{children:[mv("div",{className:"question-container",children:[mv(Fv,{question:t,forceDisableHtml:n,htmlFor:v}),mv("textarea",{ref:d,id:v,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:m,maxLength:y,onInput:function(e){p(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||g||(e.preventDefault(),c?S():w())},value:h}),b&&mv("div",{className:"validation-hint",children:b})]}),mv(Iv,{text:t.buttonText||"Submit",submitDisabled:!!g,appearance:r,onSubmit:w,onPreviewSubmit:S,canGoBack:u,onBack:l})]})}function qv(e){var t=e.question,n=e.appearance,r=e.onSubmit,i=e.onPreviewSubmit,o=e.canGoBack,s=e.onBack;return mv(iu,{children:[mv("div",{className:"question-container",children:mv(Fv,{question:t,forceDisableHtml:e.forceDisableHtml})}),mv(Iv,{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 $v(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=Bu((function(){return Dl(u)?u:Pl(u)&&u.length>0&&Dl(parseInt(u[0]))?parseInt(u[0]):Ll(u)&&Dl(parseInt(u))?parseInt(u):null})),p=h[0],_=h[1],v="emoji"===n.display&&2===n.scale,g=av().isPreviewMode,m=function(e){return g?a(e):s(e)};return mv(iu,{children:[mv("div",{className:"question-container",children:[mv(Fv,{question:n,forceDisableHtml:r}),mv("div",{className:"rating-section",children:[mv("div",{className:"rating-options",children:["emoji"===n.display&&mv("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Vv[n.scale])?void 0:t.map((function(e,t){return mv("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&&mv("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-f+1)+", minmax(0, 1fr))"},children:zv(n.scale).map((function(e,t){return mv(Nv,{displayQuestionIndex:i,active:p===e,appearance:o,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)}))})]}),!v&&mv("div",{className:"rating-text",children:[mv("div",{children:n.lowerBoundLabel}),mv("div",{children:n.upperBoundLabel})]})]})]}),mv(Iv,{text:n.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Ol(p)&&!n.optional,appearance:o,onSubmit:function(){return s(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function Nv(e){var t=e.num,n=e.setActiveNumber;return mv("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 Bv(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=ju(null),d=Uu((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=nv(t,tv(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),f=Bu((function(){return function(e,t){return Ll(e)||Mv(e)?e:t===sl.SingleChoice?null:[]}(a,t.type)})),h=f[0],p=f[1],_=Bu((function(){return function(e,t){if(Ll(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Mv(e)){var n=e.find((function(e){return!t.includes(e)}));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}}(a,d)})),v=_[0],g=_[1],m=av().isPreviewMode,y=t.type===sl.SingleChoice,b=t.type===sl.MultipleChoice,w=t.skipSubmitButton&&y&&!t.hasOpenChoice,S=function(e,t){if(t){var n=!v.isSelected;return g((function(e){return Ta({},e,{isSelected:n,inputValue:n?e.inputValue:""})})),y&&p(""),void(n&&setTimeout((function(){var e;return null==(e=c.current)?void 0:e.focus()}),75))}if(y)return p(e),g((function(e){return Ta({},e,{isSelected:!1,inputValue:""})})),void(w&&(o(e),m&&s(e)));b&&Pl(h)&&(h.includes(e)?p(h.filter((function(t){return t!==e}))):p([].concat(h,[e])))},k=function(e){e.stopPropagation();var t=e.currentTarget.value;g((function(e){return Ta({},e,{inputValue:t})})),y&&p(t)},x=function(e){e.stopPropagation(),"Enter"!==e.key||C()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),g((function(e){return Ta({},e,{isSelected:!1,inputValue:""})})),y&&p(null))},C=function(){return!(t.optional||!Ol(h)&&(!Pl(h)||v.isSelected||0!==h.length)&&(!v.isSelected||""!==v.inputValue.trim()))},E=function(){v.isSelected&&b?Pl(h)&&(m?s([].concat(h,[v.inputValue])):o([].concat(h,[v.inputValue]))):m?s(h):o(h)};return mv(iu,{children:[mv("div",{className:"question-container",children:[mv(Fv,{question:t,forceDisableHtml:n}),mv("fieldset",{className:"multiple-choice-options limit-height",children:[mv("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),d.map((function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,o="surveyQuestion"+r+"Choice"+n,s=o+"Open",a=i?v.isSelected:y?h===e:Pl(h)&&h.includes(e);return mv("label",{className:i?"choice-option-open":"",children:[mv("div",{className:"response-choice",children:[mv("input",{type:y?"radio":"checkbox",name:o,checked:a,onChange:function(){return S(e,i)},id:o,"aria-controls":s}),mv("span",{children:i?e+":":e})]}),i&&mv("input",{type:"text",ref:c,id:s,name:"question"+r+"Open",value:v.inputValue,onKeyDown:x,onInput:k,onClick:function(t){v.isSelected||S(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)}))]})]}),mv(Iv,{text:t.buttonText||"Submit",submitDisabled:C(),appearance:i,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:w,canGoBack:u,onBack:l})]})}var Hv=[1,2,3,4,5],jv=[1,2,3,4,5,6,7],Uv=[0,1,2,3,4,5,6,7,8,9,10],Vv={2:[xv,Cv],3:[wv,bv,yv],5:[Sv,wv,bv,yv,kv]};function zv(e){switch(e){case 5:default:return Hv;case 7:return jv;case 10:return Uv}}var Wv=nh("[Surveys]");function Gv(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?al.End:o;if(i.branching.type===al.End)return al.End;if(i.branching.type===al.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===al.ResponseBased){if(i.type===sl.SingleChoice){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];return Number.isInteger(u)?u:u===al.End?al.End:o}}else if(i.type===sl.Rating){var l;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];return Number.isInteger(d)?d:d===al.End?al.End:o}}return o}return Wv.warn("Falling back to next question index due to unexpected branching type"),o}var Qv="__POSTHOG_TOOLBAR__",Kv="https?://(.*)",Zv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Yv=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Zv),Jv="<masked>",Xv=["li_fat_id"];function eg(e,t,n){if(!Wf)return{};var r,i=t?[].concat(Zv,n||[]):[],o=tg(p_(Wf.URL,i,Jv),e),s=(r={},ih(Xv,(function(e){var t=w_(e);r[e]=t||null})),r);return oh(s,o)}function tg(e,t){var n=Yv.concat(t||[]),r={};return ih(n,(function(t){var n=h_(e,t);r[t]=n||null})),r}function ng(e){var t=function(e){return e?0===e.search(Kv+"google.([^/?]*)")?"google":0===e.search(Kv+"bing.com")?"bing":0===e.search(Kv+"yahoo.com")?"yahoo":0===e.search(Kv+"duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!Ol(t)){r.$search_engine=t;var i=Wf?h_(Wf.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function rg(){return navigator.language||navigator.userLanguage}var ig="$direct";function og(){return(null==Wf?void 0:Wf.referrer)||ig}function sg(e,t,n){void 0===n&&(n=!1);var r=e?[].concat(Zv,t||[]):[],i=n?kd(null==Gf?void 0:Gf.href):null==Gf?void 0:Gf.href,o=null==i?void 0:i.substring(0,1e3);return{r:og().substring(0,1e3),u:o?p_(o,r,Jv):void 0}}function ag(e,t){var n;void 0===t&&(t=!1);var r=e.r,i=e.u,o=t?kd(i):i,s={$referrer:r,$referring_domain:null==r?void 0:r==ig?ig:null==(n=f_(r))?void 0:n.host};if(o){s.$current_url=o;var a=f_(o);s.$host=null==a?void 0:a.host,s.$pathname=null==a?void 0:a.pathname;var u=tg(o);oh(s,u)}if(r){var l=ng(r);oh(s,l)}return s}function ug(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function lg(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var cg=nh("[SurveyTranslations]");function dg(e,t){var n=function(e){return function(e,t){var n=e.storedPersonProperties,r=e.locale,i=mh(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?mh(e.language):null}(n);if(o)return null==t||t.info("Using person property language: "+o),o;var s=mh(r);return s?(null==t||t.info("Using detected locale: "+s),s):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Tl(e.get_property)?e.get_property(wp):void 0,locale:rg()},cg)}(t);if(!n)return cg.info("No user language detected"),{survey:e,language:null};var r=Sh(e,n,cg);return{survey:r.survey,language:r.matchedKey}}var fg=-1,hg=Uf,pg=Wf,_g="ph:show_survey_widget",vg="PHWidgetSurveyClickListener";function gg(e,t){try{var n=e.getBoundingClientRect(),r=hg.innerHeight,i=hg.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:W_.zIndex}}catch(e){return Ih.warn("Failed to calculate trigger position:",e),null}}var mg=function(){function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTargets=new Map,this._prefillHandledSurveys=new Set,this._currentLanguage=null,this._surveyIsRendered=!1,this._languageChangeListener=null,this._unsubscribeFeatureFlags=null,this._surveyPopupProps=null,this.handlePageUnload=function(){var e=t._posthog.get_property(xp);if(e)for(var n,r=Pa(e);!(n=r()).done;){var i=n.value;hv(i)&&ev(i,t._posthog)}},this.handlePopoverSurvey=function(e,n,r){var i,o,s,a,u,l=(void 0===r?{}:r).resumeDelayFromActivation,c=void 0!==l&&l,d=t._translateSurveyForRendering(e),f=d.survey,h=d.language;t._currentLanguage=h,t._surveyPopupProps=null,t._displayOptions=n;var p=t._applyDisplayOverrides(f,n);t._clearSurveyTimeout(p.id);var _=null!=n?n:{},v=_.properties,g=_.initialResponses,m=!(!g||0>=Object.keys(g).length)&&t._handleInitialResponses(p,g,v,h);if(!m||null!=(i=p.appearance)&&i.displayThankYouMessage){t._addSurveyToFocus(p);var y={};if((null==(o=p.appearance)?void 0:o.position)===rl.NextToTrigger&&null!=(s=p.appearance)&&s.widgetSelector){var b,w=pg.querySelector(p.appearance.widgetSelector);w&&(y=gg(w,parseInt((null==(b=p.appearance)?void 0:b.maxWidth)||W_.maxWidth))||{})}var S=(null==(a=p.appearance)?void 0:a.surveyPopupDelaySeconds)||0,k=Z_(p,t._posthog).shadow;t._renderedTargets.set(k,k.host);var x={posthog:t._posthog,survey:p,removeSurveyFromFocus:t._removeSurveyFromFocus,properties:v,style:y,isSurveyCompleted:m,skipShownEvent:null==n?void 0:n.skipShownEvent,surveyLanguage:h};if(t._surveyPopupProps=x,0>=S)return t._surveyIsRendered=!0,Cu(mv(kg,Ta({},x)),k);var C=function(){if(!t._shouldDisplaySurvey(p))return Ih.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),t._removeSurveyFromFocus(p);!function(){t._surveyIsRendered=!0;var r=t._translateSurveyForRendering(e),i=r.survey,o=r.language;t._currentLanguage=o;var s=t._applyDisplayOverrides(i,n),a=Ta({},x,{survey:s,surveyLanguage:o});t._surveyPopupProps=a,Cu(mv(kg,Ta({},a,{survey:Ta({},s,{appearance:Ta({},s.appearance,{surveyPopupDelaySeconds:0})})})),k)}()},E=c?null==(u=t._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,P=Dl(E)?Math.max(0,Date.now()-E):0,T=Math.max(0,1e3*S-P);if(0>=T)return C();var I=hg.setTimeout((function(){t._surveyTimeouts.delete(p.id),C()}),T);t._surveyTimeouts.set(p.id,I)}},this._handleWidget=function(e){var n=t._translateSurveyForRendering(e),r=n.survey,i=n.language,o=Z_(r,t._posthog),s=o.shadow,a=o.isNewlyCreated;t._renderedTargets.set(s,s.host),a&&Cu(mv(Cg,{posthog:t._posthog,survey:r,surveyLanguage:i},e.id),s)},this._detachWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute(vg),t._widgetSelectorListeners.delete(e),Ih.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._detachWidgetSelectorListener(e.id))},this._isWidgetSurveyOpen=function(e){try{var t,n=pg.querySelector(_v(e,!0));return!(null==n||null==(t=n.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,n){var r=pg.querySelector(n),i=t._widgetSelectorListeners.get(e.id);if(r){if(t._handleWidget(e),i){if(r===i.element)return;Ih.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._detachWidgetSelectorListener(e.id)}if(!r.hasAttribute(vg)){var o=function(t){var n,r;t.stopPropagation();var i=(null==(n=e.appearance)?void 0:n.position)===rl.NextToTrigger?gg(t.currentTarget,parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||W_.maxWidth)):{};hg.dispatchEvent(new CustomEvent(_g,{detail:{surveyId:e.id,position:i}}))};fh(r,"click",o),r.setAttribute(vg,"true"),t._widgetSelectorListeners.set(e.id,{element:r,listener:o,survey:e}),Ih.info("Attached click listener for feedback button survey "+e.id)}}else i&&t._removeWidgetSelectorListener(e)},this.renderPopover=function(e){var n=t._translateSurveyForRendering(e),r=n.survey,i=n.language,o=Z_(r,t._posthog).shadow;t._renderedTargets.set(o,o.host),Cu(mv(kg,{posthog:t._posthog,survey:r,removeSurveyFromFocus:t._removeSurveyFromFocus,surveyLanguage:i}),o)},this.renderSurvey=function(e,n,r){var i,o=t._translateSurveyForRendering(e),s=o.survey,a=o.language,u=!1;null!=(i=t._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(u=t._handleUrlPrefill(s,a,r)),Cu(mv(kg,{posthog:t._posthog,survey:s,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:u,surveyLanguage:a}),n)},this.getActiveMatchingSurveys=function(e,n){var r;void 0===n&&(n=!1),null==(r=t._posthog)||null==(r=r.surveys)||r.getSurveys((function(n){var r=n.filter((function(e){return t._shouldDisplaySurvey(e)}));e(r)}),n)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((function(e){for(var n=e.filter((function(e){return e.type===ol.Popover||e.type===ol.Widget})),r=new Set(n.map((function(e){return e.id}))),i=0,o=Array.from(t._surveyTimeouts.keys());o.length>i;i++){var s=o[i];r.has(s)||t.cancelSurvey(s)}var a=t._sortSurveysByAppearanceDelay(n),u=new Set;a.forEach((function(e){if(e.type===ol.Widget){var n,r,i,o;if((null==(n=e.appearance)?void 0:n.widgetType)===nl.Tab)return void t._handleWidget(e);(null==(r=e.appearance)?void 0:r.widgetType)===nl.Selector&&null!=(i=e.appearance)&&i.widgetSelector&&(u.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector))}Ol(t._surveyInFocus)&&e.type===ol.Popover&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})})),t._widgetSelectorListeners.forEach((function(e){var n=e.survey;u.has(n.id)||t._removeWidgetSelectorListener(n)}))}),e)},this._addSurveyToFocus=function(e){Ol(t._surveyInFocus)||Ih.error("Survey "+t._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&Ih.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),t._clearSurveyTimeout(e.id),t._surveyInFocus=null,t._currentLanguage=null,t._surveyIsRendered=!1,t._surveyPopupProps=null,t._displayOptions=void 0,t._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null,this._languageChangeListener=function(){return t._onLanguageChange()},fh(hg,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=e.onFeatureFlags((function(){return t._onLanguageChange()}))}var t=e.prototype;return t._onLanguageChange=function(){var e=this;if(!Ol(this._surveyInFocus)){var t=this._posthog.get_property(xp),n=null==t?void 0:t.find((function(t){return t.id===e._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=Z_(s,this._posthog).shadow;Cu(mv(kg,Ta({},this._surveyPopupProps,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:o})),a)}}}},t._applyDisplayOverrides=function(e,t){return null!=t&&t.position||null!=t&&t.selector?Ta({},e,{appearance:Ta({},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)&&(Ih.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.setAutomaticDisplayDispose=function(e){this._automaticDisplayDispose=e},t.dispose=function(){var e,t=this;null==(e=this._automaticDisplayDispose)||e.call(this),this._automaticDisplayDispose=void 0,this._languageChangeListener&&(hg.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){Cu(null,t),null==e||e.remove()})),this._renderedTargets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort((function(e,t){var n,r,i=hv(e),o=hv(t);if(i&&!o)return-1;if(!i&&o)return 1;var s=e.schedule===ul,a=t.schedule===ul;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 dg(e,this._posthog)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(e){var t={},n=!1,r=e.replace(/^\?/,"");if(!r)return{params:t,autoSubmit:n};for(var i,o=Pa(r.split("&"));!(i=o()).done;){var s=i.value.split("="),a=s[0],u=s[1];if(a&&!Rl(u)){var l=decodeURIComponent(a),c=decodeURIComponent(u);if("auto_submit"!==l||"true"!==c){var d=l.match(/^q(\d+)$/);if(d){var f=parseInt(d[1],10);t[f]||(t[f]=[]),t[f].push(c)}}else n=!0}}return{params:t,autoSubmit:n}}(hg.location.search),i=r.params;if(0===Object.keys(i).length)return!1;Ih.info("[Survey Prefill] Detected URL prefill parameters");var o=this._processPrefillData(e,i,t);return!!o&&(this._autoSubmitPrefilledResponses(e,o,n,t),this._prefillHandledSurveys.add(e.id),o.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)&&Y_({responses:s?i:a,survey:e,surveySubmissionId:o,posthog:this._posthog,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])]=Pl(u)?u.map(String):[String(u)]}Ih.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=ph(e.id);try{switch(e.type){case sl.SingleChoice:if(!e.choices||0===e.choices.length)return void th.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 th.warn("[Survey Prefill] Invalid choice index for q"+r+": "+i[0]);n[o]=e.choices[s];break;case sl.MultipleChoice:if(!e.choices||0===e.choices.length)return void th.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 th.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&&th.warn("[Survey Prefill] Removed duplicate choices for q"+r),n[o]=u;break;case sl.Rating:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void th.warn("[Survey Prefill] Invalid rating for q"+r+": "+i[0]+" (scale: 0-"+c+")");n[o]=l;break;default:th.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){th.error("[Survey Prefill] Error converting q"+r+":",e)}}})),n}(e,t);if(0===Object.keys(r).length)return Ih.warn("[Survey Prefill] No valid responses after conversion"),null;var i=l_(),o=Object.keys(t).map((function(e){return parseInt(e,10)})),s=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=ph(u.id);Rl(n[l])||(i[l]=n[l])}o.push(r);var c=Gv(e,r,u.id?n[ph(u.id)]:null);if(c===al.End)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:o};r=c}return{startQuestionIndex:r,skippedResponses:i,skippedIndices:o}}(e,o,r),a=s.startQuestionIndex,u=s.skippedResponses,l=s.skippedIndices,c=a>=e.questions.length;return dv(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:a,questionOrder:rv(e.questions),visitedIndices:l,surveyLanguage:n}),Ih.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:a,isSurveyCompleted:c,skippedResponses:u}}catch(e){return Ih.error("[Survey Prefill] Error handling prefill:",e),null}},t._isSurveyFeatureFlagEnabled=function(e,t){if(void 0===t&&(t=void 0),!e)return!0;var n=this._featureFlags,r=!(null==n||!n.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),i=!0;return t&&(i=(null==n?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),r&&i},t._isSurveyConditionMatched=function(e){return!e.conditions||lv(e,this._posthog)&&function(e){var t,n;return function(e,t){var n,r,i;if(!e||0===e.length)return!0;if(!Jf)return!1;var o=ud(Jf,{userAgentDataPlatform:null==zf||null==(n=zf.userAgentData)?void 0:n.platform,maxTouchPoints:null==zf?void 0:zf.maxTouchPoints,screenWidth:null==Uf||null==(r=Uf.screen)?void 0:r.width,screenHeight:null==Uf||null==(i=Uf.screen)?void 0:i.height,devicePixelRatio:null==Uf?void 0:Uf.devicePixelRatio});return Ph[null!=t?t:"icontains"](e,[o])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==V_||!V_.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return ov(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._featureFlags)&&t.hasLoadedFlags?{satisfied:this._isSurveyFeatureFlagEnabled(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(!Fh(e))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+e.end_date,r;if(!qh.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,t){if(!e||!t)return!0;var n="string"==typeof t?new Date(t):t,r=new Date,i=Math.abs(r.getTime()-n.getTime());return Math.ceil(i/864e5)>e}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays,P_._get("lastSeenSurveyDate"))?function(e){return!!P_._get(Mh(e))&&!ov(e)}(e)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(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.checkSurveyRenderability=function(e){var t=this.checkSurveyEligibility(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;if(!kh(e)&&!Rh(e))return!0;var n=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==n||!n.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=pg.querySelector(_v(e,!0));null!=t&&t.shadowRoot&&(Cu(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Ih.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,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this),onLanguageChange:this._onLanguageChange.bind(this),currentLanguage:this._currentLanguage,surveyIsRendered:this._surveyIsRendered}},Ea(e,[{key:"_featureFlags",get:function(){var e,t,n;return null!==(e=null==(t=(n=this._posthog).getExtension)?void 0:t.call(n,Nh))&&void 0!==e?e:this._posthog.featureFlags}}])}();function yg(e,t){if(pg&&hg){var n,r=new mg(e);if(e.config.disable_surveys_automatic_display)return Ih.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===t)return Ih.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var i=function(){Rl(n)&&(n=setInterval((function(){r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},o=function(){Rl(n)||(clearInterval(n),n=void 0)};i();var s=function(){pg.hidden?o():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return fh(pg,"visibilitychange",s),r.setAutomaticDisplayDispose((function(){o(),pg.removeEventListener("visibilitychange",s)})),r}}function bg(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;Hu((function(){var e;if(!s&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===ol.Widget,o=lv(t,a),s=(null==(e=t.appearance)?void 0:e.widgetType)===nl.Tab&&n;if(!o)return Ih.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(Ih.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};fh(hg,"popstate",n),fh(hg,"hashchange",n);var o=hg.history.pushState,u=hg.history.replaceState;return hg.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()},hg.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(){hg.removeEventListener("popstate",n),hg.removeEventListener("hashchange",n),hg.history.pushState=o,hg.history.replaceState=u}}}),[s,t,r,i,a])}var wg=200;function Sg(e){switch(void 0===e&&(e=il.Right),e){case il.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case il.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case il.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function kg(e){var t,n,r,i,o,s,a,u,l,c,d,f,h=e.survey,p=e.forceDisableHtml,_=e.posthog,v=e.style,g=void 0===v?{}:v,m=e.previewPageIndex,y=e.removeSurveyFromFocus,b=void 0===y?function(){}:y,w=e.isPopup,S=void 0===w||w,k=e.onPreviewSubmit,x=void 0===k?function(){}:k,C=e.onPreviewBack,E=void 0===C?function(){}:C,P=e.onPopupSurveyDismissed,T=void 0===P?function(){}:P,I=e.onCloseConfirmationMessage,F=void 0===I?function(){}:I,R=e.properties,L=e.isSurveyCompleted,A=e.skipShownEvent,O=e.surveyLanguage,M=ju(null),D=Number.isInteger(m),q=null!=(t=h.appearance)&&t.surveyPopupDelaySeconds?1e3*h.appearance.surveyPopupDelaySeconds:0,N=function(e,t,n,r,i,o,s,a,u){var l=Bu(r||0===n||e.type===ol.ExternalSurvey),c=l[0],d=l[1],f=Bu(!1),h=f[0],p=f[1],_=ju(!1),v=function(){var t=function(){o&&i(e),d(!1)};if(!_.current){var n=null==s?void 0:s.current;n?(_.current=!0,n.style.transition="opacity "+wg+"ms ease-out",n.style.opacity="0",setTimeout((function(){_.current=!1,t()}),wg+50)):t()}},g=function(t){t.detail.surveyId===e.id&&v()};return Hu((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 v();p(!0),null!=(r=e.appearance)&&r.autoDisappear&&(i&&clearTimeout(i),i=setTimeout(v,5e3))}},s=function(){if(lv(e,t)){var n,r;d(!0),hg.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(ll.SHOWN,Ta(((n={})[cl.SURVEY_NAME]=e.name,n[cl.SURVEY_ID]=e.id,n[cl.SURVEY_ITERATION]=e.current_iteration,n[cl.SURVEY_ITERATION_START_DATE]=e.current_iteration_start_date,n),u&&((r={})[cl.SURVEY_LANGUAGE]=u,r),{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};fh(hg,"PHSurveyClosed",g),fh(hg,"PHSurveySent",o);var l=n>0?setTimeout(s,n):void 0;return Rl(l)&&s(),function(){Rl(l)||clearTimeout(l),Rl(i)||clearTimeout(i),hg.removeEventListener("PHSurveyClosed",g),hg.removeEventListener("PHSurveySent",o)}}}else Ih.error("usePopupVisibility hook called without a PostHog instance.")}),[]),bg({survey:e,removeSurveyFromFocus:i,setSurveyVisible:d,isPreviewMode:r,posthog:t}),{isPopupVisible:c,isSurveySent:h,setIsPopupVisible:d,hidePopupWithAnimation:v}}(h,_,q,D,b,S,M,A,O),B=N.isPopupVisible,H=N.hidePopupWithAnimation,j=N.isSurveySent||m===h.questions.length||!0===L,U=Bu(!1),V=U[0],z=U[1],W=Uu((function(){return!!fv(h)}),[h]),G=!!(null!=(n=h.appearance)&&n.introScreenHeader||null!=(r=h.appearance)&&r.introScreenDescription),Q=D?m===fg:!(null==(i=h.appearance)||!i.displayIntroScreen)&&G&&!V&&!W,K=Uu((function(){var e=fv(h),t=(null==e?void 0:e.surveySubmissionId)||l_();return{isPreviewMode:D,previewPageIndex:m,onPopupSurveyDismissed:function(){O?X_(h,_,D,O):X_(h,_,D),T()},isPopup:S||!1,surveySubmissionId:t,onPreviewSubmit:x,onPreviewBack:E,posthog:_,properties:R,surveyLanguage:O}}),[D,m,S,_,h,T,x,E,R,O]);return B?mv(sv.Provider,{value:K,children:mv("div",{className:"ph-survey",style:Ta({},vv(h.type,null==(o=h.appearance)?void 0:o.position,null==(s=h.appearance)?void 0:s.widgetType),g),ref:M,children:j?mv(Av,{header:(null==(a=h.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(u=h.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=h.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:h.appearance||W_,onClose:function(){H(),F()}}):Q?mv(Ov,{header:(null==(c=h.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=h.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(f=h.appearance)?void 0:f.introScreenDescriptionContentType,appearance:h.appearance||W_,onStart:function(){return z(!0)}}):mv(xg,{survey:h,forceDisableHtml:!!p,posthog:_})})}):null}function xg(e){var t,n,r=e.survey,i=e.forceDisableHtml,o=e.posthog,s=Uu((function(){var e=fv(r);if(!e)return null;var t=Dl(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&r.questions.length>e.lastQuestionIndex?e:(pv(r),null)}),[r]),a=Bu((function(){return null!=s&&s.responses&&Ih.info("Survey is already in progress, filling in initial responses"),(null==s?void 0:s.responses)||{}})),u=a[0],l=a[1],c=Vu(sv),d=c.previewPageIndex,f=c.onPopupSurveyDismissed,h=c.isPopup,p=c.onPreviewSubmit,_=c.onPreviewBack,v=c.surveySubmissionId,g=c.isPreviewMode,m=c.properties,y=c.surveyLanguage,b=Bu((function(){var e=null==s?void 0:s.lastQuestionIndex,t=Dl(e)&&e>=0&&r.questions.length>e?e:0;return Dl(d)&&d>=0?d:t})),w=b[0],S=b[1],k=Bu((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}))})),x=k[0],C=k[1],E=Bu((function(){var e,t=fv(r);return null!==(e=null==t?void 0:t.questionSnapshots)&&void 0!==e?e:{}})),P=E[0],T=E[1],I=Uu((function(){return rv(iv(r,s))}),[r.id,s]),F=Uu((function(){if(!I||new Set(I).size!==I.length)return iv(r,s);var e=new Map(r.questions.map((function(e){return[e.id,e]}))),t=I.map((function(t){return e.get(t)})).filter((function(e){return!!e}));return t.length===I.length?t:r.questions}),[I,r.questions,r,s]);Hu((function(){!g||Rl(d)||0>d||S(d)}),[d,g]);var R=!(null==(t=r.appearance)||!t.allowGoBack)&&(g?(null!=d?d:0)>0:x.length>0),L=F.at(w);return L?mv("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(n=r.appearance)?void 0:n.hideCancelButton)&&mv(Rv,{onClick:function(){f()}}),mv("div",{className:"survey-box","data-question-index":w,children:Eg({question:L,forceDisableHtml:i,displayQuestionIndex:w,appearance:r.appearance||W_,onSubmit:function(e){return function(e){var t,n,i=e.res,s=e.displayQuestionIndex,a=e.questionId;if(o)if(a){var c=ph(a),d=Ta({},u,((t={})[c]=i,t));l(d);var f=F[s],h=null!=f&&f.id?Ta({},P,((n={})[f.id]=f.question,n)):P;T(h);var p=Gv(r,s,i),_=p===al.End,g=[].concat(x,[s]);if(_||(C(g),S(p),dv(r,{surveySubmissionId:v,responses:d,lastQuestionIndex:p,questionOrder:rv(F),visitedIndices:g,surveyLanguage:y,questionSnapshots:h})),r.enable_partial_responses||_){var b=new Set(g.map((function(e){var t;return null==(t=F[e])?void 0:t.id})).filter((function(e){return!!e})).map((function(e){return ph(e)}))),w=Object.fromEntries(Object.entries(d).filter((function(e){return b.has(e[0])})));Y_({responses:w,survey:r,surveySubmissionId:v,isSurveyCompleted:_,posthog:o,properties:m,surveyLanguage:y,questionSnapshots:h})}}else Ih.error("onNextButtonClick called without a questionId.");else Ih.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:w,questionId:L.id})},onPreviewSubmit:p,initialValue:L.id?u[ph(L.id)]:void 0,canGoBack:R,onBack:function(){if(g)_();else if(0!==x.length){var e=x[x.length-1],t=x.slice(0,-1);C(t),S(e),dv(r,{surveySubmissionId:v,responses:u,lastQuestionIndex:e,questionOrder:rv(F),visitedIndices:t,surveyLanguage:y,questionSnapshots:P})}}})})]}):null}function Cg(e){var t,n,r,i,o,s,a,u=e.survey,l=e.forceDisableHtml,c=e.posthog,d=e.readOnly,f=e.surveyLanguage,h=Bu(!0),p=h[0],_=h[1],v=Bu(!1),g=v[0],m=v[1],y=Bu({}),b=y[0],w=y[1],S=ju(void 0),k=function(){m(!g)};if(Hu((function(){var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&w({top:"50%",bottom:"auto"});var t=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===u.id&&(Ih.info("Received show event for feedback button survey "+u.id),w(n.detail.position||{}),k())};return fh(hg,_g,t),function(){Rl(S.current)||(clearTimeout(S.current),S.current=void 0),hg.removeEventListener(_g,t)}}}else Ih.error("FeedbackWidget called without a PostHog instance.")}),[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(n=u.appearance)?void 0:n.widgetSelector,null==(r=u.appearance)?void 0:r.borderColor]),bg({survey:u,setSurveyVisible:_,posthog:c}),!p)return null;var x=function(){u.schedule!==ul&&_(!1),Rl(S.current)||clearTimeout(S.current),S.current=setTimeout((function(){S.current=void 0,m(!1)}),200)};return mv(iu,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&mv("button",{className:"ph-survey-widget-tab "+((null==(o=u.appearance)?void 0:o.tabPosition)===il.Top?"widget-tab-top":""),onClick:k,disabled:d,style:Sg(null==(s=u.appearance)?void 0:s.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),g&&mv(kg,{posthog:c,survey:u,forceDisableHtml:l,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:f})]})}var Eg=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 sl.Open:return nu(Dv,Ta({},i,{question:t,key:t.id}));case sl.Link:return nu(qv,Ta({},i,{question:t,key:t.id}));case sl.Rating:return nu($v,Ta({},i,{question:t,key:t.id}));case sl.SingleChoice:case sl.MultipleChoice:return nu(Bv,Ta({},i,{question:t,key:t.id}));default:return Ih.error("Unsupported question type: "+t.type),null}},Pg="undefined"!=typeof globalThis?globalThis:Uf;Pg&&"undefined"==typeof self&&(Pg.self=Pg),Pg&&"undefined"==typeof File&&(Pg.File=function(){});var Tg=null!=Uf?Uf:{};Tg.__PosthogExtensions__=Tg.__PosthogExtensions__||{},Tg.__PosthogExtensions__.generateSurveys=yg,Tg.extendPostHogWithSurveys=yg;var Ig=nh("[Error tracking]"),Fg="webkit-masked-url:",Rg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Fg],Lg=["__firefox__","__gCrWeb"];function Ag(){return new Td([new Hd,new Yd,new Ud,new jd,new Kd,new Qd,new zd,new Zd],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=r;o.length>s;s++){var a=o[s];if(1024>=a.length){var u=Nd.test(a)?a.replace(Nd,"$1"):a;if(!u.match(/\S*Error: /)){for(var l=0,c=n;c.length>l;l++){var d=(0,c[l])(u,e);if(d){i.push(d);break}}if(i.length>=Bd)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Bd).map((function(e){return Ta({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Id});var n}))}(i)}}("web:javascript",Md,$d))}var Og=function(){function e(e){var t,n;this._suppressionRules=[],this._errorPropertiesBuilder=Ag(),this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property(Yh))&&void 0!==t?t:[],this._exceptionStepsConfig=nf(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new rf(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=nf(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,r;if(e.ok){var i=e.config;if("errorTracking"in i){var o,s=null!==(t=null==(n=i.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[],a=null==(r=i.errorTracking)?void 0:r.captureExtensionExceptions;this._suppressionRules=s,this._instance.persistence&&this._instance.persistence.register(((o={})[Yh]=this._suppressionRules,o[Jh]=a,o))}}},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(!Ll(e)||0===e.trim().length)return void Ig.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 ef.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&&Ig.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this._exceptionStepsBuffer.add(Ta(((n={})[Jd]=e,n[Xd]=(new Date).toISOString(),n),i))}catch(e){Ig.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 Ig.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 Ig.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 Ig.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 Ig.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this._exceptionStepsConfig.enabled&&Ml(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,r="string"==typeof(o=globalThis._posthogReleaseId)&&o.length>0?o: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 Ig.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void Ig.error("Failed to process exception event. Ignoring this exception.",e)}var o},t._addBufferedExceptionSteps=function(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:Ta({},e,{$exception_steps:t})}catch(t){return Ig.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={})[Jd]=e,t[Xd]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return Il(e)?Ta({},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 Ll(n)&&n.length>0&&e.$exception_types.push(n),Ll(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=Ph[e.operator],r=t[e.key];if(!n||!r)return!1;var i=Pl(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 Ig.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&&Rg.some((function(e){return t.startsWith(e)}))}));return 0!==n.length&&(!n.every((function(e){var t=e.filename;return!!t&&t.startsWith(Fg)}))||e.some((function(e){var t=e.value;return Ll(t)&&t.includes("isolatedAPI.contexts.topHostname")}))&&!t.some((function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(Fg))})))},t._isInjectedBrowserScriptException=function(e){return e.some((function(e){var t=e.value;return Ll(t)&&Lg.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:[],s=o[o.length-1];return null!==(r=null==s||null==(i=s.filename)?void 0:i.includes("posthog.com/static"))&&void 0!==r&&r}return!1},t._isExceptionList=function(e){return!Ml(e)&&Pl(e)},Ea(e,[{key:"_captureExtensionExceptions",get:function(){var e,t=!!this._instance.get_property(Jh),n=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=n?n:t)&&void 0!==e&&e}}])}(),Mg=nh("[ExceptionAutocapture]"),Dg=Ag(),qg=function(e){var t=Uf;t||Mg.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];var s=Dg.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(Ll(t)&&Ll(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}});return e(s),!!Tl(n)&&null!==(t=n.apply(void 0,i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},$g=function(e,t){void 0===t&&(t=!1);var n=Uf;n||Mg.info("window not available, cannot wrap onUnhandledRejection");var r=n.onunhandledrejection;return n.onunhandledrejection=function(n){var i,o=Dg.buildFromUnknown(n,{mechanism:{handled:!1}});return e(o),Tl(r)?null!==(i=r(n))&&void 0!==i&&i:t},n.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=n.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,n.onunhandledrejection=r}},Ng={wrapOnError:qg,wrapUnhandledRejection:$g,wrapConsoleError:function(e){var t=console;t||Mg.info("console not available, cannot wrap console.error");var n=t.error;return t.error=function(){for(var t,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];t=1==i.length?i[0]:i.join(" ");var s=i.find((function(e){return e instanceof Error})),a=Dg.buildFromUnknown(s||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(a),Tl(n)&&n.apply(void 0,i)},t.error.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=n}}};Tg.__PosthogExtensions__=Tg.__PosthogExtensions__||{},Tg.__PosthogExtensions__.errorWrappingFunctions=Ng,Tg.posthogErrorWrappingFunctions=Ng;var Bg=function(e,t){if(Tl(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,r=!Ol(n)&&"object"==typeof n&&Pl(n.errors_to_ignore)?n.errors_to_ignore.reduce((function(e,t){try{e.push(new RegExp(t))}catch(e){Mg.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){Mg.error("Failed to capture exception for a legacy client",e)}};qg((function(e){r.some((function(t){return e.$exception_list.some((function(e){return t.test(e.value||"")}))}))||i(e)})),$g(i,!0)}};Tg.extendPostHogWithExceptionAutoCapture=Bg,Tg.extendPostHogWithExceptionAutocapture=Bg;var Hg=function(){},jg=function(e){var t;if(Tl(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function Ug(e,t,n){try{if(!(t in e))return Hg;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 Tl(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=jg(n);o;){if(o.next===i)return void(o.next=r.next);o=jg(n=o.next)}else e[t]=r.next}}catch(e){return Hg}}var Vg="X-POSTHOG-SESSION-ID",zg="X-POSTHOG-WINDOW-ID",Wg="X-POSTHOG-DISTINCT-ID",Gg=[Vg,zg,Wg],Qg=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Kg=function(e,t){return{}.hasOwnProperty.call(e,t)},Zg=function(e){return"object"==typeof e&&!Ol(e)||Tl(e)},Yg=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},Jg=function(e){try{var t;return Yg(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Uf||null==(t=Uf.location)?void 0:t.href).toString()}catch(e){return}},Xg=function(e,t,n,r,i){var o;try{o=new URL(r).hostname}catch(e){return!1}if(!e)return!1;if(Pl(e)&&!e.includes(o))return!1;var s=!1;if(n){var a=n.checkAndGetSessionAndWindowId(!0),u=a.windowId;i.set(Vg,a.sessionId),i.set(zg,u),s=!0}var l=function(e){return Tl(e)?e():e}(t);return l&&l!==Hp&&(i.set(Wg,l),s=!0),s};Tg.__PosthogExtensions__=Tg.__PosthogExtensions__||{};var em={_patchFetch:function(e,t,n){return Ug(Uf,"fetch",(function(r){return function(i,o){var s=arguments.length>1?[i,o]:[i],a=s;try{var u=Jg(i);if(u)if(Yg(i)){var l=new Request(i,o);Xg(e,t,n,l.url,l.headers),a=[l]}else{var c=new Headers(Zg(o)?o.headers:void 0);if(Xg(e,t,n,u,c)){var d=function(e,t){if(Rl(e)||Ol(e))return{headers:t};if(Zg(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 Kg(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return Kg(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)})),Qg.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&&Qg.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?Ta({},i,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(o,c);d&&(a=[i,d])}}}catch(e){a=s}return r.apply(this,a)}}))},_patchXHR:function(e,t,n){return Ug(Uf.XMLHttpRequest.prototype,"open",(function(r){return function(i,o,s,a,u){void 0===s&&(s=!0);var l=this,c=new Headers,d=Jg(o);d&&Xg(e,t,n,d,c);var f=r.call(l,i,o,s,a,u);return Gg.forEach((function(e){var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),f}}))}};Tg.__PosthogExtensions__.tracingHeadersPatchFns=em,Tg.postHogTracingHeadersPatchFns=em;jf.DEBUG=!1,jf.LIB_VERSION="1.426.4",jf.LIB_NAME="web";var tm=function(){function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return this._config.cookieless_mode===Qp||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===Gp},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==zf?void 0:zf.doNotTrack,null==zf?void 0:zf.msDoNotTrack,Tg.doNotTrack,null==zf?void 0:zf.globalPrivacyControl].some((function(e){return Ql(e)}))},Ea(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 Ql(e)?1:pl(Kl,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?P_:C_,n=t._is_supported()?t:N_;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var r="localStorage"===e?C_:P_;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Ql(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}(),nm=1,rm=3,im=11;function om(e){return e instanceof Element&&(e.id===Qv||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sm(e){return!!e&&e.nodeType===nm}function am(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function um(e){return!!e&&e.nodeType===rm}function lm(e){return!!e&&e.nodeType===im&&sm(e.host)}var cm=1e3;function dm(e){return e?_l(e).split(/\s+/):[]}function fm(e,t){var n=b_(t);return!!(n&&e&&e.some((function(e){return n.match(e)})))}function hm(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 dm(t)}function pm(e){return Ml(e)?null:_l(e).split(/(\s+)/).filter((function(e){return $m(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function _m(e){var t="";return Im(e)&&!Fm(e)&&e.childNodes&&e.childNodes.length&&ih(e.childNodes,(function(e){var n;um(e)&&e.textContent&&(t+=null!==(n=pm(e.textContent))&&void 0!==n?n:"")})),_l(t)}function vm(e){var t;return Rl(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var gm=["a","button","form","input","select","textarea","label"];function mm(e,t){if(Rl(t))return!0;for(var n,r,i=function(){var e=r.value;if(t.some((function(t){return function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch(e){return!1}}(e,t)})))return{v:!0}},o=Pa(e);!(r=o()).done;)if(n=i())return n.v;return!1}function ym(e){var t=e.parentNode;return!(!t||!sm(t))&&t}var bm=[".ph-no-autocapture","[data-ph-no-autocapture]"],wm=["next","previous","prev",">","<"],Sm=[].concat(wm,["+","-","−","–"]),km=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},xm=[".ph-no-rageclick",".ph-no-capture"],Cm=["","text","search","email","password","url","tel","number"];function Em(e,t){if(!Uf||Pm(e))return!1;var n,r,i,o,s;if($l(t)?(n=!!t&&xm,r=void 0,i=!1):(n=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:xm,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||!sm(e))&&(!!am(e,"textarea")||(am(e,"input")?pl(Cm,(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=Tm(e,!1).targetElementList;return!function(e,t){if(!1===e||Rl(e))return!1;var n;if(!0===e)n=wm;else{if(!Pl(e))return!1;if(e.length>10)return th.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map((function(e){return e.toLowerCase()}))}return t.some((function(e){var t=e.safeText,r=e.ariaLabel;return n.some((function(e){return km(t,e)||km(r,e)}))}))}(r,a.map((function(e){var t;return{safeText:_m(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!mm(a,n)}var Pm=function(e){return!e||am(e,"html")||!sm(e)},Tm=function(e,t){if(!Uf||Pm(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!am(i,"body");)if(lm(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var o=ym(i);if(!o)break;if(t||gm.indexOf(o.tagName.toLowerCase())>-1)n=!0;else try{var s=Uf.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(n=!0)}catch(e){}r.push(o),i=o}return{parentIsUsefulElement:n,targetElementList:r}};function Im(e){for(var t=new Set,n=0,r=e;r.parentNode&&!am(r,"body");r=r.parentNode){if(n++>=cm||t.has(r))return!1;t.add(r);var i=hm(r);if(pl(i,"ph-sensitive")||pl(i,"ph-no-capture"))return!1}if(pl(hm(e),"ph-include"))return!0;var o=e.type||"";if(Ll(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!Ll(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function Fm(e){return!!(am(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||am(e,"select")||am(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Rm=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}))$"),Lm=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Am=[16,15,14,13],Om=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Mm=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Dm=/[0-9A-Za-z_]/;function qm(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 $m(e,t){if(void 0===t&&(t=!0),Ml(e))return!1;if(Ll(e)){e=_l(e);var n=t?Rm.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(Lm.lastIndex=0;t=Lm.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,""),i=0;r.length>i;i++)for(var o,s=Pa(Am);!(o=s()).done;){var a=i+o.value;if(r.length>=a){var u=r.slice(i,a);if(Rm.test(u)&&qm(u))return!0}}}return!1}(e);if(n)return!1;var r=t?Om.test(e):function(e){var t;for(Mm.lastIndex=0;t=Mm.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&Dm.test(n)&&Dm.test(r)))return!0}return!1}(e);if(r)return!1}return!0}function Nm(e){var t=_m(e);return $m(t=(t+" "+Bm(e)).trim())?t:""}function Bm(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ih(e.childNodes,(function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=_m(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Bm(e)).trim())}catch(e){th.error("[AutoCapture]",e)}})),t}function Hm(e){return e.replace(/"|\\"/g,'\\"')}function jm(e){var t=e.attr__class;if(t)return Pl(t)?t:dm(t)}var Um=nh("[Dead Clicks]"),Vm=function(){return!0},zm=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(ep)),r=e.instance.config.capture_dead_clicks;return $l(r)?r:!!Il(r)||n},Wm=function(){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){if(e.ok){var t,n=e.config;if("captureDeadClicks"in n)this.instance.persistence&&this.instance.persistence.register(((t={})[ep]=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=Tg.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(function(t){t?Um.error("failed to load script",t):e()}))},t._start=function(){var e;if(Wf){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=Tg.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Il(this.instance.config.capture_dead_clicks)?Ta({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=Tg.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Wf),Um.info("starting...")}}else Um.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Um.info("stopping..."))},Ea(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Gm=nh("[SegmentIntegration]");function Qm(e,t,n){void 0===n&&(n=!0);var r=e.config.segment;if(!r)return t();!function(e,t,n){var r=e.config.segment;if(!r)return t();var i=function(r){var i=function(){return r.anonymousId()||l_()};e.config.get_device_id=i,n&&r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(Op,Zp)),t(n?void 0:r.anonymousId()||void 0)},o=r.user();"then"in o&&Tl(o.then)?o.then(i):i(o)}(e,(function(n){r.register(function(e,t){"undefined"!=typeof Promise&&Promise.resolve||Gm.warn("This browser does not have Promise support, and can not use the segment integration");var n=function(n,r){if(!r)return n;var i=!!t&&n.event.anonymousId===t&&!n.event.userId;i||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Gm.info("No userId set, resetting PostHog"),e.reset()),i||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Gm.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var o=e.calculateEventProperties(r,n.event.properties);return n.event.properties=Object.assign({},o,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 n(e,e.event.event)},page:function(e){return n(e,e_)},identify:function(e){return n(e,n_)},screen:function(e){return n(e,"$screen")}}}(e,n)).then((function(){t()}),(function(e){Gm.error("Failed to register the Segment integration",e),t()}))}),n)}var Km="posthog-js";function Zm(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,d;if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var f=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=f,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h,p=(null==(n=t.exception)?void 0:n.values)||[],_=p.map((function(e){return Ta({},e,{stacktrace:e.stacktrace?Ta({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((function(e){return Ta({},e,{platform:"web:javascript"})}))}):void 0})})),v={$exception_message:(null==(s=p[0])?void 0:s.value)||t.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:t.level,$exception_list:_,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:t.tags};return r&&i&&(v.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),l&&(null==(h=e.exceptions)||h.sendExceptionEvent(v)),t}}var Ym,Jm=function(e,t,n,r,i,o){this.name=Km,this.setupOnce=function(s){s(Zm(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==o||o}))}},Xm=function(){function e(e){var t=this;this._onSessionIdChange=function(e,n,r){r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(th.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==Uf?void 0:Uf.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(!(Rl(o)||Rl(s)||Rl(a)||Rl(u)||Rl(l)||Rl(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?Zl(s/o,0,1,th):1,f=o>1?Zl(a/o,0,1,th):1,h=u>1?Zl(l/u,0,1,th):1,p=u>1?Zl(c/u,0,1,th):1;r=oh(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}(),ey=["flags","surveys"],ty=((Ym={})[Bh]={exposure:"hidden"},Ym[Vh]={exposure:"hidden"},Ym.__cmpns={exposure:"hidden"},Ym[Gh]={exposure:"hidden"},Ym[Wh]={exposure:"hidden"},Ym[Qh]={exposure:"event"},Ym[Kh]={exposure:"hidden"},Ym[np]={exposure:"hidden"},Ym[Zh]={exposure:"event"},Ym[Yh]={exposure:"hidden"},Ym[Jh]={exposure:"event"},Ym[Xh]={exposure:"event"},Ym[ep]={exposure:"event"},Ym[tp]={exposure:"hidden"},Ym[rp]={exposure:"event"},Ym[ip]={exposure:"hidden"},Ym.$session_recording_enabled_server_side={exposure:"hidden"},Ym[cp]={exposure:"hidden"},Ym[dp]={exposure:"event"},Ym[op]={exposure:"event",shouldSkipFromEventProperties:function(e){return Ol(e)}},Ym.$session_past_minimum_duration={exposure:"event"},Ym.$session_recording_url_trigger_activated_session={exposure:"event"},Ym.$session_recording_event_trigger_activated_session={exposure:"event"},Ym.$debug_first_full_snapshot_timestamp={exposure:"event"},Ym.$sess_rec_flush_size={exposure:"hidden"},Ym[fp]={exposure:"hidden",storageGroup:"flags"},Ym[hp]={exposure:"hidden",storageGroup:"flags"},Ym[pp]={exposure:"hidden"},Ym[_p]={exposure:"hidden",storageGroup:"flags"},Ym[vp]={exposure:"hidden",storageGroup:"flags"},Ym[gp]={exposure:"hidden",storageGroup:"flags",volatile:!0},Ym[mp]={exposure:"hidden",storageGroup:"flags"},Ym[yp]={exposure:"hidden"},Ym[bp]={exposure:"hidden"},Ym[wp]={exposure:"hidden"},Ym[Sp]={exposure:"hidden"},Ym[xp]={exposure:"hidden",storageGroup:"surveys"},Ym[Cp]={exposure:"hidden",storageGroup:"surveys",volatile:!0},Ym[Ep]={exposure:"event"},Ym[Pp]={exposure:"hidden"},Ym[Tp]={exposure:"hidden"},Ym[Ip]={exposure:"hidden"},Ym.$product_tours_activated={exposure:"hidden"},Ym.$product_tours_activated_session={exposure:"hidden"},Ym.$conversations_widget_session_id={exposure:"event"},Ym.$conversations_ticket_id={exposure:"event"},Ym.$conversations_widget_state={exposure:"event"},Ym.$conversations_user_traits={exposure:"event"},Ym[Fp]={exposure:"hidden"},Ym[Rp]={exposure:"hidden"},Ym[kp]={exposure:"event"},Ym[Lp]={exposure:"hidden"},Ym[Ap]={exposure:"hidden",storageGroup:"flags",volatile:!0},Ym[Op]={exposure:"hidden"},Ym[Mp]={exposure:"hidden"},Ym[Dp]={exposure:"hidden"},Ym[qp]={exposure:"hidden"},Ym[$p]={exposure:"hidden"},Ym[Np]={exposure:"hidden"},Ym[Bp]={exposure:"hidden"},Ym[sp]={exposure:"event"},Ym[ap]={exposure:"event"},Ym[up]={exposure:"event"},Ym[lp]={exposure:"event"},Ym[Up]={exposure:"event"},Ym[Vp]={exposure:"event"},Ym[zp]={exposure:"event"},Ym.$sdk_debug_replay_event_trigger_status={exposure:"event"},Ym.$sdk_debug_replay_linked_flag_trigger_status={exposure:"event"},Ym.$sdk_debug_replay_matched_recording_trigger_groups={exposure:"event"},Ym.$sdk_debug_replay_pending_trigger_conditions={exposure:"event"},Ym.$sdk_debug_replay_remote_trigger_matching_config={exposure:"event"},Ym.$sdk_debug_replay_trigger_groups_count={exposure:"event"},Ym.$sdk_debug_replay_url_trigger_status={exposure:"event"},Ym.$session_recording_start_reason={exposure:"event"},Ym),ny=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ry=function(e){var t=ty[e];if(t)return t;for(var n=0,r=ny;r.length>n;n++){var i=r[n],o=i[1];if(0===e.indexOf(i[0]))return o}},iy={flags:Ap,surveys:Cp},oy=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sy=function(e){return e+"_cookie_identity_change_pending"},ay=function(e){for(var t,n="",r=0,i=Pa(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},uy="main",ly=[fp,hp,_p,vp,gp,Ap,mp,wp],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 Il(t)?t:{}},hy=function(e,t){ih(e,(function(n,r){var i=ry(r);i&&"event"!==i.exposure||{}.hasOwnProperty.call(t,r)||delete e[r]}))},py=function(){function e(e,t,n){var r=this;if(void 0===n&&(n=!0),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._facebookClickIdChangePending=!1,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._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),this._markLoadedCrossTabFeatureFlagChangesPending(),e.debug&&th.info("Persistence loaded",e.persistence,Ta({},this.props)),this.update_config(e,e,t),this.save(),Uf){var i=function(){return r.flush()};fh(Uf,"beforeunload",i,{capture:!1}),fh(Uf,"pagehide",i,{capture:!1}),this._onStorage=function(e){if(r._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Uf?void 0:Uf.localStorage))&&e.key)if(e.key!==r._name){if(r._splitStorage){var t=ey.find((function(t){return e.key===r._groupEntryName(t)}));t&&r._syncCrossTabFeatureFlagProperties(e.key,t)}}else r._syncCrossTabFeatureFlagProperties(e.key,uy)},fh(Uf,"storage",this._onStorage)}}var t=e.prototype;return 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(cy(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&&Uf&&(Uf.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=P_._get(e),Ol(i)){var o=this._slotWriteState(t);return o.storageValue=null,t!==uy&&(o.persisted=!1),!1}r=fy(i)}catch(e){return!1}var s=t===uy?r:P_._parse(this._name);if(s&&this._hasCrossTabFeatureFlagIdentityMismatch(s))return!1;var a=this._mergeCrossTabFeatureFlagProperties(r,t,n);return t===uy&&this._splitStorage&&!dy(this._partitionProps().main,r)||this._rememberCrossTabStorageFingerprint(r,t,!0,i),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[Hh],n=e[Hh];return!Rl(t)&&!Rl(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,r){var i=this._slotWriteState(t);i.storageValue=r,t!==uy&&(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 ly.forEach((function(n){var o,s=null==(o=ry(n))?void 0:o.storageGroup;if(!(t===uy&&r._splitStorage&&s||t!==uy&&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._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=P_._get(this._name),r=this._slotWriteState(uy),i=!1,o=!1;if(n!==r.storageValue)if(Ol(n))r.storageValue=null;else{if(t=fy(n),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;o=this._mergeCrossTabFeatureFlagProperties(t,uy,!1),!this._splitStorage||dy(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,uy,!0,n):r.storageValue=n,i=!0}return this._splitStorage&&ey.forEach((function(n){var r=P_._get(e._groupEntryName(n)),s=e._slotWriteState(n),a=t||{},u=i&&ly.some((function(e){var t;return(null==(t=ry(e))?void 0:t.storageGroup)===n&&e in a}));if(r!==s.storageValue||u){if(Ol(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=ry(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||uy).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;ly.forEach((function(t){return e._pendingCrossTabFeatureFlagChanges.set(t,!0)}))},t._markLoadedCrossTabFeatureFlagChangesPending=function(){var e=this;if(this._splitStorageEligible)try{var t=P_._get(this._name),n=fy(t);this._slotWriteState(uy).storageValue=t,ly.forEach((function(t){var r,i=e._splitStorage?null==(r=ry(t))?void 0:r.storageGroup:void 0,o=i?P_._get(e._groupEntryName(i)):null;if(i){var s=e._slotWriteState(i);s.storageValue=o,s.persisted=!Ol(o)}var a=i&&!Ol(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(e===hp){var r=new Set(Pl(t)?t:[]),i=new Set(Pl(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=Il(t)?Ta({},t):{},s=Il(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(cy(e)){var r=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==r){var i=t;if(this._splitStorageEligible)try{var o,s=this._splitStorage?null==(o=ry(e))?void 0:o.storageGroup:void 0,a=s?this._groupEntryName(s):this._name;i=fy(P_._get(a))[e]}catch(e){}var u=new Set(r||[]);if(e===hp){if(!Rl(t)&&!Pl(t)||!Rl(i)&&!Pl(i)||!Pl(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(!Il(n))return void(dy(i,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!Rl(t)&&!Il(t)||Rl(t)&&Fl(n)&&Rl(i))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var f=Il(t)?t:{},h=Il(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 Dl(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=A_(e,this._config.cookie_persisted_properties||[]),n=M_(t,this._config.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),i=C_._get(this._name)||void 0;i&&q_(this._name,i)===r&&(this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i)}catch(e){}else try{var o=C_._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=o?q_(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=C_._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var i,o=q_(this._name,n);try{i=L_(JSON.parse(n))}catch(e){return!1}if((C_._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=o,this._lastSeenMainCookieValue=n;var s=D_(this._name,n),a=[].concat(I_,s.properties),u={};if(Object.keys(i).forEach((function(e){var t=i[e];(Rl(t)||Ol(t)||""===t||e===Op&&t!==Kp&&t!==Zp)&&(u[e]=!0,delete i[e])})),Fl(i))return!1;var l=Hh in i||i[Op]===Kp||i[Op]===Zp,c=this.props,d=c[Hh],f=c[Op],h=oh({},c);[].concat(I_,e.cookie_persisted_properties||[]).forEach((function(e){if(-1!==a.indexOf(e)&&!(e in i)&&!u[e]&&(l||e!==Hh&&e!==Op)){var t=h[e];!s.isValid&&-1!==I_.indexOf(e)&&(!1===t||0===t)||delete h[e]}})),this.props=oh(h,i),ly.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||Op in i||Op in this.props||this._setProp(Op,Kp);var p=this.props[Hh],_=this.props[Op];return!l||p===d&&_===f||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,H_._set(sy(this._name),!0),this._deleteProp(wp),this._deleteProp(hp),this._deleteProp(fp),this._deleteProp(_p),this._deleteProp(vp),this._deleteProp(gp),this._deleteProp(Ap),this._deleteProp(Lp),this._deleteProp(Fp),_===Kp&&(f===Zp||i[Op]===Kp||!Rl(d)&&p!==d)&&(hy(this.props,i),this._deleteProp(Sp)),_===Zp?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(Vh)),!0},t.consumeCookieIdentityChange=function(){var e=sy(this._name),t=this._cookieIdentityChangePending||!!H_._get(e);return this._cookieIdentityChangePending=!1,t&&H_._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&&(Rl(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[uy],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():Rl(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){-1===oy.indexOf(e.persistence.toLowerCase())&&(th.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,n=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var n=[].concat(I_,e);return Ta({},P_,{_parse:function(e){try{var r,i={};try{r=C_._get(e)||void 0,i=r?L_(JSON.parse(r)):{}}catch(e){}var o,s=JSON.parse(P_._get(e)||"{}");if(t){var a=D_(e,r),u=[].concat(I_,a.properties),l={};Object.keys(i).forEach((function(e){var t=i[e];Ol(t)||""===t||e===Op&&t!==Kp&&t!==Zp||(l[e]=t)}));var c=Hh in l||l[Op]===Kp||l[Op]===Zp;if(Object.keys(l).length>0){var d,f=s[Hh],h=null!==(d=s[Op])&&void 0!==d?d:Kp;n.forEach((function(e){if(-1!==u.indexOf(e)&&!(e in i)&&(c||e!==Hh&&e!==Op)){var t=s[e];!a.isValid&&-1!==I_.indexOf(e)&&(!1===t||0===t)||delete s[e]}})),!c||Op in i||Op in s||(s[Op]=Kp),!c||(Hh in l?l[Hh]:s[Hh])===f&&(Op in l?l[Op]:s[Op])===h||(T_.forEach((function(e){return delete s[e]})),l[Op]===Zp&&Hh in l?s.$user_id=l[Hh]:delete s.$user_id,l[Op]!==Zp&&(delete s[kp],delete s[Sp]),delete s.__alias)}o=oh(s,l)}else o=oh(i,s);return P_._set(e,o),o}catch(e){}return null},_set:function(n,r,i,o,s,a){var u=P_._set(n,r,void 0,void 0,a);try{var l=A_(r,e);if(Object.keys(l).length){if(t){var c=F_(n),d=M_(l,e);if(C_._set(c,d,i,o,s,a),C_._get(c)!==JSON.stringify(d)){C_._remove(c,o);var f=A_(r);return C_._set(n,f,i,o,s,a),u}}C_._set(n,l,i,o,s,a)}}catch(e){P_._error(e)}return u},_remove:function(e,t){try{null==Uf||Uf.localStorage.removeItem(e),C_._remove(e,t),C_._remove(F_(e),t)}catch(e){P_._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,i=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&P_._is_supported()?(t=P_,i=!0):"localstorage+cookie"===o&&n._is_supported()?(t=n,i=!0,r=!0):"sessionstorage"===o&&H_._is_supported()?t=H_:"memory"===o?t=N_:"cookie"===o&&C_._is_supported()?(t=C_,r=!0):n._is_supported()?(t=n,i=!0,r=!0):C_._is_supported()?(t=C_,r=!0):t=N_,this._splitStorageEligible=i,this._storesIdentityInCookie=r,t},t._groupEntryName=function(e){return this._name+"__"+e},t._resolveSplitStorage=function(e){return this._splitStorageEligible&&!!e.split_storage},t.properties=function(){var e={};return ih(this.props,(function(t,n){var r=ry(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?P_._parse(this._name):null,i={};if(n)try{ih(i=L_(C_._parse(this._name)),(function(e,t){(Rl(e)||Ol(e)||""===e)&&delete i[t]}))}catch(e){}var o=this._storage._parse(this._name);if(o&&(this.props=oh({},o)),this._splitStorage&&this._loadGroupEntries(),n&&o){var s,a,u=null==r?void 0:r[Hh],l=null!==(s=null==r?void 0:r[Op])&&void 0!==s?s:Kp,c=o[Hh],d=null!==(a=o[Op])&&void 0!==a?a:Kp;if(c!==u||d!==l){this._cookieIdentityChangePending=!0,H_._set(sy(this._name),!0);var f=oh({},this.props);T_.forEach((function(e){return delete f[e]})),d===Kp&&(l===Zp||i[Op]===Kp||!Rl(u)&&c!==u)&&(hy(f,i),delete f[Sp]),this.props=f;var h=new Set;T_.forEach((function(e){var t,n=null==(t=ry(e))?void 0:t.storageGroup;n&&h.add(n)})),h.forEach((function(e){var n={};ih(t.props,(function(t,r){var i;(null==(i=ry(r))?void 0:i.storageGroup)===e&&(n[r]=t)})),Fl(n)?(P_._remove(t._groupEntryName(e)),t._slotState[e]={}):P_._set(t._groupEntryName(e),n)&&(t._slotState[e]={persisted:!0,fingerprint:t._entryFingerprint(n,e)})}))}}H_._get(sy(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e,t=Pa(ey);!(e=t()).done;){var n=e.value,r=P_._parse(this._groupEntryName(n));if(r&&!Fl(r)){var i=this._slotWriteState(n);i.persisted=!0,this._mainCarriesGroupKey(n)||(i.fingerprint=this._entryFingerprint(r,n)),this._groupEntryIsStale(n,r)||oh(this.props,r)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some((function(t){var n;return(null==(n=ry(t))?void 0:n.storageGroup)===e}))},t._groupEntryIsStale=function(e,t){var n=iy[e];if(!n)return!1;var r=t[n],i=this.props[n];return Dl(r)&&Dl(i)&&i>r},t.refreshKey=function(e){var t;if(!(this._disabled||e===Wh&&this._facebookClickIdChangePending)){var n=this._splitStorage?null==(t=ry(e))?void 0:t.storageGroup:void 0,r=n?P_._parse(this._groupEntryName(n)):this._storage._parse(this._name);if(r&&e in r)this._setProp(e,r[e],!1);else{if(n){var i=this._storage._parse(this._name);if(i&&e in i)return void this._setProp(e,i[e],!1)}this._deleteProp(e,!1)}}},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?Rl(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout((function(){e._pendingSaveTimer=void 0,e._writeNow()}),t)):this._writeNow()}},t.flush=function(){Rl(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._facebookClickIdChangePending||this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase()||this.refreshKey(Wh));var t=!e&&!this._storageMigrationInProgress;t||(this._crossTabFeatureFlagIdentityMismatch=!1);var n=!!t&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&th.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this._splitStorage)return this._writeNowSplit(),void(n&&this._crossTabFeatureFlagHandlers.forEach((function(e){return e()})));var r=this._writeEntry(this._storage,this._name,this.props,uy);"written"===r&&this._rememberCurrentCookieProperties(this.props),"failed"!==r&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1),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,uy);"written"===i&&this._rememberCurrentCookieProperties(n),"failed"!==i&&(this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1,ly.forEach((function(t){var n;null!=(n=ry(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)})));for(var o,s=function(){var t,n=o.value,i=r[n];if(Fl(i)&&(null==(t=e._slotState[n])||!t.persisted))return ly.forEach((function(t){var r;(null==(r=ry(t))?void 0:r.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)})),1;var s=e._writeEntry(P_,e._groupEntryName(n),i,n);"failed"!==s&&ly.forEach((function(t){var r=ry(t);(null==r?void 0:r.storageGroup)!==n||"written"!==s&&r.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)}))},a=Pa(ey);!(o=a()).done;)s()},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return ih(this.props,(function(n,r){var i,o=null==(i=ry(r))?void 0:i.storageGroup;o?t[o][r]=n:e[r]=n})),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===uy)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return ih(e,(function(e,t){var r;n[t]=null!=(r=ry(t))&&r.volatile?"__volatile__":e})),JSON.stringify(n)},t._writeEntry=function(e,t,n,r){var i,o=this._slotWriteState(r);if(r!==uy&&!o.dirty&&!Rl(o.fingerprint))return"skipped";try{if((i=this._entryFingerprint(n,r))===o.fingerprint)return o.dirty=!1,"skipped"}catch(e){i=void 0}return e._set(t,n,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(o.dirty=!1,r!==uy&&(o.persisted=!0),Rl(i)||(o.fingerprint=i),this._splitStorageEligible&&(o.storageValue=P_._get(t)),"written"):(this._config.debug&&th.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(),Rl(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,i=Pa(ey);!(r=i()).done;)P_._remove(this._groupEntryName(r.value));n?delete this._slotState[uy]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0},t.clear=function(){this.remove(),this.props={}},t.register_once=function(e,t,n){var r=this;if(Il(e)){this.syncCookieProperties(),Rl(t)&&(t="None"),this._expire_days=Rl(n)?this._default_expiry:n;var i=!1;if(ih(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(Il(e)){this.syncCookieProperties(),this._expire_days=Rl(t)?this._default_expiry:t;var r=!1;if(ih(e,(function(t,i){e.hasOwnProperty(i)&&(n.props[i]!==t||Il(t)||Pl(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=Pa("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==Wf?void 0:Wf.URL;if(e!==this._campaign_params_url){var t=eg(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!Fl(lh(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==Wf?void 0:Wf.referrer)?ng(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:og(),$referring_domain:null!=Wf&&Wf.referrer&&(null==(e=f_(Wf.referrer))?void 0:e.host)||ig},void 0)},t.set_initial_person_info=function(){var e;if(!this.props[qp]&&!this.props[$p]){var t=sg(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[Np]=this._storesIdentityInCookie?{r:ay(t.r),u:t.u?ay(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};ih([$p,qp],(function(n){var r=e.props[n];r&&ih(r,(function(e,n){t["$initial_"+vl(n)]=e}))}));var n=this.props[Np];if(n){var r=function(e,t){void 0===t&&(t=!1);var n=ag(e,t),r={};return ih(n,(function(e,t){r["$initial_"+vl(t)]=e})),r}(n,this._config.disable_capture_url_hashes);oh(t,r)}return t},t.safe_merge=function(e){return ih(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._syncCookieProperties(Ta({},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),d=o||c!==this._splitStorage,f=!a&&(d||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(u);this._storageMigrationInProgress=d;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),d){var h=this.props;this.clear(),this._storage=l,this._splitStorage=c,this.props=h,this.save()}else s&&(this._storage=l,a||(delete this._slotState[uy],this._writeNow()))}finally{this._storageMigrationInProgress=!1,f&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[Np];if(this._storesIdentityInCookie&&Il(e)&&"string"==typeof e.r){var t=ay(e.r),n="string"==typeof e.u?ay(e.u):e.u;t===e.r&&n===e.u||this._setProp(Np,Ta({},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[Gh]||{};n[e]=t,this._setProp(Gh,n),this.save()},t.remove_event_timer=function(e){var t=this.props[Gh]||{},n=t[e];return Rl(n)||(delete t[e],this._setProp(Gh,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&&(e!==Hh&&e!==Op||i===t||(this._localIdentityChangePending=!0),e!==Wh||dy(i,t)||(this._facebookClickIdChangePending=!0),this._markPendingCrossTabFeatureFlagChanges(e,i,t),null!=(r=ry(e))&&r.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(cy(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),e===Wh&&(this._facebookClickIdChangePending=!0),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=ry(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),_y=nh("[RateLimiter]"),vy=function(){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,n,r;void 0===e&&(e=!1);var i=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,s=(new Date).getTime(),a=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property(Dp))&&void 0!==t?t:{tokens:i,last:s};a.tokens+=(s-a.last)/1e3*o,a.last=s,a.tokens>i&&(a.tokens=i);var u=1>a.tokens;if(u||e||(a.tokens=Math.max(0,a.tokens-1)),u&&!e){var l=(Dl(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this._captureWarning(l)&&(a.dropped=0)}return this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Dp,a),{isRateLimited:u,remainingTokens:a.tokens}},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Pl(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Gf&&Gf.pathname)return""+(null!==(e=Gf.origin)&&void 0!==e?e:"")+Gf.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},Ea(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)}}])}(),gy=nh("[RemoteConfig]"),my=function(){function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,r=this;null!=(t=Tg.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",(function(){return e(r.remoteConfig)})):e()},t._loadRemoteConfigJSON=function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback: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.");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)}},Ea(e,[{key:"remoteConfig",get:function(){var e;return null==(e=Tg._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),yy=Uint8Array,by=Uint16Array,wy=Uint32Array,Sy=new yy([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]),ky=new yy([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]),xy=new yy([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cy=function(e,t){for(var n=new by(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new wy(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]},Ey=Cy(Sy,2),Py=Ey[1];Ey[0][28]=258,Py[258]=28;for(var Ty=Cy(ky,0)[1],Iy=new by(32768),Fy=0;32768>Fy;++Fy){var Ry=(43690&Fy)>>>1|(21845&Fy)<<1;Iy[Fy]=((65280&(Ry=(61680&(Ry=(52428&Ry)>>>2|(13107&Ry)<<2))>>>4|(3855&Ry)<<4))>>>8|(255&Ry)<<8)>>>1}var Ly=function(e,t,n){for(var r=e.length,i=0,o=new by(t);r>i;++i)++o[e[i]-1];var s,a=new by(t);for(i=0;t>i;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new by(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[Iy[d]>>>u]=l}else for(s=new by(r),i=0;r>i;++i)s[i]=Iy[a[e[i]-1]++]>>>15-e[i];return s},Ay=new yy(288);for(Fy=0;144>Fy;++Fy)Ay[Fy]=8;for(Fy=144;256>Fy;++Fy)Ay[Fy]=9;for(Fy=256;280>Fy;++Fy)Ay[Fy]=7;for(Fy=280;288>Fy;++Fy)Ay[Fy]=8;var Oy=new yy(32);for(Fy=0;32>Fy;++Fy)Oy[Fy]=5;var My=Ly(Ay,9,0),Dy=Ly(Oy,5,0),qy=function(e){return(e/8>>0)+(7&e&&1)},$y=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof by?by:e instanceof wy?wy:yy)(n-t);return r.set(e.subarray(t,n)),r},Ny=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},By=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Hy=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 yy(0),0];if(1==i){var s=new yy(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 by(f+1),p=jy(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 yy(h),p]},jy=function(e,t,n){return-1==e.s?Math.max(jy(e.l,t,n+1),jy(e.r,t,n+1)):t[e.s]=n},Uy=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new by(++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]},Vy=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},zy=function(e,t,n){var r=n.length,i=qy(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)},Wy=function(e,t,n,r,i,o,s,a,u,l,c){Ny(t,c++,n),++i[256];for(var d=Hy(i,15),f=d[0],h=d[1],p=Hy(o,15),_=p[0],v=p[1],g=Uy(f),m=g[0],y=g[1],b=Uy(_),w=b[0],S=b[1],k=new by(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=Hy(k,7),E=C[0],P=C[1],T=19;T>4&&!E[xy[T-1]];--T);var I,F,R,L,A=l+5<<3,O=Vy(i,Ay)+Vy(o,Oy)+s,M=Vy(i,f)+Vy(o,_)+s+14+3*T+Vy(k,E)+(2*k[16]+3*k[17]+7*k[18]);if(O>=A&&M>=A)return zy(t,c,e.subarray(u,u+l));if(Ny(t,c,1+(O>M)),c+=2,O>M){I=Ly(f,h,0),F=f,R=Ly(_,v,0),L=_;var D=Ly(E,P,0);for(Ny(t,c,y-257),Ny(t,c+5,S-1),Ny(t,c+10,T-4),c+=14,x=0;T>x;++x)Ny(t,c+3*x,E[xy[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)Ny(t,c,D[H=31&B[x]]),c+=E[H],H>15&&(Ny(t,c,B[x]>>>5&127),c+=B[x]>>>12)}}else I=My,F=Ay,R=Dy,L=Oy;for(x=0;a>x;++x)if(r[x]>255){var H;By(t,c,I[257+(H=r[x]>>>18&31)]),c+=F[H+257],H>7&&(Ny(t,c,r[x]>>>23&31),c+=Sy[H]);var j=31&r[x];By(t,c,R[j]),c+=L[j],j>3&&(By(t,c,r[x]>>>5&8191),c+=ky[j])}else By(t,c,I[r[x]]),c+=F[r[x]];return By(t,c,I[256]),c+F[256]},Gy=new wy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qy=function(){for(var e=new wy(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ky=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Zy(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=Qy[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=(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 yy(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=zy(u,l,e.subarray(c,d)):(u[c]=!0,l=zy(u,l,e.subarray(c,s)))}else{for(var f=Gy[t-1],h=f>>>13,p=8191&f,_=(1<<n)-1,v=new by(32768),g=new by(_+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 wy(25e3),S=new by(288),k=new by(32),x=0,C=0,E=(c=0,0),P=0,T=0;s>c;++c){var I=b(c),F=32767&c,R=g[I];if(v[F]=R,g[I]=F,c>=P){var L=s-c;if((x>7e3||E>24576)&&L>423){l=Wy(e,u,0,w,S,k,C,E,T,c-T,l),E=x=C=0,T=c;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)k[A]=0}var O=2,M=0,D=p,q=F-R&32767;if(L>2&&I==b(c-q))for(var N=Math.min(h,L)-1,B=Math.min(32767,c),H=Math.min(258,L);B>=q&&--D&&F!=R;){if(e[c+O]==e[c+O-q]){for(var j=0;H>j&&e[c+j]==e[c+j-q];++j);if(j>O){if(O=j,M=q,j>N)break;var U=Math.min(q,j-2),V=0;for(A=0;U>A;++A){var z=c-q+A+32768&32767,W=z-v[z]+32768&32767;W>V&&(V=W,R=z)}}}q+=(F=R)-(R=v[F])+32768&32767}if(M){w[E++]=268435456|Py[O]<<18|Ty[M];var G=31&Py[O],Q=31&Ty[M];C+=Sy[G]+ky[Q],++S[257+G],++k[Q],P=c+O,++x}else w[E++]=e[c],++S[e[c]]}}l=Wy(e,u,!0,w,S,k,C,E,T,c-T,l)}return $y(a,0,r+qy(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)),l=u.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&&Ky(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)}}(u,t),Ky(u,l-8,n.d()),Ky(u,l-4,r),u}var Yy=!!Kf||!!Qf,Jy="text/plain",Xy=!1,eb=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:"")},tb=function(e,t,n){var r;void 0===n&&(n=!0);var i=e.split("?"),o=i[0],s=i[1],a=Ta({},t),u=null!==(r=null==s?void 0:s.split("&").map((function(e){var t,r=e.split("="),i=r[0],o=n&&null!==(t=a[i])&&void 0!==t?t:r[1];return delete a[i],i+"="+o})))&&void 0!==r?r:[],l=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return ih(e,(function(e,t){Rl(e)||Rl(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)}(a);return l&&u.push(l),u.length>0?o+"?"+u.join("&"):o},nb=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===Ju){var r=Zy(function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new yy(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;n>s;++s){if(i+5>r.length){var a=new yy(i+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);128>u?o(u):2048>u?(o(192|u>>>6),o(128|63&u)):u>55295&&57344>u?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return $y(r,0,i)}(d_(t)),{mtime:0});return{contentType:Jy,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Xu){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}(d_(t)),o=function(e){return"data="+encodeURIComponent("string"==typeof e?e:d_(e))}(i);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var s=d_(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},rb=function(e){var t,n,r=function(){return"sendBeacon"===e.transport?{url:tb(e.url,{compression:Xu}),encodedBody:nb(Ta({},e,{compression:Xu,_encodedBody:void 0}))}:{url:eb(e.url,"compression"),encodedBody:nb(Ta({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=nb(e)}catch(t){if(hf(e.compression,h_(e.url,"compression")))return th.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&hf(e.compression,h_(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?ff(new Uint8Array(n)):ArrayBuffer.isView(n)&&ff(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Xy=!0,r()):{url:e.url,encodedBody:t}},ib=function(e){try{return rb(e)}catch(t){return th.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},ob=function(){var e=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.n){case 0:return n=d_(t.data),e.n=1,mf(n,jf.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,Ta({},t,{_encodedBody:{contentType:Jy,body:i=e.v,estimatedSize:i.byteLength}}))}}),e)})));return function(t){return e.apply(this,arguments)}}(),sb=/Failed to fetch|NetworkError|Load failed/i,ab=function(e){return"TypeError"===(null==e?void 0:e.name)&&sb.test((null==e?void 0:e.message)||"")},ub=function(e){var t=ib(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;ih(e.headers,(function(e,t){u.append(t,e)})),o&&u.append("Content-Type",o);var l=null,c=!1;if(Zf){var d=new Zf;l={signal:d.signal,timeout:setTimeout((function(){var t;c=!0,d.abort(Sd("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}),e.timeout)}}var f=function(t){c&&"AbortError"===(null==t?void 0:t.name)||ab(t)?th.warn(t):th.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var h;Qf(n,Ta({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(a||0),body:s,signal:null==(h=l)?void 0:h.signal},e.fetchOptions)).then((function(t){return t.text().then((function(n){var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){th.error(e)}null==e.callback||e.callback(r)}))})).catch(f).finally((function(){return l?clearTimeout(l.timeout):null}))}catch(e){l&&clearTimeout(l.timeout),f(e)}}},lb=function(e){try{var t,n=rb(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(zf.sendBeacon(r,u))return;var l=Pl(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Pl(l)&&l.length>1&&(null!=a?a:0)>16384){var c=Math.ceil(l.length/2),d=function(t){return Pl(e.data)?t:Ta({},e.data,{batch:t})};return lb(Ta({},e,{data:d(l.slice(0,c))})),void lb(Ta({},e,{data:d(l.slice(c))}))}th.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to fetch"),ub(Ta({},e,{_keepaliveDisabled:!0}))}catch(e){th.warn("Beacon send failed",e)}},cb=function(e,t,n,r){var i,o="query"===r?"POST"===t?"sent_at":"_":void 0;return tb(n===Ju?eb(e,"compression"):e,Ta({},o?((i={})[o]=Date.now().toString(),i):{},n===Ju?{}:{compression:n}))},db=[];Qf&&db.push({transport:"fetch",method:ub}),Kf&&db.push({transport:"XHR",method:function(e){var t=ib(e);if(t){var n=new Kf,r=t.encodedBody;n.open(e.method||"GET",t.url,!0);var i=null!=r?r:{},o=i.contentType,s=i.body;ih(e.headers,(function(e,t){n.setRequestHeader(t,e)})),o&&n.setRequestHeader("Content-Type",o),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=function(){if(4===n.readyState){var t={statusCode:n.status,text:n.responseText};if(200===n.status)try{t.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(t)}},n.send(s)}}}),null!=zf&&zf.sendBeacon&&db.push({transport:"sendBeacon",method:lb});var fb=3e3,hb=function(){function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=Zl((null==t?void 0:t.flush_interval_ms)||fb,250,5e3,th.createLogger("flush interval"),fb),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),r=[].concat(n.filter((function(e){return 0===e.url.indexOf("/e")})),n.filter((function(e){return 0!==e.url.indexOf("/e")})));r.map((function(t){e._sendRequestSafely(Ta({},t,{transport:"sendBeacon"}))}))},t.enable=function(){this._isPaused=!1,this._setFlushTimeout()},t._setFlushTimeout=function(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((function(){if(e._clearFlushTimeout(),e._queue.length>0){var t=e._formatQueue(),n=function(){var n=t[r],i=(new Date).getTime();n.data&&Pl(n.data)&&ih(n.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e._sendRequestSafely(n)};for(var r in t)n()}}),this._flushTimeoutMs))},t._sendRequestSafely=function(e){try{this._sendRequest(e)}catch(e){th.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return ih(this._queue,(function(t){var n,r=t,i=(r?r.batchKey:null)||r.url;Rl(e[i])&&(e[i]=Ta({},r,{data:[]})),null==(n=e[i].data)||n.push(r.data)})),this._queue=[],e},e}(),pb=["retriesPerformedSoFar"],_b=function(){function e(e){var t=this;this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!Rl(Uf)&&"onLine"in Uf.navigator&&(this._areWeOnline=Uf.navigator.onLine,this._onlineListener=function(){t._areWeOnline=!0,t._flush()},this._offlineListener=function(){t._areWeOnline=!1},fh(Uf,"online",this._onlineListener),fh(Uf,"offline",this._offlineListener))}var t=e.prototype;return t.retriableRequest=function(e){var t=this,n=e.retriesPerformedSoFar,r=Fa(e,pb);ql(n)&&(r.url=tb(r.url,{retry_count:n})),this._instance._send_request(Ta({},r,{callback:function(e){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=n?n:0))return void t._enqueue(Ta({retriesPerformedSoFar:n},r));0===e.statusCode&&th.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!=n?n:0)+" retries.")}null==r.callback||r.callback(e)}}))},t._enqueue=function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this._queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in "+n;navigator.onLine||(i+=" (Browser is offline)"),th.warn(i),this._isPolling||(this._isPolling=!0,this._poll())},t._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)},t._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=Pa(n);!(r=i()).done;)this.retriableRequest(r.value.requestOptions)},t.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,Rl(Uf)||(this._onlineListener&&(Uf.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Uf.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=Pa(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(Ta({},n,{transport:"sendBeacon"}))}catch(e){th.error(e)}}this._queue=[]},Ea(e,[{key:"length",get:function(){return this._queue.length}}])}(),vb=function(){function e(e){var t=this;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)},this._instance=e}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){fh(Uf,"scroll",this._updateScrollData,{capture:!0}),fh(Uf,"scrollend",this._updateScrollData,{capture:!0}),fh(Uf,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Uf||null==(e=Uf.document)?void 0:e.documentElement;for(var t,n=Pa(Pl(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var r,i=null==Uf||null==(r=Uf.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 Uf?"y"===e?Uf.scrollY||Uf.pageYOffset||(null==(t=Uf.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Uf.scrollX||Uf.pageXOffset||(null==(n=Uf.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")},Ea(e,[{key:"_scrollRoot",get:function(){return this._instance.config.scroll_root_selector}}])}(),gb=function(e){return sg(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)},mb=function(){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={})[Mp]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||gb,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Mp]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ag(t,this._instance.config.disable_capture_url_hashes):{$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 ih(lh(this.getSetOnceProps()),(function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+vl(n)]=t})),e},e}(),yb=function(){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=Pa(this._events[e]||[]);!(n=r()).done;)(0,n.value)(t);for(var i,o=Pa(this._events["*"]||[]);!(i=o()).done;)(0,i.value)(e,t)},e}(),bb=nh("[SessionId]"),wb=864e5,Sb=function(){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 yb,this._sessionHasBeenIdleTooLong=function(e,t){return!(!ql(e)||!ql(t))&&Math.abs(e-t)>i.sessionTimeoutMs},!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Qp)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||l_,this._windowIdGenerator=n||l_;var o=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*Zl(this._config.session_idle_timeout_seconds||1800,60,36e3,bb.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=H_._parse(this._window_id_storage_key),a=H_._parse(this._primary_window_exists_storage_key);s&&!a?this._windowId=s:H_._remove(this._window_id_storage_key),H_._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 Rl(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&&H_._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&H_._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?H_._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!Ol(t)&&!Ol(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={})[cp]=[t,e,n],r)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return ql(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(cp):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!Ol(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={})[cp]=[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=ql(e)?e:0,n=ql(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[cp];return Pl(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 bb.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void bb.error("Invalid sessionID in bootstrap",e)}}(e);return!Rl(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&&Uf&&(Uf.removeEventListener(Xp,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&H_._remove(e._primary_window_exists_storage_key)},fh(Uf,Xp,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),this._config.cookieless_mode===Qp)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(Ol(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=!Rl(i)&&u!==i,d=this._freshestActivityTimestamp(),f=this._getWindowId(),h=this._pendingBootstrapSession,p=!!h&&(h.sessionStartTimestamp>r+6e4||r-h.sessionStartTimestamp>wb),_=h?p:ql(l)&&Math.abs(r-l)>wb,v=!1,g=c,m=!u||!!h,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(r,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(r))||bb.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2]}if(m||b||_){g=!1;var S=h&&!p;u=S?h.sessionId:this._sessionIdGenerator(),f=this._windowIdGenerator(),bb.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)&&(bb.info("adopted cross-tab session id",{sessionId:u,windowId:f}),v=!0);var k=ql(d)&&e&&!_?d:r,x=ql(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))},Ea(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),kb=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&hl(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((function(e){return hl(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver};function xb(){return(xb=Ca(Ra().m((function e(){var t,n,r;return Ra().w((function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==zf?void 0:zf.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:return e.a(2,Ll(r=null==(n=e.v)?void 0:n.model)&&r.length>0?r:void 0);case 3:return e.p=3,th.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}}),e,null,[[1,3]])})))).apply(this,arguments)}var Cb="custom",Eb="i.posthog.com",Pb=/^\/static\//,Tb=["/s/","/e/","/i/"],Ib=function(){function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(Pb.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=f_(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=f_(n))?void 0:o.href)||n;r=i(new URL(s)).toString()}if(i&&"api"===e&&Tb.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||(c={apiHost:l,rewriteRequestPath:i,urls:new Set},this._ingestionEndpoints=c),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===Cb)return this._prepareEndpoint(e,t,this.apiHost+t);var r=Eb+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)}},Ea(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("."+Eb,".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":Cb),this._regionCache[this.apiHost]}}])}(),Fb=nh("[PostHog ExternalIntegrations]"),Rb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Lb=function(){function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,(function(e){if(e)return Fb.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=Tg.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(Rb[a],(function(){var t;null==(t=Tg.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)})),!u&&null!=(i=Tg.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[a]&&(null==(o=Tg.__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}(),Ab=function(){function e(e,t){this._logger=e,this._client=t,this._extensions=new Map,this._disposed=!1}var t=e.prototype;return t.add=function(){var e=Ca(Ra().m((function e(t){var n,r,i;return Ra().w((function(e){for(;;)switch(e.p=e.n){case 0:if(!this._disposed){e.n=1;break}throw new Error("Cannot add an extension to a disposed ExtensionRuntime");case 1:if(!this._extensions.has(t.name)){e.n=2;break}throw new Error('Browser extension "'+t.name+'" is already registered');case 2:if(this._extensions.set(t.name,t),e.p=3,!(n=t.setup(this._client))){e.n=4;break}return e.n=4,n;case 4:e.n=6;break;case 5:e.p=5,i=e.v,(r=this._extensions.get(t.name)===t)&&this._extensions.delete(t.name),this._logger.error('Failed to set up browser extension "'+t.name+'"',i),r&&this._disposeExtension(t);case 6:return e.a(2)}}),e,this,[[3,5]])})));return function(t){return e.apply(this,arguments)}}(),t.getExtension=function(e){return this._extensions.get(e)},t.dispose=function(){if(!this._disposed){this._disposed=!0;var e=Array.from(this._extensions.values()).reverse();this._extensions.clear();for(var t,n=Pa(e);!(t=n()).done;)this._disposeExtension(t.value)}},t._disposeExtension=function(e){var t=this;try{var n=null==e.dispose?void 0:e.dispose();n&&Tl(n.then)&&n.then(void 0,(function(n){t._logger.error('Failed to dispose browser extension "'+e.name+'"',n)}))}catch(t){this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}},e}(),Ob=function(){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=Pa(e);!(n=i()).done;){var o=n.value,s=null==t?void 0:t.get_property(o);Rl(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}(),Mb="extensionsRemoteConfig",Db=function(){function e(e){var t=this;this._disposed=!1,this.instance=e,this._logger=th,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new Ob(e),this.onEvent=function(e){return Hf(t.instance.on("eventCaptured",(function(n){try{e({event:n.event,properties:n.properties})}catch(e){t._logger.error("Browser extension event listener failed",e)}})))},this.onRemoteConfig=function(e){if(t._disposed)return Hf((function(){}));var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},r=t.instance._internalEventEmitter.on(Mb,n);return t._latestRemoteConfigResult&&n(t._latestRemoteConfigResult),Hf(r)},this._runtime=new Ab(th.createLogger("[BrowserExtensions]"),this)}var t=e.prototype;return t.add=function(e){return this._runtime.add(e)},t.getExtension=function(e){return this._runtime.getExtension(e)},t.capture=function(){var e=Ca(Ra().m((function e(t,n,r){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(r){e.n=1;break}return this.instance.capture(t,n),e.a(2);case 1:this.instance.capture(t,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce});case 2:return e.a(2)}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.registerDynamicEventProperties=function(e){return Hf(this.instance._registerExtensionEventProperties(e))},t.handleRemoteConfig=function(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(Mb,e))},t.sendRequest=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s=this;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),i=this.instance.requestRouter.endpointFor(null!==(r=n.target)&&void 0!==r?r:"api",t),o={method:n.method,url:n.query?tb(i,n.query):i,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?yl.Base64:void 0,timestampMode:n.sentAt},"sendBeacon"!==n.transport){e.n=1;break}return this.instance._send_request(o),e.a(2,{statusCode:202});case 1:return e.a(2,new Promise((function(e){o.callback=e,s.instance._send_request(o)})))}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.dispose=function(){this._disposed||(this._disposed=!0,this._runtime.dispose())},Ea(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(jh))&&void 0!==e?e:this.distinctId}},{key:"deviceId",get:function(){var e=this.instance.get_property(jh);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:jf.LIB_NAME,version:jf.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=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==i?void 0:i.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==i?void 0:i.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(r=null==i?void 0:i.sessionStartTimestamp)&&void 0!==r?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}},{key:"canCapture",get:function(){return this.instance.is_capturing()}},{key:"projectToken",get:function(){return this.instance.config.token}}])}(),qb={},$b=0,Nb=function(){},Bb='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Hb="Surveys module not available",jb="sanitize_properties is deprecated. Use before_send instead",Ub="Invalid value for property_denylist config: ",Vb=/^[A-Za-z0-9_-]{1,400}$/,zb=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Wb=["token","distinct_id",jp],Gb="posthog",Qb=!Yy&&-1===(null==Jf?void 0:Jf.indexOf("MSIE"))&&-1===(null==Jf?void 0:Jf.indexOf("Mozilla")),Kb=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},Zb=function(e){var t;return Ta({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:dh(null==Wf?void 0:Wf.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Nb,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Gf&&Ll(null==Gf?void 0:Gf.search)&&-1!==Gf.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Uf||null==(t=Uf.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,surveys_request_timeout_ms:1e4,on_request_error:function(e){th.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:Yp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:fb},error_tracking:{},_onCapture:Nb},function(e){return{rageclick:e&&e>="2026-05-30"?{content_ignorelist:Sm,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:Kb(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))},Yb=[["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"]],Jb=function(e){for(var t={},n=0,r=Yb;r.length>n;n++){var i=r[n],o=i[0],s=i[1];Rl(e[o])||(t[s]=e[o])}var a=oh({},t,e),u=e.__preview_external_dependency_versioned_paths;return Rl(u)||(Rl(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),Ll(u)&&Rl(e.asset_host)&&(a.asset_host=u)),Pl(e.property_blacklist)&&(Rl(e.property_denylist)?a.property_denylist=e.property_blacklist:Pl(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):th.error(Ub+e.property_denylist)),a},Xb=function(){return Ea((function(){this.__forceAllowLocalhost=!1}),[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){th.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),ew=function(){function e(){var t,n=this;this.webPerformance=new Xb,this._personProcessingSetOncePropertiesSent=!1,this.version=jf.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new yb,this._extensions=[],this._extensionEventPropertyProducers=[],this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Zb(),this.SentryIntegration=Jm,this.sentryIntegration=function(e){return function(e,t){var n=Zm(e,t);return{name:Km,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 vb(this),this.pageViewManager=new Xm(this),this.rateLimiter=new vy(this),this.requestRouter=new Ib(this),this.consent=new tm(this),this.externalIntegrations=new Lb(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=Ll(e)?((i={})[e]=t,i):e;n.setPersonProperties(o),null==r||r({})},set_once:function(e,t,r){var i,o=Ll(e)?((i={})[e]=t,i):e;n.setPersonProperties(void 0,o),null==r||r({})}},this.on("eventCaptured",(function(e){return th.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 this.config.cookieless_mode===Qp||this.config.cookieless_mode===Gp&&this.consent.isRejected()},t._warnIfVolatileIdentityWithoutStableId=function(){if(!this._hasWarnedAboutVolatileIdentity&&!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', or keep this persistence and pass a stable ID through bootstrap.distinctID."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",n="Either set disable_persistence to false, or keep persistence disabled and pass a stable ID through bootstrap.distinctID."),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._healCookielessSentinelDistinctId=function(){if(!this._inCookielessMode()&&this.get_distinct_id()===Hp){var e=this.persistence;if(e){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||t===Hp){var n=this.config.get_device_id(l_());this.register({distinct_id:n,$device_id:n}),e.set_property(Op,Kp)}this._sync_opt_out_with_persistence()}}},t.init=function(t,n,r){if(r&&r!==Gb){var i,o=null!==(i=qb[r])&&void 0!==i?i:new e;return o._init(t,n,r),qb[r]=o,qb[Gb][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=Ll(e)?e.trim():"";if(!u)return th.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=Zb(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=Zb(t.defaults),c=Jb(t),d=oh({},l,c,{name:n,token:u});Il(l.rageclick)&&Il(c.rageclick)&&(d.rageclick=oh({},l.rageclick,c.rageclick)),Il(l.session_recording)&&Il(c.session_recording)&&(d.session_recording=oh({},l.session_recording,c.session_recording)),this.set_config(d),this.config.on_xhr_error&&th.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ju;var f=this._is_persistence_disabled();if(this.persistence=new py(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new py(Ta({},this.config,{persistence:"sessionStorage"}),f,!1),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!f&&H_._is_supported()){var h=H_._parse(this._sessionRegisteredPropertiesStorageKey);Pl(h)&&h.forEach((function(e){Ll(e)&&s._sessionRegisteredPropKeys.add(e)}))}else H_._remove(this._sessionRegisteredPropertiesStorageKey);var p=Ta({},this.persistence.props),_=Ta({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new hb((function(e){return s._send_retriable_request(e)}),this.config.request_queue_config),this._retryQueue=new _b(this),this.__request_queue=[];var v=this._inCookielessMode();v||(this.sessionManager=new Sb(this),this.sessionPropsManager=new mb(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?(th.info("Deferring extension initialization to improve startup performance"),setTimeout((function(){s._initExtensions(v)}),0)):(th.info("Initializing extensions synchronously"),this._initExtensions(v)),jf.DEBUG=jf.DEBUG||this.config.debug,jf.DEBUG&&th.info("Starting in debug mode",{this:this,config:t,thisC:Ta({},this.config),p:p,s:_}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=Ta({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var g=null==(i=t.bootstrap)?void 0:i.distinctID;if(this._hasStableInitialDistinctId=!!g&&!Al(g),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var m=t.bootstrap.distinctID,y=this.get_distinct_id(),b=this.persistence.get_property(Op);if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Kp)this.identify(m);else if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Zp)th.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 w=this.config.get_device_id(l_()),S=t.bootstrap.isIdentifiedID?w:m;this.persistence.set_property(Op,t.bootstrap.isIdentifiedID?Zp:Kp),this.register({distinct_id:m,$device_id:S})}}if(v)this.register_once({distinct_id:Hp,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(l_());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Op,Kp)}return fh(Uf,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?Qm(this,(function(){return s._loaded()})):this._loaded(),Tl(this.config._onCapture)&&this.config._onCapture!==Nb&&(th.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(function(e){return s.config._onCapture(e.event,e)}))),this.config.ip&&th.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 xb.apply(this,arguments)}().then((function(e){var t;e&&s.register(((t={})[Uh]=e,t))})).catch(Nb),this},t._isSharedExtension=function(e){var t=e;return Ll(t.name)&&Tl(t.setup)},t._enrollExtension=function(e,t){var n=this;this._isSharedExtension(e)?t.push((function(){n._getBrowserClientAdapter().add(e).catch((function(){return null==e.dispose?void 0:e.dispose()})).catch((function(t){th.error('Failed to dispose browser extension "'+e.name+'"',t)}))})):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;u&&(this.featureFlags&&this.featureFlags instanceof u||(null==(i=this._featureFlagsReloadingUnsubscribe)||i.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),Tl(this.featureFlags.onReloading)&&Tl(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading((function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)})),this._getBrowserClientAdapter().add(this.featureFlags)):null==(o=(s=this.featureFlags).initialize)||o.call(s))},t._initExtensions=function(t){var n,r,i,o,s,a,u,l=this,c=performance.now(),d=Ta({},e.__defaultExtensionClasses,this.config.__extensionClasses),f=[];d.exceptions&&this._extensions.push(this.exceptions=null!==(n=this.exceptions)&&void 0!==n?n:new d.exceptions(this)),d.historyAutocapture&&this._extensions.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this._extensions.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this._extensions.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this._extensions.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||f.push((function(){l.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this._enrollExtension(this.autocapture=new d.autocapture(this),f),d.surveys&&this._enrollExtension(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),f),d.logs&&this._enrollExtension(this.logs=null!==(i=this.logs)&&void 0!==i?i:new d.logs(this),f),d.metrics&&this._extensions.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this._extensions.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new d.conversations(this)),d.productTours&&this._extensions.push(this.productTours=new d.productTours(this)),d.heatmaps&&this._extensions.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this._extensions.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,zm)),d.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new d.toolbar(this)),d.experiments&&this._extensions.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this._extensions.forEach((function(e){e.initialize&&f.push((function(){null==e.initialize||e.initialize()}))})),f.push((function(){if(l._pendingRemoteConfig){var e=l._pendingRemoteConfig;l._pendingRemoteConfig=void 0,l._extensions.forEach((function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)}))}})),this._processInitTaskQueue(f,c)},t._processInitTaskQueue=function(e,t){for(var n,r=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((function(){r._processInitTaskQueue(e,t)}),0);var i=e.shift();if(i)try{i()}catch(e){th.error("Error initializing extension:",e)}}var o=Math.round(performance.now()-t);this.register_for_session(((n={})[Up]=this.config.__preview_deferred_init_extensions?"deferred":"synchronous",n[Vp]=o,n)),this.config.__preview_deferred_init_extensions&&th.info("PostHog extensions initialized ("+o+"ms)")},t._onRemoteConfig=function(e){var t,n=this;if(!Wf||!Wf.body)return th.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n._onRemoteConfig(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var r,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=pl(i.supportedCompression,Ju)?Ju:pl(i.supportedCompression,Xu)?Xu:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Yp}),null==(t=this._browserClientAdapter)||t.handleRemoteConfig(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){th.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Gf&&Gf.hostname){var t=Gf.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()&&rh(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;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(t_),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(t_,null,{transport:"sendBeacon"})},t._send_request=function(e){var t,n=this;this.__loaded?Qb?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=Ta({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(Rl(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,r,i=Ta({},e);i.timeout=i.timeout||6e4;var o,s,a,u,l,c=null!==(t=i.transport)&&void 0!==t?t:"fetch";"sendBeacon"===c&&Rl(i.compression)&&i.data&&(i.compression=Xu),"POST"===i.method&&i.data&&("capture-body"===i.timestampMode?i.data={api_key:null!==(s=null==(l=(u=(Pl(o=i.data)?o:[o]).map((function(e){return Ta({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})})))[0])||null==(a=l.properties)?void 0:a.token)&&void 0!==s?s:null==l?void 0:l.token,batch:u,sent_at:(new Date).toISOString()}:"body"===i.timestampMode&&(i.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Pl(e)?e.map((function(e){return Ta({},e,{sent_at:t})})):Ta({},e,{sent_at:t})}(i.data))),i.url=cb(i.url,i.method,i.compression,i.timestampMode);var d=db.filter((function(e){return!i.disableTransport||!e.transport||!i.disableTransport.includes(e.transport)})),f=null!==(n=null==(r=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(d,(function(e){return e.transport===c})))?void 0:r.method)&&void 0!==n?n:d[0].method;if(!f)throw new Error("No available transport method");var h=function(e){try{f(e)}catch(e){ab(e)?th.warn(e):th.error(e),null==i.callback||i.callback({statusCode:0,error:e})}};"sendBeacon"!==c&&i.data&&i.compression===Ju&&Yf&&"undefined"!=typeof Promise&&!Xy?ob(i).then((function(e){h(e)})).catch((function(t){if(pf(t))return Xy=!0,void h(Ta({},i,{compression:void 0,url:cb(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 pf(e)||t===df})(t)&&(Xy=!0),h(i)})):f(i)}(Ta({},e,{callback:function(t){n.rateLimiter.checkForLimiting(t),400>t.statusCode||null==n.config.on_request_error||n.config.on_request_error(t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))},t._send_retriable_request=function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)},t._execute_array=function(e){var t=this;$b++;try{var n,r=[],i=[],o=[];rh(e,(function(e){if(e)if(Pl(n=e[0]))o.push(e);else if(Tl(e))try{e.call(t)}catch(t){th.error("Error executing queued PostHog call",e,t)}else Pl(e)&&"alias"===n?r.push(e):Pl(e)&&-1!==n.indexOf("capture")&&Tl(t[n])?o.push(e):i.push(e)}));var s=function(e,t){rh(e,(function(e){try{if(Pl(e[0])){var n=t;ih(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){th.error("Error executing queued PostHog call",e,t)}}))};s(r,this),s(i,this),s(o,this)}finally{$b--}},t.push=function(t){if($b>0&&Pl(t)&&Ll(t[0])){var n=e.prototype[t[0]];Tl(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedFacebookClickId=function(){var e,t=null==(e=this.persistence)?void 0:e.get_property(Wh);return Ll(t)&&zb.test(t)?{value:t,delivered:!1}:Il(t)&&Ll(t.value)&&zb.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0},t._updateFacebookClickId=function(e,t,n,r){if(this.persistence){this.persistence.refreshKey(Wh);var i=this._getPersistedFacebookClickId();if(!r){var o;if(n)return Ll(t)&&zb.test(t)?(t!==(null==i?void 0:i.value)&&this.persistence.register(((o={})[Wh]={value:t,delivered:!1},o)),{value:t,pending:t!==(null==i?void 0:i.value)||!i.delivered}):void this.persistence.unregister(Wh);if(Ll(e)&&Vb.test(e)){var s;if((null==i?void 0:i.value.split(".")[3])===e)return{value:i.value,pending:!i.delivered};var a="fb.1."+Date.now()+"."+e;return this.persistence.register(((s={})[Wh]={value:a,delivered:!1},s)),{value:a,pending:!0}}return i?{value:i.value,pending:!i.delivered}:void 0}this.persistence.unregister(Wh)}},t._markFacebookClickIdDelivered=function(e){if(this.persistence){this.persistence.refreshKey(Wh);var t,n=this._getPersistedFacebookClickId();(null==n?void 0:n.value)!==e||n.delivered||this.persistence.register(((t={})[Wh]={value:e,delivered:!0},t))}},t.capture=function(e,t,n){var r,i,o,s,a,u,l,c,d,f,h=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Rl(e)&&Ll(e)){this._healCookielessSentinelDistinctId();var p=!this.config.opt_out_useragent_filter&&this._is_bot();if(!p||this.config.__preview_capture_bot_pageviews){var _=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==_||!_.isRateLimited){var v;null!=t&&t.$current_url&&!Ll(null==t?void 0:t.$current_url)&&(th.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||th.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(v=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 g=new Date,m=(null==n?void 0:n.timestamp)||g,y=wd(null==n?void 0:n.uuid,l_),b={uuid:y,event:e,properties:this.calculateEventProperties(e,t||{},m,y)};e===e_&&this.config.__preview_capture_bot_pageviews&&p&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),_&&(b.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var w="$feature_flag_called"===e&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(mp);(null==n?void 0:n.$set)&&!w&&(b.$set=null==n?void 0:n.$set);var S,k=Il(null==t?void 0:t.$set)?t.$set:void 0,x=!(null==n||!n.$set)&&zh in n.$set,C=x||!!k&&zh in k,E=x?null==n||null==(r=n.$set)?void 0:r[zh]:null==k?void 0:k[zh],P=Pl(null==t?void 0:t.$unset)?t.$unset:[],T=(null==n?void 0:n.$unset)||[],I=-1!==P.indexOf(zh)||-1!==T.indexOf(zh),F=this._updateFacebookClickId(null==(i=v)?void 0:i.fbclid,E,C,I);F&&!0===b.properties.$process_person_profile&&F.pending&&!C&&!w&&(b.$set=Ta(((S={})[zh]=F.value,S),b.$set));var R=null==n?void 0:n.$unset;R&&(b.$unset=R);var L=w?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==r_,e===n_);if(L&&(b.$set_once=L),null!=n&&n._noTruncate||(l=this.config.properties_string_max_length,c=b,d=function(e){return Ll(e)?e.slice(0,l):e},f=new Set,b=function e(t,n){if(t!==Object(t))return d?d(t):t;if(!f.has(t)){var r;if(f.add(t),Pl(t))r=[],rh(t,(function(t){r.push(e(t))}));else{var i={};ih(t,(function(t,n){f.has(t)||(i[n]=e(t,n))})),r=i}return r}}(c)),b.timestamp=m,Rl(null==n?void 0:n.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),w&&(b.properties=function(e,t){void 0===t&&(t=[]);var n={},r=function(t){void 0!==e[t]&&(n[t]=e[t])};return cf.forEach(r),t.forEach(r),n}(b.properties,Wb)),e===ll.DISMISSED||e===ll.SENT){var A,O=null==t?void 0:t[cl.SURVEY_ID],M=null==t?void 0:t[cl.SURVEY_ITERATION];Dh({id:O,current_iteration:M}),b.$set=Ta({},b.$set,((A={})[gh({id:O,current_iteration:M},e===ll.SENT?"responded":"dismissed")]=!0,A))}else if(e===ll.SHOWN){var D;b.$set=Ta({},b.$set,((D={})[cl.SURVEY_LAST_SEEN_DATE]=(new Date).toISOString(),D))}if("product tour shown"===e){var q,N=null==t?void 0:t.$product_tour_type;N&&(b.$set=Ta({},b.$set,((q={})["$product_tour_last_seen_date/"+N]=(new Date).toISOString(),q)))}var B=Ta({},b.properties.$set,b.$set);if(Fl(B)||this.setPersonPropertiesForFlags(B),!Ml(this.config.before_send)){var H=this._runBeforeSend(b);if(!H)return;(b=H).uuid=wd(b.uuid,l_)}var j=null!==(o=null==(s=b.$set)?void 0:s[zh])&&void 0!==o?o:Il(null==(a=b.properties)?void 0:a.$set)?b.properties.$set[zh]:void 0,U=null!=F&&F.pending&&j===F.value?F.value:void 0;this._internalEventEmitter.emit("eventCaptured",b);var V=null!==(u=null==n?void 0:n._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),z=Ta({method:"POST",url:V,data:b,compression:"best-available",timestampMode:"recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(V)?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},null!=n&&n.transport?{transport:n.transport}:{},U?{fireCallbackOnDrop:!0,callback:function(e){e.statusCode>=200&&300>e.statusCode&&h._markFacebookClickIdDelivered(U)}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly||U?this._send_retriable_request(z):this._requestQueue.enqueue(z),b}th.critical("This capture call is ignored due to client rate limiting.")}}else th.error("No event name provided to posthog.capture")}else th.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 Db(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,n,r;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,this.persistence.get_property(Op)===Kp&&(null==(r=this.sessionPersistence)||r.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags(),!0)},t.calculateEventProperties=function(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var o=i?void 0:this.persistence.remove_event_timer(e),s=Ta({},t);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,this._inCookielessMode()&&(s[jp]=!0),"$snapshot"===e){var a=Ta({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!Ll(s.distinct_id)&&!Dl(s.distinct_id)||Al(s.distinct_id))&&th.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,l=function(e,t,n,r){var i,o,s,a;if(void 0===r&&(r=!1),!Jf)return{};var u,l=e?[].concat(Zv,t||[]):[],c=sd(Jf),d=c[0],f=c[1],h=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},p={};Rl(n)||(p.detectGoogleSearchApp=n);var _={},v=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,g=null==(o=navigator)?void 0:o.maxTouchPoints,m=null==Uf||null==(s=Uf.screen)?void 0:s.width,y=null==Uf||null==(a=Uf.screen)?void 0:a.height,b=null==Uf?void 0:Uf.devicePixelRatio;Rl(v)||(_.userAgentDataPlatform=v),Rl(g)||(_.maxTouchPoints=g),Rl(m)||(_.screenWidth=m),Rl(y)||(_.screenHeight=y),Rl(b)||(_.devicePixelRatio=b);var w,S=oh(lh({$os:d,$os_version:f,$browser:nd(Jf,navigator.vendor,h,p),$device:ad(Jf),$device_type:ud(Jf,_),$timezone:ug(),$timezone_offset:lg()}),{$current_url:p_(r?kd(null==Gf?void 0:Gf.href):null==Gf?void 0:Gf.href,l,Jv),$host:null==Gf?void 0:Gf.host,$pathname:null==Gf?void 0:Gf.pathname,$raw_user_agent:Jf.length>1e3?Jf.substring(0,997)+"...":Jf,$browser_version:id(Jf,navigator.vendor,h,p),$browser_language:rg(),$browser_language_prefix:(w=rg(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==Uf?void 0:Uf.screen.height,$screen_width:null==Uf?void 0:Uf.screen.width,$viewport_height:null==Uf?void 0:Uf.innerHeight,$viewport_width:null==Uf?void 0:Uf.innerWidth,$lib:jf.LIB_NAME,$lib_version:jf.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return jf.SDK_DIST_CHANNEL&&(S.$sdk_dist_channel=jf.SDK_DIST_CHANNEL),S}(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 c=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime(),!0),d=c.windowId;s.$session_id=c.sessionId,s.$window_id=d}this.sessionPropsManager&&oh(s,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&oh(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=null==(f=this._retryQueue)?void 0:f.length}catch(e){s.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Cb&&(s.$lib_custom_api_host=this.config.api_host),u=e!==e_||i?e!==t_||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=oh(s,u),e===e_&&Wf&&(s.title=Wf.title),!Rl(o)){var h=n.getTime()-o;s.$duration=parseFloat((h/1e3).toFixed(3))}Jf&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),_=this.sessionPersistence.properties(),v=s.$groups,g=p.$groups;Il(v)&&!Fl(v)&&(s.$groups=Ta({},Il(g)?g:{},v)),ih(["$referrer","$referring_domain"],(function(e){e in p&&delete _[e]}));var m={};if(this._extensionEventPropertyProducers.length>0)for(var y,b=Pa(this._extensionEventPropertyProducers.slice());!(y=b()).done;){var w=y.value;try{oh(m,w())}catch(e){th.error("Failed to produce browser extension event properties",e)}}(s=oh({},l,p,_,Ta({},m,s))).$is_identified=this._isIdentified(),Pl(this.config.property_denylist)?ih(this.config.property_denylist,(function(e){delete s[e]})):th.error(Ub+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(th.error(jb),s=S(s,e));var k=this._hasPersonProcessing();return s.$process_person_profile=k,k&&!i&&this._requirePersonProcessing("_calculate_event_properties"),s},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=this.persistence.get_initial_props(),o=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=oh({},i,o||{},e||{}),a=this.config.sanitize_properties;return a&&(th.error(jb),s=a(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Fl(s)?void 0:s},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||!H_._is_supported())H_._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach((function(e){return t.push(e)})),t.length>0?H_._set(this._sessionRegisteredPropertiesStorageKey,t):H_._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:Hb}),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:Hb})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Hb})},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=$h),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:Hb}},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:Hb})},t._validateIdentifyId=function(e){return!e||Al(e)?(th.critical("Unique user id has not been set in posthog.identify"),!1):e===Hp?(th.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())||(th.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 th.uninitializedWarning("posthog.identify");if(Dl(e)&&(e=e.toString(),th.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._healCookielessSentinelDistinctId();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(jh)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(Vh)&&(this.unregister(Vh),this.register({distinct_id:e}));var l,c=(this.persistence.get_property(Op)||Kp)===Kp,d=e!==u,f=!d&&c;if(d&&c)this.persistence.set_property(Op,Zp),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture(n_,{distinct_id:e,$anon_distinct_id:u},{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=m_(e,t,n),null==(l=this.featureFlags)||l.setAnonymousDistinctId(u);else if(f){this.persistence.set_property(Op,Zp);var h=t||{},p=n||{};this.setPersonPropertiesForFlags({$set:h,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:h,$set_once:p}),this._cachedPersonProperties=m_(e,t,n)}else(t||n)&&this.setPersonProperties(t,n);d||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Fp)):f&&(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=m_(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):th.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Pl(e)?e:[e]).filter((function(e){return Ll(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;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var o,s=this.getGroups(),a=s[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Ta({},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(r_,u)}n&&this.setGroupPropertiesForFlags(((o={})[e]=n,o)),a&&!n&&this.reloadFeatureFlags()}else th.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=$l(e)?e:null==e?void 0:e.resetDeviceID,n=$l(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var r,i,o;if(void 0===t&&(t=!1),th.info("reset"),!this.__loaded)return th.uninitializedWarning("posthog.reset");var s=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 a=this.get_property(jh),u=this.get_property(Uh),l=this.get_property(ip),c=this.is_capturing();this.consent.reset(),t||!c||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var d=null==(o=this.persistence)||null==o._beginCookieSyncSuppression?void 0:o._beginCookieSyncSuppression(),f=!1;try{var h,p,_,v,g,m,y,b,w,S,k,x,C,E;if(null==(h=this.persistence)||h.clear(),null==(p=this.sessionPersistence)||p.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),Rl(l)||null==(S=this.persistence)||S.register(((k={})[ip]=l,k)),null==(_=this.surveys)||_.reset(),null==(v=this.featureFlags)||v.reset(),null==(g=this.conversations)||g.reset(),null==(m=this.logs)||m.reset(),null==(y=this.metrics)||y.reset(),null==(b=this.persistence)||b.set_property(Op,Kp),null==(w=this.sessionManager)||w.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===Qp)this.register_once({distinct_id:Hp,$device_id:null},"");else{var P,T=this.config.get_device_id(l_());this.register_once({distinct_id:T,$device_id:e?T:a},""),e||Rl(u)||this.register(((P={})[Uh]=u,P))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(void 0===n.distinctID||this._inCookielessMode()||(null==(E=this.persistence)||E.set_property(Op,n.isIdentifiedID?Zp:Kp),this.register({distinct_id:n.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(Rl(s)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(s,!0))){var I=Ta({},n);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var F;d&&(null==(F=this.persistence)||null==F._endCookieSyncSuppression||F._endCookieSyncSuppression(f))}this.reloadFeatureFlags()},t.shutdown=function(){var e=Ca(Ra().m((function e(t){var n,r,i,o,s,a,u,l;return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return th.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:this._getBrowserClientAdapter().dispose(),null==(n=this.sessionRecording)||n.dispose(),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.metrics)||i.flush("sendBeacon"),null==(o=this._requestQueue)||o.unload(),null==(s=this._retryQueue)||s.unload();try{null==(l=this.featureFlags)||l.destroy()}catch(e){th.error("Error while destroying feature flags",e)}null==(a=this.persistence)||a.destroy(),null==(u=this.sessionPersistence)||u.destroy();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(Bh)?(th.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Rl(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Vh,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(th.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t=Ta({},this.config);if(Il(e)){var n,r,i,o,s,a,u,l,c,d,f,h;oh(this.config,Jb(e));var p=this._is_persistence_disabled();null==(n=this.persistence)||n.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new py(Ta({},this.config,{persistence:"sessionStorage"}),p,!1);var _,v=this._checkLocalStorageForDebug(this.config.debug);$l(v)&&(this.config.debug=v),$l(this.config.debug)&&(this.config.debug?(jf.DEBUG=!0,P_._is_supported()&&P_._set("ph_debug",!0),th.info("set_config",{config:e,oldConfig:t,newConfig:Ta({},this.config)})):(jf.DEBUG=!1,P_._is_supported()&&P_._remove("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(i=this.exceptionObserver)||i.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(_=this.historyAutocapture)||_.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Qm(this,Nb,!1)}},t._overrideSDKInfo=function(e,t){jf.LIB_NAME=e,jf.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){if(this.exceptions){var n=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(Ta({},r,t))}},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:Gb;return t!==Gb&&(t=Gb+"."+t),t},t._isIdentified=function(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(Op))===Zp||(null==(t=this.sessionPersistence)?void 0:t.get_property(Op))===Zp},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===Yp&&!this._isIdentified()&&Fl(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Vh])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Bp]))},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?(th.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(Bp,!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&&this.config.cookieless_mode!==Gp)},t._sync_opt_out_with_persistence=function(){var e,t,n,r,i,o=this._is_persistence_disabled();return this.is_capturing()||null==(n=this.logs)||n._onOptOut(),(null==(e=this.persistence)?void 0:e._disabled)!==o&&(null==(r=this.persistence)||r.set_disabled(o)),(null==(t=this.sessionPersistence)?void 0:t._disabled)!==o&&(null==(i=this.sessionPersistence)||i.set_disabled(o)),o&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),o},t.opt_in_capturing=function(t){var n;if(this.config.cookieless_mode!==Qp){if(this._inCookielessMode()){var r,i,o,s,a,u;null==(r=this.sessionRecording)||r.dispose({discardBufferedEvents:!0}),this._reset(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new Sb(this),this.pageViewManager=new Xm(this),this.persistence&&(this.sessionPropsManager=new mb(this,this.sessionManager,this.persistence));var l,c=null!==(s=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==s?s:null==(u=e.__defaultExtensionClasses)?void 0:u.sessionRecording;c&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new c(this)),this._lastRemoteConfig&&(null==(l=this.sessionRecording)||null==l.onRemoteConfig||l.onRemoteConfig(this._lastRemoteConfig)))}var d,f;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),this.config.cookieless_mode==Gp&&(null==(d=this.surveys)||d.loadIfEnabled()),(Rl(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(f=null==t?void 0:t.captureEventName)&&void 0!==f?f:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else th.warn(Bb)},t.opt_out_capturing=function(){if(this.config.cookieless_mode!==Qp){var e,t,n=this.config.cookieless_mode===Gp?this.sessionRecording:void 0;null==n||n.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===Gp&&this.consent.isOptedIn()&&this._reset(!0,!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===Gp&&(this.register({distinct_id:Hp,$device_id:null}),this._removeExtension(n),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())}else th.warn(Bb)},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.config.cookieless_mode===Qp||(this.config.cookieless_mode===Gp?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 zf?kb(zf,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Wf&&("visible"===Wf.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(e_,{title:Wf.title},{send_instantly:!0}),this._visibilityStateListener&&(Wf.removeEventListener(Jp,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),fh(Wf,Jp,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Uf||Uf.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Uf||Uf.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?(th.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&&!Ml(e[t]),s=n in e&&!Ml(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,th)},t._runBeforeSend=function(e){var t;if(Ml(this.config.before_send))return e;for(var n,r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Hl),i=e,o=Pa(Pl(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(n=o()).done;){var s=n.value;try{if(i=s(i),Ml(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return Bl(e.event)?th.warn(a+". This can cause unexpected behavior."):th.info(a),null}i.properties&&!Fl(i.properties)||th.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return th.error("Error in beforeSend function for event '"+e.event+"':",t),null}}for(var u,l=Pa(r);!(u=l()).done;){var c=u.value;if(i.properties&&Ml(i.properties[c]))return th.warn("Event '"+e.event+"' had its '"+c+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null}return i},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=$l(e)&&!e,n=P_._is_supported()&&"true"===P_._get("ph_debug");return!t&&(!!n||e)},Ea(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:"logger",get:function(){var t,n;return null!==(t=null==(n=this.logs)?void 0:n.logger)&&void 0!==t?t:e._noopLogger}}])}();ew.__defaultExtensionClasses={},ew._noopLogger=function(){var e=function(){};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}}(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=uh(e.prototype[t[n]])}(ew,["identify"]);var tw=function(){function e(e){this.disabled=!1===e;var t=Il(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}(),nw="$copy_autocapture",rw=nh("[AutoCapture]");function iw(e,t){return t.length>e?t.slice(0,e)+"...":t}function ow(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!sm(t));return t}function sw(e,t){var n,r,i=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=t.disableCaptureUrlHashes;if(!sm(e))return{props:{}};for(var c=[e],d=new Set([e]),f=e;f.parentNode&&!am(f,"body")&&cm>c.length;)if(lm(f.parentNode)){var h=f.parentNode.host;if(d.has(h))break;d.add(h),c.push(h),f=h}else{if(!sm(f.parentNode))break;if(d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var p,_,v=[],g={},m=!1,y=!1;if(ih(c,(function(e){var t=Im(e);if(am(e,"a")){var n=e.getAttribute("href");m=!!(t&&n&&$m(n))&&(l?kd(n):n)}pl(hm(e),"ph-no-capture")&&(y=!0),v.push(function(e,t,n,r,i){void 0===i&&(i=!1);var o=e.tagName.toLowerCase(),s={tag_name:o};gm.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?iw(1024,Nm(e)):iw(1024,_m(e)));var a=hm(e);a.length>0&&(s.classes=a.filter((function(e){return""!==e}))),ih(e.attributes,(function(n){var o;if((!Fm(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&$m(n.value)&&(!Ll(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){var a=n.value;"class"===n.name&&(a=dm(a).join(" ")),s["attr__"+n.name]=iw(1024,"href"===n.name&&i?kd(a):a)}}));for(var u=1,l=1,c=e;c=ow(c);)u++,c.tagName===e.tagName&&l++;return s.nth_child=u,s.nth_of_type=l,s}(e,o,s,a,l));var r=function(e){if(!Im(e))return{};var t={};return ih(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&&$m(r)&&(t[n]=r)}})),t}(e);ih(r,(function(e,t){({}).hasOwnProperty.call(g,t)||(g[t]=e)}))})),y)return{props:{},explicitNoCapture:y};if(s||(v[0].$el_text=am(e,"a")||am(e,"button")?Nm(e):_m(e)),m){var b,w;v[0].attr__href=m;var S=null==(b=f_(m))?void 0:b.host,k=null==Uf||null==(w=Uf.location)?void 0:w.host;S&&k&&S!==k&&(p=m)}return{props:oh({$event_type:i.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:(_=v,Pl(_)?function(e){var t=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=Pa(e.attr_class);!(i=o()).done;)r+="."+i.value.replace(/"/g,"")}var s=Ta({},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 sh(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[Hm(e[0].toString())]=Hm(t.toString())})),(r+=":")+sh(a).map((function(e){return e[0]+'="'+e[1]+'"'})).join("")}));return t.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:jm(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sh(e).filter((function(e){return 0===e[0].indexOf("attr__")})).forEach((function(e){return r.attributes[e[0]]=e[1]})),r}))}(_)):"")},null!=(n=v[0])&&n.$el_text?{$el_text:null==(r=v[0])?void 0:r.$el_text}:{},p&&"click"===i.type?{$external_click_url:p}:{},g)}}var aw=function(){function e(e){this.name="autocapture",this._initialized=!1,this._isDisabledServerSide=null,this._hasReceivedConfigResponse=!1,this._elementsChainAsString=!1,this._config={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this._disposed=!1,this._configSource=e,this._configSource.refresh(this._config),this.rageclicks=new tw(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return 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._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;if(this.isBrowserSupported()){if(Uf&&Wf){var t=this._domEventHandler=function(t){t=t||(null==Uf?void 0:Uf.event);try{e._captureEvent(t)}catch(e){rw.error("Failed to capture event",e)}};if(fh(Wf,"submit",t,{capture:!0}),fh(Wf,"change",t,{capture:!0}),fh(Wf,"click",t,{capture:!0}),this._refreshConfig().capture_copied_text){var n=this._copiedTextHandler=function(t){t=t||(null==Uf?void 0:Uf.event);try{e._captureEvent(t,nw)}catch(e){rw.error("Failed to capture clipboard event",e)}};fh(Wf,"copy",n,{capture:!0}),fh(Wf,"cut",n,{capture:!0}),fh(Wf,"paste",n,{capture:!0})}}}else rw.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){this._domEventHandler&&(null==Wf||Wf.removeEventListener("submit",this._domEventHandler,!0),null==Wf||Wf.removeEventListener("change",this._domEventHandler,!0),null==Wf||Wf.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==Wf||Wf.removeEventListener("copy",this._copiedTextHandler,!0),null==Wf||Wf.removeEventListener("cut",this._copiedTextHandler,!0),null==Wf||Wf.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._initialized=!1},t.startIfEnabled=function(){!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;$l(r)&&(null==(n=this._client)||n.kv.set(Qh,r),this._isDisabledServerSide=r),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e){this._elementSelectors=e},t.getElementSelectors=function(e){var t,n=[];return null==(t=this._elementSelectors)||t.forEach((function(t){var r=null==Wf?void 0:Wf.querySelectorAll(t);null==r||r.forEach((function(r){e===r&&n.push(t)}))})),n},t._captureEvent=function(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n=vm(e);um(n)&&(n=n.parentNode||null);var r,i=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&i.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Em(n,i.rageclick)&&this._captureEvent(e,"$rageclick");var o=t===nw,s=o?Ta({},i,{dom_event_allowlist:void 0}):i;if(n&&function(e,t,n,r,i,o){var s;if(!Uf||Pm(e))return!1;if(null!=n&&n.url_allowlist&&!fm(n.url_allowlist,o))return!1;if(null!=n&&n.url_ignorelist&&fm(n.url_ignorelist,o))return!1;if(null!=n&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some((function(e){return t.type===e})))return!1}var u=Tm(e,r),l=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Rl(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=Pa(e);!(i=s()).done;)if(r=o())return r.v;return!1}(c,n))return!1;if(!mm(c,null==n?void 0:n.css_selector_allowlist))return!1;if(mm(c,null!==(s=null==n?void 0:n.css_selector_ignorelist)&&void 0!==s?s:bm))return!1;try{var d=Uf.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){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 l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(gm.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(n,e,s,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:i.getCurrentUrl}})){var a,u=sw(n,{e:e,maskAllElementAttributes:i.maskAllElementAttributes,maskAllText:i.maskAllText,elementAttributeIgnoreList:i.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:i.disableCaptureUrlHashes}),l=u.props;if(u.explicitNoCapture)return!1;var c=this.getElementSelectors(n);if(c&&c.length>0&&(l.$element_selectors=c),t===nw){var d=e.type||"clipboard";if("paste"!==d){var f,h,p=null==Uf||null==(f=Uf.getSelection())?void 0:f.toString(),_=pm(p);if(!_)return!1;l.$selected_content=_,l.$clipboard_text_length=null!==(h=null==p?void 0:p.length)&&void 0!==h?h:0}l.$copy_type=d}return null==(a=this._client)||a.capture(t,l).catch((function(e){return rw.error("Failed to capture event",e)})),!0}}},t.isBrowserSupported=function(){return Tl(null==Wf?void 0:Wf.querySelectorAll)},Ea(e,[{key:"isEnabled",get:function(){var e,t;if(this._disposed)return!1;var n=null==(e=this._client)?void 0:e.kv.get(Qh),r=this._isDisabledServerSide,i=this._refreshConfig(),o=i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if(Ol(r)&&!$l(n)&&!o)return!1;var s=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!i.enabled&&!s}}])}(),uw=function(){function e(e){this._instance=e}return e.prototype.refresh=function(e){var t=this._instance.config,n=Il(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance._shouldDisableFlags(),e.url_allowlist=null==n?void 0:n.url_allowlist,e.url_ignorelist=null==n?void 0:n.url_ignorelist,e.dom_event_allowlist=null==n?void 0:n.dom_event_allowlist,e.element_allowlist=null==n?void 0:n.element_allowlist,e.css_selector_allowlist=null==n?void 0:n.css_selector_allowlist,e.css_selector_ignorelist=null==n?void 0:n.css_selector_ignorelist,e.element_attribute_ignorelist=null==n?void 0:n.element_attribute_ignorelist,e.capture_copied_text=null==n?void 0:n.capture_copied_text},e}(),lw=function(e){function t(t){var n;return(n=e.call(this,new uw(t))||this).instance=t,n}return Ia(t,e),t}(aw),cw=nh("[ExceptionAutocapture]"),dw=function(){function e(e){var t,n=this;this._startCapturing=function(){var e;if(Uf&&n.isEnabled&&null!=(e=Tg.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=Tg.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Tg.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Tg.__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){cw.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Zh]),this._rateLimiter=new Jl(Ta({},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:cw})),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 Il(e)?t=Ta({},t,e):(Rl(e)?this._remoteEnabled:e)&&(t=Ta({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(cw.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=Tg.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",(function(t){if(t)return cw.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){if(e.ok){var t,n=e.config;if("autocaptureExceptions"in n)this._remoteEnabled=!!n.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register(((t={})[Zh]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){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";this._rateLimiter.consumeRateLimit(i)?cw.info("Skipping exception capture because of client rate limiting.",{exception:i}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)},Ea(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),fw=function(){function e(e){this._instance=e,this._lastLocation=this._getCurrentLocation()}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){this.isEnabled&&(th.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,th.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Uf&&Uf.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Uf&&(null==(t=Uf.history[e])||!t.__posthog_wrapped__)){var n=this;Ug(Uf.history,e,(function(t){return function(r,i,o){t.call(this,r,i,o),n._capturePageview(e)}}))}},t._getCurrentLocation=function(){var e=null==Uf?void 0:Uf.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}:Il(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){try{var t=this._getCurrentLocation();if(!t)return;this._hasLocationChanged(t)&&this._instance.capture(e_,{navigation_type:e}),this._lastLocation=t}catch(t){th.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};fh(Uf,"popstate",t),this._popstateListener=function(){Uf&&Uf.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};fh(Uf,"hashchange",t),this._hashchangeListener=function(){Uf&&Uf.removeEventListener("hashchange",t)}}},Ea(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),hw=nh("[TracingHeaders]"),pw=function(){function e(e){var t=this;this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._startCapturing=function(){var e,n,r=t._syncHostnamesForPatch();r?(Rl(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=Tg.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,(function(){return t._instance.get_distinct_id()}),t._instance.sessionManager)),Rl(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=Tg.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(r,(function(){return t._instance.get_distinct_id()}),t._instance.sessionManager))):t._stopCapturing()},this._instance=e}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t._loadScript=function(e){var t,n;null!=(t=Tg.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",(function(t){if(t)return hw.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 Pl(t)?(Pl(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):(Pl(this._hostnamesForPatch)&&this._hostnamesForPatch.splice(0),this._hostnamesForPatch=t||void 0,this._hostnamesForPatch)},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(){this._syncHostnamesForPatch()?this._loadScript(this._startCapturing):this._stopCapturing()},e}(),_w=nh("[Web Vitals]"),vw=9e5,gw=["CLS","FCP","INP","LCP"],mw=["INP","LCP"],yw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],bw=function(){function e(e){var t,n=this;this._enabledServerSide=!1,this._initialized=!1,this._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(){clearTimeout(n._delayedFlushTimer),n._delayedFlushTimer=void 0,0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",Ta({$current_url:n._buffer.url},n._buffer.metrics.reduce((function(e,t){var n;return Ta({},e,((n={})["$web_vitals_"+t.name+"_event"]=Ta({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))}),{}))),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},Ml(null==e?void 0:e.name)||Ml(null==e?void 0:e.value))_w.error("Invalid metric received",e);else{var r="string"==typeof e.navigationURL?e.navigationURL:void 0,i=n._maskedURL(r);if(!Rl(i)){var o=Dl(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)),Rl(n._buffer.navigationKey)&&(n._buffer.navigationKey=o,n._buffer.url=i),n._buffer.firstMetricTimestamp=Rl(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var s=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=Ta({},e,r?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete a.entries,Il(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var u,l={},c=Pa(yw);!(u=c()).done;){var d=u.value,f="url"===d&&"string"==typeof e.attribution[d]?n._maskedURL(e.attribution[d]):e.attribution[d];Rl(f)||(l[d]=f)}a.attribution=l}else delete a.attribution;Rl(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 _w.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,r,i,o=!1,s=Tg.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,u=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&Rl(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!Rl(u)){var l=u.withoutAttribution,c=n.attributionMetrics;o=!Rl(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 d={reportSoftNavs:n.useSoftNavs},f=o&&n.attributionMetrics.indexOf("INP")>-1?Ta({},d,{includeProcessedEventEntries:!1}):d;n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n),d),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n),d),n.allowedMetrics.indexOf("FCP")>-1&&r(n._addToBuffer.bind(n),d),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n),f),n._initialized=!0}else _w.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Xh]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(_w.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=Il(t.capturePerformance)&&!!t.capturePerformance.web_vitals,o=Il(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[Xh]=i,n)),this._instance.persistence.register(((r={})[rp]=o,r))),this._enabledServerSide=i,this.startIfEnabled()}}},t._loadScript=function(e){var t=Tg.__PosthogExtensions__,n=this._callbackFlavor,r=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=r&&r[n]||"web-vitals"===n&&Rl(r)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,n,(function(t){t?_w.error("failed to load script",t):e()}))},t._maskedURL=function(e){var t=e||(null==Uf?void 0:Uf.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?kd(t):t,r=this._instance.config.mask_personal_data_properties?[].concat(Zv,this._instance.config.custom_personal_data_properties||[]):[];return p_(n,r,Jv)}_w.error("Could not determine current URL")},Ea(e,[{key:"_perfConfig",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=Il(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Ml(n)?(null==(t=this._instance.persistence)?void 0:t.props[rp])||gw:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(Il(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=Il(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return $l(e)?e?gw:[]:Pl(e)?e:mw}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e=Il(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}},{key:"_maxAllowedValue",get:function(){var e=Il(this._perfConfig)&&Dl(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:vw;return e>0&&6e4>=e?vw:e}},{key:"isEnabled",get:function(){var e=null==Gf?void 0:Gf.protocol;if("http:"!==e&&"https:"!==e)return _w.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Il(this._perfConfig)?this._perfConfig.web_vitals:$l(this._perfConfig)?this._perfConfig:void 0;return $l(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"}}])}(),ww="disabled",Sw="lazy_loading",kw="awaiting_config",xw="missing_config";nh("[SessionRecording]"),nh("[SessionRecording]");var Cw="[SessionRecording]",Ew=nh(Cw),Pw=function(){function e(e){var t=this;if(this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=ww,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._documentWasEverVisible=function(){var e;if(null==Wf||!Wf.visibilityState||"visible"===Wf.visibilityState)return!0;var t=null==Uf||null==(e=Uf.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==Wf?void 0:Wf.visibilityState)&&(t._documentWasEverVisible=!0,null==(e=t._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Ew.error("started without valid sessionManager"),new Error(Cw+" started without valid sessionManager. This is a bug.");if(this._config.cookieless_mode===Qp)throw new Error(Cw+' cannot be used with cookieless_mode="always"');null!=Wf&&Wf.addEventListener&&fh(Wf,"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==Wf||null==Wf.removeEventListener||Wf.removeEventListener("visibilitychange",this._onVisibilityChange),n?this._discardRecording(!0):this.stopRecording()},t.startIfEnabledOrStop=function(e){var t;if(!(this._sessionRecordingDisposed||this._isRecordingEnabled&&null!=(t=this._lazyLoadedSessionRecording)&&t.isStarted)){var n=!Rl(Object.assign)&&!Rl(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Ew.info("starting")):(this._recordingStatus=ww,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,r=this;if(this._isRecordingEnabled)if(this._recordingStatus!==kw&&this._recordingStatus!==xw&&(this._recordingStatus=Sw),null!=Tg&&null!=(t=Tg.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=Tg.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var i,o=this._instance.sessionManager;null==(i=Tg.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(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={})[zp]=!0,n)),Ew.error("could not load recorder",t);r._onScriptLoaded(e)}else r._recordingStatus=ww}))}},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;void 0===e&&(e=!1),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=void 0,null==(n=this._lazyLoadedSessionRecording)||n.discard({discardProducerEvents:e})},t._resetSampling=function(){var e,t;null==(e=this._persistence)||e.unregister(dp),null==(t=this._persistence)||t.unregister(op)},t._validateSampleRate=function(e,t){if(Ml(e))return null;var n,r=Dl(e)?e:parseFloat(e);return"number"!=typeof(n=r)||!Number.isFinite(n)||0>n||n>1?(Ew.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;Ml(u)&&t._resetSampling();var l=null==o?void 0:o.minimumDurationMilliseconds;i.register(((r={})[ip]=Ta({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:Ta({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:Rl(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;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this._persistRemoteConfig(t),void this._discardRecording()):(this._persistRemoteConfig(t),void this.startIfEnabledOrStop()):(this._recordingStatus===kw&&(this._recordingStatus=xw,Ew.warn("config refresh failed, recording will not start until page reload")),void 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):Ew.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(ip);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Ew.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!Ml(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._onScriptLoaded=function(e){var t,n,r;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var i,o;if(null==(t=Tg.__PosthogExtensions__)||!t.initSessionRecording)return Ew.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((i={},i[zp]=!0,i));if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(o=Tg.__PosthogExtensions__)?void 0:o.initSessionRecording(this._instance,this._documentWasEverVisible),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if(this._recordingStatus===xw||this._recordingStatus===kw)return;return this._recordingStatus=kw,Ew.info("persisted remote config is stale, requesting fresh config before starting"),void new my(this._instance).load()}this._recordingStatus=Sw,null==(n=(r=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(r,this._documentWasEverVisible),this._lazyLoadedSessionRecording.start(e)}else this._recordingStatus=ww},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==(t=this._persistence)||t.register(((n={})[ap]=!0,n)),null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})[sp]=!0,n)),null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()},t.overrideTrigger=function(e){var t,n,r;this._lazyLoadedSessionRecording||null==(n=this._persistence)||n.register(((r={})["url"===e?up:lp]=!0,r)),null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)},t.tryAddCustomEvent=function(e,t){var n;return!(null==(n=this._lazyLoadedSessionRecording)||!n.tryAddCustomEvent(e,t))},Ea(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._recordingStatus===kw||this._recordingStatus===xw?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(ip))||!e.enabled),n=!this._config.disable_session_recording,r=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Uf&&t&&n&&!r}},{key:"_scriptName",get:function(){var e,t,n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(ip);return(null==n||null==(t=n.scriptConfig)?void 0:t.script)||"lazy-recorder"}},{key:"sdkDebugProperties",get:function(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}}])}(),Tw=nh("[Heatmaps]");function Iw(e){return Il(e)&&"clientX"in e&&"clientY"in e&&Dl(e.clientX)&&Dl(e.clientY)}var Fw=function(){function e(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Kh]),this.rageclicks=new tw(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Tw.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){if(e.ok){var t=e.config;if("heatmaps"in t){var n,r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register(((n={})[Kh]=r,n)),this._enabledServerSide=r,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){Iw(e.originalEvent)&&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)}(Wf)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Uf&&Wf&&(this._flushHandler=this._flush.bind(this),fh(Uf,Xp,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Uf?void 0:Uf.event))},fh(Wf,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Uf?void 0:Uf.event))},fh(Wf,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Wm(this.instance,Vm,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),fh(Wf,Jp,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Uf&&Wf&&(this._flushHandler&&Uf.removeEventListener(Xp,this._flushHandler),this._onClickHandler&&Wf.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Wf.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Wf.removeEventListener(Jp,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),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&&sm(r)&&!am(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:Uf)?void 0:o.getComputedStyle(r).position}catch(e){return!1}if(pl(t,i))return!0;r=ym(r)}return!1}(vm(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"),!om(e.target)&&Iw(e)){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&Em(vm(e),this.instance.config.rageclick)&&this._capture(Ta({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!om(e.target)&&Iw(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))},t._capture=function(e){if(Uf){var t=this._config.disable_capture_url_hashes?kd(Uf.location.href):Uf.location.href,n=this._config.mask_personal_data_properties?[].concat(Zv,this._config.custom_personal_data_properties||[]):[],r=p_(t,n,Jv);this._buffer=this._buffer||{},this._buffer[r]||(this._buffer[r]=[]),this._buffer[r].push(e)}},t._flush=function(){this._buffer&&!Fl(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},Ea(e,[{key:"_config",get:function(){return this.instance.config}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return Il(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 Ml(this._config.capture_heatmaps)?Ml(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),Rw=nh("[Product Tours]"),Lw=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(tp))},Aw=function(){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){if(e.ok){var t=e.config;if("productTours"in t){var n,r,i;if(this._persistence&&this._persistence.register(((n={})[tp]=!!t.productTours,n)),!Lw(this._instance))return!this._productTourManager&&Ml(null==(r=this._persistence)?void 0:r.props[Ip])||Rw.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&&Lw(this._instance)&&this._loadScript((function(){return e._startProductTours()}))},t._loadScript=function(e){var t,n;null!=(t=Tg.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=Tg.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",(function(t){t?Rw.error("Could not load product tours script",t):e()}))},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=Tg.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=Tg.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Pl(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[Ip];if(Pl(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){if(Lw(n._instance)){var i=t.statusCode;if(200!==i||!t.json){var o="Product Tours API could not be loaded, status: "+i;return 0===i?t.error||Rw.warn(o):Rw.error(o),void e([],{isLoaded:!1,error:o})}var s,a=Pl(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,r&&r.register(((s={})[Ip]=a,s)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){Ml(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(Ip)},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)},Ea(e,[{key:"_persistence",get:function(){return this._instance.persistence}}])}(),Ow=["$set_once","$set"],Mw=nh("[SiteApps]"),Dw="Error while initializing PostHog app with config id ",qw=function(){function e(e){this._siteAppElementPatchCount=0,this._instance=e,this._bufferedInvocations=[],this.apps={}}var t=e.prototype;return t._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))}},t.initialize=function(){var e=this;if(this.isEnabled){var t=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=function(){t(),e._bufferedInvocations=[],e._stopBuffering=void 0}}},t.globalsForEvent=function(e){var t,n,r,i,o,s,a;if(!e)throw new Error("Event payload is required");for(var u={},l=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{},d=0,f=Object.entries(c);f.length>d;d++){var h=f[d],p=h[0];u[p]={id:l[p],type:p,properties:h[1]}}var _=e.$set_once,v=e.$set;return{event:Ta({},Fa(e,Ow),{properties:Ta({},e.properties,v?{$set:Ta({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},v)}:{},_?{$set_once:Ta({},null!==(r=null==(i=e.properties)?void 0:i.$set_once)&&void 0!==r?r:{},_)}:{}),elements_chain:null!==(o=null==(s=e.properties)?void 0:s.$elements_chain)&&void 0!==o?o:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}},t._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)||(Mw.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)||(Mw.error("prepare_external_dependency_script returned null"),null):e},t._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==Wf?void 0:Wf.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!Ol(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()},t._releaseSiteAppElementPatches=function(){var e=this,t=!1;return function(){t||(t=!0,e._siteAppElementPatchCount--,0===e._siteAppElementPatchCount&&(null==e._restoreSiteAppElementPatches||e._restoreSiteAppElementPatches()))}},t._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}},t.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(Mw.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,Mw.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){Mw.error(Dw+e.id,t),o(!1)}if(i&&n.loaded)try{r()}catch(t){Mw.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}},t._setupSiteApps=function(){for(var e,t=this.siteAppLoaders||[],n=Pa(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=Pa(t);!(i=o()).done;)this.setupSiteApp(i.value)},t._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){Mw.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()},t.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 Mw.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;Tg["__$$ph_site_app_"+n]=i._instance,null==(e=Tg.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,(function(e){if(e)return Mw.error(Dw+n,e)}))},u=Pa(o.siteApps);!(s=u()).done;)a();else Mw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Ea(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"siteAppLoaders",get:function(){var e;return null==(e=Tg._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),$w=function(e,t){return null!=e&&e.then?e.then(t):t(e)},Nw="SDK is not enabled or survey functionality is not yet loaded",Bw="Disabled. Not loading surveys.",Hw=function(){function e(e,t){var n=this;this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._disposed=!1,this._renderTimeouts=new Set,this.onRemoteConfig=function(e){if(!n._disposed&&!n._config.disableSurveys){if(!e.ok)return Ih.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Ml(t))return Ih.warn("Flags not loaded yet. Not loading surveys.");n._isSurveysEnabled=$l(t)?t:t.length>0,Ih.info("flags response received, isSurveysEnabled: "+n._isSurveysEnabled),n.loadIfEnabled()}},this._configSource=e,this._initialClientState=t}var t=e.prototype;return t.setup=function(e){var t=this;if(!this._disposed)return this._initializingClient=e,$w(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;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._getSurveysInFlightPromise=null,this._renderTimeouts.forEach((function(e){return clearTimeout(e)})),this._renderTimeouts.clear())},t.initialize=function(){this.loadIfEnabled()},t.reset=function(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(null!=r&&r.startsWith(Lh)||null!=r&&r.startsWith(Ah))&&t.push(r)}t.forEach((function(e){return localStorage.removeItem(e)}))}catch(e){}},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._client){var t=this._config;if(!this._surveyManager)if(this._isInitializingSurveys)Ih.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Ih.info(Bw);else if(t.cookielessMode&&this._configSource.isOptedOut())Ih.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!Rl(this._isSurveysEnabled)||t.advancedEnableSurveys){var r=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0;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(Wp),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 Ih.error("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){this._disposed||(this._surveyManager=e(t),this._surveyEventReceiver=this._configSource.createEventReceiver(),Ih.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0}))},t._handleSurveyLoadError=function(e,t){Ih.error(e,t),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,r=this;void 0===t&&(t=!1);var i=null!==(n=this._client)&&void 0!==n?n:this._initialClientState;if(i&&!this._disposed){if(this._config.disableSurveys)return Ih.info(Bw),e([]);var o=i.kv.get(xp);if(o&&!t)return e(o,{isLoaded:!0}),void(this._shouldBackgroundRefreshSurveys()&&this.getSurveys((function(){}),!0));if(this._getSurveysInFlightPromise)this._getSurveysInFlightPromise.then((function(t){r._disposed||e(t.surveys,t.context)})).catch((function(e){return Ih.error("Error in survey callback",e)}));else{var s=this._sendSurveysRequest("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then((function(e){try{return r._handleSurveyResponse(i,e)}catch(e){return Ih.error("Error processing surveys response",e),r._handleSurveyResponse(i,{statusCode:0,error:e})}}),(function(e){return r._handleSurveyResponse(i,{statusCode:0,error:e})}));this._getSurveysInFlightPromise=s;var a=function(){r._getSurveysInFlightPromise===s&&(r._getSurveysInFlightPromise=null)};s.then((function(t){a(),r._disposed||e(t.surveys,t.context)}),a).catch((function(e){return Ih.error("Error in survey callback",e)}))}}},t._sendSurveysRequest=function(e,t){var n=this._client;return n?n.sendRequest(e,t):new Promise((function(e){return e({statusCode:0,error:new Error(Nw)})}))},t._handleSurveyResponse=function(e,t){var n;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:Nw}};var r=t.statusCode;if(200!==r||!t.json){var i="Surveys API could not be loaded, status: "+r;return 0!==r?Ih.error(i):t.error||Ih.warn(i),this._lastSurveyRefreshFailedAt=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this._lastSurveyRefreshFailedAt=null;var o,s=t.json.surveys||[],a=s.filter((function(e){return Fh(e)&&(kh(e)||Rh(e))}));return a.length>0&&(null==(o=this._surveyEventReceiver)||o.register(a)),e.kv.set(((n={})[xp]=s,n[Cp]=Date.now(),n)),{surveys:s,context:{isLoaded:!0}}},t._shouldBackgroundRefreshSurveys=function(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()},t._isSurveyCacheStale=function(){var e,t,n=null==(e=null!==(t=this._client)&&void 0!==t?t:this._initialClientState)?void 0:e.kv.get(Cp);return Dl(n)&&Date.now()-n>3e5},t._isSurveyRefreshBackingOff=function(){return Dl(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n,r={id:e,current_iteration:null!==(n=null==t?void 0:t.iteration)&&void 0!==n?n:null};Dh(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}},t._notifySurveyCallbacks=function(e){for(var t,n=Pa(this._surveyCallbacks);!(t=n()).done;){var r=t.value;try{if(!e.isLoaded)return r([],e);this.getSurveys(r)}catch(e){Ih.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!Ml(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ih.warn("init was not called")},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(Ml(this._surveyManager))return{eligible:!1,reason:Nw};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){if(Ml(this._surveyManager))return{eligible:!1,reason:Nw};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(Ml(this._surveyManager))return Ih.warn("init was not called"),{visible:!1,disabledReason:Nw};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return Ml(this._surveyManager)?(Ih.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Nw})):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=this;if(Ml(this._surveyManager))Ih.warn("init was not called");else{var o="string"==typeof e?this._getSurveyById(e):e;if(null!=o&&o.id)if(qh.includes(o.type)){var s=null==Wf?void 0:Wf.querySelector(t);if(s)if(null!=(r=o.appearance)&&r.surveyPopupDelaySeconds){Ih.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout((function(){var e,t;i._renderTimeouts.delete(a),i._disposed||(Ih.info("Rendering survey "+o.id+" with delay of "+(null==(e=o.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=i._surveyManager)||t.renderSurvey(o,s,n),Ih.info("Survey "+o.id+" rendered"))}),1e3*o.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(a)}else this._surveyManager.renderSurvey(o,s,n);else Ih.warn("Survey element not found")}else Ih.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Ih.warn("Survey not found")}},t.displaySurvey=function(e,t){var n;if(Ml(this._surveyManager))Ih.warn("init was not called");else{var r=this._getSurveyById(e);if(r){var i=r;if(null!=(n=r.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=Ta({},r,{appearance:Ta({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==dl&&t.initialResponses&&Ih.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this._checkSurveyEligibility(r);if(!o.eligible)return void Ih.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else Ih.warn("Survey not found")}},t.cancelPendingSurvey=function(e){Ml(this._surveyManager)?Ih.warn("init was not called"):this._surveyManager.cancelSurvey(e)},t.handlePageUnload=function(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()},Ea(e,[{key:"_config",get:function(){return this._configSource.get()}}])}();function jw(e,t,n){if(Ml(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 Uw=function(){function e(e){var t=this;this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new yb,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)},this._instance=e}var t=e.prototype;return t.init=function(){var e,t,n=this;Rl(null==(e=this._instance)?void 0:e._addCaptureHook)||(this._captureHookUnsubscribe=null==(t=this._instance)?void 0:t._addCaptureHook((function(e,t){n.on(e,t)})))},t.dispose=function(){var e;null==(e=this._captureHookUnsubscribe)||e.call(this),this._captureHookUnsubscribe=void 0,this._debugEventEmitter=new yb},t.register=function(e){var t,n,r=this;if(!Rl(null==(t=this._instance)?void 0:t._addCaptureHook)&&(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._instance)&&n.autocapture)){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._instance.autocapture.setElementSelectors(i)}},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=Pa(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(!r||"string"!=typeof r)return!1;if(!jw(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 jw(e.href,t.href,t.href_matching||"exact")}));var i,o=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!o&&jw((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 jw(e.text,t.text,t.text_matching||"exact")||jw(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;!Ml(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 jw(e,o,s)})))},t._checkStepSelector=function(e,t){var n,r;if(null==t||!t.selector)return!0;var i=null==e||null==(n=e.properties)?void 0:n.$element_selectors;if(null!=i&&i.includes(t.selector))return!0;var o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch(e){return!1}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||Th(t.properties.reduce((function(e,t){var n=Pl(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}(),Vw=function(){function e(e){var t,n=this;this._pendingActivatedItems=[],this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map,this._sessionIdUnsubscribe=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId((function(e){return n._onSessionIdChanged(e)}))}var t=e.prototype;return 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&&Th(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===el?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){var n;Rl(null==(n=this._instance)?void 0:n._addCaptureHook)||(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 Uw(this._instance),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=this,o=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})),s=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})),a=this._buildEventToItemMap(e,el),u=this._buildEventToItemMap(e,tl);t?(this._eventToItems=a,this._cancelEventToItems=u):(this._mergeItemMaps(this._eventToItems,a),this._mergeItemMaps(this._cancelEventToItems,u)),(0!==o.length||0!==s.length)&&(null!==(n=this._captureHookUnsubscribe)&&void 0!==n||(this._captureHookUnsubscribe=null==(r=this._instance)?void 0:r._addCaptureHook((function(e,t){i.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);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,tl);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,el);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){var t;if(0!==e.length){for(var n,r=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),i=[],o=Pa(e);!(n=o()).done;){var s=n.value;r&&this._shouldPersistArmedActivation(s)?this._persistActivation(s)&&this._recordActivationTimestamp(s):i.push(s)}i.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,i)))),this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()})}},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)},t._getRawActivationTimestamps=function(){var e,t=this._getActivationTimestampsKey();if(!t)return{};var n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return n&&"object"==typeof n?n:{}},t._recordActivationTimestamp=function(e){var t;if(this._getActivationTimestampsKey()){var n=this._getRawActivationTimestamps();this._writeActivationTimestamps(Ta({},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&&(Fl(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 Dl(t)?t:void 0}},t._getRawPersistedActivatedIds=function(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]},t._getPersistedActivatedIds=function(){var e,t,n=this._getRawPersistedActivatedIds();if(0===n.length)return[];var r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._getActivatedSessionKey()],i=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return i&&r===i?n:[]},t._stampActivationSession=function(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this._setActivatedSession(t)},t._clearActivationSession=function(){this._clearActivatedSession()},t._onSessionIdChanged=function(e){var t,n=this,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._getActivatedSessionKey()];if(r&&r!==e){var i=this._getRawPersistedActivatedIds(),o=this._getRawActivationTimestamps();i.length>0&&(this._setActivatedItems([]),i.filter((function(e){return Dl(o[e])})).forEach((function(e){return n._cancelPendingItem(e)}))),this._clearActivationSession(),this._clearAllActivationTimestamps()}},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()},t.getEventToItemsMap=function(){return this._eventToItems},t._getActionMatcher=function(){return this._actionMatcher},e}(),zw=function(e){function t(t){return e.call(this,t)||this}Ia(t,e);var n=t.prototype;return n._getActivatedKey=function(){return Ep},n._getActivatedSessionKey=function(){return Pp},n._getActivationTimestampsKey=function(){return Tp},n._writeActivationTimestamps=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Tp]=e,n))},n._clearActivationTimestampsStore=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Tp)},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 Dl(r)&&r>0},n._getShownEventName=function(){return ll.SHOWN},n._getItems=function(e){var t;null==(t=this._instance)||t.getSurveys(e)},n._cancelPendingItem=function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)},n._getLogger=function(){return Ih},n._setActivatedItems=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Ep]=e,n))},n._setActivatedSession=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Pp]=e,n))},n._clearActivatedSession=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Pp)},n._isItemPermanentlyIneligible=function(){return!1},n._activationOutcome=function(e,t){var n;return this._getItems((function(e){n=e.find((function(e){return e.id===t}))})),!n||xh(n)?e===ll.SHOWN?"consume":"ignore":e===ll.SHOWN?"persist":e===ll.DISMISSED||e===ll.SENT?"consume":"ignore"},n.getSurveys=function(){return this.getActivatedIds()},n.getEventToSurveys=function(){return this.getEventToItemsMap()},t}(Vw),Ww=function(){function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){if("string"==typeof e)return this._instance.get_property(e);for(var t,n={},r=Pa(e);!(t=r()).done;){var i=t.value,o=this._instance.get_property(i);Rl(o)||(n[i]=o)}return n},t.set=function(e,t){var n;this._instance.register("string"==typeof e?((n={})[e]=t,n):e)},t.remove=function(e){var t=this;"string"!=typeof e?e.forEach((function(e){return t._instance.unregister(e)})):this._instance.unregister(e)},e}(),Gw=function(){function e(e){this._instance=e}var t=e.prototype;return t.get=function(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}},t.isOptedOut=function(){return this._instance.consent.isOptedOut()},t.getExtensions=function(){var e=this,t=null==Tg?void 0:Tg.__PosthogExtensions__;if(t){var n=t.generateSurveys,r=t.loadExternalDependency;return{generateSurveys:n?function(t){return n(e._instance,t)}:void 0,loadExternalDependency:r?function(t){return r(e._instance,"surveys",t)}:void 0}}},t.createEventReceiver=function(){return new zw(this._instance)},e}(),Qw=function(e){function t(t){var n,r;return(n=e.call(this,new Gw(t),{get projectToken(){return r.config.token},kv:new Ww(r=t)})||this)._instance=t,n}return Ia(t,e),t.prototype._sendSurveysRequest=function(e,t){var n=this,r=t.query?tb(e,t.query):e;return new Promise((function(e){var i;n._instance._send_request({method:t.method,url:n._instance.requestRouter.endpointFor(null!==(i=t.target)&&void 0!==i?i:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})}))},t}(Hw),Kw=null!=Uf&&Uf.location?__(Uf.location.hash,"__posthog")||__(location.hash,"state"):null,Zw="_postHogToolbarParams",Yw=nh("[Toolbar]"),Jw=function(){function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){Tg.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=Tg.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),hh(this.instance.config))return!1;if(!Uf||!Wf)return!1;e=null!=e?e:Uf.location,n=null!=n?n:Uf.history;try{if(!t){try{Uf.localStorage.setItem("test","test"),Uf.localStorage.removeItem("test")}catch(e){return!1}t=null==Uf?void 0:Uf.localStorage}var r,i=Kw||__(e.hash,"__posthog")||__(e.hash,"state"),o=i?ah((function(){return JSON.parse(atob(decodeURIComponent(i)))}))||ah((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(Zw)||"{}")).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=Tg.ph_load_toolbar||Tg.ph_load_editor;!Ml(t)&&Tl(t)?t(e,this.instance):Yw.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Wf||!Wf.getElementById(Qv));if(!Uf||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=Ta({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Uf.localStorage.setItem(Zw,JSON.stringify(Ta({},i,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(i);else if(0===this._getToolbarState()){var o;this._setToolbarState(1),null==(o=Tg.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(function(e){if(e)return Yw.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(i)})),fh(Uf,"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}(),Xw=nh("[FeatureFlags]"),eS=function(){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;return{bootstrap:{featureFlags:null==(n=e.bootstrap)?void 0:n.featureFlags,featureFlagPayloads:null==(r=e.bootstrap)?void 0:r.featureFlagPayloads},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!==(i=e.remote_config_refresh_interval_ms)&&void 0!==i?i:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(o=null!==(s=e.evaluation_contexts)&&void 0!==s?s:e.evaluation_environments)&&void 0!==o?o:[],flagKeys:Pl(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(Xw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),Rl(e.flag_keys)||Pl(e.flag_keys)||Xw.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),tS=nh("[FeatureFlags]"),nS=nh("[FeatureFlags]",{debugEnabled:!0}),rS="\" failed. Feature flags didn't load in time.",iS="connection_error",oS=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},sS=function(e){for(var t,n={},r=Pa(sh(e||{}));!(t=r()).done;){var i=t.value,o=i[1];o&&(n[i[0]]=o)}return n},aS=function(){function e(e){var t=this;this.name=Nh,this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=tS,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._reloadingHandlers=[],this._hasLoadedFlags=!1,this._requestInFlight=!1,this._requestGeneration=0,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n=t._refreshIntervalMs;Rl(n)||t._config.remoteRequestsDisabled||!Wf||"hidden"===Wf.visibilityState||Date.now()-(null!==(e=t._lastRefreshAt)&&void 0!==e?e:0)<n||(t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onVisibilityChange=function(){"visible"===(null==Wf?void 0:Wf.visibilityState)&&t._refreshIfDue()},"get"in e?this._configSource=e:(this._instance=e,this._mutableConfigSource=new eS(e.config,e._shouldDisableFlags()),this._configSource=this._mutableConfigSource)}var t=e.prototype;return t.updateConfig=function(e,t){var n;null==(n=this._mutableConfigSource)||n.update(e,t),this._client&&this._syncAutomaticRefresh()},t.setup=function(e){var t=this;return this._initializingClient=e,this._logger=e.logger.createLogger("[FeatureFlags]"),$w(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 Uf&&fh(Uf,"online",this._onOnline),this._syncAutomaticRefresh(),this._dynamicProperties=e.registerDynamicEventProperties((function(){return n._isCacheStale()?n._baseEventProperties:n._eventPropertiesWithFlagValues})),this._crossTabPersistenceUnsubscribe=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange((function(){n._clearBootstrapState(),n._rebuildEventProperties(),n._fireFeatureFlagsCallbacks()})),this._rebuildEventProperties(),this.initialize()},t._syncAutomaticRefresh=function(){var e=this._config.refreshIntervalMs,t=!this._config.remoteRequestsDisabled&&Wf&&!Rl(e)&&e>0?e:void 0;t!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),Rl(t)||(this._refreshIntervalMs=t,this._scheduleNextRefresh(),null!=Wf&&Wf.addEventListener&&fh(Wf,Jp,this._onVisibilityChange)))},t._scheduleNextRefresh=function(){Rl(this._refreshIntervalMs)||(Rl(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){Rl(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==Wf||null==Wf.removeEventListener||Wf.removeEventListener(Jp,this._onVisibilityChange)),this._refreshIntervalMs=void 0,this._lastRefreshAt=void 0},t.destroy=function(){this._dispose()},t.dispose=function(){this._dispose()},t._dispose=function(){var e,t;this._stopAutomaticRefresh(),this._requestGeneration++,this._additionalReloadRequested=!1,this._initializingClient=void 0,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==Uf||Uf.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!Rl(null==(e=this._client)?void 0:e.kv.get(fp))&&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,i;if(null!=(r=this._instance)&&r.persistence&&e[fp]){var o=this._prop(fp)||{},s=e[fp]||{},a=t.flags||t.featureFlags,u=t.flags?Object.entries(t.flags).filter((function(e){var t=e[1];return!(null!=t&&t.failed)})).map((function(e){return e[0]})):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,c=l?u:n&&!Pl(a)?Object.keys(a||{}):Array.from(new Set([].concat(Object.keys(o),Object.keys(s)))),d=this._prop(vp)||{},f=e[vp]||{},h=l||n?c:Array.from(new Set([].concat(Object.keys(d),Object.keys(f)))),p=!l&&!n,_=!!p||c,v=!!p||h,g=((i={})[hp]=_,i[fp]=_,i[vp]=v,i);e[_p]&&(g[_p]=_);for(var m,y=Pa([gp,Ap,mp]);!(m=y()).done;){var b=m.value;Rl(e[b])||(g[b]=!0)}this._instance.persistence.markCrossTabFeatureFlagChanges(g)}},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={},n=Pa([hp,vp,gp,yp]);!(e=n()).done;){var r=e.value,i=this._prop(r);Rl(i)||(t[r]=i)}this._baseEventProperties=t;var o=Ta({},t),s=this._prop(fp);if(s)for(var a=0,u=Object.entries(s);u.length>a;a++){var l=u[a];o["$feature/"+l[0]]=l[1]}this._eventPropertiesWithFlagValues=o},t._isCacheStale=function(){var e=this._config.cacheTtlMs;if(!e||0>=e)return!1;var t=this._prop(Ap);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(!Rl(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!Rl(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]=s[t],e}),{});return this._receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u},void 0,{persist:!1})}},t.updateFlags=function(e,t,n){for(var r,i,o=null!=n&&n.merge&&null!==(r=this._prop(fp))&&void 0!==r?r:{},s=null!=n&&n.merge&&null!==(i=this._prop(vp))&&void 0!==i?i:{},a=Ta({},o,e),u=Ta({},s,t),l={},c=0,d=Object.entries(a);d.length>c;c++){var f=d[c],h=f[0],p=f[1];l[h]={key:h,enabled:af(p),variant:uf(p),reason:void 0,metadata:Rl(null==u?void 0:u[h])?void 0:{id:0,version:void 0,description:void 0,payload:u[h]}}}this._receivedFeatureFlags({flags:l})},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._prop(_p),t=this._prop(yp),n=this._prop(bp);if(!n&&!t)return e||{};for(var r,i=oh({},e||{}),o=Pa([].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],d=Rl(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,f=Rl(c)?null==l?void 0:l.variant:"string"==typeof c?c:void 0,h=null==n?void 0:n[u],p=Ta({},l,{enabled:d,variant:d?null!=f?f:null==l?void 0:l.variant:void 0});d!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),f!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),h&&(p.metadata=Ta({},null==l?void 0:l.metadata,{payload:h,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),i[u]=p}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:af(r),variant:uf(r),payload:sf(t[n])}}))},t.getFlagVariants=function(){var e=this._prop(fp),t=this._prop(yp);if(!t)return e||{};for(var n=oh({},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=this._prop(vp),t=this._prop(bp);if(!t)return e||{};for(var n=oh({},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._requestInFlight&&(this._additionalReloadRequested=!0),this._reloadDebouncer||(this._reloadingHandlers.slice().forEach((function(t){try{t()}catch(t){e._logger.error("Error while running feature flags reloading callback",t)}})),this._reloadDebouncer=setTimeout((function(){e._callFlagsEndpoint()}),5)))},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(Fp)},t._callFlagsEndpoint=function(e){var t=this;this._clearDebouncer();var n=this._client;if(n&&!this._config.remoteRequestsDisabled&&!this._hasStatusZeroCircuitBreakerTripped())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:Ta({},n.initialPersonProperties,this._prop(wp)||{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this._prop(Sp),timezone:ug()};Rl(n.deviceId)||(r.$device_id=n.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(r.disable_flags=!0);var i=this._getValidEvaluationEnvironments();i.length&&(r.evaluation_contexts=i);var o=this._getValidFlagKeys();Rl(o)||(r.flag_keys=o);var s=this._config.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),u=this._requestGeneration;this._requestInFlight=!0;var l=function(){t._additionalReloadRequested&&(t._additionalReloadRequested=!1,t._callFlagsEndpoint())},c=function(e){var n;t._requestInFlight=!1,u===t._requestGeneration?(t._set(((n={})[Lp]=[iS],n)),t._logger.error("Feature flag request failed",e),t._fallBackToPersistedFlags()&&t._fireFeatureFlagsCallbacks(!0),l()):l()};try{n.sendRequest(a,{target:"flags",method:"POST",body:r,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs}).then((function(e){var n,i,o,a=null!==(n=e.json)&&void 0!==n?n:{},c=200!==e.statusCode;if(t._requestInFlight=!1,u===t._requestGeneration){if(t._trackStatusZeroReachability(e.statusCode),c||t._additionalReloadRequested||(t.$anon_distinct_id=void 0),!r.disable_flags||t._additionalReloadRequested){t._flagsLoadedFromRemote=!c;var d=[];e.error?d.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?iS:"unknown_error"):200!==e.statusCode&&d.push("api_error_"+e.statusCode),a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var f=!(null==(i=a.quotaLimited)||!i.includes("feature_flags"));f&&d.push("quota_limited"),t._set(((o={})[Lp]=d,o)),f?t._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."):r.disable_flags||t._receivedFeatureFlags(a,c,{partialResponse:s}),l()}}else l()})).catch(c)}catch(e){c(e)}}},t._hasStatusZeroCircuitBreakerTripped=function(){return v_(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=g_(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.getFeatureFlag=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){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}}else this._logger.warn('getFeatureFlag for key "'+e+rS)},t.getFeatureFlagDetails=function(e){return this.getFlagsWithDetails()[e]},t.getFeatureFlagPayload=function(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload},t.getFeatureFlagResult=function(e,t){if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var n,r=this.getFlagVariants(),i=e in r,o=r[e],s=this.getFlagPayloads()[e],a=String(o),u=this._prop(gp)||void 0,l=this._prop(Ap)||void 0,c=this._prop(Fp)||{};if(this._config.deduplicateCallsPerSession){var d,f=null==(d=this._client)?void 0:d.session.sessionId,h=this._prop(Rp);f&&f!==h&&(c={},n=f)}if(t.send_event||!("send_event"in t))if(e in c&&c[e].includes(a)){if(n){var p;this._set(((p={})[Fp]=c,p[Rp]=n,p))}}else{var _,v,g,m,y,b,w,S,k,x,C,E,P,T;Pl(c[e])?c[e].push(a):c[e]=[a],this._set(Ta(((_={})[Fp]=c,_),n?((v={})[Rp]=n,v):{}));var I=this.getFeatureFlagDetails(e),F=[].concat(null!==(g=this._prop(Lp))&&void 0!==g?g:[]);Rl(o)&&F.push("flag_missing");var R={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:null!=s?s:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:null!==(m=null==(y=this._config.bootstrap)||null==(y=y.featureFlags)?void 0:y[e])&&void 0!==m?m:null,$feature_flag_bootstrapped_payload:null!==(b=null==(w=this._config.bootstrap)||null==(w=w.featureFlagPayloads)?void 0:w[e])&&void 0!==b?b:null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Rl(null==I||null==(S=I.metadata)?void 0:S.has_experiment)||(R.$feature_flag_has_experiment=I.metadata.has_experiment),Rl(null==I||null==(k=I.metadata)?void 0:k.version)||(R.$feature_flag_version=I.metadata.version);var L,A=null!==(x=null==I||null==(C=I.reason)?void 0:C.description)&&void 0!==x?x:null==I||null==(E=I.reason)?void 0:E.code;A&&(R.$feature_flag_reason=A),null!=I&&null!=(P=I.metadata)&&P.id&&(R.$feature_flag_id=I.metadata.id),Rl(null==I?void 0:I.original_variant)&&Rl(null==I?void 0:I.original_enabled)||(R.$feature_flag_original_response=Rl(I.original_variant)?I.original_enabled:I.original_variant),null!=I&&null!=(T=I.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==I||null==(L=I.metadata)?void 0:L.original_payload),F.length&&(R.$feature_flag_error=F.join(",")),this._captureFeatureFlagCalled(R)}else if(n){var O;this._set(((O={})[Fp]=c,O[Rp]=n,O))}if(i)return{key:e,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:sf(s)}}}else this._logger.warn('getFeatureFlagResult for key "'+e+rS)},t._captureFeatureFlagCalled=function(e){var t=this;try{var n;null==(n=this._client)||n.capture("$feature_flag_called",e).catch((function(e){t._logger.error("Failed to capture feature flag call",e)}))}catch(e){this._logger.error("Failed to capture feature flag call",e)}},t.getRemoteConfigPayload=function(e,t){this._getRemoteConfigPayload(e,t)},t._getRemoteConfigPayload=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s,a,u,l;return Ra().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(),Rl(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:l=null==(u=e.v.json)?void 0:u.featureFlagPayloads,a=(null==l?void 0:l[t])||void 0,e.n=5;break;case 4:return e.p=4,this._logger.error("Remote config feature flag request failed",e.v),e.a(2);case 5:try{n(a)}catch(e){this._logger.error("Remote config feature flag callback failed",e)}case 6:return e.a(2)}}),e,this,[[2,4]])})));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._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0))return this._logger.warn('isFeatureEnabled for key "'+e+rS),t.defaultValue;var n=this.getFeatureFlag(e,t);return Rl(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){this._hasLoadedFlags=!0;var r=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=tS);var l=function(e,t){var n=e.flags;return n?Ta({},e,{featureFlags:Object.fromEntries(Object.keys(n).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].enabled})).filter((function(e){var t;return!Rl(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)}(e,o),c=l.flags,d=l.featureFlags,f=l.featureFlagPayloads;if(d){var h=e.requestId,p=e.evaluatedAt;if(Pl(d)){var _;o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(d)for(var g=0;d.length>g;g++)v[d[g]]=!0;return(_={})[hp]=d,_[fp]=v,_[mp]=!1,_}var m=d,y=f,b=c;if(null!=i&&i.partialResponse){var w=Object.keys(m),S=y||{};m=Ta({},t,m),y=Ta({},n,S),w.forEach((function(e){var t;e in S||null==(t=y)||delete t[e]})),b=Ta({},r,b)}else if(e.errorsWhileComputingFlags)if(c){var k=new Set(Object.keys(c).filter((function(e){var t;return!(null!=(t=c[e])&&t.failed)})));m=Ta({},t,Object.fromEntries(Object.entries(m).filter((function(e){return k.has(e[0])}))));var x=Object.fromEntries(Object.entries(y||{}).filter((function(e){return k.has(e[0])})));y=Ta({},n,x),k.forEach((function(e){var t;e in x||null==(t=y)||delete t[e]})),b=Ta({},r,Object.fromEntries(Object.entries(b||{}).filter((function(e){return k.has(e[0])}))))}else m=Ta({},t,m),y=Ta({},n,y),b=Ta({},r,b);return Ta(((s={})[hp]=Object.keys(sS(m)),s[fp]=m||{},s[vp]=y||{},s[_p]=b||{},s[mp]=!0===e.minimalFlagCalledEvents,s),h?((a={})[gp]=h,a):{},p?((u={})[Ap]=p,u):{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this._logger);if(r)if(!1===(null==n?void 0:n.persist)){var i=!Rl(this._client.kv.get(fp));this._bootstrapState=r,i||this._set(r)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(r,e,!(null==n||!n.partialResponse)),this._set(r);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([yp,bp]),this._fireFeatureFlagsCallbacks(),void nS.info("All overrides cleared");var t,n;if(Pl(e))return this._set(((t={})[yp]=oS(e),t)),this._fireFeatureFlagsCallbacks(),void nS.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[yp]=Pl(s)?oS(s):s),a&&(o[bp]=a),Object.keys(o).length&&this._set(o),!1===s&&!1===a?this._remove([yp,bp]):!1===s?this._remove(yp):!1===a&&this._remove(bp),this._fireFeatureFlagsCallbacks(),!1===s?nS.info("Flag overrides cleared"):s&&nS.info("Flag overrides set",{flags:s}),void(!1===a?nS.info("Payload overrides cleared"):a&&nS.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[yp]=e,n)),this._fireFeatureFlagsCallbacks(),void nS.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=this,l=(this._prop(pp)||[]).find((function(t){return t.flagKey===e})),c=((r={})["$feature_enrollment/"+e]=t,r),d={$feature_flag:e,$feature_enrollment:t,$set:c};l&&(d.$early_access_feature_name=l.name),n&&(d.$feature_enrollment_stage=n);var f=Ta({},this.getFlagVariants(),((i={})[e]=t,i));null==(o=this._instance)||null==(o=o.persistence)||o.markCrossTabFeatureFlagChanges(((s={})[hp]=[e],s[fp]=[e],s[wp]=Object.keys(c),s)),this._set(((a={})[hp]=Object.keys(sS(f)),a[fp]=f,a[wp]=Ta({},this._prop(wp)||{},c),a)),this._fireFeatureFlagsCallbacks();try{var h;null==(h=this._client)||h.capture("$feature_enrollment_update",d).catch((function(e){u._logger.error("Failed to capture early access feature enrollment",e)}))}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(pp);!r||t?this._getEarlyAccessFeatures(e,n):e(r)},t._getEarlyAccessFeatures=function(){var e=Ca(Ra().m((function e(t,n){var r,i,o,s,a;return Ra().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={})[pp]=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;this.featureFlagEventHandlers.forEach((function(n){try{n(r,i,{errorsLoading:e})}catch(e){t._logger.error("Error while running feature flags callback",e)}}))},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(wp)||{},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={})[wp]=Ta({},r,s,i),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=Ta({},this._prop(wp)||{});e.forEach((function(e){delete r[e]})),this._set(((n={})[wp]=r,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(wp),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var r=this._prop(Sp)||{},i=Ta({},r),o=0,s=Object.keys(e);s.length>o;o++){var a=s[o];i[a]=Ta({},r[a],e[a])}this._set(((n={})[Sp]=i,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._prop(Sp)||{};this._set(((n={})[Sp]=Ta({},r,((t={})[e]={},t)),n))}else this._remove(Sp)},t.reset=function(){this._requestGeneration++,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},Ea(e,[{key:"_config",get:function(){return this._configSource.get()}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),uS="Refusing to render web experiment since the viewer is a likely bot",lS={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 Ch(t,e)},not_regex:function(e,t){return!Ch(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},cS=function(){function e(t){var n=this;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);Ll(i)&&t.variants[i]&&n._applyTransforms(t.name,i,t.variants[i].transforms)}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=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(uS);else if(!this._config.disable_web_experiments){if(Ml(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._applyTransforms(o.name,i,o.variants[i].transforms)}}))}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var r=h_(null==n?void 0:n.search,"__experiment_id"),i=h_(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))},e._matchesTestVariant=function(t,n){return!Ml(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var r;if(Ml(t.conditions)||Ml(null==(r=t.conditions)?void 0:r.url))return!0;var i=e.getWindowLocation();if(i){var o,s,a,u=y_(n,i.href);return null==(o=t.conditions)||!o.url||lS[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==Uf?void 0:Uf.location},e._matchUTMConditions=function(e){var t;if(Ml(e.conditions)||Ml(null==(t=e.conditions)?void 0:t.utm))return!0;var n=eg();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];th.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo(uS):"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);null==o||o.forEach((function(e){var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return zf&&this._instance?kb(zf,this._config.custom_blocked_useragents):void 0},Ea(e,[{key:"_config",get:function(){return this._instance.config}}])}(),dS=nh("[Conversations]"),fS="Conversations not available yet.",hS=function(){function e(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._loadFailed=!1,this._instance=e}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){if(!this._instance.config.disable_conversations&&(this._remoteConfigSuccessful=e.ok,e.ok)){var t=e.config.conversations;Ml(t)||($l(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}},t.reset=function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null,this._remoteConfigSuccessful=void 0,this._loadFailed=!1},t.loadIfEnabled=function(){var e=this;if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||hh(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Tg?void 0:Tg.__PosthogExtensions__;if(t&&!Rl(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=t.loadExternalDependency;if(!r)return void this._handleLoadError(Wp);r(this._instance,"conversations",(function(n){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 dS.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,dS.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else dS.error("Cannot complete initialization: remote config is null")},t._handleLoadError=function(e,t){dS.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():dS.warn("Conversations not loaded yet.")},t.hide=function(){this._conversationsManager&&this._conversationsManager.hide()},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!Ol(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":hh(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":Rl(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?Ml(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=Tg&&Tg.__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=Ca(Ra().m((function e(t,n,r){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t,n){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(t){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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=Ca(Ra().m((function e(){return Ra().w((function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return dS.warn(fS),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 pS(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,d=null!=t&&t.consoleCapture?void 0:null!==(i=null==e?void 0:e.maxLogsPerInterval)&&void 0!==i?i:1e3,f=Rl(d)?Math.max(c,2048):Math.max(c,d),h=Ta({},function(){var e="",t="";try{var n=null==zf?void 0:zf.userAgent;if(n){var r=sd(n);e=r[0],t=r[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(Tf,e)?Tf[e]:e}(e);return Ta({},n?{"os.name":n}:{},t?{"os.version":t}:{})}(e,t)}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(o=null!==(s=null==h?void 0:h["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==h?void 0:h["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(u=null==h?void 0:h["deployment.environment"])&&void 0!==u?u:null==e?void 0:e.environment,resourceAttributes:h,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:l,maxBufferSize:c,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var _S=["debug","log","warn","error","info"],vS="console",gS="__posthogHandledLogsRequestError",mS=function(e,t){var n=e instanceof Error?e:new Error(t);return n[gS]=!0,n},yS=function(e){return!!e&&"object"==typeof e&&!0===e[gS]},bS=function(){function e(e){var t,n=this;this.name="logs",this._isLogsEnabled=!1,this._isLoaded=!1,this._isLoading=!1,this._logger=nh("[logs]"),this._coreLogger=Ta({},this._logger,{error:function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];var i;t.some(yS)||(i=n._logger).error.apply(i,t)}}),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._disposed=!1,this._consoleBuffer=[],this._consoleRecorderUnpatchers=[],this._isRecordingConsole=!1,this._isRecordingConsoleEntry=!1,this._onReconnect=function(){var e,t;n._disposed||(n._consecutiveStatusZeroFailures=0,null==(e=n._core)||e.onReconnect(),null==(t=n._consoleCore)||t.onReconnect())},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),Uf&&fh(Uf,"online",this._onReconnect)}var t=e.prototype;return t._buildCore=function(e,t,n,r){var i,o=this,s=pS(null==(i=this._instance)||null==(i=i.config)?void 0:i.logs,n);return[new Mf(this._createHost(e,t),s,this._coreLogger,(function(){return o._getSdkContext()}),(function(e){return e()}),void 0,r),s]},t._getCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._core||this._resolvedFrom!==n){var r;null==(r=this._core)||r.reset(),this._resolvedFrom=n;var i=this._buildCore((function(){return t._queue}),(function(e){t._queue=e}));this._core=i[0],this._resolvedConfig=i[1]}return this._core},t._getConsoleCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._consoleCore||this._consoleResolvedFrom!==n){var r;null==(r=this._consoleCore)||r.reset(),this._consoleResolvedFrom=n;var i=this._buildCore((function(){return t._consoleQueue}),(function(e){t._consoleQueue=e}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},vS);this._consoleCore=i[0],this._consoleResolvedConfig=i[1]}return this._consoleCore},t.setup=function(e){var t,n=this;if(!this._disposed){this._client=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),(this._isLogsEnabled||this._remoteConfigWillArrive()&&this._persistedCaptureHint())&&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;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==Uf||Uf.removeEventListener("online",this._onReconnect),null==(t=this._consoleLogsDispose)||t.call(this),this._consoleLogsDispose=void 0,null==(n=this._core)||n.reset(),null==(r=this._consoleCore)||r.reset())},t.onRemoteConfig=function(e){var t,n,r;if(!this._disposed){var i=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Ml(i)?this._stopRecorderStartedByPersistedHint():(null==(n=this._instance)||null==(n=n.persistence)||n.register(((r={})[np]=!!i,r)),i?(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._getCore().captureLog(e)},t.captureConsoleLog=function(e){this._disposed||this._getConsoleCore().captureLog(e)},t.captureBufferedConsoleLog=function(e,t,n){this._disposed||this._getConsoleCore().captureLog(e,{context:t,occurredAtMs:n})},t._persistedCaptureHint=function(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[np])},t._remoteConfigWillArrive=function(){var e,t;return null==(e=this._instance)||null==e._shouldDisableFlags||!e._shouldDisableFlags()||!(null==(t=Tg._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)},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!=Tg&&Tg.console){for(var n,r=pS(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,i=function(){var e,i=n.value;try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(Tg.console[i])}catch(e){return 0}if(!e)return 0;t._consoleRecorderUnpatchers.push(Ug(Tg.console,i,(function(n){var o=function(){for(var e=arguments.length,o=new Array(e),s=0;e>s;s++)o[s]=arguments[s];try{t._recordConsoleEntry(i,o,r)}catch(e){}return n.apply(Tg.console,o)};return o.__rrweb_original__=e,o})))},o=Pa(_S);!(n=o()).done;)i();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._instance)&&r.is_capturing()){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=Pa(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;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._logFlushError=function(e){yS(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=null==Tg?void 0:Tg.__PosthogExtensions__;if(!t)return this._logger.error("PostHog Extensions not found."),void this._stopConsoleRecorder();var n=t.loadExternalDependency;if(!n)return this._logger.error(Wp),void this._stopConsoleRecorder();this._isLoading=!0;try{n(this._instance,"logs",(function(n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled){var r=t.logs;if(n||null==r||!r.initializeLogs)e._logger.error("Could not load logs script",n),e._stopConsoleRecorder();else{var i,o,s=e._takeConsoleBuffer();e._consoleLogsDispose=r.initializeLogs(null!==(i=e._client)&&void 0!==i?i:e._instance),e._isLoaded=!0,s.length>0&&(null==r.replayConsoleBuffer||r.replayConsoleBuffer(null!==(o=e._client)&&void 0!==o?o:e._instance,s))}}}))}catch(e){throw this._isLoading=!1,e}}},t._createHost=function(e,t){var n=this,r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:function(t){return t===ml.LogsQueue?e():void 0},setPersistedProperty:function(e,n){var r;e===ml.LogsQueue&&t(null!==(r=n)&&void 0!==r?r:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return jf.LIB_NAME},getLibraryVersion:function(){return jf.LIB_VERSION}}},t._sendLogsBatch=function(e){var t=this;return new Promise((function(n){if(v_(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:mS(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:mS(void 0,"logs request timed out")})}),9e4);t._instance._send_request({method:"POST",url:t._logsUrl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:function(e){var n=e.statusCode;if(t._trackEndpointReachability(n),n>=200&&300>n)i({kind:"ok"});else if(413===n)i({kind:"too-large"});else if(0!==n&&408!==n&&429!==n&&500>n)i({kind:"fatal",error:new Error("logs request failed with status "+n)});else{var r;0===n?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:mS(e.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+n)})}}})}}))},t._trackEndpointReachability=function(e){var t=this;(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=g_(e,this._consecutiveStatusZeroFailures,3,(function(){return t._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,jf.LIB_NAME,(function(e){t._queue=e})),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,vS,(function(e){t._consoleQueue=e}))},t._drainQueueViaTransport=function(e,t,n,r,i){if(0!==t.length){var o=t.map((function(e){return e.record}));i([]);var s=Of(o,Af(n,jf.LIB_NAME,jf.LIB_VERSION),r,jf.LIB_VERSION);this._instance._send_request({method:"POST",url:this._logsUrl(),data:s,compression:"best-available",batchKey:"logs",transport:e})}},t._logsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)},t._getSdkContext=function(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,o=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,Ml(i)||(t.sessionStartTimestamp=i),Ml(o)||(t.lastActivityTimestamp=o)}if(null!=Tg&&null!=(e=Tg.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?kd(Tg.location.href):Tg.location.href),this._instance.featureFlags){var s=this._instance.featureFlags.getFlags();s&&s.length>0&&(t.activeFeatureFlags=s)}return t},Ea(e,[{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}}])}(),wS=function(){function e(e){this._logger=nh("[metrics]"),this._instance=e}var t=e.prototype;return t.initialize=function(){},t._getCore=function(){var e,t,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this._core&&this._resolvedFrom===n||(null==(t=this._core)||t.reset(),this._resolvedFrom=n,this._core=new Nf(this._createHost(),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}}(n),this._logger)),this._core},t.count=function(e,t,n){void 0===t&&(t=1),this._getCore().count(e,t,n)},t.gauge=function(e,t,n){this._getCore().gauge(e,t,n)},t.histogram=function(e,t,n){this._getCore().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._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 jf.LIB_NAME},getLibraryVersion:function(){return jf.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(Ta({method:"POST",url:n._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback:function(e){var t=e.statusCode;if(t>=200&&300>t)o({kind:"ok"});else if(413===t)o({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)o({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var n;o({kind:"retry-later",error:null!==(n=e.error)&&void 0!==n?n:new Error("metrics request failed with status "+t)})}}}))}))},t._metricsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)},e}(),SS={featureFlags:aS},kS={sessionRecording:Pw},xS={autocapture:lw,historyAutocapture:fw,heatmaps:Fw,deadClicksAutocapture:Wm,webVitalsAutocapture:bw},CS={exceptionObserver:dw,exceptions:Og},ES=Ta({productTours:Aw},SS),PS={siteApps:qw},TS={tracingHeaders:pw},IS=Ta({surveys:Qw},SS),FS={toolbar:Jw},RS=Ta({experiments:cS},SS),LS=Ta({},SS,kS,xS,CS,ES,PS,IS,TS,FS,RS,{conversations:hS},{logs:bS},{metrics:wS});if(ew.__defaultExtensionClasses=Ta({},LS),function(){jf.SDK_DIST_CHANNEL="cdn";var e=Tg.posthog;if(!e||Pl(e._i)){var t=qb[Gb]=new ew;if(e){var n=[];ih(e._i,(function(r){if(r&&Pl(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))}}))}t.__SV=1,Tg.posthog=t,function(){function e(){e.done||(e.done=!0,Qb=!1,ih(qb,(function(e){e._dom_loaded()})))}null!=Wf&&Wf.addEventListener?"complete"===Wf.readyState?e():fh(Wf,"DOMContentLoaded",e,{capture:!1}):Uf&&th.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var AS="undefined"!=typeof performance?performance:{};AS.now=AS.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=AS)}}();
|
|
2
2
|
//# sourceMappingURL=array.full.es5.js.map
|