posthog-js 1.245.2 → 1.246.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e,t,n,r,i,o,s,a,u,l,c,d,f,p,_,h,v,g,m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(){return t?e:(t=1,e=function(e){try{return!!e()}catch(e){return!0}})}function b(){if(r)return n;r=1;var e=y();return n=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function w(){if(o)return i;o=1;var e=b(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return i=e?r:function(e){return function(){return n.apply(e,arguments)}},i}function S(){if(a)return s;a=1;var e=w(),t=e({}.toString),n=e("".slice);return s=function(e){return n(t(e),8,-1)}}function k(){return d?c:(d=1,c=function(e){return null==e})}function x(){if(p)return f;p=1;var e=k(),t=TypeError;return f=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function E(){if(h)return _;h=1;var e=function(){if(l)return u;l=1;var e=w(),t=y(),n=S(),r=Object,i=e("".split);return u=t((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?i(e,""):r(e)}:r}(),t=x();return _=function(n){return e(t(n))}}function C(){if(g)return v;g=1;var e=function(e){return e&&e.Math===Math&&e};return v=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof m&&m)||e("object"==typeof v&&v)||function(){return this}()||Function("return this")()}var T,P,I,F,R,M,O,L,q,$,A,D,N,H,B,j,z,U,V,W,G,Z,Q,Y,J,X,K,ee,te,ne={exports:{}};function re(){return P?T:(P=1,T=!1)}function ie(){if(F)return I;F=1;var e=C(),t=Object.defineProperty;return I=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function oe(){if(R)return ne.exports;R=1;var e=re(),t=C(),n=ie(),r="__core-js_shared__",i=ne.exports=t[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.38.1",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"}),ne.exports}function se(){if(O)return M;O=1;var e=oe();return M=function(t,n){return e[t]||(e[t]=n||{})}}function ae(){if(q)return L;q=1;var e=x(),t=Object;return L=function(n){return t(e(n))}}function ue(){if(A)return $;A=1;var e=w(),t=ae(),n=e({}.hasOwnProperty);return $=Object.hasOwn||function(e,r){return n(t(e),r)}}function le(){if(N)return D;N=1;var e=w(),t=0,n=Math.random(),r=e(1..toString);return D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function ce(){if(z)return j;z=1;var e,t,n=C(),r=function(){if(B)return H;B=1;var e=C().navigator,t=e&&e.userAgent;return H=t?String(t):""}(),i=n.process,o=n.Deno,s=i&&i.versions||o&&o.version,a=s&&s.v8;return a&&(t=(e=a.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),j=t}function de(){if(V)return U;V=1;var e=ce(),t=y(),n=C().String;return U=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function fe(){if(G)return W;G=1;var e=de();return W=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function pe(){if(Q)return Z;Q=1;var e=C(),t=se(),n=ue(),r=le(),i=de(),o=fe(),s=e.Symbol,a=t("wks"),u=o?s.for||s:s&&s.withoutSetter||r;return Z=function(e){return n(a,e)||(a[e]=i&&n(s,e)?s[e]:u("Symbol."+e)),a[e]},Z}function _e(){if(J)return Y;J=1;var e="object"==typeof document&&document.all;return Y=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function he(){if(K)return X;K=1;var e=_e();return X=function(t){return"object"==typeof t?null!==t:e(t)}}function ve(){if(te)return ee;te=1;var e=he(),t=String,n=TypeError;return ee=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}var ge,me,ye,be,we={};function Se(){if(me)return ge;me=1;var e=y();return ge=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function ke(){if(be)return ye;be=1;var e=Se(),t=y();return ye=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}var xe,Ee,Ce,Te,Pe,Ie,Fe,Re,Me,Oe,Le,qe,$e,Ae,De,Ne,He,Be,je,ze,Ue,Ve,We,Ge,Ze,Qe,Ye,Je,Xe,Ke,et,tt,nt,rt,it,ot,st,at,ut,lt,ct,dt,ft,pt,_t,ht,vt,gt,mt,yt,bt,wt,St,kt,xt,Et,Ct,Tt,Pt,It,Ft,Rt,Mt,Ot,Lt={};function qt(){if(Ee)return xe;Ee=1;var e=C(),t=he(),n=e.document,r=t(n)&&t(n.createElement);return xe=function(e){return r?n.createElement(e):{}}}function $t(){if(Te)return Ce;Te=1;var e=Se(),t=y(),n=qt();return Ce=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function At(){if(Ie)return Pe;Ie=1;var e=b(),t=Function.prototype.call;return Pe=e?t.bind(t):function(){return t.apply(t,arguments)},Pe}function Dt(){if(Re)return Fe;Re=1;var e=C(),t=_e();return Fe=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},Fe}function Nt(){if(Oe)return Me;Oe=1;var e=w();return Me=e({}.isPrototypeOf)}function Ht(){if(qe)return Le;qe=1;var e=Dt(),t=_e(),n=Nt(),r=fe(),i=Object;return Le=r?function(e){return"symbol"==typeof e}:function(r){var o=e("Symbol");return t(o)&&n(o.prototype,i(r))}}function Bt(){if(Ae)return $e;Ae=1;var e=String;return $e=function(t){try{return e(t)}catch(e){return"Object"}}}function jt(){if(Ne)return De;Ne=1;var e=_e(),t=Bt(),n=TypeError;return De=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function zt(){if(Be)return He;Be=1;var e=jt(),t=k();return He=function(n,r){var i=n[r];return t(i)?void 0:e(i)},He}function Ut(){if(ze)return je;ze=1;var e=At(),t=_e(),n=he(),r=TypeError;return je=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")}}function Vt(){if(Ve)return Ue;Ve=1;var e=At(),t=he(),n=Ht(),r=zt(),i=Ut(),o=pe(),s=TypeError,a=o("toPrimitive");return Ue=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 Wt(){if(Ge)return We;Ge=1;var e=Vt(),t=Ht();return We=function(n){var r=e(n,"string");return t(r)?r:r+""}}function Gt(){if(Ze)return Lt;Ze=1;var e=Se(),t=$t(),n=ke(),r=ve(),i=Wt(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Lt.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},Lt}function Zt(){if(Xe)return Je;Xe=1;var e=function(){if(Ye)return Qe;Ye=1;var e=Math.ceil,t=Math.floor;return Qe=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},Qe}();return Je=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function Qt(){if(et)return Ke;et=1;var e=Zt(),t=Math.max,n=Math.min;return Ke=function(r,i){var o=e(r);return o<0?t(o+i,0):n(o,i)}}function Yt(){if(nt)return tt;nt=1;var e=Zt(),t=Math.min;return tt=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function Jt(){if(it)return rt;it=1;var e=Yt();return rt=function(t){return e(t.length)}}function Xt(){return ut?at:(ut=1,at={})}function Kt(){if(ct)return lt;ct=1;var e=w(),t=ue(),n=E(),r=function(){if(st)return ot;st=1;var e=E(),t=Qt(),n=Jt(),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 ot={includes:r(!0),indexOf:r(!1)}}().indexOf,i=Xt(),o=e([].push);return lt=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},lt}function en(){return ft?dt:(ft=1,dt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function tn(){if(_t)return pt;_t=1;var e=Kt(),t=en();return pt=Object.keys||function(n){return e(n,t)},pt}function nn(){if(gt)return vt;gt=1;var e=Dt();return vt=e("document","documentElement")}function rn(){if(yt)return mt;yt=1;var e=se(),t=le(),n=e("keys");return mt=function(e){return n[e]||(n[e]=t(e))}}function on(){if(wt)return bt;wt=1;var e,t=ve(),n=function(){if(ht)return we;ht=1;var e=Se(),t=ke(),n=Gt(),r=ve(),i=E(),o=tn();return we.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},we}(),r=en(),i=Xt(),o=nn(),s=qt(),a=rn(),u="prototype",l="script",c=a("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+"</"+l+">"},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;_="undefined"!=typeof document?document.domain&&e?p(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):p(e);for(var a=r.length;a--;)delete _[u][r[a]];return _()};return i[c]=!0,bt=Object.create||function(e,r){var i;return null!==e?(d[u]=t(e),i=new d,d[u]=null,i[c]=e):i=_(),void 0===r?i:n.f(i,r)},bt}function sn(){if(kt)return St;kt=1;var e=pe(),t=on(),n=Gt().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),St=function(e){i[r][e]=!0}}function an(){return Et?xt:(Et=1,xt={})}function un(){return It?Pt:(It=1,Pt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function ln(){if(Rt)return Ft;Rt=1;var e=Se(),t=Gt(),n=un();return Ft=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}function cn(){if(Ot)return Mt;Ot=1;var e,t,n,r=function(){if(Tt)return Ct;Tt=1;var e=C(),t=_e(),n=e.WeakMap;return Ct=t(n)&&/native code/.test(String(n))}(),i=C(),o=he(),s=ln(),a=ue(),u=oe(),l=rn(),c=Xt(),d="Object already initialized",f=i.TypeError,p=i.WeakMap;if(r||u.state){var _=u.state||(u.state=new p);_.get=_.get,_.has=_.has,_.set=_.set,e=function(e,t){if(_.has(e))throw new f(d);return t.facade=e,_.set(e,t),t},t=function(e){return _.get(e)||{}},n=function(e){return _.has(e)}}else{var h=l("state");c[h]=!0,e=function(e,t){if(a(e,h))throw new f(d);return t.facade=e,s(e,h,t),t},t=function(e){return a(e,h)?e[h]:{}},n=function(e){return a(e,h)}}return Mt={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(!o(n)||(r=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}}var dn,fn,pn={},_n={};function hn(){if(fn)return pn;fn=1;var e=Se(),t=At(),n=function(){if(dn)return _n;dn=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return _n.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,_n}(),r=un(),i=E(),o=Wt(),s=ue(),a=$t(),u=Object.getOwnPropertyDescriptor;return pn.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])},pn}var vn,gn,mn,yn,bn,wn,Sn,kn={exports:{}};function xn(){if(gn)return vn;gn=1;var e=Se(),t=ue(),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 vn={EXISTS:i,PROPER:o,CONFIGURABLE:s}}function En(){if(yn)return mn;yn=1;var e=w(),t=_e(),n=oe(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),mn=n.inspectSource}function Cn(){if(bn)return kn.exports;bn=1;var e=w(),t=y(),n=_e(),r=ue(),i=Se(),o=xn().CONFIGURABLE,s=En(),a=cn(),u=a.enforce,l=a.get,c=String,d=Object.defineProperty,f=e("".slice),p=e("".replace),_=e([].join),h=i&&!t((function(){return 8!==d((function(){}),"length",{value:8}).length})),v=String(String).split("String"),g=kn.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+p(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),h&&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,"string"==typeof t?t:"")),e};return Function.prototype.toString=g((function(){return n(this)&&l(this).source||s(this)}),"toString"),kn.exports}function Tn(){if(Sn)return wn;Sn=1;var e=_e(),t=Gt(),n=Cn(),r=ie();return wn=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},wn}var Pn,In={};var Fn,Rn,Mn,On,Ln,qn,$n,An,Dn,Nn,Hn,Bn,jn,zn,Un,Vn,Wn,Gn,Zn,Qn,Yn,Jn,Xn,Kn,er,tr,nr,rr,ir,or,sr,ar,ur,lr={};function cr(){if(Mn)return Rn;Mn=1;var e=Dt(),t=w(),n=function(){if(Pn)return In;Pn=1;var e=Kt(),t=en().concat("length","prototype");return In.f=Object.getOwnPropertyNames||function(n){return e(n,t)},In}(),r=(Fn||(Fn=1,lr.f=Object.getOwnPropertySymbols),lr),i=ve(),o=t([].concat);return Rn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),s=r.f;return s?o(t,s(e)):t}}function dr(){if(Ln)return On;Ln=1;var e=ue(),t=cr(),n=hn(),r=Gt();return On=function(i,o,s){for(var a=t(o),u=r.f,l=n.f,c=0;c<a.length;c++){var d=a[c];e(i,d)||s&&e(s,d)||u(i,d,l(o,d))}},On}function fr(){if(Dn)return An;Dn=1;var e=C(),t=hn().f,n=ln(),r=Tn(),i=ie(),o=dr(),s=function(){if($n)return qn;$n=1;var e=y(),t=_e(),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 qn=r}();return An=function(a,u){var l,c,d,f,p,_=a.target,h=a.global,v=a.stat;if(l=h?e:v?e[_]||i(_,{}):e[_]&&e[_].prototype)for(c in u){if(f=u[c],d=a.dontCallGetSet?(p=t(l,c))&&p.value:l[c],!s(h?c:_+(v?".":"#")+c,a.forced)&&void 0!==d){if(typeof f==typeof d)continue;o(f,d)}(a.sham||d&&d.sham)&&n(f,"sham",!0),r(l,c,f,a)}}}function pr(){if(jn)return Bn;jn=1;var e=ue(),t=_e(),n=ae(),r=rn(),i=function(){if(Hn)return Nn;Hn=1;var e=y();return Nn=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Nn}(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Bn=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},Bn}function _r(){if(Un)return zn;Un=1;var e,t,n,r=y(),i=_e(),o=he(),s=on(),a=pr(),u=Tn(),l=pe(),c=re(),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})),zn={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:f}}function hr(){if(Wn)return Vn;Wn=1;var e=Gt().f,t=ue(),n=pe()("toStringTag");return Vn=function(r,i,o){r&&!o&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function vr(){if(Xn)return Jn;Xn=1;var e=he();return Jn=function(t){return e(t)||null===t}}function gr(){if(er)return Kn;er=1;var e=vr(),t=String,n=TypeError;return Kn=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function mr(){if(nr)return tr;nr=1;var e=function(){if(Yn)return Qn;Yn=1;var e=w(),t=jt();return Qn=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}(),t=he(),n=x(),r=gr();return tr=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),tr}function yr(){if(ir)return rr;ir=1;var e=fr(),t=At(),n=re(),r=xn(),i=_e(),o=function(){if(Zn)return Gn;Zn=1;var e=_r().IteratorPrototype,t=on(),n=un(),r=hr(),i=an(),o=function(){return this};return Gn=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},Gn}(),s=pr(),a=mr(),u=hr(),l=ln(),c=Tn(),d=pe(),f=an(),p=_r(),_=r.PROPER,h=r.CONFIGURABLE,v=p.IteratorPrototype,g=p.BUGGY_SAFARI_ITERATORS,m=d("iterator"),y="keys",b="values",w="entries",S=function(){return this};return rr=function(r,d,p,k,x,E,C){o(p,d,k);var T,P,I,F=function(e){if(e===x&&q)return q;if(!g&&e&&e in O)return O[e];switch(e){case y:case b:case w:return function(){return new p(this,e)}}return function(){return new p(this)}},R=d+" Iterator",M=!1,O=r.prototype,L=O[m]||O["@@iterator"]||x&&O[x],q=!g&&L||F(x),$="Array"===d&&O.entries||L;if($&&(T=s($.call(new r)))!==Object.prototype&&T.next&&(n||s(T)===v||(a?a(T,v):i(T[m])||c(T,m,S)),u(T,R,!0,!0),n&&(f[R]=S)),_&&x===b&&L&&L.name!==b&&(!n&&h?l(O,"name",b):(M=!0,q=function(){return t(L,this)})),x)if(P={values:F(b),keys:E?q:F(y),entries:F(w)},C)for(I in P)(g||M||!(I in O))&&c(O,I,P[I]);else e({target:d,proto:!0,forced:g||M},P);return n&&!C||O[m]===q||c(O,m,q,{name:x}),f[d]=q,P},rr}function br(){return sr?or:(sr=1,or=function(e,t){return{value:e,done:t}})}function wr(){if(ur)return ar;ur=1;var e=E(),t=sn(),n=an(),r=cn(),i=Gt().f,o=yr(),s=br(),a=re(),u=Se(),l="Array Iterator",c=r.set,d=r.getterFor(l);ar=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 ar}var Sr,kr,xr,Er,Cr,Tr,Pr,Ir,Fr,Rr,Mr,Or,Lr,qr,$r,Ar,Dr,Nr,Hr,Br,jr,zr,Ur,Vr,Wr,Gr={};function Zr(){if(Er)return xr;Er=1;var e=function(){if(kr)return Sr;kr=1;var e=S(),t=w();return Sr=function(n){if("Function"===e(n))return t(n)}}(),t=jt(),n=b(),r=e(e.bind);return xr=function(e,i){return t(e),void 0===i?e:n?r(e,i):function(){return e.apply(i,arguments)}},xr}function Qr(){if(Tr)return Cr;Tr=1;var e=pe(),t=an(),n=e("iterator"),r=Array.prototype;return Cr=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function Yr(){if(Rr)return Fr;Rr=1;var e=function(){if(Ir)return Pr;Ir=1;var e={};return e[pe()("toStringTag")]="z",Pr="[object z]"===String(e)}(),t=_e(),n=S(),r=pe()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Fr=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},Fr}function Jr(){if(Or)return Mr;Or=1;var e=Yr(),t=zt(),n=k(),r=an(),i=pe()("iterator");return Mr=function(o){if(!n(o))return t(o,i)||t(o,"@@iterator")||r[e(o)]}}function Xr(){if(qr)return Lr;qr=1;var e=At(),t=jt(),n=ve(),r=Bt(),i=Jr(),o=TypeError;return Lr=function(s,a){var u=arguments.length<2?i(s):a;if(t(u))return n(e(u,s));throw new o(r(s)+" is not iterable")},Lr}function Kr(){if(Ar)return $r;Ar=1;var e=At(),t=ve(),n=zt();return $r=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 ei(){if(Nr)return Dr;Nr=1;var e=Zr(),t=At(),n=ve(),r=Bt(),i=Qr(),o=Jt(),s=Nt(),a=Xr(),u=Jr(),l=Kr(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return Dr=function(p,_,h){var v,g,m,y,b,w,S,k=h&&h.that,x=!(!h||!h.AS_ENTRIES),E=!(!h||!h.IS_RECORD),C=!(!h||!h.IS_ITERATOR),T=!(!h||!h.INTERRUPTED),P=e(_,k),I=function(e){return v&&l(v,"normal",e),new d(!0,e)},F=function(e){return x?(n(e),T?P(e[0],e[1],I):P(e[0],e[1])):T?P(e,I):P(e)};if(E)v=p.iterator;else if(C)v=p;else{if(!(g=u(p)))throw new c(r(p)+" is not iterable");if(i(g)){for(m=0,y=o(p);y>m;m++)if((b=F(p[m]))&&s(f,b))return b;return new d(!1)}v=a(p,g)}for(w=E?p.next:v.next;!(S=t(w,v)).done;){try{b=F(S.value)}catch(e){l(v,"throw",e)}if("object"==typeof b&&b&&s(f,b))return b}return new d(!1)}}function ti(){if(Br)return Hr;Br=1;var e=Se(),t=Gt(),n=un();return Hr=function(r,i,o){e?t.f(r,i,n(0,o)):r[i]=o}}function ni(){if(Ur)return zr;Ur=1;var e=C();return zr=e}function ri(){if(Wr)return Vr;Wr=1,wr(),function(){if(jr)return Gr;jr=1;var e=fr(),t=ei(),n=ti();e({target:"Object",stat:!0},{fromEntries:function(e){var r={};return t(e,(function(e,t){n(r,e,t)}),{AS_ENTRIES:!0}),r}})}();var e=ni();return Vr=e.Object.fromEntries}var ii,oi,si,ai,ui,li,ci,di,fi,pi,_i,hi,vi={};function gi(){if(ui)return vi;ui=1;var e=C(),t=oi?ii:(oi=1,ii={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(ai)return si;ai=1;var e=qt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return si=t===Object.prototype?void 0:t}(),r=wr(),i=ln(),o=hr(),s=pe()("iterator"),a=r.values,u=function(e,n){if(e){if(e[s]!==a)try{i(e,s,a)}catch(t){e[s]=a}if(o(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{i(e,u,r[u])}catch(t){e[u]=r[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);return u(n,"DOMTokenList"),vi}function mi(){if(fi)return di;fi=1;var e=function(){if(ci)return li;ci=1;var e=ri();return gi(),li=e}();return di=e}function yi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bi(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 wi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ci(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Si(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 yi(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)?yi(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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 ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ki.apply(null,arguments)}function xi(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 Ei(){Ei=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(e,t,n,r){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(t,n,r,i){var o=n&&n.prototype instanceof f?n:f,s=Object.create(o.prototype);return u(s,"_invoke",function(t,n,r){var i=1;return function(o,s){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw s;return{value:e,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===i)throw i=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=3;var l=c(t,n,r);if("normal"===l.type){if(i=r.done?4:2,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=4,r.method="throw",r.arg=l.arg)}}}(t,r,new x(i||[])),!0),s}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d={};function f(){}function p(){}function _(){}var h={};u(h,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(E([])));g&&g!==n&&r.call(g,o)&&(h=g);var m=_.prototype=f.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,s,a){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,a)}))}a(u.arg)}var i;u(this,"_invoke",(function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function w(t,n){var r=n.method,i=t.i[r];if(i===e)return n.delegate=null,"throw"===r&&t.i.return&&(n.method="return",n.arg=e,w(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=c(i,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var s=o.arg;return s?s.done?(n[t.r]=s.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function S(e){this.tryEntries.push(e)}function k(t){var n=t[4]||{};n.type="normal",n.arg=e,t[4]=n}function x(e){this.tryEntries=[[-1]],e.forEach(S,this),this.reset(!0)}function E(t){if(null!=t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return p.prototype=_,u(m,"constructor",_),u(_,"constructor",p),p.displayName=u(_,a,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},t.awrap=function(e){return{__await:e}},y(b.prototype),u(b.prototype,s,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new b(l(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},y(m),u(m,a,"Generator"),u(m,o,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},t.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(e){s.type="throw",s.arg=t,n.next=e}for(var i=n.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o[4],a=this.prev,u=o[1],l=o[2];if(-1===o[0])return r("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=e,r(u),!0;if(a<l)return r(l),!1}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var i=r;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[2]===e)return this.complete(n[4],n[3]),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]===e){var r=n[4];if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={i:E(t),r:n,n:r},"next"===this.method&&(this.arg=e),d}},t}function Ci(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,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}hi||(hi=1,function(){if(_i)return pi;_i=1;var e=mi();pi=e}());var Ti,Pi,Ii,Fi,Ri,Mi,Oi,Li,qi={},$i=[],Ai=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Di=Array.isArray;function Ni(e,t){for(var n in t)e[n]=t[n];return e}function Hi(e){var t=e.parentNode;t&&t.removeChild(e)}function Bi(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?Ti.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 ji(e,s,r,i,null)}function ji(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Ii:i,__i:-1,__u:0};return null==i&&null!=Pi.vnode&&Pi.vnode(o),o}function zi(e){return e.children}function Ui(e,t){this.props=e,this.context=t}function Vi(e,t){if(null==t)return e.__?Vi(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Vi(e):null}function Wi(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Wi(e)}}function Gi(e){(!e.__d&&(e.__d=!0)&&Fi.push(e)&&!Zi.__r++||Ri!==Pi.debounceRendering)&&((Ri=Pi.debounceRendering)||Mi)(Zi)}function Zi(){var e,t,n,r,i,o,s,a,u;for(Fi.sort(Oi);e=Fi.shift();)e.__d&&(t=Fi.length,r=void 0,o=(i=(n=e).__v).__e,a=[],u=[],(s=n.__P)&&((r=Ni({},i)).__v=i.__v+1,Pi.vnode&&Pi.vnode(r),no(s,r,i,n.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?Vi(i):o,!!(32&i.__u),u),r.__.__k[r.__i]=r,ro(a,r,u),r.__e!=o&&Wi(r)),Fi.length>t&&Fi.sort(Oi));Zi.__r=0}function Qi(e,t,n,r,i,o,s,a,u,l,c){var d,f,p,_,h,v=r&&r.__k||$i,g=t.length;for(n.__d=u,function(e,t,n){var r,i,o,s,a,u=t.length,l=n.length,c=l,d=0;for(e.__k=[],r=0;r<u;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?ji(null,i,null,null,i):Di(i)?ji(zi,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?ji(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=Ji(i,n,s=r+d,c),i.__i=a,o=null,-1!==a&&(c--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?c>u-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Vi(o)),so(o,o,!1),n[r]=null,c--);if(c)for(r=0;r<l;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Vi(o)),so(o,o))}(n,t,v),u=n.__d,d=0;d<g;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?qi:v[p.__i]||qi,p.__i=d,no(e,p,f,i,o,s,a,u,l,c),_=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&oo(f.ref,null,p),c.push(p.ref,p.__c||_,p)),null==h&&null!=_&&(h=_),65536&p.__u||f.__k===p.__k?u=Yi(p,u,e):"function"==typeof p.type&&void 0!==p.__d?u=p.__d:_&&(u=_.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=u,n.__e=h}function Yi(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Yi(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Ji(e,t,n,r){var i=e.key,o=e.type,s=n-1,a=n+1,u=t[n];if(null===u||u&&i==u.key&&o===u.type)return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((u=t[s])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return s;s--}if(a<t.length){if((u=t[a])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return a;a++}}return-1}function Xi(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ai.test(t)?n:n+"px"}function Ki(e,t,n,r,i){var o;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||Xi(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Xi(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?to:eo,o)):e.removeEventListener(t,o?to:eo,o);else{if(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&&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,n))}}function eo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Pi.event?Pi.event(e):e)}function to(e){return this.l[e.type+!0](Pi.event?Pi.event(e):e)}function no(e,t,n,r,i,o,s,a,u,l){var c,d,f,p,_,h,v,g,m,y,b,w,S,k,x,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=Pi.__b)&&c(t);e:if("function"==typeof E)try{if(g=t.props,m=(c=E.contextType)&&r[c.__c],y=c?m?m.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(g,y):(t.__c=d=new Ui(g,y),d.constructor=E,d.render=ao),m&&m.sub(d),d.props=g,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ni({},d.__s)),Ni(d.__s,E.getDerivedStateFromProps(g,d.__s))),p=d.props,_=d.state,d.__v=t,f)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&g!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=g,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,_,h)}))}if(d.context=y,d.props=g,d.__P=e,d.__e=!1,w=Pi.__r,S=0,"prototype"in E&&E.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(r=Ni(Ni({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(h=d.getSnapshotBeforeUpdate(p,_)),Qi(e,Di(x=null!=c&&c.type===zi&&null==c.key?c.props.children:c)?x:[x],t,n,r,i,o,s,a,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),v&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=a,t.__u|=u?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Pi.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=io(n.__e,t,n,r,i,o,s,u,l);(c=Pi.diffed)&&c(t)}function ro(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)oo(n[r],n[++r],n[++r]);Pi.__c&&Pi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Pi.__e(e,t.__v)}}))}function io(e,t,n,r,i,o,s,a,u){var l,c,d,f,p,_,h,v=n.props,g=t.props,m=t.type;if("svg"===m&&(i=!0),null!=o)for(l=0;l<o.length;l++)if((p=o[l])&&"setAttribute"in p==!!m&&(m?p.localName===m:3===p.nodeType)){e=p,o[l]=null;break}if(null==e){if(null===m)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,g.is&&g),o=null,a=!1}if(null===m)v===g||a&&e.data===g||(e.data=g);else{if(o=o&&Ti.call(e.childNodes),v=n.props||qi,!a&&null!=o)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)p=v[l],"children"==l||("dangerouslySetInnerHTML"==l?d=p:"key"===l||l in g||Ki(e,l,null,p,i));for(l in g)p=g[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?_=p:"checked"==l?h=p:"key"===l||a&&"function"!=typeof p||v[l]===p||Ki(e,l,p,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=""),Qi(e,Di(f)?f:[f],t,n,r,i&&"foreignObject"!==m,o,s,o?o[0]:n.__k&&Vi(n,0),a,u),null!=o)for(l=o.length;l--;)null!=o[l]&&Hi(o[l]);a||(l="value",void 0!==_&&(_!==e[l]||"progress"===m&&!_||"option"===m&&_!==v[l])&&Ki(e,l,_,v[l],!1),l="checked",void 0!==h&&h!==e[l]&&Ki(e,l,h,v[l],!1))}return e}function oo(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Pi.__e(e,n)}}function so(e,t,n){var r,i;if(Pi.unmount&&Pi.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||oo(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Pi.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&so(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Hi(e.__e),e.__=e.__e=e.__d=void 0}function ao(e,t,n){return this.constructor(e,n)}function uo(e,t,n){var r,i,o,s;Pi.__&&Pi.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],s=[],no(t,e=(!r&&n||t).__k=Bi(zi,null,[e]),i||qi,qi,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Ti.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),ro(o,e,s)}function lo(e,t,n){var r,i,o,s,a=Ni({},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]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Ti.call(arguments,2):n),ji(e.type,a,r||e.key,i||e.ref,null)}Ti=$i.slice,Pi={__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}},Ii=0,Ui.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ni({},this.state),"function"==typeof e&&(e=e(Ni({},n),this.props)),e&&Ni(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Gi(this))},Ui.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Gi(this))},Ui.prototype.render=zi,Fi=[],Mi="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oi=function(e,t){return e.__v.__b-t.__v.__b},Zi.__r=0,Li=0;var co,fo,po,_o,ho=0,vo=[],go=[],mo=Pi.__b,yo=Pi.__r,bo=Pi.diffed,wo=Pi.__c,So=Pi.unmount;function ko(e,t){Pi.__h&&Pi.__h(fo,e,ho||t),ho=0;var n=fo.__H||(fo.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:go}),n.__[e]}function xo(e){return ho=1,function(e,t,n){var r=ko(co++,2);if(r.t=e,!r.__c&&(r.__=[qo(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=fo,!fo.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};fo.u=!0;var o=fo.shouldComponentUpdate,s=fo.componentWillUpdate;fo.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)},fo.shouldComponentUpdate=i}return r.__N||r.__}(qo,e)}function Eo(e,t){var n=ko(co++,3);!Pi.__s&&Lo(n.__H,t)&&(n.__=e,n.i=t,fo.__H.__h.push(n))}function Co(e){return ho=5,To((function(){return{current:e}}),[])}function To(e,t){var n=ko(co++,7);return Lo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Po(e){var t=fo.context[e.__c],n=ko(co++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(fo)),t.props.value):e.__}function Io(){for(var e;e=vo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mo),e.__H.__h.forEach(Oo),e.__H.__h=[]}catch(t){e.__H.__h=[],Pi.__e(t,e.__v)}}Pi.__b=function(e){fo=null,mo&&mo(e)},Pi.__r=function(e){yo&&yo(e),co=0;var t=(fo=e.__c).__H;t&&(po===fo?(t.__h=[],fo.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=go,e.__N=e.i=void 0}))):(t.__h.forEach(Mo),t.__h.forEach(Oo),t.__h=[],co=0)),po=fo},Pi.diffed=function(e){bo&&bo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==vo.push(t)&&_o===Pi.requestAnimationFrame||((_o=Pi.requestAnimationFrame)||Ro)(Io)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==go&&(e.__=e.__V),e.i=void 0,e.__V=go}))),po=fo=null},Pi.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Mo),e.__h=e.__h.filter((function(e){return!e.__||Oo(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Pi.__e(n,e.__v)}})),wo&&wo(e,t)},Pi.unmount=function(e){So&&So(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Mo(e)}catch(e){t=e}})),n.__H=void 0,t&&Pi.__e(t,n.__v))};var Fo="function"==typeof requestAnimationFrame;function Ro(e){var t,n=function(){clearTimeout(r),Fo&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Fo&&(t=requestAnimationFrame(n))}function Mo(e){var t=fo,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),fo=t}function Oo(e){var t=fo;e.__c=e.__(),fo=t}function Lo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function qo(e,t){return"function"==typeof t?t(e):t}var $o=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Ao=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Do=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e}({}),No=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Ho=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Bo=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),jo="undefined"!=typeof window?window:void 0,zo="undefined"!=typeof globalThis?globalThis:jo,Uo=Array.prototype,Vo=Uo.forEach,Wo=Uo.indexOf,Go=null==zo?void 0:zo.navigator,Zo=null==zo?void 0:zo.document,Qo=null==zo?void 0:zo.location,Yo=null==zo?void 0:zo.fetch,Jo=null!=zo&&zo.XMLHttpRequest&&"withCredentials"in new zo.XMLHttpRequest?zo.XMLHttpRequest:void 0,Xo=null==zo?void 0:zo.AbortController,Ko=null==Go?void 0:Go.userAgent,es=null!=jo?jo:{},ts={DEBUG:!1,LIB_VERSION:"1.245.2"},ns="$copy_autocapture",rs=["$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"],is=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),os=["fatal","error","warning","log","info","debug"];function ss(e,t){return-1!==e.indexOf(t)}var as=function(e){return e.trim()},us=function(e){return e.replace(/^\$/,"")};var ls=Array.isArray,cs=Object.prototype,ds=cs.hasOwnProperty,fs=cs.toString,ps=ls||function(e){return"[object Array]"===fs.call(e)},_s=function(e){return"function"==typeof e},hs=function(e){return e===Object(e)&&!ps(e)},vs=function(e){if(hs(e)){for(var t in e)if(ds.call(e,t))return!1;return!0}return!1},gs=function(e){return void 0===e},ms=function(e){return"[object String]"==fs.call(e)},ys=function(e){return ms(e)&&0===e.trim().length},bs=function(e){return null===e},ws=function(e){return gs(e)||bs(e)},Ss=function(e){return"[object Number]"==fs.call(e)},ks=function(e){return"[object Boolean]"===fs.call(e)},xs=function(e){return e instanceof FormData},Es=function(e){return ss(rs,e)},Cs=function(e){var t={_log:function(t){if(jo&&(ts.DEBUG||es.POSTHOG_DEBUG)&&!gs(jo.console)&&jo.console){for(var n=("__rrweb_original__"in jo.console[t]?jo.console[t].__rrweb_original__:jo.console[t]),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(void 0,[e].concat(i))}},info:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log.apply(t,["log"].concat(n))},warn:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log.apply(t,["warn"].concat(n))},error:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log.apply(t,["error"].concat(n))},critical:function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=console).error.apply(t,[e].concat(r))},uninitializedWarning:function(e){t.error("You must initialize PostHog before calling "+e)},createLogger:function(t){return Cs(e+" "+t)}};return t},Ts=Cs("[PostHog.js]"),Ps=Ts.createLogger,Is={};function Fs(e,t,n){if(ps(e))if(Vo&&e.forEach===Vo)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===Is)return}function Rs(e,t,n){if(!ws(e)){if(ps(e))return Fs(e,t,n);if(xs(e))for(var r,i=Si(e.entries());!(r=i()).done;){var o=r.value;if(t.call(n,o[1],o[0])===Is)return}else for(var s in e)if(ds.call(e,s)&&t.call(n,e[s],s)===Is)return}}var Ms=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Fs(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Os=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Fs(n,(function(t){Fs(t,(function(t){e.push(t)}))})),e};function Ls(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 qs=function(e){try{return e()}catch(e){return}},$s=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Ts.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ts.critical(e)}}},As=function(e){var t={};return Rs(e,(function(e,n){(ms(e)&&e.length>0||Ss(e))&&(t[n]=e)})),t};function Ds(e,t){return n=e,r=function(e){return ms(e)&&!bs(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),ps(t)?(o=[],Fs(t,(function(t){o.push(e(t))}))):(o={},Rs(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var Ns=["herokuapp.com","vercel.app","netlify.app"];function Hs(e){var t=null==e?void 0:e.hostname;if(!ms(t))return!1;for(var n,r=t.split(".").slice(-2).join("."),i=Si(Ns);!(n=i()).done;){if(r===n.value)return!1}return!0}function Bs(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function js(e,t,n,r){var i=null!=r?r:{},o=i.capture,s=void 0!==o&&o,a=i.passive,u=void 0===a||a;null==e||e.addEventListener(t,n,{capture:s,passive:u})}var zs=Ps("[Surveys]");function Us(e){return!(!e.start_date||e.end_date)}function Vs(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Ws(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Gs="seenSurvey_",Zs="inProgressSurvey_";Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ss(e)&&isFinite(e)&&Math.floor(e)===e});var Qs="0123456789abcdef",Ys=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)||t<0||n<0||r<0||i<0||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/Math.pow(2,8),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;t<this.bytes.length;t++)e=e+Qs.charAt(this.bytes[t]>>>4)+Qs.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e},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;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0},e}(),Js=function(){function e(){this._timestamp=0,this._counter=0,this._random=new ta}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(gs(e)){this._timestamp=0;var t=this.generateOrAbort();if(gs(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e},t.generateOrAbort=function(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Ys.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}(),Xs=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};jo&&!gs(jo.crypto)&&crypto.getRandomValues&&(Xs=function(e){return crypto.getRandomValues(e)});var Ks,ea,ta=function(){function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._cursor>=this._buffer.length&&(Xs(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),na=function(){return ra().toString()},ra=function(){return(Ks||(Ks=new Js)).generate()},ia="Mobile",oa="iOS",sa="Android",aa="Tablet",ua=sa+" "+aa,la="iPad",ca="Apple",da=ca+" Watch",fa="Safari",pa="BlackBerry",_a="Samsung",ha=_a+"Browser",va=_a+" Internet",ga="Chrome",ma=ga+" OS",ya=ga+" "+oa,ba="Internet Explorer",wa=ba+" "+ia,Sa="Opera",ka=Sa+" Mini",xa="Edge",Ea="Microsoft "+xa,Ca="Firefox",Ta=Ca+" "+oa,Pa="Nintendo",Ia="PlayStation",Fa="Xbox",Ra=sa+" "+ia,Ma=ia+" "+fa,Oa="Windows",La=Oa+" Phone",qa="Nokia",$a="Ouya",Aa="Generic",Da=Aa+" "+ia.toLowerCase(),Na=Aa+" "+aa.toLowerCase(),Ha="Konqueror",Ba="(\\d+(\\.\\d+)?)",ja=new RegExp("Version/"+Ba),za=new RegExp(Fa,"i"),Ua=new RegExp(Ia+" \\w+","i"),Va=new RegExp(Pa+" \\w+","i"),Wa=new RegExp(pa+"|PlayBook|BB10","i"),Ga={"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"};var Za=function(e,t){return t&&ss(t,ca)||function(e){return ss(e,fa)&&!ss(e,ga)&&!ss(e,sa)}(e)},Qa=function(e,t){return t=t||"",ss(e," OPR/")&&ss(e,"Mini")?ka:ss(e," OPR/")?Sa:Wa.test(e)?pa:ss(e,"IE"+ia)||ss(e,"WPDesktop")?wa:ss(e,ha)?va:ss(e,xa)||ss(e,"Edg/")?Ea:ss(e,"FBIOS")?"Facebook "+ia:ss(e,"UCWEB")||ss(e,"UCBrowser")?"UC Browser":ss(e,"CriOS")?ya:ss(e,"CrMo")||ss(e,ga)?ga:ss(e,sa)&&ss(e,fa)?Ra:ss(e,"FxiOS")?Ta:ss(e.toLowerCase(),Ha.toLowerCase())?Ha:Za(e,t)?ss(e,ia)?Ma:fa:ss(e,Ca)?Ca:ss(e,"MSIE")||ss(e,"Trident/")?ba:ss(e,"Gecko")?Ca:""},Ya=((ea={})[wa]=[new RegExp("rv:"+Ba)],ea[Ea]=[new RegExp(xa+"?\\/"+Ba)],ea[ga]=[new RegExp("("+ga+"|CrMo)\\/"+Ba)],ea[ya]=[new RegExp("CriOS\\/"+Ba)],ea["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/"+Ba)],ea[fa]=[ja],ea[Ma]=[ja],ea[Sa]=[new RegExp("(Opera|OPR)\\/"+Ba)],ea[Ca]=[new RegExp(Ca+"\\/"+Ba)],ea[Ta]=[new RegExp("FxiOS\\/"+Ba)],ea[Ha]=[new RegExp("Konqueror[:/]?"+Ba,"i")],ea[pa]=[new RegExp(pa+" "+Ba),ja],ea[Ra]=[new RegExp("android\\s"+Ba,"i")],ea[va]=[new RegExp(ha+"\\/"+Ba)],ea[ba]=[new RegExp("(rv:|MSIE )"+Ba)],ea.Mozilla=[new RegExp("rv:"+Ba)],ea),Ja=function(e,t){var n=Qa(e,t),r=Ya[n];if(gs(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},Xa=[[new RegExp(Fa+"; "+Fa+" (.*?)[);]","i"),function(e){return[Fa,e&&e[1]||""]}],[new RegExp(Pa,"i"),[Pa,""]],[new RegExp(Ia,"i"),[Ia,""]],[Wa,[pa,""]],[new RegExp(Oa,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[La,""];if(new RegExp(ia).test(t)&&!/IEMobile\b/.test(t))return[Oa+" "+ia,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Ga[r]||"";return/arm/i.test(t)&&(i="RT"),[Oa,i]}return[Oa,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[oa,t.join(".")]}return[oa,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=gs(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+sa+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+sa+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[sa,t.join(".")]}return[sa,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ma,""]],[/Linux|debian/i,["Linux",""]]],Ka=function(e){return Va.test(e)?Pa:Ua.test(e)?Ia:za.test(e)?Fa:new RegExp($a,"i").test(e)?$a:new RegExp("("+La+"|WPDesktop)","i").test(e)?La:/iPad/.test(e)?la:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?da:Wa.test(e)?pa:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(qa,"i").test(e)?qa:/(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(ia).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)?sa:ua:sa:new RegExp("(pda|"+ia+")","i").test(e)?Da:new RegExp(aa,"i").test(e)&&!new RegExp(aa+" pc","i").test(e)?Na:""},eu=function(e){var t=Ka(e);return t===la||t===ua||"Kobo"===t||"Kindle Fire"===t||t===Na?aa:t===Pa||t===Fa||t===Ia||t===$a?"Console":t===da?"Wearable":t?ia:"Desktop"},tu=["localhost","127.0.0.1"],nu=function(e){var t=null==Zo?void 0:Zo.createElement("a");return gs(t)?null:(t.href=e,t)},ru=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return Rs(e,(function(e,t){gs(e)||gs(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)},iu=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!ps(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){Ts.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},ou=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),c=[],d=0;d<l.length;d++){var f=l[d].split("=");ps(f)&&(t.includes(f[0])?c.push(f[0]+"="+n):c.push(l[d]))}var p=u;return null!=a&&(p+="?"+c.join("&")),null!=o&&(p+="#"+o),p},su=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},au=Uint8Array,uu=Uint16Array,lu=Uint32Array,cu=new au([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]),du=new au([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]),fu=new au([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pu=function(e,t){for(var n=new uu(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new lu(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},_u=pu(cu,2),hu=_u[0],vu=_u[1];hu[28]=258,vu[258]=28;for(var gu=pu(du,0)[1],mu=new uu(32768),yu=0;yu<32768;++yu){var bu=(43690&yu)>>>1|(21845&yu)<<1;bu=(61680&(bu=(52428&bu)>>>2|(13107&bu)<<2))>>>4|(3855&bu)<<4,mu[yu]=((65280&bu)>>>8|(255&bu)<<8)>>>1}var wu=function(e,t,n){for(var r=e.length,i=0,o=new uu(t);i<r;++i)++o[e[i]-1];var s,a=new uu(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new uu(1<<t);var u=15-t;for(i=0;i<r;++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;d<=f;++d)s[mu[d]>>>u]=l}else for(s=new uu(r),i=0;i<r;++i)s[i]=mu[a[e[i]-1]++]>>>15-e[i];return s},Su=new au(288);for(yu=0;yu<144;++yu)Su[yu]=8;for(yu=144;yu<256;++yu)Su[yu]=9;for(yu=256;yu<280;++yu)Su[yu]=7;for(yu=280;yu<288;++yu)Su[yu]=8;var ku=new au(32);for(yu=0;yu<32;++yu)ku[yu]=5;var xu=wu(Su,9,0),Eu=wu(ku,5,0),Cu=function(e){return(e/8>>0)+(7&e&&1)},Tu=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof uu?uu:e instanceof lu?lu:au)(n-t);return r.set(e.subarray(t,n)),r},Pu=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Iu=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Fu=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new au(0),0];if(1==i){var s=new au(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[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new uu(f+1),_=Ru(n[c-1],p,0);if(_>t){r=0;var h=0,v=_-t,g=1<<v;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var m=o[r].s;if(!(p[m]>t))break;h+=g-(1<<_-p[m]),p[m]=t}for(h>>>=v;h>0;){var y=o[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=o[r].s;p[b]==t&&(--p[b],++h)}_=t}return[new au(p),_]},Ru=function(e,t,n){return-1==e.s?Math.max(Ru(e.l,t,n+1),Ru(e.r,t,n+1)):t[e.s]=n},Mu=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new uu(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++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]},Ou=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Lu=function(e,t,n){var r=n.length,i=Cu(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;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},qu=function(e,t,n,r,i,o,s,a,u,l,c){Pu(t,c++,n),++i[256];for(var d=Fu(i,15),f=d[0],p=d[1],_=Fu(o,15),h=_[0],v=_[1],g=Mu(f),m=g[0],y=g[1],b=Mu(h),w=b[0],S=b[1],k=new uu(19),x=0;x<m.length;++x)k[31&m[x]]++;for(x=0;x<w.length;++x)k[31&w[x]]++;for(var E=Fu(k,7),C=E[0],T=E[1],P=19;P>4&&!C[fu[P-1]];--P);var I,F,R,M,O=l+5<<3,L=Ou(i,Su)+Ou(o,ku)+s,q=Ou(i,f)+Ou(o,h)+s+14+3*P+Ou(k,C)+(2*k[16]+3*k[17]+7*k[18]);if(O<=L&&O<=q)return Lu(t,c,e.subarray(u,u+l));if(Pu(t,c,1+(q<L)),c+=2,q<L){I=wu(f,p,0),F=f,R=wu(h,v,0),M=h;var $=wu(C,T,0);Pu(t,c,y-257),Pu(t,c+5,S-1),Pu(t,c+10,P-4),c+=14;for(x=0;x<P;++x)Pu(t,c+3*x,C[fu[x]]);c+=3*P;for(var A=[m,w],D=0;D<2;++D){var N=A[D];for(x=0;x<N.length;++x){var H=31&N[x];Pu(t,c,$[H]),c+=C[H],H>15&&(Pu(t,c,N[x]>>>5&127),c+=N[x]>>>12)}}}else I=xu,F=Su,R=Eu,M=ku;for(x=0;x<a;++x)if(r[x]>255){H=r[x]>>>18&31;Iu(t,c,I[H+257]),c+=F[H+257],H>7&&(Pu(t,c,r[x]>>>23&31),c+=cu[H]);var B=31&r[x];Iu(t,c,R[B]),c+=M[B],B>3&&(Iu(t,c,r[x]>>>5&8191),c+=du[B])}else Iu(t,c,I[r[x]]),c+=F[r[x]];return Iu(t,c,I[256]),c+F[256]},$u=new lu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Au=function(){for(var e=new lu(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Du=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Au[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Nu=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new au(r+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?l=Lu(u,l,e.subarray(c,d)):(u[c]=o,l=Lu(u,l,e.subarray(c,s)))}else{for(var f=$u[t-1],p=f>>>13,_=8191&f,h=(1<<n)-1,v=new uu(32768),g=new uu(h+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&h},w=new lu(25e3),S=new uu(288),k=new uu(32),x=0,E=0,C=(c=0,0),T=0,P=0;c<s;++c){var I=b(c),F=32767&c,R=g[I];if(v[F]=R,g[I]=F,T<=c){var M=s-c;if((x>7e3||C>24576)&&M>423){l=qu(e,u,0,w,S,k,E,C,P,c-P,l),C=x=E=0,P=c;for(var O=0;O<286;++O)S[O]=0;for(O=0;O<30;++O)k[O]=0}var L=2,q=0,$=_,A=F-R&32767;if(M>2&&I==b(c-A))for(var D=Math.min(p,M)-1,N=Math.min(32767,c),H=Math.min(258,M);A<=N&&--$&&F!=R;){if(e[c+L]==e[c+L-A]){for(var B=0;B<H&&e[c+B]==e[c+B-A];++B);if(B>L){if(L=B,q=A,B>D)break;var j=Math.min(A,B-2),z=0;for(O=0;O<j;++O){var U=c-A+O+32768&32767,V=U-v[U]+32768&32767;V>z&&(z=V,R=U)}}}A+=(F=R)-(R=v[F])+32768&32767}if(q){w[C++]=268435456|vu[L]<<18|gu[q];var W=31&vu[L],G=31&gu[q];E+=cu[W]+du[G],++S[257+W],++k[G],T=c+L,++x}else w[C++]=e[c],++S[e[c]]}}l=qu(e,u,o,w,S,k,E,C,P,c-P,l)}return Tu(a,0,r+Cu(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Hu=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Bu=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Hu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},ju=function(e){return 10+(e.filename&&e.filename.length+1||0)};function zu(e,t){void 0===t&&(t={});var n=Du(),r=e.length;n.p(e);var i=Nu(e,t,ju(t),8),o=i.length;return Bu(i,t),Hu(i,o-8,n.d()),Hu(i,o-4,r),i}function Uu(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new au(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new au(i+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(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 Tu(r,0,i)}var Vu=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),bs(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Wu=!!Jo||!!Yo,Gu="text/plain",Zu=function(e,t){var n=e.split("?"),r=n[0],i=n[1],o=ki({},t);null==i||i.split("&").forEach((function(e){var t=e.split("=")[0];delete o[t]}));var s=ru(o);return r+"?"+(s=s?(i?i+"&":"")+s:i)},Qu=function(e,t){return JSON.stringify(e,(function(e,t){return"bigint"==typeof t?t.toString():t}),t)},Yu=function(e){var t=e.data,n=e.compression;if(t){if(n===is.GZipJS){var r=zu(Uu(Qu(t)),{mtime:0}),i=new Blob([r],{type:Gu});return{contentType:Gu,body:i,estimatedSize:i.size}}if(n===is.Base64){var o=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",c=[];if(!e)return e;e=Vu(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Qu(t)),s=function(e){return"data="+encodeURIComponent("string"==typeof e?e:Qu(e))}(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Qu(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Ju=[];Yo&&Ju.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=Yu(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,s=r.estimatedSize,a=new Headers;Rs(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var u=e.url,l=null;if(Xo){var c=new Xo;l={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}Yo(u,ki({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null==(n=l)?void 0:n.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){Ts.error(e)}null==e.callback||e.callback(r)}))})).catch((function(t){Ts.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((function(){return l?clearTimeout(l.timeout):null}))}}),Jo&&Ju.push({transport:"XHR",method:function(e){var t,n=new Jo;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Yu(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;Rs(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,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(o)}}),null!=Go&&Go.sendBeacon&&Ju.push({transport:"sendBeacon",method:function(e){var t=Zu(e.url,{beacon:"1"});try{var n,r=null!==(n=Yu(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,s="string"==typeof o?new Blob([o],{type:i}):o;Go.sendBeacon(t,s)}catch(e){}}});var Xu=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Ku(e,t,n){return Qu({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var el={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 Xu(t,e)}))}))},not_regex:function(e,t){return t.every((function(t){return e.every((function(e){return!Xu(t,e)}))}))},icontains:function(e,t){return t.map(tl).some((function(t){return e.map(tl).some((function(e){return t.includes(e)}))}))},not_icontains:function(e,t){return t.map(tl).every((function(t){return e.map(tl).every((function(e){return!t.includes(e)}))}))}},tl=function(e){return e.toLowerCase()},nl=Ps("[Stylesheet Loader]"),rl=jo,il=Zo;function ol(e){return"$survey_response_"+e}var sl="#020617",al={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:Ao.Right,widgetColor:"#e0a045",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",inputBackground:"white",boxPadding:"20px 24px",borderRadius:"10px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"};function ul(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ll(e){var t;void 0===e&&(e=al.backgroundColor),"#"===e[0]&&(t=ul(e)),e.startsWith("rgb")&&(t=e);var n=function(e){return{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()]}(e);if(n&&(t=ul(n)),!t)return sl;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?sl:"white"}return sl}function cl(e){var t=function(e,t,n){var r,i=e.createElement("style");return i.innerText=t,null!=n&&null!=(r=n.config)&&r.prepare_external_dependency_stylesheet&&(i=n.config.prepare_external_dependency_stylesheet(i)),i||(nl.error("prepare_external_dependency_stylesheet returned null"),null)}(il,':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:2147483647;--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 rgba(0,0,0,.15);--ph-survey-disabled-button-opacity:0.6;--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-survey-input-background:#fff;--ph-survey-input-focus-shadow:rgba(0,0,0,.15);--ph-survey-choice-border-hover:rgba(0,0,0,.4);--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-input-text-color:#020617;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;font-family:inherit;font-size:1rem;font-weight:500;padding:10px 12px;position:fixed;right:0;text-align:center;top:50%;transform:rotate(-90deg) translateY(-100%);transform-origin:right top;transition:padding-bottom .1s ease-in-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover{padding-bottom:16px}@keyframes ph-survey-fade-in-up{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes ph-survey-fade-out-down{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(10px)}}@keyframes ph-survey-question-slide-in{0%{opacity:.5;transform:translateX(15px)}to{opacity:1;transform:translateX(0)}}.survey-container{bottom:0;height:fit-content;margin:0;max-width:85%;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.survey-box,.thank-you-message-container{display:flex;flex-direction:column;gap:16px}.bottom-section{display:flex;flex-direction:column;gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message-container{animation:ph-survey-question-slide-in .25s ease-out forwards;display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form,.thank-you-message{animation:ph-survey-fade-in-up .3s ease-out forwards;background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family);font-weight:400;margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{background:var(--ph-survey-input-background);color:var(--ph-survey-input-text-color)}@media (max-width:768px){.survey-form input[type=text],.survey-form textarea{font-size:1rem}}.survey-form input[type=text],.survey-form textarea{font-family:inherit}.survey-form textarea{border:1.5px solid var(--ph-survey-border-color);border-radius:6px;box-sizing:border-box;outline:none;padding:10px;width:100%}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{display:flex;flex-direction:column;font-size:14px;gap:8px}.multiple-choice-options .choice-option{cursor:pointer;display:flex;font-size:13px;position:relative}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) label{border-color:var(--ph-survey-text-subtle-color)}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) .choice-check{opacity:.5}.multiple-choice-options input{cursor:pointer;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;z-index:1}:is(.multiple-choice-options input):checked+label{border:1.5px solid var(--ph-survey-text-subtle-color);font-weight:700}:is(:is(.multiple-choice-options input):checked+label)+.choice-check{opacity:1}:is(:is(.multiple-choice-options input):checked+label) input{font-weight:700}.multiple-choice-options label{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;box-sizing:border-box;color:var(--ph-survey-input-text-color);cursor:pointer;display:block;padding:10px 35px 10px 10px;position:relative;transition:border-color .15s ease,background-color .15s ease;width:100%}:is(.multiple-choice-options .choice-option-open) label{display:flex;flex-wrap:wrap;gap:4px;padding-right:10px}:is(.multiple-choice-options .choice-option-open) label span{width:100%}:is(.multiple-choice-options .choice-option-open) label input{border:0;flex-grow:1;opacity:1;outline:0;position:relative;z-index:2}:is(:is(.multiple-choice-options .choice-option-open) label input)::placeholder{color:var(--ph-survey-text-subtle-color)}.choice-check{background:transparent;color:var(--ph-survey-input-text-color);opacity:0;pointer-events:none;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:opacity .15s ease;z-index:2}.choice-check svg{fill:var(--ph-survey-rating-bg-color);display:block;height:16px;width:16px}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0;transition:transform .15s ease,opacity .15s ease}.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)}.rating-options-number{border:1.5px solid var(--ph-survey-border-color);border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number>.ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;text-align:center;transition:background-color .15s ease,color .15s ease}:is(.rating-options-number>.ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number>.ratings-number){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;font-size:16px;font-weight:600;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:1.5px solid transparent;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);box-sizing:border-box;color:var(--ph-survey-submit-button-text-color);cursor:pointer;display:inline-block;font-family:inherit;font-size:14px;font-weight:700;margin:0;outline:0;overflow:visible;padding:12px;position:relative;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.12);text-transform:none;touch-action:manipulation;transition:transform .15s ease,box-shadow .15s ease;user-select:none;white-space:nowrap;width:100%}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;filter:grayscale(50%);opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border:1.5px solid var(--ph-survey-border-color);border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%);transition:opacity .15s ease,transform .15s ease}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;color:var(--ph-survey-text-primary-color);display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-align:center;text-decoration:none;transition:opacity .15s ease}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{color:var(--ph-survey-text-primary-color);font-size:16px;font-weight:600;margin:10px 0 0}.thank-you-message-body{color:var(--ph-survey-text-primary-color);font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.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}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.bolded{font-weight:600}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var dl=function(e,t,n){var r=Rl(e),i=il.querySelector("."+r);if(i&&i.shadowRoot)return i.shadowRoot;var o=il.createElement("div");!function(e,t,n){var r=ki({},al,n),i=e.style,o=[Ao.Center,Ao.Left,Ao.Right].includes(r.position);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||t===Do.Widget&&(null==n?void 0:n.widgetType)!==$o.Tab?(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)||ll(r.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),i.setProperty("--ph-survey-rating-text-color",ll(r.ratingButtonColor)),i.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",ll(r.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",ll(r.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),i.setProperty("--ph-survey-input-background",r.inputBackground),i.setProperty("--ph-survey-input-text-color",ll(r.inputBackground)),i.setProperty("--ph-widget-color",r.widgetColor),i.setProperty("--ph-widget-text-color",ll(r.widgetColor)),i.setProperty("--ph-widget-z-index",r.zIndex),"white"===r.backgroundColor&&i.setProperty("--ph-survey-input-background","#f8f8f8")}(o,e.type,e.appearance),o.className=r;var s=o.attachShadow({mode:"open"}),a=cl(t);if(a){var u=s.querySelector("style");u&&s.removeChild(u),s.appendChild(a)}return il.body.appendChild(o),s},fl=function(e,t){if(!t)return null;var n=e[ol(t)];return ps(n)?[].concat(n):n},pl=function(e){var t,n=e.responses,r=e.survey,i=e.surveySubmissionId,o=e.posthog,s=e.isSurveyCompleted;o?(localStorage.setItem(yl(r),"true"),o.capture("survey sent",ki({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((function(e){return{id:e.id,question:e.question,response:fl(n,e.id)}})),$survey_submission_id:i,$survey_completed:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},n,{$set:(t={},t[bl(r,"responded")]=!0,t)})),s&&(rl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Fl(r))):zs.error("[survey sent] event not captured, PostHog instance not found.")},_l=function(e,t,n){var r;if(t){if(!n){var i=Pl(e);t.capture("survey dismissed",ki({$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,$survey_partially_completed:Object.values((null==i?void 0:i.responses)||{}).filter((function(e){return!ws(e)})).length>0,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()},null==i?void 0:i.responses,{$survey_submission_id:null==i?void 0:i.surveySubmissionId,$survey_questions:e.questions.map((function(e){return{id:e.id,question:e.question,response:fl((null==i?void 0:i.responses)||{},e.id)}})),$set:(r={},r[bl(e,"dismissed")]=!0,r)})),Fl(e),localStorage.setItem(yl(e),"true"),rl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else zs.error("[survey dismissed] event not captured, PostHog instance not found.")},hl=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}))},vl=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},gl=function(e){return e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?vl(e.questions,hl(e.questions)):e.questions},ml=function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!function(e){var t,n;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}(e))||e.schedule===Bo.Always||Il(e)},yl=function(e){var t=""+Gs+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Gs+e.id+"_"+e.current_iteration),t},bl=function(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},wl=function(e,t){var n={__c:t="__cC"+Li++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Gi(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},surveySubmissionId:""}),Sl=function(){return Po(wl)},kl=function(e){var t=e.component,n=e.children,r=e.renderAsHtml,i=e.style;return lo(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})};function xl(e){return null!=e?e:"icontains"}function El(e){var t,n,r;if(null==(t=e.conditions)||!t.url)return!0;var i=null==rl||null==(n=rl.location)?void 0:n.href;if(!i)return!1;var o=[e.conditions.url],s=xl(null==(r=e.conditions)?void 0:r.urlMatchType);return el[s](o,[i])}var Cl=function(e){var t=""+Zs+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Zs+e.id+"_"+e.current_iteration),t},Tl=function(e,t){try{localStorage.setItem(Cl(e),JSON.stringify(t))}catch(e){zs.error("Error setting in-progress survey state in localStorage",e)}},Pl=function(e){try{var t=localStorage.getItem(Cl(e));if(t)return JSON.parse(t)}catch(e){zs.error("Error getting in-progress survey state from localStorage",e)}return null},Il=function(e){var t=Pl(e);return!ws(null==t?void 0:t.surveySubmissionId)},Fl=function(e){try{localStorage.removeItem(Cl(e))}catch(e){zs.error("Error clearing in-progress survey state from localStorage",e)}};function Rl(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}var Ml=0;function Ol(e,t,n,r,i,o){var s,a,u={};for(a in 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,__d:void 0,__c:null,constructor:void 0,__v:--Ml,__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 Pi.vnode&&Pi.vnode(l),l}var Ll=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),ql=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),$l=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),Al=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),Dl=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),Nl=Ol("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ol("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:"black"})}),Hl=Ol("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ol("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ol("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ol("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ol("g",{mask:"url(#mask0_2415_6911)",children:[Ol("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"}),Ol("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"}),Ol("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"}),Ol("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"}),Ol("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"}),Ol("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"})]})]}),Ol("defs",{children:Ol("clipPath",{id:"clip0_2415_6911",children:Ol("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Bl=Ol("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ol("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"})});function jl(){return Ol("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Hl]})}function zl(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,o=e.link,s=e.onPreviewSubmit,a=e.skipSubmitButton,u=Po(wl).isPreviewMode;return Ol("div",{className:"bottom-section",children:[!a&&Ol("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){o&&(null==jo||jo.open(o)),u?null==s||s():i()},children:t}),!r.whiteLabel&&Ol(jl,{})]})}function Ul(e){var t=e.question,n=e.description,r=e.descriptionContentType,i=e.forceDisableHtml;return Ol("div",{className:"question-header",children:[Ol("div",{className:"survey-question",children:t}),n&&kl({component:Bi("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function Vl(e){return Ol("button",{className:"form-cancel",onClick:e.onClick,disabled:Po(wl).isPreviewMode,"aria-label":"Close survey",type:"button",children:Nl})}function Wl(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=Po(wl).isPopup;return Ol("div",{className:"thank-you-message",children:[a&&Ol(Vl,{onClick:function(){return s()}}),Ol("div",{className:"thank-you-message-container",children:[Ol("h3",{className:"thank-you-message-header",children:t}),n&&kl({component:Bi("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&Ol(zl,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})]})}function Gl(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=e.onPreviewSubmit,s=e.initialValue,a=xo((function(){return ms(s)?s:""})),u=a[0],l=a[1];return Ol(zi,{children:[Ol("div",{className:"question-container",children:[Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ol("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:function(e){l(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation()},value:u})]}),Ol(zl,{text:t.buttonText||"Submit",submitDisabled:!u&&!t.optional,appearance:r,onSubmit:function(){return i(u)},onPreviewSubmit:function(){return o(u)}})]})}function Zl(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=e.onPreviewSubmit;return Ol(zi,{children:[Ol("div",{className:"question-container",children:Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n})}),Ol(zl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:function(){return i("link clicked")},onPreviewSubmit:function(){return o("link clicked")}})]})}function Ql(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=e.initialValue,u=t.scale,l=10===t.scale?0:1,c=xo((function(){return Ss(a)?a:ps(a)&&a.length>0&&Ss(parseInt(a[0]))?parseInt(a[0]):ms(a)&&Ss(parseInt(a))?parseInt(a):null})),d=c[0],f=c[1],p=Sl().isPreviewMode,_=function(e){return p?s(e):o(e)};return Ol(zi,{children:[Ol("div",{className:"question-container",children:[Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ol("div",{className:"rating-section",children:[Ol("div",{className:"rating-options",children:["emoji"===t.display&&Ol("div",{className:"rating-options-emoji",children:(3===t.scale?Kl:ec).map((function(e,n){return Ol("button",{"aria-label":"Rate "+(n+1),className:"ratings-emoji question-"+r+"-rating-"+n+" "+(n+1===d?"rating-active":""),value:n+1,type:"button",onClick:function(){var e=n+1;f(e),t.skipSubmitButton&&_(e)},children:e},n)}))}),"number"===t.display&&Ol("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-l+1)+", minmax(0, 1fr))"},children:ic(t.scale).map((function(e,n){return Ol(Yl,{displayQuestionIndex:r,active:d===e,appearance:i,num:e,setActiveNumber:function(e){f(e),t.skipSubmitButton&&_(e)}},n)}))})]}),Ol("div",{className:"rating-text",children:[Ol("div",{children:t.lowerBoundLabel}),Ol("div",{children:t.upperBoundLabel})]})]})]}),Ol(zl,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:bs(d)&&!t.optional,appearance:i,onSubmit:function(){return o(d)},onPreviewSubmit:function(){return s(d)},skipSubmitButton:t.skipSubmitButton})]})}function Yl(e){var t=e.num,n=e.active,r=e.displayQuestionIndex,i=e.setActiveNumber;return Ol("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+r+"-rating-"+t+" "+(n?"rating-active":""),type:"button",onClick:function(){i(t)},children:t})}function Jl(e,t,n,r){if(r)return!1;if(bs(e))return!0;if(ps(e)){if(!t&&0===e.length)return!0;if(t&&!n&&0===e.length)return!0}return!1}function Xl(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=e.initialValue,u=Co(null),l=To((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=vl(t,hl(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),c=xo((function(){return ms(a)||ps(a)?a:t.type===No.SingleChoice?null:[]})),d=c[0],f=c[1],p=xo((function(){return ms(a)?!l.includes(a):!!ps(a)&&!l.some((function(e){return a.includes(e)}))})),_=p[0],h=p[1],v=xo((function(){return ms(a)&&!l.includes(a)?a:ps(a)&&a.find((function(e){return!l.includes(e)}))||""})),g=v[0],m=v[1],y=Sl().isPreviewMode,b=t.type===No.SingleChoice?"radio":"checkbox",w=t.skipSubmitButton&&t.type===No.SingleChoice&&!t.hasOpenChoice,S=function(e,n){return n?(h(!_),void(_||setTimeout((function(){var e;return null==(e=u.current)?void 0:e.focus()}),0))):t.type===No.SingleChoice?(f(e),h(!1),void(w&&(o(e),y&&s(e)))):void(t.type===No.MultipleChoice&&ps(d)&&(d.includes(e)?f(d.filter((function(t){return t!==e}))):f([].concat(d,[e]))))};return Ol(zi,{children:[Ol("div",{className:"question-container",children:[Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ol("div",{className:"multiple-choice-options limit-height",children:l.map((function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,o="choice-option"+(i?" choice-option-open":""),s=i?_:t.type===No.SingleChoice?d===e:ps(d)&&d.includes(e);return Ol("div",{className:o,children:[Ol("input",{type:b,id:"surveyQuestion"+r+"Choice"+n,name:"question"+r,checked:s,onClick:function(){return S(e,i)}}),Ol("label",{htmlFor:"surveyQuestion"+r+"Choice"+n,children:i?Ol(zi,{children:[Ol("span",{children:[e,":"]}),Ol("input",{type:"text",ref:u,id:"surveyQuestion"+r+"Choice"+n+"Open",name:"question"+r,value:g,onKeyDown:function(e){e.stopPropagation()},onInput:function(e){return function(e){e.stopPropagation(),m(e.currentTarget.value),t.type===No.SingleChoice&&f(e.currentTarget.value)}(e)},onClick:function(t){_||S(e,!0),t.stopPropagation()}})]}):e}),Ol("span",{className:"choice-check",children:Bl})]},n)}))})]}),Ol(zl,{text:t.buttonText||"Submit",submitDisabled:Jl(d,_,g,!!t.optional),appearance:i,onSubmit:function(){_&&t.type===No.MultipleChoice?ps(d)&&o([].concat(d,[g])):o(d)},onPreviewSubmit:function(){_&&t.type===No.MultipleChoice?ps(d)&&s([].concat(d,[g])):s(d)},skipSubmitButton:w})]})}var Kl=[$l,ql,Ll],ec=[Al,$l,ql,Ll,Dl],tc=[1,2,3,4,5],nc=[1,2,3,4,5,6,7],rc=[0,1,2,3,4,5,6,7,8,9,10];function ic(e){switch(e){case 5:default:return tc;case 7:return nc;case 10:return rc}}var oc=jo,sc=Zo,ac="ph:show_survey_widget";function uc(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?Ho.End:o;if(i.branching.type===Ho.End)return Ho.End;if(i.branching.type===Ho.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ho.ResponseBased){if(i.type===No.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===Ho.End?Ho.End:o}}else if(i.type===No.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(3===t){if(e<1||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(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 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===Ho.End?Ho.End:o}}return o}return zs.warn("Falling back to next question index due to unexpected branching type"),o}var lc=function(){function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._handlePopoverSurvey=function(e){var n,r,i=null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays;if(function(e,t){if(!t||!e)return!0;var n=new Date,r=Math.abs(n.getTime()-new Date(e).getTime());return Math.ceil(r/864e5)>t}(localStorage.getItem("lastSeenSurveyDate"),i)){var o=function(e){return!!localStorage.getItem(yl(e))&&!ml(e)}(e);if(!o){t._clearSurveyTimeout(e.id),t._addSurveyToFocus(e);var s=(null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0,a=dl(e,t._posthog);if(s<=0)return uo(Ol(pc,{posthog:t._posthog,survey:e,removeSurveyFromFocus:t._removeSurveyFromFocus}),a);var u=setTimeout((function(){if(!El(e))return t._removeSurveyFromFocus(e);uo(Ol(pc,{posthog:t._posthog,survey:ki({},e,{appearance:ki({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:t._removeSurveyFromFocus}),a)}),1e3*s);t._surveyTimeouts.set(e.id,u)}}},this._handleWidget=function(e){var n=dl(e,t._posthog);uo(Ol(hc,{posthog:t._posthog,survey:e}),n)},this._removeWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute("PHWidgetSurveyClickListener"),t._widgetSelectorListeners.delete(e),zs.info("Removed click listener for survey "+e))},this._manageWidgetSelectorListener=function(e){var n,r=null==(n=e.appearance)?void 0:n.widgetSelector;if(r){var i=sc.querySelector(r),o=t._widgetSelectorListeners.get(e.id);if(i){if(t._handleWidget(e),o){if(i===o.element)return;zs.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._removeWidgetSelectorListener(e.id)}if(!i.hasAttribute("PHWidgetSurveyClickListener")){var s=function(t){var n,r;if(t.stopPropagation(),(null==(n=e.appearance)?void 0:n.position)===Ao.NextToTrigger){var i=t.currentTarget.getBoundingClientRect(),o=oc.innerHeight,s=oc.innerWidth,a=parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||"300"),u=i.left+i.width/2-a/2;u+a>s-20&&(u=s-a-20),u<20&&(u=20);var l=o-i.bottom,c=i.top,d=l<250&&c>l,f={position:"fixed",top:d?"auto":i.bottom+12+"px",left:u+"px",right:"auto",bottom:d?o-i.top+12+"px":"auto",zIndex:al.zIndex};oc.dispatchEvent(new CustomEvent(ac,{detail:{surveyId:e.id,position:f}}))}else oc.dispatchEvent(new CustomEvent(ac,{detail:{surveyId:e.id,position:{}}}))};js(i,"click",s),i.setAttribute("PHWidgetSurveyClickListener","true"),t._widgetSelectorListeners.set(e.id,{element:i,listener:s}),zs.info("Attached click listener for feedback button survey "+e.id)}}else o&&t._removeWidgetSelectorListener(e.id)}},this.renderSurvey=function(e,n){uo(Ol(pc,{posthog:t._posthog,survey:e,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1}),n)},this.getActiveMatchingSurveys=function(e,n){var r;void 0===n&&(n=!1),null==(r=t._posthog)||r.surveys.getSurveys((function(n){var r=n.filter((function(e){return t.checkSurveyEligibility(e).eligible&&t._isSurveyConditionMatched(e)&&t._hasActionOrEventTriggeredSurvey(e)&&t._checkFlags(e)}));e(r)}),n)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((function(e){var n=e.filter((function(e){return e.type!==Do.API})),r=t._sortSurveysByAppearanceDelay(n),i=new Set;r.forEach((function(e){var n,r,o;e.type===Do.Widget&&((null==(n=e.appearance)?void 0:n.widgetType)===$o.Tab?t._handleWidget(e):(null==(r=e.appearance)?void 0:r.widgetType)===$o.Selector&&null!=(o=e.appearance)&&o.widgetSelector&&(i.add(e.id),t._manageWidgetSelectorListener(e)));bs(t._surveyInFocus)&&e.type===Do.Popover&&t._handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((function(e,n){i.has(n)||t._removeWidgetSelectorListener(n)}))}),e)},this._addSurveyToFocus=function(e){bs(t._surveyInFocus)||zs.error("Survey "+[].concat(t._surveyInFocus)+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&zs.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),t._clearSurveyTimeout(e.id),t._surveyInFocus=null,uo(null,dl(e,t._posthog));var n=sc.querySelector(Rl(e,!0));null==n||n.remove()},this._posthog=e,this._surveyInFocus=null}var t=e.prototype;return t._clearSurveyTimeout=function(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))},t._sortSurveysByAppearanceDelay=function(e){return e.sort((function(e,t){var n,r,i=Il(e),o=Il(t);if(i&&!o)return-1;if(!i&&o)return 1;var s=e.schedule===Bo.Always,a=t.schedule===Bo.Always;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._isSurveyFeatureFlagEnabled=function(e){return!e||!!this._posthog.featureFlags.isFeatureEnabled(e)},t._isSurveyConditionMatched=function(e){return!e.conditions||El(e)&&function(e){var t,n,r;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(n=e.conditions)?void 0:n.deviceTypes.length))return!0;if(!Ko)return!1;var i=eu(Ko);return el[xl(null==(r=e.conditions)?void 0:r.deviceTypesMatchType)](e.conditions.deviceTypes,[i])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==il||!il.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){return ml(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||Il(e)},t.checkSurveyEligibility=function(e){var t={eligible:!0,reason:void 0};return Us(e)?this._isSurveyFeatureFlagEnabled(e.linked_flag_key)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?(this._internalFlagCheckSatisfied(e)||(t.eligible=!1,t.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress"),t):(t.eligible=!1,t.reason="Survey targeting feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey linked feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey is not running. It was completed on "+e.end_date,t)},t._hasActionOrEventTriggeredSurvey=function(e){var t;if(!Vs(e)&&!Ws(e))return!0;var n=null==(t=this._posthog.surveys._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.key,r=e.value;return!t||!r||n._posthog.featureFlags.isFeatureEnabled(r)}))},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)}},e}();function cc(e){if(sc&&oc){var t=new lc(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function dc(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;Eo((function(){var e;if(!s&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===Do.Widget,o=El(t),s=(null==(e=t.appearance)?void 0:e.widgetType)===$o.Tab&&n;if(!o)return zs.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(zs.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};js(oc,"popstate",n),js(oc,"hashchange",n);var o=oc.history.pushState,a=oc.history.replaceState;return oc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),n()},oc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),n()},function(){oc.removeEventListener("popstate",n),oc.removeEventListener("hashchange",n),oc.history.pushState=o,oc.history.replaceState=a}}}),[s,t,r,i])}function fc(e,t,n){switch(void 0===t&&(t=Ao.Right),t){case Ao.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ao.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ao.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ao.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ao.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ao.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ao.Left:return{left:"30px"};case Ao.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Ao.Right:return{right:e===Do.Widget&&n===$o.Tab?"60px":"30px"}}}function pc(e){var t,n,r,i,o,s,a=e.survey,u=e.forceDisableHtml,l=e.posthog,c=e.style,d=void 0===c?{}:c,f=e.previewPageIndex,p=e.removeSurveyFromFocus,_=void 0===p?function(){}:p,h=e.isPopup,v=void 0===h||h,g=e.onPreviewSubmit,m=void 0===g?function(){}:g,y=e.onPopupSurveyDismissed,b=void 0===y?function(){}:y,w=e.onCloseConfirmationMessage,S=void 0===w?function(){}:w,k=Co(null),x=Number.isInteger(f),E=null!=(t=a.appearance)&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,C=function(e,t,n,r,i,o){var s=xo(r||0===n),a=s[0],u=s[1],l=xo(!1),c=l[0],d=l[1],f=function(){var t=function(){e.type===Do.Popover&&i(e),u(!1)};sc.startViewTransition?sc.startViewTransition((function(){var e;null==o||null==(e=o.current)||e.remove()})).finished.then((function(){t()})):t()},p=function(t){t.detail.surveyId===e.id&&f()};return Eo((function(){if(t){if(!r){var i=function(t){var n,r;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return f();d(!0),null!=(r=e.appearance)&&r.autoDisappear&&setTimeout((function(){f()}),5e3)}},o=function(){El(e)&&(u(!0),oc.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()),setTimeout((function(){var t,n=null==(t=sc.querySelector(Rl(e,!0)))||null==(t=t.shadowRoot)?void 0:t.querySelector("textarea");n&&n.focus()}),100))};if(js(oc,"PHSurveyClosed",p),js(oc,"PHSurveySent",i),n>0){var s=setTimeout(o,n);return function(){clearTimeout(s),oc.removeEventListener("PHSurveyClosed",p),oc.removeEventListener("PHSurveySent",i)}}return o(),function(){oc.removeEventListener("PHSurveyClosed",p),oc.removeEventListener("PHSurveySent",i)}}}else zs.error("usePopupVisibility hook called without a PostHog instance.")}),[]),dc({survey:e,removeSurveyFromFocus:i,setSurveyVisible:u,isPreviewMode:r}),{isPopupVisible:a,isSurveySent:c,setIsPopupVisible:u,hidePopupWithViewTransition:f}}(a,l,E,x,_,k),T=C.isPopupVisible,P=C.isSurveySent,I=C.hidePopupWithViewTransition,F=P||f===a.questions.length,R=To((function(){var e=Pl(a);return{isPreviewMode:x,previewPageIndex:f,onPopupSurveyDismissed:function(){_l(a,l,x),b()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||na(),onPreviewSubmit:m,posthog:l}}),[x,f,v,l,a,b,m]);return T?Ol(wl.Provider,{value:R,children:Ol("div",{className:"survey-container",style:ki({},fc(a.type,null==(n=a.appearance)?void 0:n.position,null==(r=a.appearance)?void 0:r.widgetType),d),ref:k,children:F?Ol(Wl,{header:(null==(i=a.appearance)?void 0:i.thankYouMessageHeader)||"Thank you!",description:(null==(o=a.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(s=a.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||al,onClose:function(){I(),S()}}):Ol(_c,{survey:a,forceDisableHtml:!!u,posthog:l})})}):null}function _c(e){var t=e.survey,n=e.forceDisableHtml,r=e.posthog,i=xo((function(){var e=Pl(t);return null!=e&&e.responses&&zs.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),o=i[0],s=i[1],a=Po(wl),u=a.previewPageIndex,l=a.onPopupSurveyDismissed,c=a.isPopup,d=a.onPreviewSubmit,f=a.surveySubmissionId,p=a.isPreviewMode,_=xo((function(){var e=Pl(t);return u||(null==e?void 0:e.lastQuestionIndex)||0})),h=_[0],v=_[1],g=To((function(){return gl(t)}),[t]);Eo((function(){p&&!gs(u)&&v(u)}),[u,p]);var m=g.at(h);return m?Ol("form",{className:"survey-form",name:"surveyForm",children:[c&&Ol(Vl,{onClick:function(){l()}}),Ol("div",{className:"survey-box",children:vc({question:m,forceDisableHtml:n,displayQuestionIndex:h,appearance:t.appearance||al,onSubmit:function(e){return function(e){var n,i=e.res,a=e.displayQuestionIndex,u=e.questionId;if(r)if(u){var l=ol(u),c=ki({},o,((n={})[l]=i,n));s(c);var d=uc(t,a,i),p=d===Ho.End;p||(v(d),Tl(t,{surveySubmissionId:f,responses:c,lastQuestionIndex:d})),(t.enable_partial_responses||p)&&pl({responses:c,survey:t,surveySubmissionId:f,isSurveyCompleted:p,posthog:r})}else zs.error("onNextButtonClick called without a questionId.");else zs.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:h,questionId:m.id})},onPreviewSubmit:d,initialValue:m.id?o[ol(m.id)]:void 0})})]}):null}function hc(e){var t,n,r,i,o,s=e.survey,a=e.forceDisableHtml,u=e.posthog,l=e.readOnly,c=xo(!0),d=c[0],f=c[1],p=xo(!1),_=p[0],h=p[1],v=xo({}),g=v[0],m=v[1];if(Eo((function(){var e;if(u){if(!l){"tab"===(null==(e=s.appearance)?void 0:e.widgetType)&&m({top:"50%",bottom:"auto"});var t=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===s.id&&(zs.info("Received show event for feedback button survey "+s.id),m(n.detail.position||{}),h(!0))};return js(oc,ac,t),function(){oc.removeEventListener(ac,t)}}}else zs.error("FeedbackWidget called without a PostHog instance.")}),[u,l,s.id,null==(t=s.appearance)?void 0:t.widgetType,null==(n=s.appearance)?void 0:n.widgetSelector,null==(r=s.appearance)?void 0:r.borderColor]),dc({survey:s,setSurveyVisible:f}),!d)return null;var y=function(){setTimeout((function(){h(!1)}),200)};return Ol(zi,{children:["tab"===(null==(i=s.appearance)?void 0:i.widgetType)&&Ol("button",{className:"ph-survey-widget-tab",onClick:function(){return h(!_)},disabled:l,children:(null==(o=s.appearance)?void 0:o.widgetLabel)||""}),_&&Ol(pc,{posthog:u,survey:s,forceDisableHtml:a,style:g,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var vc=function(e){var t,n,r=e.question,i=e.forceDisableHtml,o=e.displayQuestionIndex,s=e.appearance,a=e.onSubmit,u=e.onPreviewSubmit,l=e.initialValue,c=((t={})[No.Open]=Gl,t[No.Link]=Zl,t[No.Rating]=Ql,t[No.SingleChoice]=Xl,t[No.MultipleChoice]=Xl,t),d={question:r,forceDisableHtml:i,appearance:s,onPreviewSubmit:function(e){u(e)},onSubmit:function(e){a(e)},initialValue:l},f=((n={})[No.Open]={},n[No.Link]={},n[No.Rating]={displayQuestionIndex:o},n[No.SingleChoice]={displayQuestionIndex:o},n[No.MultipleChoice]={displayQuestionIndex:o},n),p=c[r.type],_=ki({},d,f[r.type]);return Bi(p,ki({},_,{key:r.id}))};function gc(e){return!gs(Event)&&mc(e,Event)}function mc(e,t){try{return e instanceof t}catch(e){return!1}}function yc(e){return bs(e)||!hs(e)&&!_s(e)}function bc(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return mc(e,Error)}}function wc(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function Sc(e){return wc(e,"DOMError")}es.__PosthogExtensions__=es.__PosthogExtensions__||{},es.__PosthogExtensions__.generateSurveys=cc,es.extendPostHogWithSurveys=cc;var kc=/\(error: (.*)\)/,xc=50,Ec="?";function Cc(e,t,n,r){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?Ec:t,in_app:!0};return gs(n)||(i.lineno=n),gs(r)||(i.colno=r),i}var Tc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ic=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mc=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e,t){void 0===t&&(t=0);for(var n=[],i=e.split("\n"),o=t;o<i.length;o++){var s=i[o];if(!(s.length>1024)){var a=kc.test(s)?s.replace(kc,"$1"):s;if(!a.match(/\S*Error: /)){for(var u,l=Si(r);!(u=l()).done;){var c=(0,u.value)(a);if(c){n.push(c);break}}if(n.length>=xc)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,xc).map((function(e){return ki({},e,{filename:e.filename||Oc(t).filename,function:e.function||Ec})}))}(n)}}.apply(void 0,[[30,function(e){var t=Tc.exec(e);if(t){var n=t[1],r=t[2],i=t[3];return Cc(n,Ec,+r,+i)}var o=Pc.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=Ic.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var a=Ac(o[1]||Ec,o[2]),u=a[0];return Cc(a[1],u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,function(e){var t=Fc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Rc.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||Ec,o=Ac(i,r);return i=o[0],Cc(r=o[1],i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Oc(e){return e[e.length-1]||{}}var Lc,qc,$c,Ac=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]:Ec,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};var Dc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Nc(e,t){void 0===t&&(t=0);var n=e.stacktrace||e.stack||"",r=function(e){if(e&&Hc.test(e.message))return 1;return 0}(e);try{var i=Mc,o=function(e,t){var n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var n=Object.keys(t);return $c&&n.length===qc||(qc=n.length,$c=n.reduce((function(n,r){Lc||(Lc={});var i=Lc[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,Lc[r]=[u,l];break}}return n}),{})),$c}(t);return e.forEach((function(e){e.filename&&(e.chunk_id=n[e.filename])})),e}(i(n,r),i);return o.slice(0,o.length-t)}catch(e){}return[]}var Hc=/Minified React error #\d+;/i;function Bc(e,t){var n,r,i=Nc(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return String(t.error.message);return String(t)}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}}function jc(e,t){var n=Bc(e,t);return e.cause&&bc(e.cause)&&e.cause!==e?[n].concat(jc(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})):[n]}function zc(e,t){return{$exception_list:jc(e,t),$exception_level:"error"}}function Uc(e,t){var n,r,i,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var u=Nc(t.syntheticException,1);u.length&&(a.stacktrace={frames:u,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Vc(e){return ms(e)&&!ys(e)&&os.indexOf(e)>=0}function Wc(e,t){var n,r,i=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:gc(e)?e.constructor.name:"Error",a="Non-Error 'exception' captured with keys: "+function(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(!(i.length>t))return r===n.length||i.length<=t?i:i.slice(0,t)+"..."}return""}(e),u={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var l=Nc(null==t?void 0:t.syntheticException,1);l.length&&(u.stacktrace={frames:l,type:"raw"})}return{$exception_list:[u],$exception_level:Vc(e.level)?e.level:"error"}}function Gc(e,t){var n=e.error,r=e.event,i={$exception_list:[]},o=n||r;if(Sc(o)||function(e){return wc(e,"DOMException")}(o)){var s=o;if(function(e){return"stack"in e}(o))i=zc(o,t);else{var a=s.name||(Sc(s)?"DOMError":"DOMException"),u=s.message?a+": "+s.message:a;i=Uc(u,ki({},t,{overrideExceptionType:Sc(s)?"DOMError":"DOMException",defaultExceptionMessage:u}))}return"code"in s&&(i.$exception_DOMException_code=""+s.code),i}if(function(e){return wc(e,"ErrorEvent")}(o)&&o.error)return zc(o.error,t);if(bc(o))return zc(o,t);if(function(e){return wc(e,"Object")}(o)||gc(o))return Wc(o,t);if(gs(n)&&ms(r)){var l="Error",c=r,d=r.match(Dc);return d&&(l=d[1],c=d[2]),Uc(c,ki({},t,{overrideExceptionType:l,defaultExceptionMessage:c}))}return Uc(o,t)}function Zc(e){var t=function(e){if(yc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(e[0]);return yc(t)?Uc("Non-Error promise rejection captured with value: "+String(t),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Gc({event:t},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(t)})}var Qc=Ps("[ExceptionAutocapture]"),Yc={wrapOnError:function(e){var t=jo;t||Qc.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;o<r;o++)i[o]=arguments[o];var s=Gc({event:i[0],error:i[4]});return e(s),null!==(t=null==n?void 0: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}},wrapUnhandledRejection:function(e){var t=jo;t||Qc.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=Zc(o);return e(a),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}},wrapConsoleError:function(e){var t=console;t||Qc.info("console not available, cannot wrap console.error");var n=t.error;return t.error=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=r.join(" "),s=r.find((function(e){return e instanceof Error})),a=s?Gc({event:o,error:s}):Gc({event:o},{syntheticException:new Error("PostHog syntheticException")});return e(a),null==n?void 0:n.apply(void 0,r)},t.error.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=n}}};function Jc(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return _s(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}es.__PosthogExtensions__=es.__PosthogExtensions__||{},es.__PosthogExtensions__.errorWrappingFunctions=Yc,es.posthogErrorWrappingFunctions=Yc;var Xc=function(e,t){if(e){var n=e.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",i)}};es.__PosthogExtensions__=es.__PosthogExtensions__||{};var Kc={_patchFetch:function(e){return Jc(jo,"fetch",(function(t){return function(){var n=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){bi(o,r,i,s,a,"next",e)}function a(e){bi(o,r,i,s,a,"throw",e)}s(void 0)}))}}(Ei().mark((function n(r,i){var o;return Ei().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=new Request(r,i),Xc(e,o),n.abrupt("return",t(o));case 3:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}()}))},_patchXHR:function(e){return Jc(jo.XMLHttpRequest.prototype,"open",(function(t){return function(n,r,i,o,s){void 0===i&&(i=!0);var a=new Request(r);return Xc(e,a),t.call(this,n,a.url,i,o,s)}}))}};es.__PosthogExtensions__.tracingHeadersPatchFns=Kc,es.postHogTracingHeadersPatchFns=Kc;var ed="$people_distinct_id",td="__alias",nd="__timers",rd="$autocapture_disabled_server_side",id="$heatmaps_enabled_server_side",od="$exception_capture_enabled_server_side",sd="$error_tracking_suppression_rules",ad="$web_vitals_enabled_server_side",ud="$dead_clicks_enabled_server_side",ld="$web_vitals_allowed_metrics",cd="$session_recording_enabled_server_side",dd="$console_log_recording_enabled_server_side",fd="$session_recording_network_payload_capture",pd="$session_recording_masking",_d="$session_recording_canvas_recording",hd="$replay_sample_rate",vd="$replay_minimum_duration",gd="$replay_script_config",md="$sesid",yd="$session_is_sampled",bd="$session_recording_url_trigger_activated_session",wd="$session_recording_event_trigger_activated_session",Sd="$enabled_feature_flags",kd="$early_access_features",xd="$feature_flag_details",Ed="$stored_person_properties",Cd="$stored_group_properties",Td="$surveys",Pd="$surveys_activated",Id="$flag_call_reported",Fd="$user_state",Rd="$client_session_props",Md="$capture_rate_limit",Od="$initial_campaign_params",Ld="$initial_referrer_info",qd="$initial_person_info",$d="$epp",Ad="__POSTHOG_TOOLBAR__",Dd="$posthog_cookieless",Nd=[ed,td,"__cmpns",nd,cd,id,md,Sd,sd,Fd,kd,xd,Cd,Ed,Td,Id,Rd,Md,Od,Ld,$d,qd];function Hd(e){return e instanceof Element&&(e.id===Ad||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Bd(e){return!!e&&1===e.nodeType}function jd(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function zd(e){return!!e&&3===e.nodeType}function Ud(e){return!!e&&11===e.nodeType}function Vd(e){return e?as(e).split(/\s+/):[]}function Wd(e){var t=null==jo?void 0:jo.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Gd(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 Vd(t)}function Zd(e){return ws(e)?null:as(e).split(/(\s+)/).filter((function(e){return lf(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Qd(e){var t="";return ef(e)&&!tf(e)&&e.childNodes&&e.childNodes.length&&Rs(e.childNodes,(function(e){var n;zd(e)&&e.textContent&&(t+=null!==(n=Zd(e.textContent))&&void 0!==n?n:"")})),as(t)}function Yd(e){return gs(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Jd=["a","button","form","input","select","textarea","label"];function Xd(e){var t=e.parentNode;return!(!t||!Bd(t))&&t}function Kd(e,t,n,r,i){var o,s,a;if(void 0===n&&(n=void 0),!jo||!e||jd(e,"html")||!Bd(e))return!1;if(null!=(o=n)&&o.url_allowlist&&!Wd(n.url_allowlist))return!1;if(null!=(s=n)&&s.url_ignorelist&&Wd(n.url_ignorelist))return!1;if(null!=(a=n)&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var l=!1,c=[e],d=!0,f=e;f.parentNode&&!jd(f,"body");)if(Ud(f.parentNode))c.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=Xd(f)))break;if(r||Jd.indexOf(d.tagName.toLowerCase())>-1)l=!0;else{var p=jo.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(l=!0)}c.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(gs(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=Si(e);!(i=s()).done;)if(r=o())return r.v;return!1}(c,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(gs(n))return!0;for(var r,i,o=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}},s=Si(e);!(i=s()).done;)if(r=o())return r.v;return!1}(c,n))return!1;var _=jo.getComputedStyle(e);if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Jd.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function ef(e){for(var t=e;t.parentNode&&!jd(t,"body");t=t.parentNode){var n=Gd(t);if(ss(n,"ph-sensitive")||ss(n,"ph-no-capture"))return!1}if(ss(Gd(e),"ph-include"))return!0;var r=e.type||"";if(ms(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(ms(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function tf(e){return!!(jd(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||jd(e,"select")||jd(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var nf="(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})",rf=new RegExp("^(?:"+nf+")$"),of=new RegExp(nf),sf="\\d{3}-?\\d{2}-?\\d{4}",af=new RegExp("^("+sf+")$"),uf=new RegExp("("+sf+")");function lf(e,t){if(void 0===t&&(t=!0),ws(e))return!1;if(ms(e)){if(e=as(e),(t?rf:of).test((e||"").replace(/[- ]/g,"")))return!1;if((t?af:uf).test(e))return!1}return!0}function cf(e){var t=Qd(e);return lf(t=(t+" "+df(e)).trim())?t:""}function df(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Rs(e.childNodes,(function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=Qd(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+df(e)).trim())}catch(e){Ts.error("[AutoCapture]",e)}})),t}function ff(e){return 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=Si(e.attr_class);!(i=o()).done;){r+="."+i.value.replace(/"/g,"")}}var s=ki({},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 Ls(s).sort((function(e,t){var n=e[0],r=t[0];return n.localeCompare(r)})).forEach((function(e){var t=e[0],n=e[1];return a[pf(t.toString())]=pf(n.toString())})),r+=":",r+=Ls(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:_f(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Ls(e).filter((function(e){return 0===e[0].indexOf("attr__")})).forEach((function(e){var t=e[0],n=e[1];return r.attributes[t]=n})),r}))}(e))}function pf(e){return e.replace(/"|\\"/g,'\\"')}function _f(e){var t=e.attr__class;return t?ps(t)?t:Vd(t):void 0}var hf=function(){function e(){this.clicks=[]}return e.prototype.isRageClick=function(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1},e}(),vf=Ps("[AutoCapture]");function gf(e,t){return t.length>e?t.slice(0,e)+"...":t}function mf(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bd(t));return t}function yf(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};Jd.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=gf(1024,cf(e)):o.$el_text=gf(1024,Qd(e)));var s=Gd(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Rs(e.attributes,(function(n){var i;if((!tf(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!t&&lf(n.value)&&(i=n.name,!ms(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=n.value;"class"===n.name&&(s=Vd(s).join(" ")),o["attr__"+n.name]=gf(1024,s)}}));for(var a=1,u=1,l=e;l=mf(l);)a++,l.tagName===e.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function bf(e,t){for(var n,r,i=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=[e],c=e;c.parentNode&&!jd(c,"body");)Ud(c.parentNode)?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,f=[],p={},_=!1,h=!1;if(Rs(l,(function(e){var t=ef(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&lf(_)&&_),ss(Gd(e),"ph-no-capture")&&(h=!0),f.push(yf(e,o,s,a));var n=function(e){if(!ef(e))return{};var t={};return Rs(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&&lf(r)&&(t[n]=r)}})),t}(e);Ms(p,n)})),h)return{props:{},explicitNoCapture:h};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?f[0].$el_text=cf(e):f[0].$el_text=Qd(e)),_){var v,g;f[0].attr__href=_;var m=null==(v=nu(_))?void 0:v.host,y=null==jo||null==(g=jo.location)?void 0:g.host;m&&y&&m!==y&&(d=_)}return{props:Ms({$event_type:i.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:ff(f)},null!=(n=f[0])&&n.$el_text?{$el_text:null==(r=f[0])?void 0:r.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}var wf=function(){function e(e){this._initialized=!1,this._isDisabledServerSide=null,this.rageclicks=new hf,this._elementsChainAsString=!1,this.instance=e,this._elementSelectors=null}var t=e.prototype;return t._addDomEventHandlers=function(){var e=this;if(this.isBrowserSupported()){if(jo&&Zo){var t=function(t){t=t||(null==jo?void 0:jo.event);try{e._captureEvent(t)}catch(e){vf.error("Failed to capture event",e)}};if(js(Zo,"submit",t,{capture:!0}),js(Zo,"change",t,{capture:!0}),js(Zo,"click",t,{capture:!0}),this._config.capture_copied_text){var n=function(t){t=t||(null==jo?void 0:jo.event),e._captureEvent(t,ns)};js(Zo,"copy",n,{capture:!0}),js(Zo,"cut",n,{capture:!0})}}}else vf.info("Disabling Automatic Event Collection because this browser is not supported")},t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)},t.onRemoteConfig=function(e){var t;(e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence)&&this.instance.persistence.register(((t={})[rd]=!!e.autocapture_opt_out,t));this._isDisabledServerSide=!!e.autocapture_opt_out,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==Zo?void 0:Zo.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,r=Yd(e);if(zd(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===ns;if(r&&Kd(r,e,this._config,i,i?["copy","cut"]:void 0)){var o=bf(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString}),s=o.props;if(o.explicitNoCapture)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),t===ns){var u,l=Zd(null==jo||null==(u=jo.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=c}return this.instance.capture(t,s),!0}}},t.isBrowserSupported=function(){return _s(null==Zo?void 0:Zo.querySelectorAll)},wi(e,[{key:"_config",get:function(){var e,t,n=hs(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null==(e=n.url_allowlist)?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null==(t=n.url_ignorelist)?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:"isEnabled",get:function(){var e,t,n=null==(e=this.instance.persistence)?void 0:e.props[rd],r=this._isDisabledServerSide;if(bs(r)&&!ks(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}}])}(),Sf="";var kf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xf(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Zo),Sf)return Sf;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_"+na();!Sf&&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",Sf=o)}return Sf}(e);if(!n){var r=function(e){var t=e.match(kf);return t?t[0]:""}(e);r!==n&&Ts.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ef={_is_supported:function(){return!!Zo},_error:function(e){Ts.error("cookieStore error: "+e)},_get:function(e){if(Zo){try{for(var t=e+"=",n=Zo.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;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}},_parse:function(e){var t;try{t=JSON.parse(Ef._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(Zo)try{var o="",s="",a=xf(Zo.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),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&&Ts.warn("cookieStore warning: large cookie, len="+l.length),Zo.cookie=l,l}catch(e){return}},_remove:function(e,t){try{Ef._set(e,"",-1,t)}catch(e){return}}},Cf=null,Tf={_is_supported:function(){if(!bs(Cf))return Cf;var e=!0;if(gs(jo))e=!1;else try{var t="__mplssupport__";Tf._set(t,"xyz"),'"xyz"'!==Tf._get(t)&&(e=!1),Tf._remove(t)}catch(t){e=!1}return e||Ts.error("localStorage unsupported; falling back to cookie store"),Cf=e,e},_error:function(e){Ts.error("localStorage error: "+e)},_get:function(e){try{return null==jo?void 0:jo.localStorage.getItem(e)}catch(e){Tf._error(e)}return null},_parse:function(e){try{return JSON.parse(Tf._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==jo||jo.localStorage.setItem(e,JSON.stringify(t))}catch(e){Tf._error(e)}},_remove:function(e){try{null==jo||jo.localStorage.removeItem(e)}catch(e){Tf._error(e)}}},Pf=["distinct_id",md,yd,$d,qd],If=ki({},Tf,{_parse:function(e){try{var t={};try{t=Ef._parse(e)||{}}catch(e){}var n=Ms(t,JSON.parse(Tf._get(e)||"{}"));return Tf._set(e,n),n}catch(e){}return null},_set:function(e,t,n,r,i,o){try{Tf._set(e,t,void 0,void 0,o);var s={};Pf.forEach((function(e){t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Ef._set(e,s,n,r,i,o)}catch(e){Tf._error(e)}},_remove:function(e,t){try{null==jo||jo.localStorage.removeItem(e),Ef._remove(e,t)}catch(e){Tf._error(e)}}}),Ff={},Rf={_is_supported:function(){return!0},_error:function(e){Ts.error("memoryStorage error: "+e)},_get:function(e){return Ff[e]||null},_parse:function(e){return Ff[e]||null},_set:function(e,t){Ff[e]=t},_remove:function(e){delete Ff[e]}},Mf=null,Of={_is_supported:function(){if(!bs(Mf))return Mf;if(Mf=!0,gs(jo))Mf=!1;else try{var e="__support__";Of._set(e,"xyz"),'"xyz"'!==Of._get(e)&&(Mf=!1),Of._remove(e)}catch(e){Mf=!1}return Mf},_error:function(e){Ts.error("sessionStorage error: ",e)},_get:function(e){try{return null==jo?void 0:jo.sessionStorage.getItem(e)}catch(e){Of._error(e)}return null},_parse:function(e){try{return JSON.parse(Of._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==jo||jo.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Of._error(e)}},_remove:function(e){try{null==jo||jo.sessionStorage.removeItem(e)}catch(e){Of._error(e)}}},Lf=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({}),qf=function(){function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return this.consent===Lf.DENIED||this.consent===Lf.PENDING&&this._config.opt_out_capturing_by_default},t.isOptedIn=function(){return!this.isOptedOut()},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&&!!Bs([null==Go?void 0:Go.doNotTrack,null==Go?void 0:Go.msDoNotTrack,es.doNotTrack],(function(e){return ss([!0,1,"1","yes"],e)}))},wi(e,[{key:"_config",get:function(){return this._instance.config}},{key:"consent",get:function(){return this._getDnt()?Lf.DENIED:this._storedConsent}},{key:"_storageKey",get:function(){var e=this._instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"_storedConsent",get:function(){var e=this._storage._get(this._storageKey);return"1"===e?Lf.GRANTED:"0"===e?Lf.DENIED:Lf.PENDING}},{key:"_storage",get:function(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?Tf:Ef;var t="localStorage"===e?Ef:Tf;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut("1"===t._get(this._storageKey)),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}(),$f=Ps("[Dead Clicks]"),Af=function(){return!0},Df=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(ud)),r=e.instance.config.capture_dead_clicks;return ks(r)?r:n},Nf=function(){function e(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}var t=e.prototype;return t.onRemoteConfig=function(e){var t;this.instance.persistence&&this.instance.persistence.register(((t={})[ud]=null==e?void 0:e.captureDeadClicks,t));this.startIfEnabled()},t.startIfEnabled=function(){var e=this;this.isEnabled(this)&&this._loadScript((function(){e._start()}))},t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(function(t){t?$f.error("failed to load script",t):e()}))},t._start=function(){var e;if(Zo){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=es.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=hs(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=es.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Zo),$f.info("starting...")}}else $f.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,$f.info("stopping..."))},wi(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Hf=Ps("[ExceptionAutocapture]"),Bf=function(){function e(e){var t,n=this;this._startCapturing=function(){var e;if(jo&&n.isEnabled&&null!=(e=es.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=es.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=es.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=es.__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){Hf.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[od]),this._config=this._requiredConfig(),this.startIfEnabled()}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 hs(e)?t=ki({},t,e):(gs(e)?this._remoteEnabled:e)&&(t=ki({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabled=function(){this.isEnabled&&(Hf.info("enabled"),this._loadScript(this._startCapturing))},t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",(function(t){if(t)return Hf.error("failed to load script",t);e()}))},t._stopCapturing=function(){var e,t,n;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(n=this._unwrapConsoleError)||n.call(this),this._unwrapConsoleError=void 0},t.onRemoteConfig=function(e){var t,n=e.autocaptureExceptions;(this._remoteEnabled=!!n||!1,this._config=this._requiredConfig(),this._instance.persistence)&&this._instance.persistence.register(((t={})[od]=this._remoteEnabled,t));this.startIfEnabled()},t.captureException=function(e){var t=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=t+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id(),this._instance.exceptions.sendExceptionEvent(e)},wi(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),jf=function(){function e(e){var t;this._instance=e,this._lastPathname=(null==jo||null==(t=jo.location)?void 0:t.pathname)||""}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&(Ts.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())},t.stop=function(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,Ts.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){var e,t;if(jo&&jo.history){var n=this;null!=(e=jo.history.pushState)&&e.__posthog_wrapped__||Jc(jo.history,"pushState",(function(e){return function(t,r,i){e.call(this,t,r,i),n._capturePageview("pushState")}})),null!=(t=jo.history.replaceState)&&t.__posthog_wrapped__||Jc(jo.history,"replaceState",(function(e){return function(t,r,i){e.call(this,t,r,i),n._capturePageview("replaceState")}})),this._setupPopstateListener()}},t._capturePageview=function(e){try{var t,n=null==jo||null==(t=jo.location)?void 0:t.pathname;if(!n)return;n!==this._lastPathname&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._lastPathname=n}catch(t){Ts.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};js(jo,"popstate",t),this._popstateListener=function(){jo&&jo.removeEventListener("popstate",t)}}},wi(e,[{key:"isEnabled",get:function(){return"history_change"===this._instance.config.capture_pageview}}])}();function zf(e){var t,n;return(null==(t=JSON.stringify(e,(n=[],function(e,t){if(hs(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))?void 0:t.length)||0}function Uf(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[Uf({size:zf(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),Uf({size:zf(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var Vf=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Vf||{}),Wf=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(Wf||{}),Gf="[SessionRecording]",Zf="redacted",Qf={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Yf=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Jf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Xf=["/s/","/e/","/i/"];function Kf(e,t,n,r){if(ws(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return ms(i)&&(i=parseInt(i)),i>n?Gf+" "+r+" body too large to record ("+i+" bytes)":e}function ep(e,t){if(ws(e))return e;var n=e;return lf(n,!1)||(n=Gf+" "+t+" body "+Zf),Rs(Jf,(function(e){var r,i;null!=(r=n)&&r.length&&-1!==(null==(i=n)?void 0:i.indexOf(e))&&(n=Gf+" "+t+" body "+Zf+" as might contain: "+e)})),n}var tp=function(e,t){var n,r,i,o={payloadSizeLimitBytes:Qf.payloadSizeLimitBytes,performanceEntryTypeToObserve:[].concat(Qf.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(t.payloadHostDenyList||[],Qf.payloadHostDenyList)},s=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,u=!1!==e.capture_performance&&t.recordPerformance,l=(n=o,i=Math.min(1e6,null!==(r=n.payloadSizeLimitBytes)&&void 0!==r?r:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=Kf(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Kf(e.responseBody,e.responseHeaders,i,"Response")),e}),c=function(t){return l(function(e,t){var n,r=nu(e.name),i=0===t.indexOf("http")?null==(n=nu(t))?void 0:n.pathname:t;"/"===i&&(i="");var o=null==r?void 0:r.pathname.replace(i||"","");if(!(r&&o&&Xf.some((function(e){return 0===o.indexOf(e)}))))return e}((r=(n=t).requestHeaders,ws(r)||Rs(Object.keys(null!=r?r:{}),(function(e){Yf.includes(e.toLowerCase())&&(r[e]=Zf)})),n),e.api_host));var n,r},d=_s(e.session_recording.maskNetworkRequestFn);return d&&_s(e.session_recording.maskCapturedNetworkRequestFn)&&Ts.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return ki({},t,{name:null==n?void 0:n.url})}),o.maskRequestFn=_s(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r=c(t);return r&&null!==(n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==n?n:void 0}:function(e){return function(e){if(!gs(e))return e.requestBody=ep(e.requestBody,"Request"),e.responseBody=ep(e.responseBody,"Response"),e}(c(e))},ki({},Qf,o,{recordHeaders:s,recordBody:a,recordPerformance:u,recordInitialRequests:u})};function np(e,t,n,r,i){return t>n&&(Ts.warn("min cannot be greater than max."),t=n),Ss(e)?e>n?(r&&Ts.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&Ts.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&Ts.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),np(i||n,t,n,r))}var rp=function(e,t){var n,r,i=this;void 0===t&&(t={}),this._bucketSize=100,this._refillRate=10,this._mutationBuckets={},this._loggedTracker={},this._refillBuckets=function(){Object.keys(i._mutationBuckets).forEach((function(e){i._mutationBuckets[e]=i._mutationBuckets[e]+i._refillRate,i._mutationBuckets[e]>=i._bucketSize&&delete i._mutationBuckets[e]}))},this._getNodeOrRelevantParent=function(e){var t=i._rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i._rrweb.mirror.getId(n),n]}return[e,t]},this._numberOfChanges=function(e){var t,n,r,i,o,s,a,u;return(null!==(t=null==(n=e.removes)?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null==(i=e.attributes)?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null==(s=e.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=e.adds)?void 0:u.length)&&void 0!==a?a:0)},this.throttleMutations=function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i._numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n=i._getNodeOrRelevantParent(e.id),r=n[0],o=n[1];return 0!==i._mutationBuckets[r]&&(i._mutationBuckets[r]=null!==(t=i._mutationBuckets[r])&&void 0!==t?t:i._bucketSize,i._mutationBuckets[r]=Math.max(i._mutationBuckets[r]-1,0),0===i._mutationBuckets[r]&&(i._loggedTracker[r]||(i._loggedTracker[r]=!0,null==i._options.onBlockedNode||i._options.onBlockedNode(r,o))),e)})));var r=i._numberOfChanges(t);return 0!==r||n===r?e:void 0},this._rrweb=e,this._options=t,this._refillRate=np(null!==(n=this._options.refillRate)&&void 0!==n?n:this._refillRate,0,100,"mutation throttling refill rate"),this._bucketSize=np(null!==(r=this._options.bucketSize)&&void 0!==r?r:this._bucketSize,0,100,"mutation throttling bucket size"),setInterval((function(){i._refillBuckets()}),1e3)};function ip(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<np(100*t,0,100)}var op="disabled",sp="sampled",ap="active",up="buffering",lp="paused",cp="trigger",dp=cp+"_activated",fp=cp+"_pending",pp=cp+"_"+op;function _p(e,t){return t.some((function(t){return"regex"===t.matching&&new RegExp(t.url).test(e)}))}var hp=function(){function e(e){this._matchers=e}var t=e.prototype;return t.triggerStatus=function(e){var t=this._matchers.map((function(t){return t.triggerStatus(e)}));return t.includes(dp)?dp:t.includes(fp)?fp:pp},t.stop=function(){this._matchers.forEach((function(e){return e.stop()}))},e}(),vp=function(){function e(e){this._matchers=e}var t=e.prototype;return t.triggerStatus=function(e){for(var t,n=new Set,r=Si(this._matchers);!(t=r()).done;){var i=t.value;n.add(i.triggerStatus(e))}switch(n.delete(pp),n.size){case 0:return pp;case 1:return Array.from(n)[0];default:return fp}},t.stop=function(){this._matchers.forEach((function(e){return e.stop()}))},e}(),gp=function(){function e(){}var t=e.prototype;return t.triggerStatus=function(){return fp},t.stop=function(){},e}(),mp=function(){function e(e){this._urlTriggers=[],this._urlBlocklist=[],this.urlBlocked=!1,this._instance=e}var t=e.prototype;return t.onRemoteConfig=function(e){var t,n;this._urlTriggers=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this._urlBlocklist=(null==(n=e.sessionRecording)?void 0:n.urlBlocklist)||[]},t._urlTriggerStatus=function(e){var t;return 0===this._urlTriggers.length?pp:(null==(t=this._instance)?void 0:t.get_property(bd))===e?dp:fp},t.triggerStatus=function(e){var t=this._urlTriggerStatus(e),n=t===dp?dp:t===fp?fp:pp;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:n}),n},t.checkUrlTriggerConditions=function(e,t,n){if(void 0!==jo&&jo.location.href){var r=jo.location.href,i=this.urlBlocked,o=_p(r,this._urlBlocklist);i&&o||(o&&!i?e():!o&&i&&t(),_p(r,this._urlTriggers)&&n("url"))}},t.stop=function(){},e}(),yp=function(){function e(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this._flaglistenerCleanup=function(){},this._instance=e}var t=e.prototype;return t.triggerStatus=function(){var e=fp;return ws(this.linkedFlag)&&(e=pp),this.linkedFlagSeen&&(e=dp),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e},t.onRemoteConfig=function(e,t){var n,r=this;if(this.linkedFlag=(null==(n=e.sessionRecording)?void 0:n.linkedFlag)||null,!ws(this.linkedFlag)&&!this.linkedFlagSeen){var i=ms(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,o=ms(this.linkedFlag)?null:this.linkedFlag.variant;this._flaglistenerCleanup=this._instance.onFeatureFlags((function(e,n){var s=!1;if(hs(n)&&i in n){var a=n[i];s=ks(a)?!0===a:o?a===o:!!a}r.linkedFlagSeen=s,s&&t(i,o)}))}},t.stop=function(){this._flaglistenerCleanup()},e}(),bp=function(){function e(e){this._eventTriggers=[],this._instance=e}var t=e.prototype;return t.onRemoteConfig=function(e){var t;this._eventTriggers=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]},t._eventTriggerStatus=function(e){var t;return 0===this._eventTriggers.length?pp:(null==(t=this._instance)?void 0:t.get_property(wd))===e?dp:fp},t.triggerStatus=function(e){var t=this._eventTriggerStatus(e),n=t===dp?dp:t===fp?fp:pp;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:n}),n},t.stop=function(){},e}();function wp(e){return e.isRecordingEnabled?up:op}function Sp(e){if(!e.receivedDecide)return up;if(!e.isRecordingEnabled)return op;if(e.urlTriggerMatching.urlBlocked)return lp;var t=!0===e.isSampled,n=new hp([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?sp:n===dp?ap:n===fp?up:!1===e.isSampled?op:ap}function kp(e){if(!e.receivedDecide)return up;if(!e.isRecordingEnabled)return op;if(e.urlTriggerMatching.urlBlocked)return lp;var t=new vp([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),n=t!==pp,r=ks(e.isSampled);return n&&t===fp?up:n&&t===pp||r&&!e.isSampled?op:!0===e.isSampled?sp:ap}var xp="[SessionRecording]",Ep=Ps(xp);function Cp(){var e;return null==es||null==(e=es.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var Tp=3e5,Pp=[Wf.MouseMove,Wf.MouseInteraction,Wf.Scroll,Wf.ViewportResize,Wf.Input,Wf.TouchMove,Wf.MediaInteraction,Wf.Drag],Ip=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}};function Fp(e){return function(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(zu(Uu(JSON.stringify(e))),!0)}function Rp(e){return e.type===Vf.Custom&&"sessionIdle"===e.data.tag}var Mp=function(){function e(e){var t=this;if(this._statusMatcher=wp,this._receivedDecide=!1,this._queuedRRWebEvents=[],this._isIdle="unknown",this._lastActivityTimestamp=Date.now(),this._triggerMatching=new gp,this._removePageViewCaptureHook=void 0,this._onSessionIdListener=void 0,this._persistDecideOnSessionListener=void 0,this._samplingSessionListener=void 0,this._removeEventTriggerCaptureHook=void 0,this._forceAllowLocalhostNetworkCapture=!1,this._onBeforeUnload=function(){t._flushBuffer()},this._onOffline=function(){t._tryAddCustomEvent("browser offline",{})},this._onOnline=function(){t._tryAddCustomEvent("browser online",{})},this._onVisibilityChange=function(){if(null!=Zo&&Zo.visibilityState){var e="window "+Zo.visibilityState;t._tryAddCustomEvent(e,{})}},this._instance=e,this._captureStarted=!1,this._endpoint="/s/",this._stopRrweb=void 0,this._receivedDecide=!1,!this._instance.sessionManager)throw Ep.error("started without valid sessionManager"),new Error(xp+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(xp+" cannot be used with __preview_experimental_cookieless_mode.");this._linkedFlagMatching=new yp(this._instance),this._urlTriggerMatching=new mp(this._instance),this._eventTriggerMatching=new bp(this._instance);var n=this._sessionManager.checkAndGetSessionAndWindowId(),r=n.sessionId,i=n.windowId;this._sessionId=r,this._windowId=i,this._buffer=this._clearBuffer(),this._sessionIdleThresholdMilliseconds>=this._sessionManager.sessionTimeoutMs&&Ep.warn("session_idle_threshold_ms ("+this._sessionIdleThresholdMilliseconds+") is greater than the session timeout ("+this._sessionManager.sessionTimeoutMs+"). Session will never be detected as idle")}var t=e.prototype;return t.startIfEnabledOrStop=function(e){var t=this;this._isRecordingEnabled?(this._startCapture(e),js(jo,"beforeunload",this._onBeforeUnload),js(jo,"offline",this._onOffline),js(jo,"online",this._onOnline),js(jo,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),ws(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this._instance.on("eventCaptured",(function(e){try{if("$pageview"===e.event){var n=null!=e&&e.properties.$current_url?t._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){Ep.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this._sessionManager.onSessionId((function(e,n,r){var i,o;r&&(t._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:n,changeReason:r}),null==(i=t._instance)||null==(i=i.persistence)||i.unregister(wd),null==(o=t._instance)||null==(o=o.persistence)||o.unregister(bd))})))):this.stopRecording()},t.stopRecording=function(){var e,t,n,r;this._captureStarted&&this._stopRrweb&&(this._stopRrweb(),this._stopRrweb=void 0,this._captureStarted=!1,null==jo||jo.removeEventListener("beforeunload",this._onBeforeUnload),null==jo||jo.removeEventListener("offline",this._onOffline),null==jo||jo.removeEventListener("online",this._onOnline),null==jo||jo.removeEventListener("visibilitychange",this._onVisibilityChange),this._clearBuffer(),clearInterval(this._fullSnapshotTimer),null==(e=this._removePageViewCaptureHook)||e.call(this),this._removePageViewCaptureHook=void 0,null==(t=this._removeEventTriggerCaptureHook)||t.call(this),this._removeEventTriggerCaptureHook=void 0,null==(n=this._onSessionIdListener)||n.call(this),this._onSessionIdListener=void 0,null==(r=this._samplingSessionListener)||r.call(this),this._samplingSessionListener=void 0,this._eventTriggerMatching.stop(),this._urlTriggerMatching.stop(),this._linkedFlagMatching.stop(),Ep.info("stopped"))},t._resetSampling=function(){var e;null==(e=this._instance.persistence)||e.unregister(yd)},t._makeSamplingDecision=function(e){var t,n,r=this._sessionId!==e,i=this._sampleRate;if(Ss(i)){var o=this._isSampled,s=r||!ks(o),a=s?ip(e,i):o;s&&(a?this._reportStarted(sp):Ep.warn("Sample rate ("+i+") has determined that this sessionId ("+e+") will not be sent to the server."),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:a})),null==(t=this._instance.persistence)||t.register(((n={})[yd]=a,n))}else this._resetSampling()},t.onRemoteConfig=function(e){var t,n,r,i,o=this;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),null!=(t=e.sessionRecording)&&t.endpoint)&&(this._endpoint=null==(i=e.sessionRecording)?void 0:i.endpoint);this._setupSampling(),"any"===(null==(n=e.sessionRecording)?void 0:n.triggerMatchType)?(this._statusMatcher=Sp,this._triggerMatching=new hp([this._eventTriggerMatching,this._urlTriggerMatching])):(this._statusMatcher=kp,this._triggerMatching=new vp([this._eventTriggerMatching,this._urlTriggerMatching])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(r=e.sessionRecording)?void 0:r.triggerMatchType}),this._urlTriggerMatching.onRemoteConfig(e),this._eventTriggerMatching.onRemoteConfig(e),this._linkedFlagMatching.onRemoteConfig(e,(function(e,t){o._reportStarted("linked_flag_matched",{flag:e,variant:t})})),this._receivedDecide=!0,this.startIfEnabledOrStop()},t._setupSampling=function(){var e=this;Ss(this._sampleRate)&&ws(this._samplingSessionListener)&&(this._samplingSessionListener=this._sessionManager.onSessionId((function(t){e._makeSamplingDecision(t)})))},t._persistRemoteConfig=function(e){var t=this;if(this._instance.persistence){var n,r=this._instance.persistence,i=function(){var n,i,o,s,a,u,l,c,d,f,p=null==(n=e.sessionRecording)?void 0:n.sampleRate,_=ws(p)?null:parseFloat(p);ws(_)&&t._resetSampling();var h=null==(i=e.sessionRecording)?void 0:i.minimumDurationMilliseconds;r.register(((f={})[cd]=!!e.sessionRecording,f[dd]=null==(o=e.sessionRecording)?void 0:o.consoleLogRecordingEnabled,f[fd]=ki({capturePerformance:e.capturePerformance},null==(s=e.sessionRecording)?void 0:s.networkPayloadCapture),f[pd]=null==(a=e.sessionRecording)?void 0:a.masking,f[_d]={enabled:null==(u=e.sessionRecording)?void 0:u.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},f[hd]=_,f[vd]=gs(h)?null:h,f[gd]=null==(d=e.sessionRecording)?void 0:d.scriptConfig,f))};i(),null==(n=this._persistDecideOnSessionListener)||n.call(this),this._persistDecideOnSessionListener=this._sessionManager.onSessionId(i)}},t.log=function(e,t){var n;void 0===t&&(t="log"),null==(n=this._instance.sessionRecording)||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})},t._startCapture=function(e){var t=this;if(!gs(Object.assign)&&!gs(Array.from)&&!(this._captureStarted||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var n;if(this._captureStarted=!0,this._sessionManager.checkAndGetSessionAndWindowId(),Cp())this._onScriptLoaded();else null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,this._scriptName,(function(e){if(e)return Ep.error("could not load recorder",e);t._onScriptLoaded()}));Ep.info("starting"),this.status===ap&&this._reportStarted(e||"recording_initialized")}},t._isInteractiveEvent=function(e){var t;return 3===e.type&&-1!==Pp.indexOf(null==(t=e.data)?void 0:t.source)},t._updateWindowAndSessionIds=function(e){var t=this._isInteractiveEvent(e);t||this._isIdle||e.timestamp-this._lastActivityTimestamp>this._sessionIdleThresholdMilliseconds&&(this._isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this._sessionIdleThresholdMilliseconds,bufferLength:this._buffer.data.length,bufferSize:this._buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this._isIdle)){var r="unknown"===this._isIdle;this._isIdle=!1,r||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this._isIdle){var i=this._sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=i.windowId,s=i.sessionId,a=this._sessionId!==s,u=this._windowId!==o;this._windowId=o,this._sessionId=s,a||u?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}},t._tryRRWebMethod=function(e){try{return e.rrwebMethod(),!0}catch(t){return this._queuedRRWebEvents.length<10?this._queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Ep.warn("could not emit queued rrweb event.",t,e),!1}},t._tryAddCustomEvent=function(e,t){return this._tryRRWebMethod(Ip((function(){return Cp().addCustomEvent(e,t)})))},t._tryTakeFullSnapshot=function(){return this._tryRRWebMethod(Ip((function(){return Cp().takeFullSnapshot()})))},t._onScriptLoaded=function(){for(var e,t,n,r,i=this,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this._instance.config.session_recording,a=0,u=Object.entries(s||{});a<u.length;a++){var l=u[a],c=l[0],d=l[1];c in o&&("maskInputOptions"===c?o.maskInputOptions=ki({password:!0},d):o[c]=d)}(this._canvasRecording&&this._canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this._canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this._canvasRecording.quality}),this._masking)&&(o.maskAllInputs=null===(t=this._masking.maskAllInputs)||void 0===t||t,o.maskTextSelector=null!==(n=this._masking.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(r=this._masking.blockSelector)&&void 0!==r?r:void 0);var f=Cp();if(f){this._mutationRateLimiter=null!==(e=this._mutationRateLimiter)&&void 0!==e?e:new rp(f,{refillRate:this._instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this._instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:function(e,t){var n="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";Ep.info(n,{node:t}),i.log(xp+" "+n,"warn")}});var p=this._gatherRRWebPlugins();this._stopRrweb=f(ki({emit:function(e){i.onRRwebEmit(e)},plugins:p},o)),this._lastActivityTimestamp=Date.now(),this._isIdle=ks(this._isIdle)?this._isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:p.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this._instance.config})}else Ep.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")},t._scheduleFullSnapshot=function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==this._isIdle){var t=this._fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),t))}},t._gatherRRWebPlugins=function(){var e,t,n=[],r=null==(e=es.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;r&&this._isConsoleLogCaptureEnabled&&n.push(r());var i=null==(t=es.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;this._networkPayloadCapture&&_s(i)&&(!tu.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(i(tp(this._instance.config,this._networkPayloadCapture))):Ep.info("NetworkCapture not started because we are on localhost."));return n},t.onRRwebEmit=function(e){var t,n=this;if(this._processQueuedEvents(),e&&hs(e)){if(e.type===Vf.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._urlTriggerMatching.checkUrlTriggerConditions((function(){return n._pauseRecording()}),(function(){return n._resumeRecording()}),(function(e){return n._activateTrigger(e)})),!this._urlTriggerMatching.urlBlocked||function(e){return e.type===Vf.Custom&&"recording paused"===e.data.tag}(e)){e.type===Vf.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Vf.FullSnapshot&&this._receivedDecide&&this._triggerMatching.triggerStatus(this.sessionId)===fp&&this._clearBuffer();var i=this._mutationRateLimiter?this._mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&hs(t)&&6===t.type&&hs(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(o),!0!==this._isIdle||Rp(o)){if(Rp(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,u=s.threshold;o.timestamp=a+u}}var l=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(zf(e)<1024)return e;try{if(e.type===Vf.FullSnapshot)return ki({},e,{data:Fp(e.data),cv:"2024-10"});if(e.type===Vf.IncrementalSnapshot&&e.data.source===Wf.Mutation)return ki({},e,{cv:"2024-10",data:ki({},e.data,{texts:Fp(e.data.texts),attributes:Fp(e.data.attributes),removes:Fp(e.data.removes),adds:Fp(e.data.adds)})});if(e.type===Vf.IncrementalSnapshot&&e.data.source===Wf.StyleSheetRule)return ki({},e,{cv:"2024-10",data:ki({},e.data,{adds:e.data.adds?Fp(e.data.adds):void 0,removes:e.data.removes?Fp(e.data.removes):void 0})})}catch(e){Ep.error("could not compress event - will use uncompressed event",e)}return e}(o):o,c={$snapshot_bytes:zf(l),$snapshot_data:l,$session_id:this._sessionId,$window_id:this._windowId};this.status!==op?this._captureSnapshotBuffered(c):this._clearBuffer()}}}}},t._pageViewFallBack=function(){if(!this._instance.config.capture_pageview&&jo){var e=this._maskUrl(jo.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}},t._processQueuedEvents=function(){var e=this;if(this._queuedRRWebEvents.length){var t=[].concat(this._queuedRRWebEvents);this._queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}},t._maskUrl=function(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null==(n=r=t.maskNetworkRequestFn(r))?void 0:n.url}return e},t._clearBuffer=function(){return this._buffer={size:0,data:[],sessionId:this._sessionId,windowId:this._windowId},this._buffer},t._flushBuffer=function(){var e=this;this._flushBufferTimer&&(clearTimeout(this._flushBufferTimer),this._flushBufferTimer=void 0);var t=this._minimumDuration,n=this._sessionDuration,r=Ss(n)&&n>=0,i=Ss(t)&&r&&n<t;if(this.status===up||this.status===lp||this.status===op||i)return this._flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this._buffer;this._buffer.data.length>0&&Uf(this._buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:ts.LIB_VERSION})}));return this._clearBuffer()},t._captureSnapshotBuffered=function(e){var t,n=this,r=2+((null==(t=this._buffer)?void 0:t.data.length)||0);!this._isIdle&&(this._buffer.size+e.$snapshot_bytes+r>943718.4||this._buffer.sessionId!==this._sessionId)&&(this._buffer=this._flushBuffer()),this._buffer.size+=e.$snapshot_bytes,this._buffer.data.push(e.$snapshot_data),this._flushBufferTimer||this._isIdle||(this._flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))},t._captureSnapshot=function(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})},t._activateTrigger=function(e){var t,n;this._triggerMatching.triggerStatus(this.sessionId)===fp&&(null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})["url"===e?bd:wd]=this._sessionId,n)),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))},t._pauseRecording=function(){this._urlTriggerMatching.urlBlocked||(this._urlTriggerMatching.urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Ep.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))},t._resumeRecording=function(){this._urlTriggerMatching.urlBlocked&&(this._urlTriggerMatching.urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Ep.info("recording resumed"))},t._addEventTriggerListener=function(){var e=this;0!==this._eventTriggerMatching._eventTriggers.length&&ws(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this._instance.on("eventCaptured",(function(t){try{e._eventTriggerMatching._eventTriggers.includes(t.event)&&e._activateTrigger("event")}catch(e){Ep.error("Could not activate event trigger",e)}})))},t.overrideLinkedFlag=function(){this._linkedFlagMatching.linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")},t.overrideSampling=function(){var e,t;null==(e=this._instance.persistence)||e.register(((t={})[yd]=!0,t)),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")},t.overrideTrigger=function(e){this._activateTrigger(e)},t._reportStarted=function(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Ep.info(e.replace("_"," "),t),ss(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)},wi(e,[{key:"sessionId",get:function(){return this._sessionId}},{key:"_sessionIdleThresholdMilliseconds",get:function(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}},{key:"started",get:function(){return this._captureStarted}},{key:"_sessionManager",get:function(){if(!this._instance.sessionManager)throw new Error(xp+" must be started with a valid sessionManager.");return this._instance.sessionManager}},{key:"_fullSnapshotIntervalMillis",get:function(){var e,t;return this._triggerMatching.triggerStatus(this.sessionId)===fp?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:Tp}},{key:"_isSampled",get:function(){var e=this._instance.get_property(yd);return ks(e)?e:null}},{key:"_sessionDuration",get:function(){var e,t,n=null==(e=this._buffer)?void 0:e.data[(null==(t=this._buffer)?void 0:t.data.length)-1],r=this._sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"_isRecordingEnabled",get:function(){var e=!!this._instance.get_property(cd),t=!this._instance.config.disable_session_recording;return jo&&e&&t}},{key:"_isConsoleLogCaptureEnabled",get:function(){var e=!!this._instance.get_property(dd),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"_canvasRecording",get:function(){var e,t,n,r,i,o,s=this._instance.config.session_recording.captureCanvas,a=this._instance.get_property(_d),u=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,l=null!==(n=null!==(r=null==s?void 0:s.canvasFps)&&void 0!==r?r:null==a?void 0:a.fps)&&void 0!==n?n:4,c=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:u,fps:np(l,0,12,"canvas recording fps",4),quality:np(c,0,1,"canvas recording quality",.4)}}},{key:"_networkPayloadCapture",get:function(){var e,t,n=this._instance.get_property(fd),r={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this._instance.config.session_recording)?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=hs(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,a=!!(ks(s)?s:null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"_masking",get:function(){var e,t,n,r,i,o,s=this._instance.get_property(pd),a={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(n=this._instance.config.session_recording)?void 0:n.blockSelector},u=null!==(r=null==a?void 0:a.maskAllInputs)&&void 0!==r?r:null==s?void 0:s.maskAllInputs,l=null!==(i=null==a?void 0:a.maskTextSelector)&&void 0!==i?i:null==s?void 0:s.maskTextSelector,c=null!==(o=null==a?void 0:a.blockSelector)&&void 0!==o?o:null==s?void 0:s.blockSelector;return gs(u)&&gs(l)&&gs(c)?void 0:{maskAllInputs:null==u||u,maskTextSelector:l,blockSelector:c}}},{key:"_sampleRate",get:function(){var e=this._instance.get_property(hd);return Ss(e)?e:null}},{key:"_minimumDuration",get:function(){var e=this._instance.get_property(vd);return Ss(e)?e:null}},{key:"status",get:function(){return this._receivedDecide?this._statusMatcher({receivedDecide:this._receivedDecide,isRecordingEnabled:this._isRecordingEnabled,isSampled:this._isSampled,urlTriggerMatching:this._urlTriggerMatching,eventTriggerMatching:this._eventTriggerMatching,linkedFlagMatching:this._linkedFlagMatching,sessionId:this.sessionId}):up}},{key:"_scriptName",get:function(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(gd))?void 0:e.script)||"recorder"}},{key:"sdkDebugProperties",get:function(){var e=this._sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this._buffer.data.length,$sdk_debug_replay_internal_buffer_size:this._buffer.size,$sdk_debug_current_session_duration:this._sessionDuration,$sdk_debug_session_start:e}}}])}(),Op=Ps("[SegmentIntegration]");function Lp(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||na()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Fd,"identified")),t()},i=n.user();"then"in i&&_s(i.then)?i.then((function(e){return r(e)})):r(i)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||Op.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Op.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Op.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var qp="posthog-js";function $p(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;return function(t){var n,s,u,l,c;if(!("*"===a||a.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(n=t.exception)?void 0:n.values)||[],p=f.map((function(e){return ki({},e,{stacktrace:e.stacktrace?ki({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((function(e){return ki({},e,{platform:"web:javascript"})}))}):void 0})})),_={$exception_message:(null==(s=f[0])?void 0:s.value)||t.message,$exception_type:null==(u=f[0])?void 0:u.type,$exception_personURL:d,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(l=f[0])?void 0:l.value)||t.message,$sentry_exception_type:null==(c=f[0])?void 0:c.type,$sentry_tags:t.tags};return r&&i&&(_.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),e.exceptions.sendExceptionEvent(_),t}}var Ap=function(e,t,n,r,i){this.name=qp,this.setupOnce=function(o){o($p(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}},Dp=null!=jo&&jo.location?su(jo.location.hash,"__posthog")||su(location.hash,"state"):null,Np="_postHogToolbarParams",Hp=Ps("[Toolbar]"),Bp=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Bp||{}),jp=function(){function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){es.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=es.ph_toolbar_state)&&void 0!==e?e:Bp.UNINITIALIZED},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),!jo||!Zo)return!1;e=null!=e?e:jo.location,n=null!=n?n:jo.history;try{if(!t){try{jo.localStorage.setItem("test","test"),jo.localStorage.removeItem("test")}catch(e){return!1}t=null==jo?void 0:jo.localStorage}var r,i=Dp||su(e.hash,"__posthog")||su(e.hash,"state"),o=i?qs((function(){return JSON.parse(atob(decodeURIComponent(i)))}))||qs((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(Np)||"{}")).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=es.ph_load_toolbar||es.ph_load_editor;!ws(t)&&_s(t)?t(e,this.instance):Hp.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Zo||!Zo.getElementById(Ad));if(!jo||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=ki({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(jo.localStorage.setItem(Np,JSON.stringify(ki({},i,{source:void 0}))),this._getToolbarState()===Bp.LOADED)this._callLoadToolbar(i);else if(this._getToolbarState()===Bp.UNINITIALIZED){var o;this._setToolbarState(Bp.LOADING),null==(o=es.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(function(e){if(e)return Hp.error("[Toolbar] Failed to load",e),void t._setToolbarState(Bp.UNINITIALIZED);t._setToolbarState(Bp.LOADED),t._callLoadToolbar(i)})),js(jo,"turbolinks:load",(function(){t._setToolbarState(Bp.UNINITIALIZED),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}(),zp=Ps("[TracingHeaders]"),Up=function(){function e(e){var t=this;this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=function(){var e,n;gs(t._restoreXHRPatch)&&(null==(e=es.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(t._instance.sessionManager));gs(t._restoreFetchPatch)&&(null==(n=es.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)||n._patchFetch(t._instance.sessionManager))},this._instance=e}var t=e.prototype;return t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",(function(t){if(t)return zp.error("failed to load script",t);e()}))},t.startIfEnabledOrStop=function(){var e,t;this._instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)},e}(),Vp=Ps("[Web Vitals]"),Wp=9e5,Gp=function(){function e(e){var t,n=this;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(){clearTimeout(n._delayedFlushTimer),0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",n._buffer.metrics.reduce((function(e,t){var n;return ki({},e,((n={})["$web_vitals_"+t.name+"_event"]=ki({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))}),{})),n._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=function(e){var t,r=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(gs(r))Vp.error("Could not read session ID. Dropping metrics!");else{n._buffer=n._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=n._currentURL();if(!gs(i))if(ws(null==e?void 0:e.name)||ws(null==e?void 0:e.value))Vp.error("Invalid metric received",e);else if(n._maxAllowedValue&&e.value>=n._maxAllowedValue)Vp.error("Ignoring metric with value >= "+n._maxAllowedValue,e);else n._buffer.url!==i&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),gs(n._buffer.url)&&(n._buffer.url=i),n._buffer.firstMetricTimestamp=gs(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),n._buffer.metrics.push(ki({},e,{$current_url:i,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),n._buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()}},this._startCapturing=function(){var e,t,r,i,o=es.__PosthogExtensions__;if(!gs(o)&&!gs(o.postHogWebVitalsCallbacks)){var s=o.postHogWebVitalsCallbacks;e=s.onLCP,t=s.onCLS,r=s.onFCP,i=s.onINP}e&&t&&r&&i?(n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("FCP")>-1&&r(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n)),n._initialized=!0):Vp.error("web vitals callbacks not loaded - not starting")},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[ad]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(Vp.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){var t,n,r=hs(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=hs(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((t={})[ad]=r,t)),this._instance.persistence.register(((n={})[ld]=i,n)));this._enabledServerSide=r,this.startIfEnabled()},t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"web-vitals",(function(t){t?Vp.error("failed to load script",t):e()}))},t._currentURL=function(){var e=jo?jo.location.href:void 0;return e||Vp.error("Could not determine current URL"),e},wi(e,[{key:"allowedMetrics",get:function(){var e,t,n=hs(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return gs(n)?(null==(t=this._instance.persistence)?void 0:t.props[ld])||["CLS","FCP","INP","LCP"]:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(hs(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"_maxAllowedValue",get:function(){var e=hs(this._instance.config.capture_performance)&&Ss(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Wp;return 0<e&&e<=6e4?Wp:e}},{key:"isEnabled",get:function(){var e=null==Qo?void 0:Qo.protocol;if("http:"!==e&&"https:"!==e)return Vp.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=hs(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ks(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ks(t)?t:this._enabledServerSide}}])}(),Zp=Ps("[Heatmaps]");function Qp(e){return hs(e)&&"clientX"in e&&"clientY"in e&&Ss(e.clientX)&&Ss(e.clientY)}var Yp=function(){function e(e){var t;this.rageclicks=new hf,this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[id])}var t=e.prototype;return t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Zp.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this._flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null==(t=this._deadClicksCapture)||t.stop(),this.getAndClearBuffer()}},t.onRemoteConfig=function(e){var t,n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[id]=n,t));this._enabledServerSide=n,this.startIfEnabled()},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){this._onClick(e.originalEvent,"deadclick")},t._setupListeners=function(){var e=this;jo&&Zo&&(js(jo,"beforeunload",this._flush.bind(this)),js(Zo,"click",(function(t){return e._onClick(t||(null==jo?void 0:jo.event))}),{capture:!0}),js(Zo,"mousemove",(function(t){return e._onMouseMove(t||(null==jo?void 0:jo.event))}),{capture:!0}),this._deadClicksCapture=new Nf(this.instance,Af,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabled(),this._initialized=!0)},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&&Bd(r)&&!jd(r,"body");){if(r===n)return!1;if(ss(t,null==jo?void 0:jo.getComputedStyle(r).position))return!0;r=Xd(r)}return!1}(Yd(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"),!Hd(e.target)&&Qp(e)){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(ki({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!Hd(e.target)&&Qp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))},t._capture=function(e){if(jo){var t=jo.location.href;this._buffer=this._buffer||{},this._buffer[t]||(this._buffer[t]=[]),this._buffer[t].push(e)}},t._flush=function(){this._buffer&&!vs(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},wi(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return hs(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return gs(this.instance.config.capture_heatmaps)?gs(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}}])}(),Jp=function(){function e(e){this._instance=e}var t=e.prototype;return t.doPageView=function(e,t){var n,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==jo?void 0:jo.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(!(gs(o)||gs(s)||gs(a)||gs(u)||gs(l)||gs(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?1:np(s/o,0,1),f=o<=1?1:np(a/o,0,1),p=u<=1?1:np(l/u,0,1),_=u<=1?1:np(c/u,0,1);r=Ms(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:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:_})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r},e}(),Xp=Ps("[Error tracking]"),Kp=function(){function e(e){var t,n;this._suppressionRules=[],this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property(sd))&&void 0!==t?t:[]}var t=e.prototype;return t.onRemoteConfig=function(e){var t,n,r,i=null!==(t=null==(n=e.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[];(this._suppressionRules=i,this._instance.persistence)&&this._instance.persistence.register(((r={})[sd]=this._suppressionRules,r))},t.sendExceptionEvent=function(e){this._matchesSuppressionRule(e)?Xp.info("Skipping exception capture because a suppression rule matched"):this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})},t._matchesSuppressionRule=function(e){var t=e.$exception_list;if(!t||!ps(t)||0===t.length)return!1;var n=t.reduce((function(e,t){var n=t.type,r=t.value;return ms(n)&&n.length>0&&e.$exception_types.push(n),ms(r)&&r.length>0&&e.$exception_messages.push(r),e}),{$exception_types:[],$exception_messages:[]});return this._suppressionRules.some((function(e){var t=e.values.map((function(e){var t=el[e.operator],r=ps(e.value)?e.value:[e.value],i=n[e.key];return r.length>0&&t(r,i)}));return"OR"===e.type?t.some(Boolean):t.every(Boolean)}))},e}(),e_="https?://(.*)",t_=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],n_=Os(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],t_),r_="<masked>";function i_(e,t,n){if(!Zo)return{};var r=t?Os([],t_,n||[]):[];return o_(ou(Zo.URL,r,r_),e)}function o_(e,t){var n=n_.concat(t||[]),r={};return Rs(n,(function(t){var n=iu(e,t);r[t]=n||null})),r}function s_(e){var t=function(e){return e?0===e.search(e_+"google.([^/?]*)")?"google":0===e.search(e_+"bing.com")?"bing":0===e.search(e_+"yahoo.com")?"yahoo":0===e.search(e_+"duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!bs(t)){r.$search_engine=t;var i=Zo?iu(Zo.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function a_(){return navigator.language||navigator.userLanguage}function u_(){return(null==Zo?void 0:Zo.referrer)||"$direct"}function l_(e,t){var n=e?Os([],t_,t||[]):[],r=null==Qo?void 0:Qo.href.substring(0,1e3);return{r:u_().substring(0,1e3),u:r?ou(r,n,r_):void 0}}function c_(e){var t,n=e.r,r=e.u,i={$referrer:n,$referring_domain:null==n?void 0:"$direct"==n?"$direct":null==(t=nu(n))?void 0:t.host};if(r){i.$current_url=r;var o=nu(r);i.$host=null==o?void 0:o.host,i.$pathname=null==o?void 0:o.pathname;var s=o_(r);Ms(i,s)}if(n){var a=s_(n);Ms(i,a)}return i}function d_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function f_(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function p_(e,t){if(!Ko)return{};var n,r=e?Os([],t_,t||[]):[],i=function(e){for(var t=0;t<Xa.length;t++){var n=Xa[t],r=n[0],i=n[1],o=r.exec(e),s=o&&(_s(i)?i(o,e):i);if(s)return s}return["",""]}(Ko),o=i[0],s=i[1];return Ms(As({$os:o,$os_version:s,$browser:Qa(Ko,navigator.vendor),$device:Ka(Ko),$device_type:eu(Ko),$timezone:d_(),$timezone_offset:f_()}),{$current_url:ou(null==Qo?void 0:Qo.href,r,r_),$host:null==Qo?void 0:Qo.host,$pathname:null==Qo?void 0:Qo.pathname,$raw_user_agent:Ko.length>1e3?Ko.substring(0,997)+"...":Ko,$browser_version:Ja(Ko,navigator.vendor),$browser_language:a_(),$browser_language_prefix:(n=a_(),"string"==typeof n?n.split("-")[0]:void 0),$screen_height:null==jo?void 0:jo.screen.height,$screen_width:null==jo?void 0:jo.screen.width,$viewport_height:null==jo?void 0:jo.innerHeight,$viewport_width:null==jo?void 0:jo.innerWidth,$lib:"web",$lib_version:ts.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var __=Ps("[FeatureFlags]"),h_="$active_feature_flags",v_="$override_feature_flags",g_="$feature_flag_payloads",m_="$override_feature_flag_payloads",y_="$feature_flag_request_id",b_=function(e){for(var t,n={},r=Si(Ls(e||{}));!(t=r()).done;){var i=t.value,o=i[0],s=i[1];s&&(n[o]=s)}return n},w_=function(e){var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((function(e){var n;return[e,null!==(n=t[e].variant)&&void 0!==n?n:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((function(e){return t[e].enabled})).filter((function(e){var n;return null==(n=t[e].metadata)?void 0:n.payload})).map((function(e){var n;return[e,null==(n=t[e].metadata)?void 0:n.payload]})))):__.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},S_=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({}),k_=function(){function e(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._decideCalled=!1,this._flagsLoadedFromRemote=!1,this._instance=e,this.featureFlagEventHandlers=[]}var t=e.prototype;return t.decide=function(){if(this._instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._instance.get_property(xd),t=this._instance.get_property(v_),n=this._instance.get_property(m_);if(!n&&!t)return e||{};for(var r,i=Ms({},e||{}),o=Si([].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=gs(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,f=gs(c)?l.variant:"string"==typeof c?c:void 0,p=null==n?void 0:n[u],_=ki({},l,{enabled:d,variant:d?null!=f?f:null==l?void 0:l.variant:void 0});if(d!==(null==l?void 0:l.enabled)&&(_.original_enabled=null==l?void 0:l.enabled),f!==(null==l?void 0:l.variant)&&(_.original_variant=null==l?void 0:l.variant),p)_.metadata=ki({},null==l?void 0:l.metadata,{payload:p,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload});i[u]=_}return this._override_warning||(__.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i},t.getFlagVariants=function(){var e=this._instance.get_property(Sd),t=this._instance.get_property(v_);if(!t)return e||{};for(var n=Ms({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(__.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n},t.getFlagPayloads=function(){var e=this._instance.get_property(g_),t=this._instance.get_property(m_);if(!t)return e||{};for(var n=Ms({},e||{}),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(__.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._instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((function(){e._callDecideEndpoint()}),5))},t._clearDebouncer=function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0},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._callDecideEndpoint=function(e){var t,n=this;if(this._clearDebouncer(),!this._instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ki({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Ed)||{}),group_properties:this._instance.get_property(Cd)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var i=this._instance.config.__preview_flags_v2&&this._instance.config.__preview_remote_config;i&&(r.timezone=d_()),this._requestInFlight=!0,this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("api",i?"/flags/?v=2":"/decide/?v=4"),data:r,compression:this._instance.config.disable_compression?void 0:is.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:function(e){var t,i,o=!0;(200===e.statusCode&&(n._additionalReloadRequested||(n.$anon_distinct_id=void 0),o=!1),n._requestInFlight=!1,n._decideCalled)||(n._decideCalled=!0,n._instance._onRemoteConfig(null!==(i=e.json)&&void 0!==i?i:{}));if(!r.disable_flags||n._additionalReloadRequested)if(n._flagsLoadedFromRemote=!o,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(S_.FeatureFlags))__.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var s;if(!r.disable_flags)n.receivedFeatureFlags(null!==(s=e.json)&&void 0!==s?s:{},o);n._additionalReloadRequested&&(n._additionalReloadRequested=!1,n._callDecideEndpoint())}}})}},t.getFeatureFlag=function(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,i=this._instance.get_property(y_)||void 0,o=this._instance.get_property(Id)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(r))){var s,a,u,l,c,d,f,p,_,h;ps(o[e])?o[e].push(r):o[e]=[r],null==(s=this._instance.persistence)||s.register(((a={})[Id]=o,a));var v=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:i,$feature_flag_bootstrapped_response:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlags)?void 0:u[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};gs(null==v||null==(c=v.metadata)?void 0:c.version)||(g.$feature_flag_version=v.metadata.version);var m,y=null!==(d=null==v||null==(f=v.reason)?void 0:f.description)&&void 0!==d?d:null==v||null==(p=v.reason)?void 0:p.code;if(y&&(g.$feature_flag_reason=y),null!=v&&null!=(_=v.metadata)&&_.id&&(g.$feature_flag_id=v.metadata.id),gs(null==v?void 0:v.original_variant)&&gs(null==v?void 0:v.original_enabled)||(g.$feature_flag_original_response=gs(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(h=v.metadata)&&h.original_payload)g.$feature_flag_original_payload=null==v||null==(m=v.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",g)}return n}__.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")},t.getFeatureFlagDetails=function(e){return this.getFlagsWithDetails()[e]},t.getFeatureFlagPayload=function(e){return this.getFlagPayloads()[e]},t.getRemoteConfigPayload=function(e,t){var n=this._instance.config.token;this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:is.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:function(n){var r,i=null==(r=n.json)?void 0:r.featureFlagPayloads;t((null==i?void 0:i[e])||void 0)}})},t.isFeatureEnabled=function(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);__.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")},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){if(this._instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),i=this.getFlagsWithDetails();!function(e,t,n,r,i){var o,s;void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={});var a=w_(e),u=a.flags,l=a.featureFlags,c=a.featureFlagPayloads;if(l){var d=e.requestId;if(ps(l)){var f;__.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(l)for(var _=0;_<l.length;_++)p[l[_]]=!0;t&&t.register(((f={})[h_]=l,f[Sd]=p,f))}else{var h=l,v=c,g=u;e.errorsWhileComputingFlags&&(h=ki({},n,h),v=ki({},r,v),g=ki({},i,g)),t&&t.register(ki(((o={})[h_]=Object.keys(b_(h)),o[Sd]=h||{},o[g_]=v||{},o[xd]=g||{},o),d?((s={})[y_]=d,s):{}))}}}(e,this._instance.persistence,n,r,i),this._fireFeatureFlagsCallbacks(t)}},t.override=function(e,t){void 0===t&&(t=!1),__.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})},t.overrideFeatureFlags=function(e){if(!this._instance.__loaded||!this._instance.persistence)return __.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(v_),this._instance.persistence.unregister(m_),void this._fireFeatureFlagsCallbacks();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,n=e;if(this._override_warning=Boolean(null!==(t=n.suppressWarning)&&void 0!==t&&t),"flags"in n)if(!1===n.flags)this._instance.persistence.unregister(v_);else if(n.flags)if(ps(n.flags)){for(var r,i={},o=0;o<n.flags.length;o++)i[n.flags[o]]=!0;this._instance.persistence.register(((r={})[v_]=i,r))}else{var s;this._instance.persistence.register(((s={})[v_]=n.flags,s))}if("payloads"in n)if(!1===n.payloads)this._instance.persistence.unregister(m_);else if(n.payloads){var a;this._instance.persistence.register(((a={})[m_]=n.payloads,a))}this._fireFeatureFlagsCallbacks()}else this._fireFeatureFlagsCallbacks()},t.onFeatureFlags=function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}},t.updateEarlyAccessFeatureEnrollment=function(e,t){var n,r,i,o,s=(this._instance.get_property(kd)||[]).find((function(t){return t.flagKey===e})),a=((n={})["$feature_enrollment/"+e]=t,n),u={$feature_flag:e,$feature_enrollment:t,$set:a};s&&(u.$early_access_feature_name=s.name),this._instance.capture("$feature_enrollment_update",u),this.setPersonPropertiesForFlags(a,!1);var l=ki({},this.getFlagVariants(),((r={})[e]=t,r));null==(i=this._instance.persistence)||i.register(((o={})[h_]=Object.keys(b_(l)),o[Sd]=l,o)),this._fireFeatureFlagsCallbacks()},t.getEarlyAccessFeatures=function(e,t,n){var r=this;void 0===t&&(t=!1);var i=this._instance.get_property(kd),o=n?"&"+n.map((function(e){return"stage="+e})).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:function(t){var n,i;if(t.json){var o=t.json.earlyAccessFeatures;return null==(n=r._instance.persistence)||n.register(((i={})[kd]=o,i)),e(o)}}})},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._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))},t.setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=this._instance.get_property(Ed)||{};this._instance.register(((n={})[Ed]=ki({},r,e),n)),t&&this._instance.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(){this._instance.unregister(Ed)},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=this._instance.get_property(Cd)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(t){r[t]=ki({},r[t],e[t]),delete e[t]})),this._instance.register(((n={})[Cd]=ki({},r,e),n)),t&&this._instance.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._instance.get_property(Cd)||{};this._instance.register(((n={})[Cd]=ki({},r,((t={})[e]={},t)),n))}else this._instance.unregister(Cd)},wi(e,[{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),x_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],E_=function(){function e(e){this._config=e,this.props={},this._campaign_params_saved=!1,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.load(),e.debug&&Ts.info("Persistence loaded",e.persistence,ki({},this.props)),this.update_config(e,e),this.save()}var t=e.prototype;return t._buildStorage=function(e){-1===x_.indexOf(e.persistence.toLowerCase())&&(Ts.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Tf._is_supported()?Tf:"localstorage+cookie"===t&&If._is_supported()?If:"sessionstorage"===t&&Of._is_supported()?Of:"memory"===t?Rf:"cookie"===t?Ef:If._is_supported()?If:Ef},t.properties=function(){var e={};return Rs(this.props,(function(t,n){if(n===Sd&&hs(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/"+r[i]]=t[r[i]];else s=n,a=!1,(bs(o=Nd)?a:Wo&&o.indexOf===Wo?-1!=o.indexOf(s):(Rs(o,(function(e){if(a||(a=e===s))return Is})),a))||(e[n]=t);var o,s,a})),e},t.load=function(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=Ms({},e))}},t.save=function(){this._disabled||this._storage._set(this._name,this.props,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)},t.remove=function(){this._storage._remove(this._name,!1),this._storage._remove(this._name,!0)},t.clear=function(){this.remove(),this.props={}},t.register_once=function(e,t,n){var r=this;if(hs(e)){gs(t)&&(t="None"),this._expire_days=gs(n)?this._default_expiry:n;var i=!1;if(Rs(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(hs(e)){this._expire_days=gs(t)?this._default_expiry:t;var r=!1;if(Rs(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1},t.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},t.update_campaign_params=function(){if(!this._campaign_params_saved){var e=i_(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);vs(As(e))||this.register(e),this._campaign_params_saved=!0}},t.update_search_keyword=function(){var e;this.register((e=null==Zo?void 0:Zo.referrer)?s_(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:u_(),$referring_domain:null!=Zo&&Zo.referrer&&(null==(e=nu(Zo.referrer))?void 0:e.host)||"$direct"},void 0)},t.set_initial_person_info=function(){var e;this.props[Od]||this.props[Ld]||this.register_once(((e={})[qd]=l_(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),e),void 0)},t.get_initial_props=function(){var e=this,t={};Rs([Ld,Od],(function(n){var r=e.props[n];r&&Rs(r,(function(e,n){t["$initial_"+us(n)]=e}))}));var n,r,i=this.props[qd];if(i){var o=(n=c_(i),r={},Rs(n,(function(e,t){r["$initial_"+us(t)]=e})),r);Ms(t,o)}return t},t.safe_merge=function(e){return Rs(this.props,(function(t,n){n in e||(e[n]=t)})),e},t.update_config=function(e,t){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this._buildStorage(e),r=this.props;this.clear(),this._storage=n,this.props=r,this.save()}},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(),this.save())},t.set_secure=function(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())},t.set_event_timer=function(e,t){var n=this.props[nd]||{};n[e]=t,this.props[nd]=n,this.save()},t.remove_event_timer=function(e){var t=(this.props[nd]||{})[e];return gs(t)||(delete this.props[nd][e],this.save()),t},t.get_property=function(e){return this.props[e]},t.set_property=function(e,t){this.props[e]=t,this.save()},e}(),C_=function(){function e(){this._events={},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=Si(this._events[e]||[]);!(n=r()).done;){(0,n.value)(t)}for(var i,o=Si(this._events["*"]||[]);!(i=o()).done;){(0,i.value)(e,t)}},e}(),T_=function(){function e(e){var t=this;this._debugEventEmitter=new C_,this._checkStep=function(e,n){return t._checkStepEvent(e,n)&&t._checkStepUrl(e,n)&&t._checkStepElement(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,this._actionEvents=new Set,this._actionRegistry=new Set}var t=e.prototype;return t.init=function(){var e,t=this;if(!gs(null==(e=this._instance)?void 0:e._addCaptureHook)){var n;null==(n=this._instance)||n._addCaptureHook((function(e,n){t.on(e,n)}))}},t.register=function(e){var t,n,r=this;if(!gs(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null==(t=r._actionRegistry)||t.add(e),null==(n=e.steps)||n.forEach((function(e){var t;null==(t=r._actionEvents)||t.add((null==e?void 0:e.event)||"")}))})),null!=(n=this._instance)&&n.autocapture)){var i,o=new Set;e.forEach((function(e){var t;null==(t=e.steps)||t.forEach((function(e){null!=e&&e.selector&&o.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(o)}},t.on=function(e,t){var n,r=this;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(null==t?void 0:t.event))&&this._actionRegistry&&(null==(n=this._actionRegistry)?void 0:n.size)>0&&this._actionRegistry.forEach((function(e){r._checkAction(t,e)&&r._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=Si(t.steps);!(n=r()).done;){var i=n.value;if(this._checkStep(e,i))return!0}return!1},t.onAction=function(e,t){return this._debugEventEmitter.on(e,t)},t._checkStepUrl=function(t,n){if(null!=n&&n.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!e._matchString(i,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||"contains"))return!1}return!0},e._matchString=function(t,n,r){switch(r){case"regex":return!!jo&&Xu(t,n);case"exact":return n===t;case"contains":var i=e._escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Xu(t,i);default:return!1}},e._escapeStringRegexp=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},t._checkStepElement=function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this._getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e._matchString(t.href||"",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||"exact"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e._matchString(t.text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")&&!e._matchString(t.$el_text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")))})))return!1;if(null!=n&&n.selector){var r,i=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(!i)return!1;if(!i.includes(null==n?void 0:n.selector))return!1}return!0},t._getElementsList=function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements},e}(),P_=function(){function e(e){this._instance=e,this._eventToSurveys=new Map,this._actionToSurveys=new Map}var t=e.prototype;return t.register=function(e){var t;gs(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedSurveys(e),this._setupActionBasedSurveys(e))},t._setupActionBasedSurveys=function(e){var t=this,n=e.filter((function(e){var t,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0}));if(0!==n.length){if(null==this._actionMatcher){this._actionMatcher=new T_(this._instance),this._actionMatcher.init();this._actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,r,i,o,s;e.conditions&&null!=(n=e.conditions)&&n.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(o=t._actionMatcher)||o.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((function(n){if(n&&n.name){var r=t._actionToSurveys.get(n.name);r&&r.push(e.id),t._actionToSurveys.set(n.name,r||[e.id])}})))}))}},t._setupEventBasedSurveys=function(e){var t,n=this;if(0!==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})).length){null==(t=this._instance)||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach((function(t){if(t&&t.name){var r=n._eventToSurveys.get(t.name);r&&r.push(e.id),n._eventToSurveys.set(t.name,r||[e.id])}}))}))}},t.onEvent=function(e,t){var n,r=(null==(n=this._instance)||null==(n=n.persistence)?void 0:n.props[Pd])||[];if("survey shown"===e&&t&&r.length>0){var i;zs.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var o=null==t||null==(i=t.properties)?void 0:i.$survey_id;if(o){var s=r.indexOf(o);s>=0&&(r.splice(s,1),this._updateActivatedSurveys(r))}}else this._eventToSurveys.has(e)&&(zs.info("survey event matched, updating activated surveys",{event:e,surveys:this._eventToSurveys.get(e)}),this._updateActivatedSurveys(r.concat(this._eventToSurveys.get(e)||[])))},t.onAction=function(e){var t,n=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[Pd])||[];this._actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this._actionToSurveys.get(e)||[]))},t._updateActivatedSurveys=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Pd]=[].concat(new Set(e)),n))},t.getSurveys=function(){var e,t=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[Pd];return t||[]},t.getEventToSurveys=function(){return this._eventToSurveys},t._getActionMatcher=function(){return this._actionMatcher},e}(),I_=function(){function e(e){this._surveyManager=null,this._isFetchingSurveys=!1,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._instance=e,this._surveyEventReceiver=null}var t=e.prototype;return t.onRemoteConfig=function(e){var t=e.surveys;if(ws(t))return zs.warn("Decide not loaded yet. Not loading surveys.");var n=ps(t);this._hasSurveys=n?t.length>0:t,zs.info("decide response received, hasSurveys: "+this._hasSurveys),this._hasSurveys&&this.loadIfEnabled()},t.reset=function(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(null!=n&&n.startsWith(Gs)||null!=n&&n.startsWith(Zs))&&e.push(n)}e.forEach((function(e){return localStorage.removeItem(e)}))},t.loadIfEnabled=function(){var e=this;if(!this._surveyManager)if(this._isInitializingSurveys)zs.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)zs.info("Disabled. Not loading surveys.");else if(this._hasSurveys){var t=null==es?void 0:es.__PosthogExtensions__;if(t){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)return void this._completeSurveyInitialization(n);var r=t.loadExternalDependency;if(!r)return void this._handleSurveyLoadError("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(function(n){n||!t.generateSurveys?e._handleSurveyLoadError("Could not load surveys script",n):e._completeSurveyInitialization(t.generateSurveys)}))}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}else zs.error("PostHog Extensions not found.")}else zs.info("No surveys to load.")},t._completeSurveyInitialization=function(e){this._surveyManager=e(this._instance),this._surveyEventReceiver=new P_(this._instance),zs.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})},t._handleSurveyLoadError=function(e,t){zs.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=this;if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return zs.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(Td);if(r&&!t)return e(r,{isLoaded:!0});if(this._isFetchingSurveys)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:function(t){var r,i;n._isFetchingSurveys=!1;var o=t.statusCode;if(200!==o||!t.json){var s="Surveys API could not be loaded, status: "+o;return zs.error(s),e([],{isLoaded:!1,error:s})}var a,u=t.json.surveys||[],l=u.filter((function(e){return Us(e)&&(Vs(e)||Ws(e))}));l.length>0&&(null==(a=n._surveyEventReceiver)||a.register(l));return null==(r=n._instance.persistence)||r.register(((i={})[Td]=u,i)),e(u,{isLoaded:!0})}})}catch(e){throw this._isFetchingSurveys=!1,e}},t._notifySurveyCallbacks=function(e){for(var t,n=Si(this._surveyCallbacks);!(t=n()).done;){var r=t.value;try{e.isLoaded?this.getSurveys(r):r([],e)}catch(e){zs.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!ws(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);zs.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(ws(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(ws(this._surveyManager))return zs.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return ws(this._surveyManager)?(zs.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):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._checkSurveyEligibility(o);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))},t.renderSurvey=function(e,t){if(ws(this._surveyManager))zs.warn("init was not called");else{var n=this._getSurveyById(e),r=null==Zo?void 0:Zo.querySelector(t);n?r?this._surveyManager.renderSurvey(n,r):zs.warn("Survey element not found"):zs.warn("Survey not found")}},e}(),F_=Ps("[RateLimiter]"),R_=function(){function e(e){var t,n,r=this;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){F_.info((e||"events")+" is quota limited."),r.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void F_.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(n=e.config.rate_limiting)?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),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=(new Date).getTime(),o=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property(Md))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||e||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null==(r=this.instance.persistence)||r.set_property(Md,o),{isRateLimited:s,remainingTokens:o.tokens}},t.isServerRateLimited=function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t},e}(),M_=Ps("[RemoteConfig]"),O_=function(){function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,r=this;null!=(t=es.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",(function(){return e(r.remoteConfig)})):(M_.error("PostHog Extensions not found. Cannot load remote config."),e())},t._loadRemoteConfigJSON=function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:function(t){e(t.json)}})},t.load=function(){var e=this;try{if(this.remoteConfig)return M_.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance.config.advanced_disable_decide)return void M_.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((function(t){if(!t)return M_.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON((function(t){e._onRemoteConfig(t)}));e._onRemoteConfig(t)}))}catch(e){M_.error("Error loading remote config",e)}},t._onRemoteConfig=function(e){e?this._instance.config.__preview_remote_config?(this._instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):M_.info("__preview_remote_config is disabled. Logging config instead",e):M_.error("Failed to fetch remote config from PostHog.")},wi(e,[{key:"remoteConfig",get:function(){var e;return null==(e=es._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),L_=3e3,q_=function(){function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=np((null==t?void 0:t.flush_interval_ms)||L_,250,5e3,"flush interval",L_),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._sendRequest(ki({},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&&ps(n.data)&&Rs(n.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e._sendRequest(n)};for(var r in t)n()}}),this._flushTimeoutMs))},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return Rs(this._queue,(function(t){var n,r=t,i=(r?r.batchKey:null)||r.url;gs(e[i])&&(e[i]=ki({},r,{data:[]})),null==(n=e[i].data)||n.push(r.data)})),this._queue=[],e},e}(),$_=["retriesPerformedSoFar"];var A_=function(){function e(e){var t=this;this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!gs(jo)&&"onLine"in jo.navigator&&(this._areWeOnline=jo.navigator.onLine,js(jo,"online",(function(){t._areWeOnline=!0,t._flush()})),js(jo,"offline",(function(){t._areWeOnline=!1})))}var t=e.prototype;return t.retriableRequest=function(e){var t=this,n=e.retriesPerformedSoFar,r=xi(e,$_);Ss(n)&&n>0&&(r.url=Zu(r.url,{retry_count:n})),this._instance._send_request(ki({},r,{callback:function(e){200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?t._enqueue(ki({retriesPerformedSoFar:n},r)):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)*(r-n);return Math.ceil(r+i)}(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)"),Ts.warn(i),this._isPolling||(this._isPolling=!0,this._poll())},t._poll=function(){var e=this;this._poller&&clearTimeout(this._poller),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 n.retryAt<e||(t.push(n),!1)}));if(this._queue=t,n.length>0)for(var r,i=Si(n);!(r=i()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}},t.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);for(var e,t=Si(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(ki({},n,{transport:"sendBeacon"}))}catch(e){Ts.error(e)}}this._queue=[]},wi(e,[{key:"length",get:function(){return this._queue.length}}])}(),D_=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(){js(jo,"scroll",this._updateScrollData,{capture:!0}),js(jo,"scrollend",this._updateScrollData,{capture:!0}),js(jo,"resize",this._updateScrollData)},t.scrollElement=function(){if(!this._instance.config.scroll_root_selector)return null==jo?void 0:jo.document.documentElement;for(var e,t=Si(ps(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);!(e=t()).done;){var n=e.value,r=null==jo?void 0:jo.document.querySelector(n);if(r)return r}},t.scrollY=function(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return jo&&(jo.scrollY||jo.pageYOffset||jo.document.documentElement.scrollTop)||0},t.scrollX=function(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return jo&&(jo.scrollX||jo.pageXOffset||jo.document.documentElement.scrollLeft)||0},e}(),N_=function(e){return l_(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties)},H_=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={})[Rd]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||N_,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Rd]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?c_(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}},t.getSessionProps=function(){var e={};return Rs(As(this.getSetOnceProps()),(function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+us(n)]=t})),e},e}(),B_=Ps("[SessionId]"),j_=function(){function e(e,t,n){var r;if(this._sessionIdChangedHandlers=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||na,this._windowIdGenerator=n||na;var i=this._config.persistence_name||this._config.token,o=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*np(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+i+"_window_id",this._primary_window_exists_storage_key="ph_"+i+"_primary_window_exists",this._canUseSessionStorage()){var s=Of._parse(this._window_id_storage_key),a=Of._parse(this._primary_window_exists_storage_key);s&&!a?this._windowId=s:Of._remove(this._window_id_storage_key),Of._set(this._primary_window_exists_storage_key,!0)}if(null!=(r=this._config.bootstrap)&&r.sessionID)try{var u=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)}(this._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),u)}catch(e){B_.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}var t=e.prototype;return t.onSessionId=function(e){var t=this;return gs(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&&Of._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Of._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Of._parse(this._window_id_storage_key):null},t._setSessionId=function(e,t,n){var r;e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register(((r={})[md]=[t,e,n],r)))},t._getSessionId=function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this._persistence.props[md];return ps(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},t.resetSessionId=function(){this._setSessionId(null,null,null)},t._listenToReloadWindow=function(){var e=this;js(jo,"beforeunload",(function(){e._canUseSessionStorage()&&Of._remove(e._primary_window_exists_storage_key)}),{capture:!1})},t.checkAndGetSessionAndWindowId=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this._config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),r=this._getSessionId(),i=r[0],o=r[1],s=r[2],a=this._getWindowId(),u=Ss(s)&&s>0&&Math.abs(n-s)>864e5,l=!1,c=!o,d=!e&&Math.abs(n-i)>this.sessionTimeoutMs;c||d||u?(o=this._sessionIdGenerator(),a=this._windowIdGenerator(),B_.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}}),s=n,l=!0):a||(a=this._windowIdGenerator(),l=!0);var f=0===i||!e||u?n:i,p=0===s?(new Date).getTime():s;return this._setWindowId(a),this._setSessionId(o,f,p),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((function(e){return e(o,a,l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0)})),{sessionId:o,windowId:a,sessionStartTimestamp:p,changeReason:l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:i}},t._resetIdleTimer=function(){var e=this;clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((function(){e.resetSessionId()}),1.1*this.sessionTimeoutMs)},wi(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),z_=["$set_once","$set"],U_=Ps("[SiteApps]"),V_=function(){function e(e){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.init=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);d<f.length;d++){var p=f[d],_=p[0],h=p[1];u[_]={id:l[_],type:_,properties:h}}var v=e.$set_once,g=e.$set;return{event:ki({},xi(e,z_),{properties:ki({},e.properties,g?{$set:ki({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},v?{$set_once:ki({},null!==(r=null==(i=e.properties)?void 0:i.$set_once)&&void 0!==r?r:{},v)}:{}),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.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(U_.info("Processing "+t._bufferedInvocations.length+" events for site app with id "+e.id),t._bufferedInvocations.forEach((function(e){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,U_.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),i&&r()};try{var s=e.init({posthog:this._instance,callback:function(e){o(e)}}).processEvent;s&&(n.processEvent=s),i=!0}catch(t){U_.error("Error while initializing PostHog app with config id "+e.id,t),o(!1)}if(i&&n.loaded)try{r()}catch(t){U_.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=Si(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=Si(t);!(i=o()).done;){var s=i.value;this.setupSiteApp(s)}},t._onCapturedEvent=function(e){if(0!==Object.keys(this.apps).length)for(var t=this.globalsForEvent(e),n=0,r=Object.values(this.apps);n<r.length;n++){var i=r[n];try{null==i.processEvent||i.processEvent(t)}catch(t){U_.error("Error while processing event "+e.event+" for site app "+i.id,t)}}},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 U_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this._stopBuffering)||n.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled)for(var o,s=function(){var e,t=o.value,n=t.id,r=t.url;es["__$$ph_site_app_"+n]=i._instance,null==(e=es.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,(function(e){if(e)return U_.error("Error while initializing PostHog app with config id "+n,e)}))},a=Si(e.siteApps);!(o=a()).done;)s();else U_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')},wi(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"siteAppLoaders",get:function(){var e;return null==(e=es._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),W_=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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","googleweblight","mediapartners-google","storebot-google","bytespider"],G_=function(e,t){if(!e)return!1;var n=e.toLowerCase();return W_.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Z_=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&G_(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((function(e){return G_(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver},Q_=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Y_="i.posthog.com",J_=function(){function e(e){this._regionCache={},this.instance=e}return e.prototype.endpointFor=function(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===Q_.CUSTOM)return this.apiHost+t;var n=Y_+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}},wi(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:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Y_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Q_.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Q_.EU:this._regionCache[this.apiHost]=Q_.CUSTOM),this._regionCache[this.apiHost]}}])}(),X_={icontains:function(e,t){return!!jo&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return!!jo&&-1===t.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return!!jo&&Xu(t.href,e)},not_regex:function(e,t){return!!jo&&!Xu(t.href,e)},exact:function(e,t){return t.href===e},is_not:function(e,t){return t.href!==e}},K_=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;if(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);ms(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._applyTransforms(t.name,o,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((function(e){n.onFeatureFlags(e)}))}var t=e.prototype;return t.onFeatureFlags=function(t){var n=this;if(this._is_bot())e._logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ws(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=iu(null==n?void 0:n.search,"__experiment_id"),i=iu(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._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()},t.getWebExperiments=function(e,t,n){if(this._instance.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._instance.config.token),method:"GET",callback:function(t){if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})},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){return!ws(t.conditions)&&(e._matchUrlConditions(t)&&e._matchUTMConditions(t))},e._matchUrlConditions=function(t){var n;if(ws(t.conditions)||ws(null==(n=t.conditions)?void 0:n.url))return!0;var r,i,o,s=e.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||X_[null!==(i=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))},e.getWindowLocation=function(){return null==jo?void 0:jo.location},e._matchUTMConditions=function(e){var t;if(ws(e.conditions)||ws(null==(t=e.conditions)?void 0:t.utm))return!0;var n=i_();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,p=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,_=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&&p&&_&&f}return!1},e._logInfo=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Ts.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo("Refusing to render web experiment since the viewer is a likely bot"):"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 Go&&this._instance?Z_(Go,this._instance.config.custom_blocked_useragents):void 0},e}(),eh={},th=function(){},nh="posthog",rh=!Wu&&-1===(null==Ko?void 0:Ko.indexOf("MSIE"))&&-1===(null==Ko?void 0:Ko.indexOf("Mozilla")),ih=function(){var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Hs(null==Zo?void 0:Zo.location),persistence:"localStorage+cookie",persistence_name:"",loaded:th,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Qo&&ms(null==Qo?void 0:Qo.search)&&-1!==Qo.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==jo||null==(e=jo.location)?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;Ts.error(t)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:L_},_onCapture:th}},oh=function(e){var t={};gs(e.process_person)||(t.person_profiles=e.process_person),gs(e.xhr_headers)||(t.request_headers=e.xhr_headers),gs(e.cookie_name)||(t.persistence_name=e.cookie_name),gs(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),gs(e.store_google)||(t.save_campaign_params=e.store_google),gs(e.verbose)||(t.debug=e.verbose);var n=Ms({},t,e);return ps(e.property_blacklist)&&(gs(e.property_denylist)?n.property_denylist=e.property_blacklist:ps(e.property_denylist)?n.property_denylist=[].concat(e.property_blacklist,e.property_denylist):Ts.error("Invalid value for property_denylist config: "+e.property_denylist)),n},sh=function(){return wi((function(){this.__forceAllowLocalhost=!1}),[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Ts.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),ah=function(){function e(){var e=this;this.webPerformance=new sh,this._personProcessingSetOncePropertiesSent=!1,this.version=ts.LIB_VERSION,this._internalEventEmitter=new C_,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ih(),this.SentryIntegration=Ap,this.sentryIntegration=function(t){return function(e,t){var n=$p(e,t);return{name:qp,processEvent:function(e){return n(e)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new k_(this),this.toolbar=new jp(this),this.scrollManager=new D_(this),this.pageViewManager=new Jp(this),this.surveys=new I_(this),this.experiments=new K_(this),this.exceptions=new Kp(this),this.rateLimiter=new R_(this),this.requestRouter=new J_(this),this.consent=new qf(this),this.people={set:function(t,n,r){var i,o=ms(t)?((i={})[t]=n,i):t;e.setPersonProperties(o),null==r||r({})},set_once:function(t,n,r){var i,o=ms(t)?((i={})[t]=n,i):t;e.setPersonProperties(void 0,o),null==r||r({})}},this.on("eventCaptured",(function(e){return Ts.info('send "'+(null==e?void 0:e.event)+'"',e)}))}var t=e.prototype;return t.init=function(t,n,r){if(r&&r!==nh){var i,o=null!==(i=eh[r])&&void 0!==i?i:new e;return o._init(t,n,r),eh[r]=o,eh[nh][r]=o,o}return this._init(t,n,r)},t._init=function(e,t,n){var r,i,o=this;if(void 0===t&&(t={}),gs(e)||ys(e))return Ts.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 Ts.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],t.person_profiles&&(this._initialPersonProfilesConfig=t.person_profiles),this.set_config(Ms({},ih(),oh(t),{name:n,token:e})),this.config.on_xhr_error&&Ts.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:is.GZipJS,this.persistence=new E_(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new E_(ki({},this.config,{persistence:"sessionStorage"}));var s=ki({},this.persistence.props),a=ki({},this.sessionPersistence.props);if(this._requestQueue=new q_((function(e){return o._send_retriable_request(e)}),this.config.request_queue_config),this._retryQueue=new A_(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new j_(this),this.sessionPropsManager=new H_(this,this.sessionManager,this.persistence)),new Up(this).startIfEnabledOrStop(),this.siteApps=new V_(this),null==(r=this.siteApps)||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Mp(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new wf(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Yp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Gp(this),this.exceptionObserver=new Bf(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Nf(this,Df),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new jf(this),this.historyAutocapture.startIfEnabled(),ts.DEBUG=ts.DEBUG||this.config.debug,ts.DEBUG&&Ts.info("Starting in debug mode",{this:this,config:t,thisC:ki({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null==(i=t.bootstrap)?void 0:i.distinctID)){var u,l,c=this.config.get_device_id(na()),d=null!=(u=t.bootstrap)&&u.isIdentifiedID?c:t.bootstrap.distinctID;this.persistence.set_property(Fd,null!=(l=t.bootstrap)&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var f,p,_=Object.keys((null==(f=t.bootstrap)?void 0:f.featureFlags)||{}).filter((function(e){var n;return!(null==(n=t.bootstrap)||null==(n=n.featureFlags)||!n[e])})).reduce((function(e,n){var r;return e[n]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[n])||!1,e}),{}),h=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter((function(e){return _[e]})).reduce((function(e,n){var r,i;null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[n]&&(e[n]=null==(i=t.bootstrap)||null==(i=i.featureFlagPayloads)?void 0:i[n]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:h})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Dd,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(na());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(Fd,"anonymous")}return js(jo,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Lp(this,(function(){return o._loaded()})):this._loaded(),_s(this.config._onCapture)&&this.config._onCapture!==th&&(Ts.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(function(e){return o.config._onCapture(e.event,e)}))),this},t._onRemoteConfig=function(e){var t,n,r,i,o,s,a,u,l=this;if(!Zo||!Zo.body)return Ts.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){l._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ss(e.supportedCompression,is.GZipJS)?is.GZipJS:ss(e.supportedCompression,is.Base64)?is.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null==(n=this.siteApps)||n.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(i=this.autocapture)||i.onRemoteConfig(e),null==(o=this.heatmaps)||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(s=this.webVitalsAutocapture)||s.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)},t._loaded=function(){var e=this;try{this.config.loaded(this)}catch(e){Ts.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){e.consent.isOptedIn()&&e._captureInitialPageview()}),1),new O_(this).load(),this.featureFlags.decide()},t._start_queue_if_opted_in=function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())},t._dom_loaded=function(){var e=this;this.has_opted_out_capturing()||Fs(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;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})},t._send_request=function(e){var t=this;this.__loaded&&(rh?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Zu(e.url,{ip:this.config.ip?1:0}),e.headers=ki({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,r,i=ki({},e);i.timeout=i.timeout||6e4,i.url=Zu(i.url,{_:(new Date).getTime().toString(),ver:ts.LIB_VERSION,compression:i.compression});var o=null!==(t=i.transport)&&void 0!==t?t:"fetch",s=null!==(n=null==(r=Bs(Ju,(function(e){return e.transport===o})))?void 0:r.method)&&void 0!==n?n:Ju[0].method;if(!s)throw new Error("No available transport method");s(i)}(ki({},e,{callback:function(n){t.rateLimiter.checkForLimiting(n),n.statusCode>=400&&(null==t.config.on_request_error||t.config.on_request_error(n)),null==e.callback||e.callback(n)}}))))},t._send_retriable_request=function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)},t._execute_array=function(e){var t,n=this,r=[],i=[],o=[];Fs(e,(function(e){e&&(t=e[0],ps(t)?o.push(e):_s(e)?e.call(n):ps(e)&&"alias"===t?r.push(e):ps(e)&&-1!==t.indexOf("capture")&&_s(n[t])?o.push(e):i.push(e))}));var s=function(e,t){Fs(e,(function(e){if(ps(e[0])){var n=t;Rs(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)},t._hasBootstrappedFeatureFlags=function(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1},t.push=function(e){this._execute_array([e])},t.capture=function(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!gs(e)&&ms(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var i=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==i||!i.isRateLimited){null!=t&&t.$current_url&&!ms(null==t?void 0:t.$current_url)&&(Ts.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,s=(null==n?void 0:n.timestamp)||o,a=na(),u={uuid:a,event:e,properties:this.calculateEventProperties(e,t||{},s,a)};i&&(u.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),(null==n?void 0:n.$set)&&(u.$set=null==n?void 0:n.$set);var l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(u.$set_once=l),(u=Ds(u,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,gs(null==n?void 0:n.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=ki({},u.properties.$set,u.$set);if(vs(c)||this.setPersonPropertiesForFlags(c),!ws(this.config.before_send)){var d=this._runBeforeSend(u);if(!d)return;u=d}this._internalEventEmitter.emit("eventCaptured",u);var f={method:"POST",url:null!==(r=null==n?void 0:n._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),u}Ts.critical("This capture call is ignored due to client rate limiting.")}}else Ts.error("No event name provided to posthog.capture")}else Ts.uninitializedWarning("posthog.capture")},t._addCaptureHook=function(e){return this.on("eventCaptured",(function(t){return e(t.event,t)}))},t.calculateEventProperties=function(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var o=i?void 0:this.persistence.remove_event_timer(e),s=ki({},t);if(s.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),"$snapshot"===e){var a=ki({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!ms(s.distinct_id)&&!Ss(s.distinct_id)||ys(s.distinct_id))&&Ts.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,l=p_(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime()),d=c.sessionId,f=c.windowId;s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&Ms(s,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Ms(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){s.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Q_.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=Ms(s,u),"$pageview"===e&&Zo&&(s.title=Zo.title),!gs(o)){var _=n.getTime()-o;s.$duration=parseFloat((_/1e3).toFixed(3))}Ko&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Ms({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),ps(this.config.property_denylist)?Rs(this.config.property_denylist,(function(e){delete s[e]})):Ts.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(Ts.error("sanitize_properties is deprecated. Use before_send instead"),s=h(s,e));var v=this._hasPersonProcessing();return s.$process_person_profile=v,v&&!i&&this._requirePersonProcessing("_calculate_event_properties"),s},t._calculate_set_once_properties=function(e){var t;if(!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var n=this.persistence.get_initial_props(),r=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),i=Ms({},n,r||{},e||{}),o=this.config.sanitize_properties;return o&&(Ts.error("sanitize_properties is deprecated. Use before_send instead"),i=o(i,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,vs(i)?void 0:i},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)},t.register_for_session=function(e){var t;null==(t=this.sessionPersistence)||t.register(e)},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)},t._register_single=function(e,t){var n;this.register(((n={})[e]=t,n))},t.getFeatureFlag=function(e,t){return this.featureFlags.getFeatureFlag(e,t)},t.getFeatureFlagPayload=function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}},t.isFeatureEnabled=function(e,t){return this.featureFlags.isFeatureEnabled(e,t)},t.reloadFeatureFlags=function(){this.featureFlags.reloadFeatureFlags()},t.updateEarlyAccessFeatureEnrollment=function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)},t.getEarlyAccessFeatures=function(e,t,n){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)},t.on=function(e,t){return this._internalEventEmitter.on(e,t)},t.onFeatureFlags=function(e){return this.featureFlags.onFeatureFlags(e)},t.onSurveysLoaded=function(e){return this.surveys.onSurveysLoaded(e)},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.getSurveys(e,t)},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)},t.renderSurvey=function(e,t){this.surveys.renderSurvey(e,t)},t.canRenderSurvey=function(e){return this.surveys.canRenderSurvey(e)},t.canRenderSurveyAsync=function(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)},t.identify=function(e,t,n){if(!this.__loaded||!this.persistence)return Ts.uninitializedWarning("posthog.identify");if(Ss(e)&&(e=e.toString(),Ts.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))Ts.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(td)&&(this.unregister(td),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Fd)||"anonymous");e!==r&&o?(this.persistence.set_property(Fd,"identified"),this.setPersonPropertiesForFlags(ki({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=Ku(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Id))}}else Ts.error("Unique user id has not been set in posthog.identify")},t.setPersonProperties=function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=Ku(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags(ki({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n):Ts.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.group=function(e,t,n){var r;if(e&&t){if(this._requirePersonProcessing("posthog.group")){var i,o=this.getGroups();if(o[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ki({},o,(r={},r[e]=t,r))}),n)this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(((i={})[e]=n,i));o[e]===t||n||this.reloadFeatureFlags()}}else Ts.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){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)},t.resetPersonPropertiesForFlags=function(){this.featureFlags.resetPersonPropertiesForFlags()},t.setGroupPropertiesForFlags=function(e,t){void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)},t.resetGroupPropertiesForFlags=function(e){this.featureFlags.resetGroupPropertiesForFlags(e)},t.reset=function(e){var t,n,r,i;if(Ts.info("reset"),!this.__loaded)return Ts.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(n=this.sessionPersistence)||n.clear(),this.surveys.reset(),null==(r=this.persistence)||r.set_property(Fd,"anonymous"),null==(i=this.sessionManager)||i.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Dd,$device_id:null},"");else{var s=this.config.get_device_id(na());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)},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.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(null!=e&&e.withTimestamp&&r){var o,s=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i},t.alias=function(e,t){return e===this.get_property(ed)?(Ts.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(gs(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(td,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Ts.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t,n,r,i,o=ki({},this.config);hs(e)&&(Ms(this.config,oh(e)),null==(t=this.persistence)||t.update_config(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new E_(ki({},this.config,{persistence:"sessionStorage"})),Tf._is_supported()&&"true"===Tf._get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(ts.DEBUG=!0,Ts.info("set_config",JSON.stringify({config:e,oldConfig:o,newConfig:ki({},this.config)},null,2))),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(i=this.heatmaps)||i.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())},t.startSessionRecording=function(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,i,o,s,a;if(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),n.sampling)null==(i=this.sessionRecording)||i.overrideSampling();if(n.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(n.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(n.event_trigger)null==(a=this.sessionRecording)||a.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){var n=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(ki({},Gc(function(e){return e instanceof Error}(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))},t.loadToolbar=function(e){return this.toolbar.loadToolbar(e)},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:nh;return t!==nh&&(t=nh+"."+t),t},t._isIdentified=function(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Fd))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Fd))},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&vs(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[td])&&(null==(t=this.persistence)||null==(t=t.props)||!t[$d]))},t._shouldCapturePageleave=function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)},t.createPersonProfile=function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})},t._requirePersonProcessing=function(e){return"never"===this.config.person_profiles?(Ts.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single($d,!0),!0)},t._sync_opt_out_with_persistence=function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null==(e=this.persistence)?void 0:e._disabled)!==s&&(null==(n=this.persistence)||n.set_disabled(s));(null==(t=this.sessionPersistence)?void 0:t._disabled)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s))},t.opt_in_capturing=function(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),gs(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()},t.opt_out_capturing=function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()},t.has_opted_in_capturing=function(){return this.consent.isOptedIn()},t.has_opted_out_capturing=function(){return this.consent.isOptedOut()},t.clear_opt_in_out_capturing=function(){this.consent.reset(),this._sync_opt_out_with_persistence()},t._is_bot=function(){return Go?Z_(Go,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Zo&&("visible"===Zo.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Zo.title},{send_instantly:!0}),this._visibilityStateListener&&(Zo.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),js(Zo,"visibilitychange",this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==jo||jo.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==jo||jo.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))},t._runBeforeSend=function(e){if(ws(this.config.before_send))return e;for(var t,n=e,r=Si(ps(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(t=r()).done;){if(n=(0,t.value)(n),ws(n)){var i="Event '"+e.event+"' was rejected in beforeSend function";return Es(e.event)?Ts.warn(i+". This can cause unexpected behavior."):Ts.info(i),null}n.properties&&!vs(n.properties)||Ts.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n},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)})},wi(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}}])}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=$s(e.prototype[t[n]])}(ah,["identify"]);var uh,lh;uh=eh[nh]=new ah,(lh=es.posthog)&&Rs(lh._i,(function(e){if(e&&ps(e)){var t=uh.init(e[0],e[1],e[2]),n=lh[e[2]]||lh;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),es.posthog=uh,function(){function e(){e.done||(e.done=!0,rh=!1,Rs(eh,(function(e){e._dom_loaded()})))}null!=Zo&&Zo.addEventListener?"complete"===Zo.readyState?e():js(Zo,"DOMContentLoaded",e,{capture:!1}):jo&&Ts.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
1
+ !function(){"use strict";var e,t,n,r,i,o,s,a,u,l,c,d,f,p,_,h,v,g,m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(){return t?e:(t=1,e=function(e){try{return!!e()}catch(e){return!0}})}function b(){if(r)return n;r=1;var e=y();return n=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function w(){if(o)return i;o=1;var e=b(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return i=e?r:function(e){return function(){return n.apply(e,arguments)}},i}function S(){if(a)return s;a=1;var e=w(),t=e({}.toString),n=e("".slice);return s=function(e){return n(t(e),8,-1)}}function k(){return d?c:(d=1,c=function(e){return null==e})}function x(){if(p)return f;p=1;var e=k(),t=TypeError;return f=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function E(){if(h)return _;h=1;var e=function(){if(l)return u;l=1;var e=w(),t=y(),n=S(),r=Object,i=e("".split);return u=t((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?i(e,""):r(e)}:r}(),t=x();return _=function(n){return e(t(n))}}function C(){if(g)return v;g=1;var e=function(e){return e&&e.Math===Math&&e};return v=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof m&&m)||e("object"==typeof v&&v)||function(){return this}()||Function("return this")()}var T,P,I,F,R,M,O,L,q,$,A,D,N,H,B,j,z,U,V,W,G,Z,Q,Y,J,X,K,ee,te,ne={exports:{}};function re(){return P?T:(P=1,T=!1)}function ie(){if(F)return I;F=1;var e=C(),t=Object.defineProperty;return I=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function oe(){if(R)return ne.exports;R=1;var e=re(),t=C(),n=ie(),r="__core-js_shared__",i=ne.exports=t[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.38.1",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"}),ne.exports}function se(){if(O)return M;O=1;var e=oe();return M=function(t,n){return e[t]||(e[t]=n||{})}}function ae(){if(q)return L;q=1;var e=x(),t=Object;return L=function(n){return t(e(n))}}function ue(){if(A)return $;A=1;var e=w(),t=ae(),n=e({}.hasOwnProperty);return $=Object.hasOwn||function(e,r){return n(t(e),r)}}function le(){if(N)return D;N=1;var e=w(),t=0,n=Math.random(),r=e(1..toString);return D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function ce(){if(z)return j;z=1;var e,t,n=C(),r=function(){if(B)return H;B=1;var e=C().navigator,t=e&&e.userAgent;return H=t?String(t):""}(),i=n.process,o=n.Deno,s=i&&i.versions||o&&o.version,a=s&&s.v8;return a&&(t=(e=a.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),j=t}function de(){if(V)return U;V=1;var e=ce(),t=y(),n=C().String;return U=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function fe(){if(G)return W;G=1;var e=de();return W=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function pe(){if(Q)return Z;Q=1;var e=C(),t=se(),n=ue(),r=le(),i=de(),o=fe(),s=e.Symbol,a=t("wks"),u=o?s.for||s:s&&s.withoutSetter||r;return Z=function(e){return n(a,e)||(a[e]=i&&n(s,e)?s[e]:u("Symbol."+e)),a[e]},Z}function _e(){if(J)return Y;J=1;var e="object"==typeof document&&document.all;return Y=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function he(){if(K)return X;K=1;var e=_e();return X=function(t){return"object"==typeof t?null!==t:e(t)}}function ve(){if(te)return ee;te=1;var e=he(),t=String,n=TypeError;return ee=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}var ge,me,ye,be,we={};function Se(){if(me)return ge;me=1;var e=y();return ge=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function ke(){if(be)return ye;be=1;var e=Se(),t=y();return ye=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}var xe,Ee,Ce,Te,Pe,Ie,Fe,Re,Me,Oe,Le,qe,$e,Ae,De,Ne,He,Be,je,ze,Ue,Ve,We,Ge,Ze,Qe,Ye,Je,Xe,Ke,et,tt,nt,rt,it,ot,st,at,ut,lt,ct,dt,ft,pt,_t,ht,vt,gt,mt,yt,bt,wt,St,kt,xt,Et,Ct,Tt,Pt,It,Ft,Rt,Mt,Ot,Lt={};function qt(){if(Ee)return xe;Ee=1;var e=C(),t=he(),n=e.document,r=t(n)&&t(n.createElement);return xe=function(e){return r?n.createElement(e):{}}}function $t(){if(Te)return Ce;Te=1;var e=Se(),t=y(),n=qt();return Ce=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function At(){if(Ie)return Pe;Ie=1;var e=b(),t=Function.prototype.call;return Pe=e?t.bind(t):function(){return t.apply(t,arguments)},Pe}function Dt(){if(Re)return Fe;Re=1;var e=C(),t=_e();return Fe=function(n,r){return arguments.length<2?(i=e[n],t(i)?i:void 0):e[n]&&e[n][r];var i},Fe}function Nt(){if(Oe)return Me;Oe=1;var e=w();return Me=e({}.isPrototypeOf)}function Ht(){if(qe)return Le;qe=1;var e=Dt(),t=_e(),n=Nt(),r=fe(),i=Object;return Le=r?function(e){return"symbol"==typeof e}:function(r){var o=e("Symbol");return t(o)&&n(o.prototype,i(r))}}function Bt(){if(Ae)return $e;Ae=1;var e=String;return $e=function(t){try{return e(t)}catch(e){return"Object"}}}function jt(){if(Ne)return De;Ne=1;var e=_e(),t=Bt(),n=TypeError;return De=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function zt(){if(Be)return He;Be=1;var e=jt(),t=k();return He=function(n,r){var i=n[r];return t(i)?void 0:e(i)},He}function Ut(){if(ze)return je;ze=1;var e=At(),t=_e(),n=he(),r=TypeError;return je=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")}}function Vt(){if(Ve)return Ue;Ve=1;var e=At(),t=he(),n=Ht(),r=zt(),i=Ut(),o=pe(),s=TypeError,a=o("toPrimitive");return Ue=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 Wt(){if(Ge)return We;Ge=1;var e=Vt(),t=Ht();return We=function(n){var r=e(n,"string");return t(r)?r:r+""}}function Gt(){if(Ze)return Lt;Ze=1;var e=Se(),t=$t(),n=ke(),r=ve(),i=Wt(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Lt.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},Lt}function Zt(){if(Xe)return Je;Xe=1;var e=function(){if(Ye)return Qe;Ye=1;var e=Math.ceil,t=Math.floor;return Qe=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},Qe}();return Je=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function Qt(){if(et)return Ke;et=1;var e=Zt(),t=Math.max,n=Math.min;return Ke=function(r,i){var o=e(r);return o<0?t(o+i,0):n(o,i)}}function Yt(){if(nt)return tt;nt=1;var e=Zt(),t=Math.min;return tt=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function Jt(){if(it)return rt;it=1;var e=Yt();return rt=function(t){return e(t.length)}}function Xt(){return ut?at:(ut=1,at={})}function Kt(){if(ct)return lt;ct=1;var e=w(),t=ue(),n=E(),r=function(){if(st)return ot;st=1;var e=E(),t=Qt(),n=Jt(),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 ot={includes:r(!0),indexOf:r(!1)}}().indexOf,i=Xt(),o=e([].push);return lt=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},lt}function en(){return ft?dt:(ft=1,dt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function tn(){if(_t)return pt;_t=1;var e=Kt(),t=en();return pt=Object.keys||function(n){return e(n,t)},pt}function nn(){if(gt)return vt;gt=1;var e=Dt();return vt=e("document","documentElement")}function rn(){if(yt)return mt;yt=1;var e=se(),t=le(),n=e("keys");return mt=function(e){return n[e]||(n[e]=t(e))}}function on(){if(wt)return bt;wt=1;var e,t=ve(),n=function(){if(ht)return we;ht=1;var e=Se(),t=ke(),n=Gt(),r=ve(),i=E(),o=tn();return we.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},we}(),r=en(),i=Xt(),o=nn(),s=qt(),a=rn(),u="prototype",l="script",c=a("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+"</"+l+">"},p=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,i;_="undefined"!=typeof document?document.domain&&e?p(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):p(e);for(var a=r.length;a--;)delete _[u][r[a]];return _()};return i[c]=!0,bt=Object.create||function(e,r){var i;return null!==e?(d[u]=t(e),i=new d,d[u]=null,i[c]=e):i=_(),void 0===r?i:n.f(i,r)},bt}function sn(){if(kt)return St;kt=1;var e=pe(),t=on(),n=Gt().f,r=e("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:t(null)}),St=function(e){i[r][e]=!0}}function an(){return Et?xt:(Et=1,xt={})}function un(){return It?Pt:(It=1,Pt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function ln(){if(Rt)return Ft;Rt=1;var e=Se(),t=Gt(),n=un();return Ft=e?function(e,r,i){return t.f(e,r,n(1,i))}:function(e,t,n){return e[t]=n,e}}function cn(){if(Ot)return Mt;Ot=1;var e,t,n,r=function(){if(Tt)return Ct;Tt=1;var e=C(),t=_e(),n=e.WeakMap;return Ct=t(n)&&/native code/.test(String(n))}(),i=C(),o=he(),s=ln(),a=ue(),u=oe(),l=rn(),c=Xt(),d="Object already initialized",f=i.TypeError,p=i.WeakMap;if(r||u.state){var _=u.state||(u.state=new p);_.get=_.get,_.has=_.has,_.set=_.set,e=function(e,t){if(_.has(e))throw new f(d);return t.facade=e,_.set(e,t),t},t=function(e){return _.get(e)||{}},n=function(e){return _.has(e)}}else{var h=l("state");c[h]=!0,e=function(e,t){if(a(e,h))throw new f(d);return t.facade=e,s(e,h,t),t},t=function(e){return a(e,h)?e[h]:{}},n=function(e){return a(e,h)}}return Mt={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(!o(n)||(r=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}}var dn,fn,pn={},_n={};function hn(){if(fn)return pn;fn=1;var e=Se(),t=At(),n=function(){if(dn)return _n;dn=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return _n.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,_n}(),r=un(),i=E(),o=Wt(),s=ue(),a=$t(),u=Object.getOwnPropertyDescriptor;return pn.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])},pn}var vn,gn,mn,yn,bn,wn,Sn,kn={exports:{}};function xn(){if(gn)return vn;gn=1;var e=Se(),t=ue(),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 vn={EXISTS:i,PROPER:o,CONFIGURABLE:s}}function En(){if(yn)return mn;yn=1;var e=w(),t=_e(),n=oe(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),mn=n.inspectSource}function Cn(){if(bn)return kn.exports;bn=1;var e=w(),t=y(),n=_e(),r=ue(),i=Se(),o=xn().CONFIGURABLE,s=En(),a=cn(),u=a.enforce,l=a.get,c=String,d=Object.defineProperty,f=e("".slice),p=e("".replace),_=e([].join),h=i&&!t((function(){return 8!==d((function(){}),"length",{value:8}).length})),v=String(String).split("String"),g=kn.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+p(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),h&&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,"string"==typeof t?t:"")),e};return Function.prototype.toString=g((function(){return n(this)&&l(this).source||s(this)}),"toString"),kn.exports}function Tn(){if(Sn)return wn;Sn=1;var e=_e(),t=Gt(),n=Cn(),r=ie();return wn=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},wn}var Pn,In={};var Fn,Rn,Mn,On,Ln,qn,$n,An,Dn,Nn,Hn,Bn,jn,zn,Un,Vn,Wn,Gn,Zn,Qn,Yn,Jn,Xn,Kn,er,tr,nr,rr,ir,or,sr,ar,ur,lr={};function cr(){if(Mn)return Rn;Mn=1;var e=Dt(),t=w(),n=function(){if(Pn)return In;Pn=1;var e=Kt(),t=en().concat("length","prototype");return In.f=Object.getOwnPropertyNames||function(n){return e(n,t)},In}(),r=(Fn||(Fn=1,lr.f=Object.getOwnPropertySymbols),lr),i=ve(),o=t([].concat);return Rn=e("Reflect","ownKeys")||function(e){var t=n.f(i(e)),s=r.f;return s?o(t,s(e)):t}}function dr(){if(Ln)return On;Ln=1;var e=ue(),t=cr(),n=hn(),r=Gt();return On=function(i,o,s){for(var a=t(o),u=r.f,l=n.f,c=0;c<a.length;c++){var d=a[c];e(i,d)||s&&e(s,d)||u(i,d,l(o,d))}},On}function fr(){if(Dn)return An;Dn=1;var e=C(),t=hn().f,n=ln(),r=Tn(),i=ie(),o=dr(),s=function(){if($n)return qn;$n=1;var e=y(),t=_e(),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 qn=r}();return An=function(a,u){var l,c,d,f,p,_=a.target,h=a.global,v=a.stat;if(l=h?e:v?e[_]||i(_,{}):e[_]&&e[_].prototype)for(c in u){if(f=u[c],d=a.dontCallGetSet?(p=t(l,c))&&p.value:l[c],!s(h?c:_+(v?".":"#")+c,a.forced)&&void 0!==d){if(typeof f==typeof d)continue;o(f,d)}(a.sham||d&&d.sham)&&n(f,"sham",!0),r(l,c,f,a)}}}function pr(){if(jn)return Bn;jn=1;var e=ue(),t=_e(),n=ae(),r=rn(),i=function(){if(Hn)return Nn;Hn=1;var e=y();return Nn=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Nn}(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Bn=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},Bn}function _r(){if(Un)return zn;Un=1;var e,t,n,r=y(),i=_e(),o=he(),s=on(),a=pr(),u=Tn(),l=pe(),c=re(),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})),zn={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:f}}function hr(){if(Wn)return Vn;Wn=1;var e=Gt().f,t=ue(),n=pe()("toStringTag");return Vn=function(r,i,o){r&&!o&&(r=r.prototype),r&&!t(r,n)&&e(r,n,{configurable:!0,value:i})}}function vr(){if(Xn)return Jn;Xn=1;var e=he();return Jn=function(t){return e(t)||null===t}}function gr(){if(er)return Kn;er=1;var e=vr(),t=String,n=TypeError;return Kn=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function mr(){if(nr)return tr;nr=1;var e=function(){if(Yn)return Qn;Yn=1;var e=w(),t=jt();return Qn=function(n,r,i){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(e){}}}(),t=he(),n=x(),r=gr();return tr=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),tr}function yr(){if(ir)return rr;ir=1;var e=fr(),t=At(),n=re(),r=xn(),i=_e(),o=function(){if(Zn)return Gn;Zn=1;var e=_r().IteratorPrototype,t=on(),n=un(),r=hr(),i=an(),o=function(){return this};return Gn=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},Gn}(),s=pr(),a=mr(),u=hr(),l=ln(),c=Tn(),d=pe(),f=an(),p=_r(),_=r.PROPER,h=r.CONFIGURABLE,v=p.IteratorPrototype,g=p.BUGGY_SAFARI_ITERATORS,m=d("iterator"),y="keys",b="values",w="entries",S=function(){return this};return rr=function(r,d,p,k,x,E,C){o(p,d,k);var T,P,I,F=function(e){if(e===x&&q)return q;if(!g&&e&&e in O)return O[e];switch(e){case y:case b:case w:return function(){return new p(this,e)}}return function(){return new p(this)}},R=d+" Iterator",M=!1,O=r.prototype,L=O[m]||O["@@iterator"]||x&&O[x],q=!g&&L||F(x),$="Array"===d&&O.entries||L;if($&&(T=s($.call(new r)))!==Object.prototype&&T.next&&(n||s(T)===v||(a?a(T,v):i(T[m])||c(T,m,S)),u(T,R,!0,!0),n&&(f[R]=S)),_&&x===b&&L&&L.name!==b&&(!n&&h?l(O,"name",b):(M=!0,q=function(){return t(L,this)})),x)if(P={values:F(b),keys:E?q:F(y),entries:F(w)},C)for(I in P)(g||M||!(I in O))&&c(O,I,P[I]);else e({target:d,proto:!0,forced:g||M},P);return n&&!C||O[m]===q||c(O,m,q,{name:x}),f[d]=q,P},rr}function br(){return sr?or:(sr=1,or=function(e,t){return{value:e,done:t}})}function wr(){if(ur)return ar;ur=1;var e=E(),t=sn(),n=an(),r=cn(),i=Gt().f,o=yr(),s=br(),a=re(),u=Se(),l="Array Iterator",c=r.set,d=r.getterFor(l);ar=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 ar}var Sr,kr,xr,Er,Cr,Tr,Pr,Ir,Fr,Rr,Mr,Or,Lr,qr,$r,Ar,Dr,Nr,Hr,Br,jr,zr,Ur,Vr,Wr,Gr={};function Zr(){if(Er)return xr;Er=1;var e=function(){if(kr)return Sr;kr=1;var e=S(),t=w();return Sr=function(n){if("Function"===e(n))return t(n)}}(),t=jt(),n=b(),r=e(e.bind);return xr=function(e,i){return t(e),void 0===i?e:n?r(e,i):function(){return e.apply(i,arguments)}},xr}function Qr(){if(Tr)return Cr;Tr=1;var e=pe(),t=an(),n=e("iterator"),r=Array.prototype;return Cr=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function Yr(){if(Rr)return Fr;Rr=1;var e=function(){if(Ir)return Pr;Ir=1;var e={};return e[pe()("toStringTag")]="z",Pr="[object z]"===String(e)}(),t=_e(),n=S(),r=pe()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Fr=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},Fr}function Jr(){if(Or)return Mr;Or=1;var e=Yr(),t=zt(),n=k(),r=an(),i=pe()("iterator");return Mr=function(o){if(!n(o))return t(o,i)||t(o,"@@iterator")||r[e(o)]}}function Xr(){if(qr)return Lr;qr=1;var e=At(),t=jt(),n=ve(),r=Bt(),i=Jr(),o=TypeError;return Lr=function(s,a){var u=arguments.length<2?i(s):a;if(t(u))return n(e(u,s));throw new o(r(s)+" is not iterable")},Lr}function Kr(){if(Ar)return $r;Ar=1;var e=At(),t=ve(),n=zt();return $r=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 ei(){if(Nr)return Dr;Nr=1;var e=Zr(),t=At(),n=ve(),r=Bt(),i=Qr(),o=Jt(),s=Nt(),a=Xr(),u=Jr(),l=Kr(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return Dr=function(p,_,h){var v,g,m,y,b,w,S,k=h&&h.that,x=!(!h||!h.AS_ENTRIES),E=!(!h||!h.IS_RECORD),C=!(!h||!h.IS_ITERATOR),T=!(!h||!h.INTERRUPTED),P=e(_,k),I=function(e){return v&&l(v,"normal",e),new d(!0,e)},F=function(e){return x?(n(e),T?P(e[0],e[1],I):P(e[0],e[1])):T?P(e,I):P(e)};if(E)v=p.iterator;else if(C)v=p;else{if(!(g=u(p)))throw new c(r(p)+" is not iterable");if(i(g)){for(m=0,y=o(p);y>m;m++)if((b=F(p[m]))&&s(f,b))return b;return new d(!1)}v=a(p,g)}for(w=E?p.next:v.next;!(S=t(w,v)).done;){try{b=F(S.value)}catch(e){l(v,"throw",e)}if("object"==typeof b&&b&&s(f,b))return b}return new d(!1)}}function ti(){if(Br)return Hr;Br=1;var e=Se(),t=Gt(),n=un();return Hr=function(r,i,o){e?t.f(r,i,n(0,o)):r[i]=o}}function ni(){if(Ur)return zr;Ur=1;var e=C();return zr=e}function ri(){if(Wr)return Vr;Wr=1,wr(),function(){if(jr)return Gr;jr=1;var e=fr(),t=ei(),n=ti();e({target:"Object",stat:!0},{fromEntries:function(e){var r={};return t(e,(function(e,t){n(r,e,t)}),{AS_ENTRIES:!0}),r}})}();var e=ni();return Vr=e.Object.fromEntries}var ii,oi,si,ai,ui,li,ci,di,fi,pi,_i,hi,vi={};function gi(){if(ui)return vi;ui=1;var e=C(),t=oi?ii:(oi=1,ii={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(ai)return si;ai=1;var e=qt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return si=t===Object.prototype?void 0:t}(),r=wr(),i=ln(),o=hr(),s=pe()("iterator"),a=r.values,u=function(e,n){if(e){if(e[s]!==a)try{i(e,s,a)}catch(t){e[s]=a}if(o(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{i(e,u,r[u])}catch(t){e[u]=r[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);return u(n,"DOMTokenList"),vi}function mi(){if(fi)return di;fi=1;var e=function(){if(ci)return li;ci=1;var e=ri();return gi(),li=e}();return di=e}function yi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bi(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 wi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ci(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Si(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 yi(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)?yi(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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 ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ki.apply(null,arguments)}function xi(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 Ei(){Ei=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(e,t,n,r){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(t,n,r,i){var o=n&&n.prototype instanceof f?n:f,s=Object.create(o.prototype);return u(s,"_invoke",function(t,n,r){var i=1;return function(o,s){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw s;return{value:e,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===i)throw i=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=3;var l=c(t,n,r);if("normal"===l.type){if(i=r.done?4:2,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=4,r.method="throw",r.arg=l.arg)}}}(t,r,new x(i||[])),!0),s}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d={};function f(){}function p(){}function _(){}var h={};u(h,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(E([])));g&&g!==n&&r.call(g,o)&&(h=g);var m=_.prototype=f.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,s,a){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,a)}))}a(u.arg)}var i;u(this,"_invoke",(function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function w(t,n){var r=n.method,i=t.i[r];if(i===e)return n.delegate=null,"throw"===r&&t.i.return&&(n.method="return",n.arg=e,w(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=c(i,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var s=o.arg;return s?s.done?(n[t.r]=s.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function S(e){this.tryEntries.push(e)}function k(t){var n=t[4]||{};n.type="normal",n.arg=e,t[4]=n}function x(e){this.tryEntries=[[-1]],e.forEach(S,this),this.reset(!0)}function E(t){if(null!=t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return p.prototype=_,u(m,"constructor",_),u(_,"constructor",p),p.displayName=u(_,a,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},t.awrap=function(e){return{__await:e}},y(b.prototype),u(b.prototype,s,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new b(l(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},y(m),u(m,a,"Generator"),u(m,o,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},t.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(e){s.type="throw",s.arg=t,n.next=e}for(var i=n.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o[4],a=this.prev,u=o[1],l=o[2];if(-1===o[0])return r("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=e,r(u),!0;if(a<l)return r(l),!1}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var i=r;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[2]===e)return this.complete(n[4],n[3]),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]===e){var r=n[4];if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={i:E(t),r:n,n:r},"next"===this.method&&(this.arg=e),d}},t}function Ci(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,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}hi||(hi=1,function(){if(_i)return pi;_i=1;var e=mi();pi=e}());var Ti,Pi,Ii,Fi,Ri,Mi,Oi,Li,qi={},$i=[],Ai=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Di=Array.isArray;function Ni(e,t){for(var n in t)e[n]=t[n];return e}function Hi(e){var t=e.parentNode;t&&t.removeChild(e)}function Bi(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?Ti.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 ji(e,s,r,i,null)}function ji(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Ii:i,__i:-1,__u:0};return null==i&&null!=Pi.vnode&&Pi.vnode(o),o}function zi(e){return e.children}function Ui(e,t){this.props=e,this.context=t}function Vi(e,t){if(null==t)return e.__?Vi(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Vi(e):null}function Wi(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Wi(e)}}function Gi(e){(!e.__d&&(e.__d=!0)&&Fi.push(e)&&!Zi.__r++||Ri!==Pi.debounceRendering)&&((Ri=Pi.debounceRendering)||Mi)(Zi)}function Zi(){var e,t,n,r,i,o,s,a,u;for(Fi.sort(Oi);e=Fi.shift();)e.__d&&(t=Fi.length,r=void 0,o=(i=(n=e).__v).__e,a=[],u=[],(s=n.__P)&&((r=Ni({},i)).__v=i.__v+1,Pi.vnode&&Pi.vnode(r),no(s,r,i,n.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?Vi(i):o,!!(32&i.__u),u),r.__.__k[r.__i]=r,ro(a,r,u),r.__e!=o&&Wi(r)),Fi.length>t&&Fi.sort(Oi));Zi.__r=0}function Qi(e,t,n,r,i,o,s,a,u,l,c){var d,f,p,_,h,v=r&&r.__k||$i,g=t.length;for(n.__d=u,function(e,t,n){var r,i,o,s,a,u=t.length,l=n.length,c=l,d=0;for(e.__k=[],r=0;r<u;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?ji(null,i,null,null,i):Di(i)?ji(zi,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?ji(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=Ji(i,n,s=r+d,c),i.__i=a,o=null,-1!==a&&(c--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?c>u-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Vi(o)),so(o,o,!1),n[r]=null,c--);if(c)for(r=0;r<l;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Vi(o)),so(o,o))}(n,t,v),u=n.__d,d=0;d<g;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?qi:v[p.__i]||qi,p.__i=d,no(e,p,f,i,o,s,a,u,l,c),_=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&oo(f.ref,null,p),c.push(p.ref,p.__c||_,p)),null==h&&null!=_&&(h=_),65536&p.__u||f.__k===p.__k?u=Yi(p,u,e):"function"==typeof p.type&&void 0!==p.__d?u=p.__d:_&&(u=_.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=u,n.__e=h}function Yi(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Yi(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Ji(e,t,n,r){var i=e.key,o=e.type,s=n-1,a=n+1,u=t[n];if(null===u||u&&i==u.key&&o===u.type)return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((u=t[s])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return s;s--}if(a<t.length){if((u=t[a])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return a;a++}}return-1}function Xi(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ai.test(t)?n:n+"px"}function Ki(e,t,n,r,i){var o;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||Xi(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Xi(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?to:eo,o)):e.removeEventListener(t,o?to:eo,o);else{if(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&&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,n))}}function eo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Pi.event?Pi.event(e):e)}function to(e){return this.l[e.type+!0](Pi.event?Pi.event(e):e)}function no(e,t,n,r,i,o,s,a,u,l){var c,d,f,p,_,h,v,g,m,y,b,w,S,k,x,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=Pi.__b)&&c(t);e:if("function"==typeof E)try{if(g=t.props,m=(c=E.contextType)&&r[c.__c],y=c?m?m.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(g,y):(t.__c=d=new Ui(g,y),d.constructor=E,d.render=ao),m&&m.sub(d),d.props=g,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Ni({},d.__s)),Ni(d.__s,E.getDerivedStateFromProps(g,d.__s))),p=d.props,_=d.state,d.__v=t,f)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&g!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=g,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,_,h)}))}if(d.context=y,d.props=g,d.__P=e,d.__e=!1,w=Pi.__r,S=0,"prototype"in E&&E.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(r=Ni(Ni({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(h=d.getSnapshotBeforeUpdate(p,_)),Qi(e,Di(x=null!=c&&c.type===zi&&null==c.key?c.props.children:c)?x:[x],t,n,r,i,o,s,a,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),v&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=a,t.__u|=u?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Pi.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=io(n.__e,t,n,r,i,o,s,u,l);(c=Pi.diffed)&&c(t)}function ro(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)oo(n[r],n[++r],n[++r]);Pi.__c&&Pi.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Pi.__e(e,t.__v)}}))}function io(e,t,n,r,i,o,s,a,u){var l,c,d,f,p,_,h,v=n.props,g=t.props,m=t.type;if("svg"===m&&(i=!0),null!=o)for(l=0;l<o.length;l++)if((p=o[l])&&"setAttribute"in p==!!m&&(m?p.localName===m:3===p.nodeType)){e=p,o[l]=null;break}if(null==e){if(null===m)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,g.is&&g),o=null,a=!1}if(null===m)v===g||a&&e.data===g||(e.data=g);else{if(o=o&&Ti.call(e.childNodes),v=n.props||qi,!a&&null!=o)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)p=v[l],"children"==l||("dangerouslySetInnerHTML"==l?d=p:"key"===l||l in g||Ki(e,l,null,p,i));for(l in g)p=g[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?_=p:"checked"==l?h=p:"key"===l||a&&"function"!=typeof p||v[l]===p||Ki(e,l,p,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=""),Qi(e,Di(f)?f:[f],t,n,r,i&&"foreignObject"!==m,o,s,o?o[0]:n.__k&&Vi(n,0),a,u),null!=o)for(l=o.length;l--;)null!=o[l]&&Hi(o[l]);a||(l="value",void 0!==_&&(_!==e[l]||"progress"===m&&!_||"option"===m&&_!==v[l])&&Ki(e,l,_,v[l],!1),l="checked",void 0!==h&&h!==e[l]&&Ki(e,l,h,v[l],!1))}return e}function oo(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Pi.__e(e,n)}}function so(e,t,n){var r,i;if(Pi.unmount&&Pi.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||oo(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Pi.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&so(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Hi(e.__e),e.__=e.__e=e.__d=void 0}function ao(e,t,n){return this.constructor(e,n)}function uo(e,t,n){var r,i,o,s;Pi.__&&Pi.__(e,t),i=(r="function"==typeof n)?null:t.__k,o=[],s=[],no(t,e=(!r&&n||t).__k=Bi(zi,null,[e]),i||qi,qi,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Ti.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,s),ro(o,e,s)}function lo(e,t,n){var r,i,o,s,a=Ni({},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]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Ti.call(arguments,2):n),ji(e.type,a,r||e.key,i||e.ref,null)}Ti=$i.slice,Pi={__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}},Ii=0,Ui.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ni({},this.state),"function"==typeof e&&(e=e(Ni({},n),this.props)),e&&Ni(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Gi(this))},Ui.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Gi(this))},Ui.prototype.render=zi,Fi=[],Mi="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oi=function(e,t){return e.__v.__b-t.__v.__b},Zi.__r=0,Li=0;var co,fo,po,_o,ho=0,vo=[],go=[],mo=Pi.__b,yo=Pi.__r,bo=Pi.diffed,wo=Pi.__c,So=Pi.unmount;function ko(e,t){Pi.__h&&Pi.__h(fo,e,ho||t),ho=0;var n=fo.__H||(fo.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:go}),n.__[e]}function xo(e){return ho=1,function(e,t,n){var r=ko(co++,2);if(r.t=e,!r.__c&&(r.__=[qo(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=fo,!fo.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};fo.u=!0;var o=fo.shouldComponentUpdate,s=fo.componentWillUpdate;fo.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)},fo.shouldComponentUpdate=i}return r.__N||r.__}(qo,e)}function Eo(e,t){var n=ko(co++,3);!Pi.__s&&Lo(n.__H,t)&&(n.__=e,n.i=t,fo.__H.__h.push(n))}function Co(e){return ho=5,To((function(){return{current:e}}),[])}function To(e,t){var n=ko(co++,7);return Lo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Po(e){var t=fo.context[e.__c],n=ko(co++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(fo)),t.props.value):e.__}function Io(){for(var e;e=vo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mo),e.__H.__h.forEach(Oo),e.__H.__h=[]}catch(t){e.__H.__h=[],Pi.__e(t,e.__v)}}Pi.__b=function(e){fo=null,mo&&mo(e)},Pi.__r=function(e){yo&&yo(e),co=0;var t=(fo=e.__c).__H;t&&(po===fo?(t.__h=[],fo.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=go,e.__N=e.i=void 0}))):(t.__h.forEach(Mo),t.__h.forEach(Oo),t.__h=[],co=0)),po=fo},Pi.diffed=function(e){bo&&bo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==vo.push(t)&&_o===Pi.requestAnimationFrame||((_o=Pi.requestAnimationFrame)||Ro)(Io)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==go&&(e.__=e.__V),e.i=void 0,e.__V=go}))),po=fo=null},Pi.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Mo),e.__h=e.__h.filter((function(e){return!e.__||Oo(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Pi.__e(n,e.__v)}})),wo&&wo(e,t)},Pi.unmount=function(e){So&&So(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Mo(e)}catch(e){t=e}})),n.__H=void 0,t&&Pi.__e(t,n.__v))};var Fo="function"==typeof requestAnimationFrame;function Ro(e){var t,n=function(){clearTimeout(r),Fo&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Fo&&(t=requestAnimationFrame(n))}function Mo(e){var t=fo,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),fo=t}function Oo(e){var t=fo;e.__c=e.__(),fo=t}function Lo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function qo(e,t){return"function"==typeof t?t(e):t}var $o=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Ao=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Do=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e}({}),No=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Ho=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Bo=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),jo="undefined"!=typeof window?window:void 0,zo="undefined"!=typeof globalThis?globalThis:jo,Uo=Array.prototype,Vo=Uo.forEach,Wo=Uo.indexOf,Go=null==zo?void 0:zo.navigator,Zo=null==zo?void 0:zo.document,Qo=null==zo?void 0:zo.location,Yo=null==zo?void 0:zo.fetch,Jo=null!=zo&&zo.XMLHttpRequest&&"withCredentials"in new zo.XMLHttpRequest?zo.XMLHttpRequest:void 0,Xo=null==zo?void 0:zo.AbortController,Ko=null==Go?void 0:Go.userAgent,es=null!=jo?jo:{},ts={DEBUG:!1,LIB_VERSION:"1.246.0"},ns="$copy_autocapture",rs=["$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"],is=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),os=["fatal","error","warning","log","info","debug"];function ss(e,t){return-1!==e.indexOf(t)}var as=function(e){return e.trim()},us=function(e){return e.replace(/^\$/,"")};var ls=Array.isArray,cs=Object.prototype,ds=cs.hasOwnProperty,fs=cs.toString,ps=ls||function(e){return"[object Array]"===fs.call(e)},_s=function(e){return"function"==typeof e},hs=function(e){return e===Object(e)&&!ps(e)},vs=function(e){if(hs(e)){for(var t in e)if(ds.call(e,t))return!1;return!0}return!1},gs=function(e){return void 0===e},ms=function(e){return"[object String]"==fs.call(e)},ys=function(e){return ms(e)&&0===e.trim().length},bs=function(e){return null===e},ws=function(e){return gs(e)||bs(e)},Ss=function(e){return"[object Number]"==fs.call(e)},ks=function(e){return"[object Boolean]"===fs.call(e)},xs=function(e){return e instanceof FormData},Es=function(e){return ss(rs,e)},Cs=function(e){var t={_log:function(t){if(jo&&(ts.DEBUG||es.POSTHOG_DEBUG)&&!gs(jo.console)&&jo.console){for(var n=("__rrweb_original__"in jo.console[t]?jo.console[t].__rrweb_original__:jo.console[t]),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(void 0,[e].concat(i))}},info:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log.apply(t,["log"].concat(n))},warn:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log.apply(t,["warn"].concat(n))},error:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t._log.apply(t,["error"].concat(n))},critical:function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(t=console).error.apply(t,[e].concat(r))},uninitializedWarning:function(e){t.error("You must initialize PostHog before calling "+e)},createLogger:function(t){return Cs(e+" "+t)}};return t},Ts=Cs("[PostHog.js]"),Ps=Ts.createLogger,Is={};function Fs(e,t,n){if(ps(e))if(Vo&&e.forEach===Vo)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===Is)return}function Rs(e,t,n){if(!ws(e)){if(ps(e))return Fs(e,t,n);if(xs(e))for(var r,i=Si(e.entries());!(r=i()).done;){var o=r.value;if(t.call(n,o[1],o[0])===Is)return}else for(var s in e)if(ds.call(e,s)&&t.call(n,e[s],s)===Is)return}}var Ms=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Fs(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Os=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Fs(n,(function(t){Fs(t,(function(t){e.push(t)}))})),e};function Ls(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 qs=function(e){try{return e()}catch(e){return}},$s=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Ts.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ts.critical(e)}}},As=function(e){var t={};return Rs(e,(function(e,n){(ms(e)&&e.length>0||Ss(e))&&(t[n]=e)})),t};function Ds(e,t){return n=e,r=function(e){return ms(e)&&!bs(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),ps(t)?(o=[],Fs(t,(function(t){o.push(e(t))}))):(o={},Rs(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var Ns=["herokuapp.com","vercel.app","netlify.app"];function Hs(e){var t=null==e?void 0:e.hostname;if(!ms(t))return!1;for(var n,r=t.split(".").slice(-2).join("."),i=Si(Ns);!(n=i()).done;){if(r===n.value)return!1}return!0}function Bs(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function js(e,t,n,r){var i=null!=r?r:{},o=i.capture,s=void 0!==o&&o,a=i.passive,u=void 0===a||a;null==e||e.addEventListener(t,n,{capture:s,passive:u})}var zs=Ps("[Surveys]");function Us(e){return!(!e.start_date||e.end_date)}function Vs(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Ws(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Gs="seenSurvey_",Zs="inProgressSurvey_";Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ss(e)&&isFinite(e)&&Math.floor(e)===e});var Qs="0123456789abcdef",Ys=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)||t<0||n<0||r<0||i<0||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/Math.pow(2,8),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;t<this.bytes.length;t++)e=e+Qs.charAt(this.bytes[t]>>>4)+Qs.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e},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;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0},e}(),Js=function(){function e(){this._timestamp=0,this._counter=0,this._random=new ta}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(gs(e)){this._timestamp=0;var t=this.generateOrAbort();if(gs(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e},t.generateOrAbort=function(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Ys.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}(),Xs=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};jo&&!gs(jo.crypto)&&crypto.getRandomValues&&(Xs=function(e){return crypto.getRandomValues(e)});var Ks,ea,ta=function(){function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._cursor>=this._buffer.length&&(Xs(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),na=function(){return ra().toString()},ra=function(){return(Ks||(Ks=new Js)).generate()},ia="Mobile",oa="iOS",sa="Android",aa="Tablet",ua=sa+" "+aa,la="iPad",ca="Apple",da=ca+" Watch",fa="Safari",pa="BlackBerry",_a="Samsung",ha=_a+"Browser",va=_a+" Internet",ga="Chrome",ma=ga+" OS",ya=ga+" "+oa,ba="Internet Explorer",wa=ba+" "+ia,Sa="Opera",ka=Sa+" Mini",xa="Edge",Ea="Microsoft "+xa,Ca="Firefox",Ta=Ca+" "+oa,Pa="Nintendo",Ia="PlayStation",Fa="Xbox",Ra=sa+" "+ia,Ma=ia+" "+fa,Oa="Windows",La=Oa+" Phone",qa="Nokia",$a="Ouya",Aa="Generic",Da=Aa+" "+ia.toLowerCase(),Na=Aa+" "+aa.toLowerCase(),Ha="Konqueror",Ba="(\\d+(\\.\\d+)?)",ja=new RegExp("Version/"+Ba),za=new RegExp(Fa,"i"),Ua=new RegExp(Ia+" \\w+","i"),Va=new RegExp(Pa+" \\w+","i"),Wa=new RegExp(pa+"|PlayBook|BB10","i"),Ga={"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"};var Za=function(e,t){return t&&ss(t,ca)||function(e){return ss(e,fa)&&!ss(e,ga)&&!ss(e,sa)}(e)},Qa=function(e,t){return t=t||"",ss(e," OPR/")&&ss(e,"Mini")?ka:ss(e," OPR/")?Sa:Wa.test(e)?pa:ss(e,"IE"+ia)||ss(e,"WPDesktop")?wa:ss(e,ha)?va:ss(e,xa)||ss(e,"Edg/")?Ea:ss(e,"FBIOS")?"Facebook "+ia:ss(e,"UCWEB")||ss(e,"UCBrowser")?"UC Browser":ss(e,"CriOS")?ya:ss(e,"CrMo")||ss(e,ga)?ga:ss(e,sa)&&ss(e,fa)?Ra:ss(e,"FxiOS")?Ta:ss(e.toLowerCase(),Ha.toLowerCase())?Ha:Za(e,t)?ss(e,ia)?Ma:fa:ss(e,Ca)?Ca:ss(e,"MSIE")||ss(e,"Trident/")?ba:ss(e,"Gecko")?Ca:""},Ya=((ea={})[wa]=[new RegExp("rv:"+Ba)],ea[Ea]=[new RegExp(xa+"?\\/"+Ba)],ea[ga]=[new RegExp("("+ga+"|CrMo)\\/"+Ba)],ea[ya]=[new RegExp("CriOS\\/"+Ba)],ea["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/"+Ba)],ea[fa]=[ja],ea[Ma]=[ja],ea[Sa]=[new RegExp("(Opera|OPR)\\/"+Ba)],ea[Ca]=[new RegExp(Ca+"\\/"+Ba)],ea[Ta]=[new RegExp("FxiOS\\/"+Ba)],ea[Ha]=[new RegExp("Konqueror[:/]?"+Ba,"i")],ea[pa]=[new RegExp(pa+" "+Ba),ja],ea[Ra]=[new RegExp("android\\s"+Ba,"i")],ea[va]=[new RegExp(ha+"\\/"+Ba)],ea[ba]=[new RegExp("(rv:|MSIE )"+Ba)],ea.Mozilla=[new RegExp("rv:"+Ba)],ea),Ja=function(e,t){var n=Qa(e,t),r=Ya[n];if(gs(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},Xa=[[new RegExp(Fa+"; "+Fa+" (.*?)[);]","i"),function(e){return[Fa,e&&e[1]||""]}],[new RegExp(Pa,"i"),[Pa,""]],[new RegExp(Ia,"i"),[Ia,""]],[Wa,[pa,""]],[new RegExp(Oa,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[La,""];if(new RegExp(ia).test(t)&&!/IEMobile\b/.test(t))return[Oa+" "+ia,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Ga[r]||"";return/arm/i.test(t)&&(i="RT"),[Oa,i]}return[Oa,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[oa,t.join(".")]}return[oa,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=gs(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+sa+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+sa+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[sa,t.join(".")]}return[sa,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ma,""]],[/Linux|debian/i,["Linux",""]]],Ka=function(e){return Va.test(e)?Pa:Ua.test(e)?Ia:za.test(e)?Fa:new RegExp($a,"i").test(e)?$a:new RegExp("("+La+"|WPDesktop)","i").test(e)?La:/iPad/.test(e)?la:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?da:Wa.test(e)?pa:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(qa,"i").test(e)?qa:/(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(ia).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)?sa:ua:sa:new RegExp("(pda|"+ia+")","i").test(e)?Da:new RegExp(aa,"i").test(e)&&!new RegExp(aa+" pc","i").test(e)?Na:""},eu=function(e){var t=Ka(e);return t===la||t===ua||"Kobo"===t||"Kindle Fire"===t||t===Na?aa:t===Pa||t===Fa||t===Ia||t===$a?"Console":t===da?"Wearable":t?ia:"Desktop"},tu=["localhost","127.0.0.1"],nu=function(e){var t=null==Zo?void 0:Zo.createElement("a");return gs(t)?null:(t.href=e,t)},ru=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return Rs(e,(function(e,t){gs(e)||gs(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)},iu=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!ps(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){Ts.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},ou=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),c=[],d=0;d<l.length;d++){var f=l[d].split("=");ps(f)&&(t.includes(f[0])?c.push(f[0]+"="+n):c.push(l[d]))}var p=u;return null!=a&&(p+="?"+c.join("&")),null!=o&&(p+="#"+o),p},su=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},au=Uint8Array,uu=Uint16Array,lu=Uint32Array,cu=new au([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]),du=new au([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]),fu=new au([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pu=function(e,t){for(var n=new uu(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new lu(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},_u=pu(cu,2),hu=_u[0],vu=_u[1];hu[28]=258,vu[258]=28;for(var gu=pu(du,0)[1],mu=new uu(32768),yu=0;yu<32768;++yu){var bu=(43690&yu)>>>1|(21845&yu)<<1;bu=(61680&(bu=(52428&bu)>>>2|(13107&bu)<<2))>>>4|(3855&bu)<<4,mu[yu]=((65280&bu)>>>8|(255&bu)<<8)>>>1}var wu=function(e,t,n){for(var r=e.length,i=0,o=new uu(t);i<r;++i)++o[e[i]-1];var s,a=new uu(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new uu(1<<t);var u=15-t;for(i=0;i<r;++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;d<=f;++d)s[mu[d]>>>u]=l}else for(s=new uu(r),i=0;i<r;++i)s[i]=mu[a[e[i]-1]++]>>>15-e[i];return s},Su=new au(288);for(yu=0;yu<144;++yu)Su[yu]=8;for(yu=144;yu<256;++yu)Su[yu]=9;for(yu=256;yu<280;++yu)Su[yu]=7;for(yu=280;yu<288;++yu)Su[yu]=8;var ku=new au(32);for(yu=0;yu<32;++yu)ku[yu]=5;var xu=wu(Su,9,0),Eu=wu(ku,5,0),Cu=function(e){return(e/8>>0)+(7&e&&1)},Tu=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof uu?uu:e instanceof lu?lu:au)(n-t);return r.set(e.subarray(t,n)),r},Pu=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Iu=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Fu=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new au(0),0];if(1==i){var s=new au(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[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new uu(f+1),_=Ru(n[c-1],p,0);if(_>t){r=0;var h=0,v=_-t,g=1<<v;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var m=o[r].s;if(!(p[m]>t))break;h+=g-(1<<_-p[m]),p[m]=t}for(h>>>=v;h>0;){var y=o[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=o[r].s;p[b]==t&&(--p[b],++h)}_=t}return[new au(p),_]},Ru=function(e,t,n){return-1==e.s?Math.max(Ru(e.l,t,n+1),Ru(e.r,t,n+1)):t[e.s]=n},Mu=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new uu(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++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]},Ou=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Lu=function(e,t,n){var r=n.length,i=Cu(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;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},qu=function(e,t,n,r,i,o,s,a,u,l,c){Pu(t,c++,n),++i[256];for(var d=Fu(i,15),f=d[0],p=d[1],_=Fu(o,15),h=_[0],v=_[1],g=Mu(f),m=g[0],y=g[1],b=Mu(h),w=b[0],S=b[1],k=new uu(19),x=0;x<m.length;++x)k[31&m[x]]++;for(x=0;x<w.length;++x)k[31&w[x]]++;for(var E=Fu(k,7),C=E[0],T=E[1],P=19;P>4&&!C[fu[P-1]];--P);var I,F,R,M,O=l+5<<3,L=Ou(i,Su)+Ou(o,ku)+s,q=Ou(i,f)+Ou(o,h)+s+14+3*P+Ou(k,C)+(2*k[16]+3*k[17]+7*k[18]);if(O<=L&&O<=q)return Lu(t,c,e.subarray(u,u+l));if(Pu(t,c,1+(q<L)),c+=2,q<L){I=wu(f,p,0),F=f,R=wu(h,v,0),M=h;var $=wu(C,T,0);Pu(t,c,y-257),Pu(t,c+5,S-1),Pu(t,c+10,P-4),c+=14;for(x=0;x<P;++x)Pu(t,c+3*x,C[fu[x]]);c+=3*P;for(var A=[m,w],D=0;D<2;++D){var N=A[D];for(x=0;x<N.length;++x){var H=31&N[x];Pu(t,c,$[H]),c+=C[H],H>15&&(Pu(t,c,N[x]>>>5&127),c+=N[x]>>>12)}}}else I=xu,F=Su,R=Eu,M=ku;for(x=0;x<a;++x)if(r[x]>255){H=r[x]>>>18&31;Iu(t,c,I[H+257]),c+=F[H+257],H>7&&(Pu(t,c,r[x]>>>23&31),c+=cu[H]);var B=31&r[x];Iu(t,c,R[B]),c+=M[B],B>3&&(Iu(t,c,r[x]>>>5&8191),c+=du[B])}else Iu(t,c,I[r[x]]),c+=F[r[x]];return Iu(t,c,I[256]),c+F[256]},$u=new lu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Au=function(){for(var e=new lu(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Du=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Au[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Nu=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new au(r+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?l=Lu(u,l,e.subarray(c,d)):(u[c]=o,l=Lu(u,l,e.subarray(c,s)))}else{for(var f=$u[t-1],p=f>>>13,_=8191&f,h=(1<<n)-1,v=new uu(32768),g=new uu(h+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&h},w=new lu(25e3),S=new uu(288),k=new uu(32),x=0,E=0,C=(c=0,0),T=0,P=0;c<s;++c){var I=b(c),F=32767&c,R=g[I];if(v[F]=R,g[I]=F,T<=c){var M=s-c;if((x>7e3||C>24576)&&M>423){l=qu(e,u,0,w,S,k,E,C,P,c-P,l),C=x=E=0,P=c;for(var O=0;O<286;++O)S[O]=0;for(O=0;O<30;++O)k[O]=0}var L=2,q=0,$=_,A=F-R&32767;if(M>2&&I==b(c-A))for(var D=Math.min(p,M)-1,N=Math.min(32767,c),H=Math.min(258,M);A<=N&&--$&&F!=R;){if(e[c+L]==e[c+L-A]){for(var B=0;B<H&&e[c+B]==e[c+B-A];++B);if(B>L){if(L=B,q=A,B>D)break;var j=Math.min(A,B-2),z=0;for(O=0;O<j;++O){var U=c-A+O+32768&32767,V=U-v[U]+32768&32767;V>z&&(z=V,R=U)}}}A+=(F=R)-(R=v[F])+32768&32767}if(q){w[C++]=268435456|vu[L]<<18|gu[q];var W=31&vu[L],G=31&gu[q];E+=cu[W]+du[G],++S[257+W],++k[G],T=c+L,++x}else w[C++]=e[c],++S[e[c]]}}l=qu(e,u,o,w,S,k,E,C,P,c-P,l)}return Tu(a,0,r+Cu(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Hu=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Bu=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Hu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},ju=function(e){return 10+(e.filename&&e.filename.length+1||0)};function zu(e,t){void 0===t&&(t={});var n=Du(),r=e.length;n.p(e);var i=Nu(e,t,ju(t),8),o=i.length;return Bu(i,t),Hu(i,o-8,n.d()),Hu(i,o-4,r),i}function Uu(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new au(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new au(i+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(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 Tu(r,0,i)}var Vu=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),bs(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Wu=!!Jo||!!Yo,Gu="text/plain",Zu=function(e,t){var n=e.split("?"),r=n[0],i=n[1],o=ki({},t);null==i||i.split("&").forEach((function(e){var t=e.split("=")[0];delete o[t]}));var s=ru(o);return r+"?"+(s=s?(i?i+"&":"")+s:i)},Qu=function(e,t){return JSON.stringify(e,(function(e,t){return"bigint"==typeof t?t.toString():t}),t)},Yu=function(e){var t=e.data,n=e.compression;if(t){if(n===is.GZipJS){var r=zu(Uu(Qu(t)),{mtime:0}),i=new Blob([r],{type:Gu});return{contentType:Gu,body:i,estimatedSize:i.size}}if(n===is.Base64){var o=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",c=[];if(!e)return e;e=Vu(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Qu(t)),s=function(e){return"data="+encodeURIComponent("string"==typeof e?e:Qu(e))}(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Qu(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Ju=[];Yo&&Ju.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=Yu(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,s=r.estimatedSize,a=new Headers;Rs(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var u=e.url,l=null;if(Xo){var c=new Xo;l={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}Yo(u,ki({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null==(n=l)?void 0:n.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){Ts.error(e)}null==e.callback||e.callback(r)}))})).catch((function(t){Ts.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((function(){return l?clearTimeout(l.timeout):null}))}}),Jo&&Ju.push({transport:"XHR",method:function(e){var t,n=new Jo;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Yu(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;Rs(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,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(o)}}),null!=Go&&Go.sendBeacon&&Ju.push({transport:"sendBeacon",method:function(e){var t=Zu(e.url,{beacon:"1"});try{var n,r=null!==(n=Yu(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,s="string"==typeof o?new Blob([o],{type:i}):o;Go.sendBeacon(t,s)}catch(e){}}});var Xu=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Ku(e,t,n){return Qu({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var el={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 Xu(t,e)}))}))},not_regex:function(e,t){return t.every((function(t){return e.every((function(e){return!Xu(t,e)}))}))},icontains:function(e,t){return t.map(tl).some((function(t){return e.map(tl).some((function(e){return t.includes(e)}))}))},not_icontains:function(e,t){return t.map(tl).every((function(t){return e.map(tl).every((function(e){return!t.includes(e)}))}))}},tl=function(e){return e.toLowerCase()},nl=Ps("[Stylesheet Loader]"),rl=jo,il=Zo;function ol(e){return"$survey_response_"+e}var sl="#020617",al={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:Ao.Right,widgetColor:"#e0a045",zIndex:"2147483647",disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",inputBackground:"white",boxPadding:"20px 24px",borderRadius:"10px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"};function ul(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ll(e){var t;void 0===e&&(e=al.backgroundColor),"#"===e[0]&&(t=ul(e)),e.startsWith("rgb")&&(t=e);var n=function(e){return{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()]}(e);if(n&&(t=ul(n)),!t)return sl;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?sl:"white"}return sl}function cl(e){var t=function(e,t,n){var r,i=e.createElement("style");return i.innerText=t,null!=n&&null!=(r=n.config)&&r.prepare_external_dependency_stylesheet&&(i=n.config.prepare_external_dependency_stylesheet(i)),i||(nl.error("prepare_external_dependency_stylesheet returned null"),null)}(il,':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:2147483647;--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 rgba(0,0,0,.15);--ph-survey-disabled-button-opacity:0.6;--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-survey-input-background:#fff;--ph-survey-input-focus-shadow:rgba(0,0,0,.15);--ph-survey-choice-border-hover:rgba(0,0,0,.4);--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-input-text-color:#020617;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;font-family:inherit;font-size:1rem;font-weight:500;padding:10px 12px;position:fixed;right:0;text-align:center;top:50%;transform:rotate(-90deg) translateY(-100%);transform-origin:right top;transition:padding-bottom .1s ease-in-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover{padding-bottom:16px}@keyframes ph-survey-fade-in-up{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes ph-survey-fade-out-down{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(10px)}}@keyframes ph-survey-question-slide-in{0%{opacity:.5;transform:translateX(15px)}to{opacity:1;transform:translateX(0)}}.survey-container{bottom:0;height:fit-content;margin:0;max-width:85%;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.survey-box,.thank-you-message-container{display:flex;flex-direction:column;gap:16px}.bottom-section{display:flex;flex-direction:column;gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message-container{animation:ph-survey-question-slide-in .25s ease-out forwards;display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form,.thank-you-message{animation:ph-survey-fade-in-up .3s ease-out forwards;background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family);font-weight:400;margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{background:var(--ph-survey-input-background);color:var(--ph-survey-input-text-color)}@media (max-width:768px){.survey-form input[type=text],.survey-form textarea{font-size:1rem}}.survey-form input[type=text],.survey-form textarea{font-family:inherit}.survey-form textarea{border:1.5px solid var(--ph-survey-border-color);border-radius:6px;box-sizing:border-box;outline:none;padding:10px;width:100%}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{display:flex;flex-direction:column;font-size:14px;gap:8px}.multiple-choice-options .choice-option{cursor:pointer;display:flex;font-size:13px;position:relative}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) label{border-color:var(--ph-survey-text-subtle-color)}:is(.multiple-choice-options .choice-option):hover:not(:has(input:checked)) .choice-check{opacity:.5}.multiple-choice-options input{cursor:pointer;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;z-index:1}:is(.multiple-choice-options input):checked+label{border:1.5px solid var(--ph-survey-text-subtle-color);font-weight:700}:is(:is(.multiple-choice-options input):checked+label)+.choice-check{opacity:1}:is(:is(.multiple-choice-options input):checked+label) input{font-weight:700}.multiple-choice-options label{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;box-sizing:border-box;color:var(--ph-survey-input-text-color);cursor:pointer;display:block;padding:10px 35px 10px 10px;position:relative;transition:border-color .15s ease,background-color .15s ease;width:100%}:is(.multiple-choice-options .choice-option-open) label{display:flex;flex-wrap:wrap;gap:4px;padding-right:10px}:is(.multiple-choice-options .choice-option-open) label span{width:100%}:is(.multiple-choice-options .choice-option-open) label input{border:0;flex-grow:1;opacity:1;outline:0;position:relative;z-index:2}:is(:is(.multiple-choice-options .choice-option-open) label input)::placeholder{color:var(--ph-survey-text-subtle-color)}.choice-check{background:transparent;color:var(--ph-survey-input-text-color);opacity:0;pointer-events:none;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:opacity .15s ease;z-index:2}.choice-check svg{fill:var(--ph-survey-rating-bg-color);display:block;height:16px;width:16px}.rating-options-emoji{display:flex;justify-content:space-between}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0;transition:transform .15s ease,opacity .15s ease}.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)}.rating-options-number{border:1.5px solid var(--ph-survey-border-color);border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number>.ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;text-align:center;transition:background-color .15s ease,color .15s ease}:is(.rating-options-number>.ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number>.ratings-number){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;font-size:16px;font-weight:600;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:1.5px solid transparent;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);box-sizing:border-box;color:var(--ph-survey-submit-button-text-color);cursor:pointer;display:inline-block;font-family:inherit;font-size:14px;font-weight:700;margin:0;outline:0;overflow:visible;padding:12px;position:relative;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.12);text-transform:none;touch-action:manipulation;transition:transform .15s ease,box-shadow .15s ease;user-select:none;white-space:nowrap;width:100%}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;filter:grayscale(50%);opacity:var(--ph-survey-disabled-button-opacity)}.form-cancel{background:#fff;border:1.5px solid var(--ph-survey-border-color);border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%);transition:opacity .15s ease,transform .15s ease}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;color:var(--ph-survey-text-primary-color);display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-align:center;text-decoration:none;transition:opacity .15s ease}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{color:var(--ph-survey-text-primary-color);font-size:16px;font-weight:600;margin:10px 0 0}.thank-you-message-body{color:var(--ph-survey-text-primary-color);font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.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}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.bolded{font-weight:600}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var dl=function(e,t,n){var r=Rl(e),i=il.querySelector("."+r);if(i&&i.shadowRoot)return i.shadowRoot;var o=il.createElement("div");!function(e,t,n){var r=ki({},al,n),i=e.style,o=[Ao.Center,Ao.Left,Ao.Right].includes(r.position);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||t===Do.Widget&&(null==n?void 0:n.widgetType)!==$o.Tab?(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)||ll(r.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),i.setProperty("--ph-survey-rating-text-color",ll(r.ratingButtonColor)),i.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",ll(r.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",ll(r.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),i.setProperty("--ph-survey-input-background",r.inputBackground),i.setProperty("--ph-survey-input-text-color",ll(r.inputBackground)),i.setProperty("--ph-widget-color",r.widgetColor),i.setProperty("--ph-widget-text-color",ll(r.widgetColor)),i.setProperty("--ph-widget-z-index",r.zIndex),"white"===r.backgroundColor&&i.setProperty("--ph-survey-input-background","#f8f8f8")}(o,e.type,e.appearance),o.className=r;var s=o.attachShadow({mode:"open"}),a=cl(t);if(a){var u=s.querySelector("style");u&&s.removeChild(u),s.appendChild(a)}return il.body.appendChild(o),s},fl=function(e,t){if(!t)return null;var n=e[ol(t)];return ps(n)?[].concat(n):n},pl=function(e){var t,n=e.responses,r=e.survey,i=e.surveySubmissionId,o=e.posthog,s=e.isSurveyCompleted;o?(localStorage.setItem(yl(r),"true"),o.capture("survey sent",ki({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((function(e){return{id:e.id,question:e.question,response:fl(n,e.id)}})),$survey_submission_id:i,$survey_completed:s,sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},n,{$set:(t={},t[bl(r,"responded")]=!0,t)})),s&&(rl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Fl(r))):zs.error("[survey sent] event not captured, PostHog instance not found.")},_l=function(e,t,n){var r;if(t){if(!n){var i=Pl(e);t.capture("survey dismissed",ki({$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,$survey_partially_completed:Object.values((null==i?void 0:i.responses)||{}).filter((function(e){return!ws(e)})).length>0,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()},null==i?void 0:i.responses,{$survey_submission_id:null==i?void 0:i.surveySubmissionId,$survey_questions:e.questions.map((function(e){return{id:e.id,question:e.question,response:fl((null==i?void 0:i.responses)||{},e.id)}})),$set:(r={},r[bl(e,"dismissed")]=!0,r)})),Fl(e),localStorage.setItem(yl(e),"true"),rl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else zs.error("[survey dismissed] event not captured, PostHog instance not found.")},hl=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}))},vl=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},gl=function(e){return e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?vl(e.questions,hl(e.questions)):e.questions},ml=function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!function(e){var t,n;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}(e))||e.schedule===Bo.Always||Il(e)},yl=function(e){var t=""+Gs+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Gs+e.id+"_"+e.current_iteration),t},bl=function(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},wl=function(e,t){var n={__c:t="__cC"+Li++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Gi(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},surveySubmissionId:""}),Sl=function(){return Po(wl)},kl=function(e){var t=e.component,n=e.children,r=e.renderAsHtml,i=e.style;return lo(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})};function xl(e){return null!=e?e:"icontains"}function El(e){var t,n,r;if(null==(t=e.conditions)||!t.url)return!0;var i=null==rl||null==(n=rl.location)?void 0:n.href;if(!i)return!1;var o=[e.conditions.url],s=xl(null==(r=e.conditions)?void 0:r.urlMatchType);return el[s](o,[i])}var Cl=function(e){var t=""+Zs+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Zs+e.id+"_"+e.current_iteration),t},Tl=function(e,t){try{localStorage.setItem(Cl(e),JSON.stringify(t))}catch(e){zs.error("Error setting in-progress survey state in localStorage",e)}},Pl=function(e){try{var t=localStorage.getItem(Cl(e));if(t)return JSON.parse(t)}catch(e){zs.error("Error getting in-progress survey state from localStorage",e)}return null},Il=function(e){var t=Pl(e);return!ws(null==t?void 0:t.surveySubmissionId)},Fl=function(e){try{localStorage.removeItem(Cl(e))}catch(e){zs.error("Error clearing in-progress survey state from localStorage",e)}};function Rl(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}var Ml=0;function Ol(e,t,n,r,i,o){var s,a,u={};for(a in 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,__d:void 0,__c:null,constructor:void 0,__v:--Ml,__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 Pi.vnode&&Pi.vnode(l),l}var Ll=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),ql=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),$l=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),Al=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),Dl=Ol("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ol("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"})}),Nl=Ol("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ol("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:"black"})}),Hl=Ol("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ol("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ol("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ol("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ol("g",{mask:"url(#mask0_2415_6911)",children:[Ol("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"}),Ol("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"}),Ol("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"}),Ol("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"}),Ol("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"}),Ol("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"})]})]}),Ol("defs",{children:Ol("clipPath",{id:"clip0_2415_6911",children:Ol("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Bl=Ol("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ol("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"})});function jl(){return Ol("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Hl]})}function zl(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,o=e.link,s=e.onPreviewSubmit,a=e.skipSubmitButton,u=Po(wl).isPreviewMode;return Ol("div",{className:"bottom-section",children:[!a&&Ol("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){o&&(null==jo||jo.open(o)),u?null==s||s():i()},children:t}),!r.whiteLabel&&Ol(jl,{})]})}function Ul(e){var t=e.question,n=e.description,r=e.descriptionContentType,i=e.forceDisableHtml;return Ol("div",{className:"question-header",children:[Ol("div",{className:"survey-question",children:t}),n&&kl({component:Bi("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function Vl(e){return Ol("button",{className:"form-cancel",onClick:e.onClick,disabled:Po(wl).isPreviewMode,"aria-label":"Close survey",type:"button",children:Nl})}function Wl(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=Po(wl).isPopup;return Ol("div",{className:"thank-you-message",children:[a&&Ol(Vl,{onClick:function(){return s()}}),Ol("div",{className:"thank-you-message-container",children:[Ol("h3",{className:"thank-you-message-header",children:t}),n&&kl({component:Bi("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&Ol(zl,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})]})}function Gl(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=e.onPreviewSubmit,s=e.initialValue,a=xo((function(){return ms(s)?s:""})),u=a[0],l=a[1];return Ol(zi,{children:[Ol("div",{className:"question-container",children:[Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ol("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:function(e){l(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation()},value:u})]}),Ol(zl,{text:t.buttonText||"Submit",submitDisabled:!u&&!t.optional,appearance:r,onSubmit:function(){return i(u)},onPreviewSubmit:function(){return o(u)}})]})}function Zl(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=e.onPreviewSubmit;return Ol(zi,{children:[Ol("div",{className:"question-container",children:Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n})}),Ol(zl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:function(){return i("link clicked")},onPreviewSubmit:function(){return o("link clicked")}})]})}function Ql(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=e.initialValue,u=t.scale,l=10===t.scale?0:1,c=xo((function(){return Ss(a)?a:ps(a)&&a.length>0&&Ss(parseInt(a[0]))?parseInt(a[0]):ms(a)&&Ss(parseInt(a))?parseInt(a):null})),d=c[0],f=c[1],p=Sl().isPreviewMode,_=function(e){return p?s(e):o(e)};return Ol(zi,{children:[Ol("div",{className:"question-container",children:[Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ol("div",{className:"rating-section",children:[Ol("div",{className:"rating-options",children:["emoji"===t.display&&Ol("div",{className:"rating-options-emoji",children:(3===t.scale?Kl:ec).map((function(e,n){return Ol("button",{"aria-label":"Rate "+(n+1),className:"ratings-emoji question-"+r+"-rating-"+n+" "+(n+1===d?"rating-active":""),value:n+1,type:"button",onClick:function(){var e=n+1;f(e),t.skipSubmitButton&&_(e)},children:e},n)}))}),"number"===t.display&&Ol("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-l+1)+", minmax(0, 1fr))"},children:ic(t.scale).map((function(e,n){return Ol(Yl,{displayQuestionIndex:r,active:d===e,appearance:i,num:e,setActiveNumber:function(e){f(e),t.skipSubmitButton&&_(e)}},n)}))})]}),Ol("div",{className:"rating-text",children:[Ol("div",{children:t.lowerBoundLabel}),Ol("div",{children:t.upperBoundLabel})]})]})]}),Ol(zl,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:bs(d)&&!t.optional,appearance:i,onSubmit:function(){return o(d)},onPreviewSubmit:function(){return s(d)},skipSubmitButton:t.skipSubmitButton})]})}function Yl(e){var t=e.num,n=e.active,r=e.displayQuestionIndex,i=e.setActiveNumber;return Ol("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+r+"-rating-"+t+" "+(n?"rating-active":""),type:"button",onClick:function(){i(t)},children:t})}function Jl(e,t,n,r){if(r)return!1;if(bs(e))return!0;if(ps(e)){if(!t&&0===e.length)return!0;if(t&&!n&&0===e.length)return!0}return!1}function Xl(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=e.initialValue,u=Co(null),l=To((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=vl(t,hl(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),c=xo((function(){return ms(a)||ps(a)?a:t.type===No.SingleChoice?null:[]})),d=c[0],f=c[1],p=xo((function(){return ms(a)?!l.includes(a):!!ps(a)&&!l.some((function(e){return a.includes(e)}))})),_=p[0],h=p[1],v=xo((function(){return ms(a)&&!l.includes(a)?a:ps(a)&&a.find((function(e){return!l.includes(e)}))||""})),g=v[0],m=v[1],y=Sl().isPreviewMode,b=t.type===No.SingleChoice?"radio":"checkbox",w=t.skipSubmitButton&&t.type===No.SingleChoice&&!t.hasOpenChoice,S=function(e,n){return n?(h(!_),void(_||setTimeout((function(){var e;return null==(e=u.current)?void 0:e.focus()}),0))):t.type===No.SingleChoice?(f(e),h(!1),void(w&&(o(e),y&&s(e)))):void(t.type===No.MultipleChoice&&ps(d)&&(d.includes(e)?f(d.filter((function(t){return t!==e}))):f([].concat(d,[e]))))};return Ol(zi,{children:[Ol("div",{className:"question-container",children:[Ol(Ul,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),Ol("div",{className:"multiple-choice-options limit-height",children:l.map((function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,o="choice-option"+(i?" choice-option-open":""),s=i?_:t.type===No.SingleChoice?d===e:ps(d)&&d.includes(e);return Ol("div",{className:o,children:[Ol("input",{type:b,id:"surveyQuestion"+r+"Choice"+n,name:"question"+r,checked:s,onClick:function(){return S(e,i)}}),Ol("label",{htmlFor:"surveyQuestion"+r+"Choice"+n,children:i?Ol(zi,{children:[Ol("span",{children:[e,":"]}),Ol("input",{type:"text",ref:u,id:"surveyQuestion"+r+"Choice"+n+"Open",name:"question"+r,value:g,onKeyDown:function(e){e.stopPropagation()},onInput:function(e){return function(e){e.stopPropagation(),m(e.currentTarget.value),t.type===No.SingleChoice&&f(e.currentTarget.value)}(e)},onClick:function(t){_||S(e,!0),t.stopPropagation()}})]}):e}),Ol("span",{className:"choice-check",children:Bl})]},n)}))})]}),Ol(zl,{text:t.buttonText||"Submit",submitDisabled:Jl(d,_,g,!!t.optional),appearance:i,onSubmit:function(){_&&t.type===No.MultipleChoice?ps(d)&&o([].concat(d,[g])):o(d)},onPreviewSubmit:function(){_&&t.type===No.MultipleChoice?ps(d)&&s([].concat(d,[g])):s(d)},skipSubmitButton:w})]})}var Kl=[$l,ql,Ll],ec=[Al,$l,ql,Ll,Dl],tc=[1,2,3,4,5],nc=[1,2,3,4,5,6,7],rc=[0,1,2,3,4,5,6,7,8,9,10];function ic(e){switch(e){case 5:default:return tc;case 7:return nc;case 10:return rc}}var oc=jo,sc=Zo,ac="ph:show_survey_widget";function uc(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?Ho.End:o;if(i.branching.type===Ho.End)return Ho.End;if(i.branching.type===Ho.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ho.ResponseBased){if(i.type===No.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===Ho.End?Ho.End:o}}else if(i.type===No.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(3===t){if(e<1||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(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 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===Ho.End?Ho.End:o}}return o}return zs.warn("Falling back to next question index due to unexpected branching type"),o}var lc=function(){function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._handlePopoverSurvey=function(e){var n,r,i=null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays;if(function(e,t){if(!t||!e)return!0;var n=new Date,r=Math.abs(n.getTime()-new Date(e).getTime());return Math.ceil(r/864e5)>t}(localStorage.getItem("lastSeenSurveyDate"),i)){var o=function(e){return!!localStorage.getItem(yl(e))&&!ml(e)}(e);if(!o){t._clearSurveyTimeout(e.id),t._addSurveyToFocus(e);var s=(null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0,a=dl(e,t._posthog);if(s<=0)return uo(Ol(pc,{posthog:t._posthog,survey:e,removeSurveyFromFocus:t._removeSurveyFromFocus}),a);var u=setTimeout((function(){if(!El(e))return t._removeSurveyFromFocus(e);uo(Ol(pc,{posthog:t._posthog,survey:ki({},e,{appearance:ki({},e.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:t._removeSurveyFromFocus}),a)}),1e3*s);t._surveyTimeouts.set(e.id,u)}}},this._handleWidget=function(e){var n=dl(e,t._posthog);uo(Ol(hc,{posthog:t._posthog,survey:e}),n)},this._removeWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute("PHWidgetSurveyClickListener"),t._widgetSelectorListeners.delete(e),zs.info("Removed click listener for survey "+e))},this._manageWidgetSelectorListener=function(e){var n,r=null==(n=e.appearance)?void 0:n.widgetSelector;if(r){var i=sc.querySelector(r),o=t._widgetSelectorListeners.get(e.id);if(i){if(t._handleWidget(e),o){if(i===o.element)return;zs.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._removeWidgetSelectorListener(e.id)}if(!i.hasAttribute("PHWidgetSurveyClickListener")){var s=function(t){var n,r;if(t.stopPropagation(),(null==(n=e.appearance)?void 0:n.position)===Ao.NextToTrigger){var i=t.currentTarget.getBoundingClientRect(),o=oc.innerHeight,s=oc.innerWidth,a=parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||"300"),u=i.left+i.width/2-a/2;u+a>s-20&&(u=s-a-20),u<20&&(u=20);var l=o-i.bottom,c=i.top,d=l<250&&c>l,f={position:"fixed",top:d?"auto":i.bottom+12+"px",left:u+"px",right:"auto",bottom:d?o-i.top+12+"px":"auto",zIndex:al.zIndex};oc.dispatchEvent(new CustomEvent(ac,{detail:{surveyId:e.id,position:f}}))}else oc.dispatchEvent(new CustomEvent(ac,{detail:{surveyId:e.id,position:{}}}))};js(i,"click",s),i.setAttribute("PHWidgetSurveyClickListener","true"),t._widgetSelectorListeners.set(e.id,{element:i,listener:s}),zs.info("Attached click listener for feedback button survey "+e.id)}}else o&&t._removeWidgetSelectorListener(e.id)}},this.renderSurvey=function(e,n){uo(Ol(pc,{posthog:t._posthog,survey:e,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1}),n)},this.getActiveMatchingSurveys=function(e,n){var r;void 0===n&&(n=!1),null==(r=t._posthog)||r.surveys.getSurveys((function(n){var r=n.filter((function(e){return t.checkSurveyEligibility(e).eligible&&t._isSurveyConditionMatched(e)&&t._hasActionOrEventTriggeredSurvey(e)&&t._checkFlags(e)}));e(r)}),n)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((function(e){var n=e.filter((function(e){return e.type!==Do.API})),r=t._sortSurveysByAppearanceDelay(n),i=new Set;r.forEach((function(e){var n,r,o;e.type===Do.Widget&&((null==(n=e.appearance)?void 0:n.widgetType)===$o.Tab?t._handleWidget(e):(null==(r=e.appearance)?void 0:r.widgetType)===$o.Selector&&null!=(o=e.appearance)&&o.widgetSelector&&(i.add(e.id),t._manageWidgetSelectorListener(e)));bs(t._surveyInFocus)&&e.type===Do.Popover&&t._handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((function(e,n){i.has(n)||t._removeWidgetSelectorListener(n)}))}),e)},this._addSurveyToFocus=function(e){bs(t._surveyInFocus)||zs.error("Survey "+[].concat(t._surveyInFocus)+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&zs.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),t._clearSurveyTimeout(e.id),t._surveyInFocus=null,uo(null,dl(e,t._posthog));var n=sc.querySelector(Rl(e,!0));null==n||n.remove()},this._posthog=e,this._surveyInFocus=null}var t=e.prototype;return t._clearSurveyTimeout=function(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))},t._sortSurveysByAppearanceDelay=function(e){return e.sort((function(e,t){var n,r,i=Il(e),o=Il(t);if(i&&!o)return-1;if(!i&&o)return 1;var s=e.schedule===Bo.Always,a=t.schedule===Bo.Always;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._isSurveyFeatureFlagEnabled=function(e){return!e||!!this._posthog.featureFlags.isFeatureEnabled(e)},t._isSurveyConditionMatched=function(e){return!e.conditions||El(e)&&function(e){var t,n,r;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(n=e.conditions)?void 0:n.deviceTypes.length))return!0;if(!Ko)return!1;var i=eu(Ko);return el[xl(null==(r=e.conditions)?void 0:r.deviceTypesMatchType)](e.conditions.deviceTypes,[i])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==il||!il.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){return ml(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||Il(e)},t.checkSurveyEligibility=function(e){var t={eligible:!0,reason:void 0};return Us(e)?this._isSurveyFeatureFlagEnabled(e.linked_flag_key)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?(this._internalFlagCheckSatisfied(e)||(t.eligible=!1,t.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress"),t):(t.eligible=!1,t.reason="Survey targeting feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey linked feature flag is not enabled",t):(t.eligible=!1,t.reason="Survey is not running. It was completed on "+e.end_date,t)},t._hasActionOrEventTriggeredSurvey=function(e){var t;if(!Vs(e)&&!Ws(e))return!0;var n=null==(t=this._posthog.surveys._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.key,r=e.value;return!t||!r||n._posthog.featureFlags.isFeatureEnabled(r)}))},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)}},e}();function cc(e){if(sc&&oc){var t=new lc(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function dc(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;Eo((function(){var e;if(!s&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===Do.Widget,o=El(t),s=(null==(e=t.appearance)?void 0:e.widgetType)===$o.Tab&&n;if(!o)return zs.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);s&&(zs.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};js(oc,"popstate",n),js(oc,"hashchange",n);var o=oc.history.pushState,a=oc.history.replaceState;return oc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),n()},oc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),n()},function(){oc.removeEventListener("popstate",n),oc.removeEventListener("hashchange",n),oc.history.pushState=o,oc.history.replaceState=a}}}),[s,t,r,i])}function fc(e,t,n){switch(void 0===t&&(t=Ao.Right),t){case Ao.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ao.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ao.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ao.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ao.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ao.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ao.Left:return{left:"30px"};case Ao.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Ao.Right:return{right:e===Do.Widget&&n===$o.Tab?"60px":"30px"}}}function pc(e){var t,n,r,i,o,s,a=e.survey,u=e.forceDisableHtml,l=e.posthog,c=e.style,d=void 0===c?{}:c,f=e.previewPageIndex,p=e.removeSurveyFromFocus,_=void 0===p?function(){}:p,h=e.isPopup,v=void 0===h||h,g=e.onPreviewSubmit,m=void 0===g?function(){}:g,y=e.onPopupSurveyDismissed,b=void 0===y?function(){}:y,w=e.onCloseConfirmationMessage,S=void 0===w?function(){}:w,k=Co(null),x=Number.isInteger(f),E=null!=(t=a.appearance)&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,C=function(e,t,n,r,i,o){var s=xo(r||0===n),a=s[0],u=s[1],l=xo(!1),c=l[0],d=l[1],f=function(){var t=function(){e.type===Do.Popover&&i(e),u(!1)};sc.startViewTransition?sc.startViewTransition((function(){var e;null==o||null==(e=o.current)||e.remove()})).finished.then((function(){t()})):t()},p=function(t){t.detail.surveyId===e.id&&f()};return Eo((function(){if(t){if(!r){var i=function(t){var n,r;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return f();d(!0),null!=(r=e.appearance)&&r.autoDisappear&&setTimeout((function(){f()}),5e3)}},o=function(){El(e)&&(u(!0),oc.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()),setTimeout((function(){var t,n=null==(t=sc.querySelector(Rl(e,!0)))||null==(t=t.shadowRoot)?void 0:t.querySelector("textarea");n&&n.focus()}),100))};if(js(oc,"PHSurveyClosed",p),js(oc,"PHSurveySent",i),n>0){var s=setTimeout(o,n);return function(){clearTimeout(s),oc.removeEventListener("PHSurveyClosed",p),oc.removeEventListener("PHSurveySent",i)}}return o(),function(){oc.removeEventListener("PHSurveyClosed",p),oc.removeEventListener("PHSurveySent",i)}}}else zs.error("usePopupVisibility hook called without a PostHog instance.")}),[]),dc({survey:e,removeSurveyFromFocus:i,setSurveyVisible:u,isPreviewMode:r}),{isPopupVisible:a,isSurveySent:c,setIsPopupVisible:u,hidePopupWithViewTransition:f}}(a,l,E,x,_,k),T=C.isPopupVisible,P=C.isSurveySent,I=C.hidePopupWithViewTransition,F=P||f===a.questions.length,R=To((function(){var e=Pl(a);return{isPreviewMode:x,previewPageIndex:f,onPopupSurveyDismissed:function(){_l(a,l,x),b()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||na(),onPreviewSubmit:m,posthog:l}}),[x,f,v,l,a,b,m]);return T?Ol(wl.Provider,{value:R,children:Ol("div",{className:"survey-container",style:ki({},fc(a.type,null==(n=a.appearance)?void 0:n.position,null==(r=a.appearance)?void 0:r.widgetType),d),ref:k,children:F?Ol(Wl,{header:(null==(i=a.appearance)?void 0:i.thankYouMessageHeader)||"Thank you!",description:(null==(o=a.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(s=a.appearance)?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||al,onClose:function(){I(),S()}}):Ol(_c,{survey:a,forceDisableHtml:!!u,posthog:l})})}):null}function _c(e){var t=e.survey,n=e.forceDisableHtml,r=e.posthog,i=xo((function(){var e=Pl(t);return null!=e&&e.responses&&zs.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),o=i[0],s=i[1],a=Po(wl),u=a.previewPageIndex,l=a.onPopupSurveyDismissed,c=a.isPopup,d=a.onPreviewSubmit,f=a.surveySubmissionId,p=a.isPreviewMode,_=xo((function(){var e=Pl(t);return u||(null==e?void 0:e.lastQuestionIndex)||0})),h=_[0],v=_[1],g=To((function(){return gl(t)}),[t]);Eo((function(){p&&!gs(u)&&v(u)}),[u,p]);var m=g.at(h);return m?Ol("form",{className:"survey-form",name:"surveyForm",children:[c&&Ol(Vl,{onClick:function(){l()}}),Ol("div",{className:"survey-box",children:vc({question:m,forceDisableHtml:n,displayQuestionIndex:h,appearance:t.appearance||al,onSubmit:function(e){return function(e){var n,i=e.res,a=e.displayQuestionIndex,u=e.questionId;if(r)if(u){var l=ol(u),c=ki({},o,((n={})[l]=i,n));s(c);var d=uc(t,a,i),p=d===Ho.End;p||(v(d),Tl(t,{surveySubmissionId:f,responses:c,lastQuestionIndex:d})),(t.enable_partial_responses||p)&&pl({responses:c,survey:t,surveySubmissionId:f,isSurveyCompleted:p,posthog:r})}else zs.error("onNextButtonClick called without a questionId.");else zs.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:h,questionId:m.id})},onPreviewSubmit:d,initialValue:m.id?o[ol(m.id)]:void 0})})]}):null}function hc(e){var t,n,r,i,o,s=e.survey,a=e.forceDisableHtml,u=e.posthog,l=e.readOnly,c=xo(!0),d=c[0],f=c[1],p=xo(!1),_=p[0],h=p[1],v=xo({}),g=v[0],m=v[1];if(Eo((function(){var e;if(u){if(!l){"tab"===(null==(e=s.appearance)?void 0:e.widgetType)&&m({top:"50%",bottom:"auto"});var t=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===s.id&&(zs.info("Received show event for feedback button survey "+s.id),m(n.detail.position||{}),h(!0))};return js(oc,ac,t),function(){oc.removeEventListener(ac,t)}}}else zs.error("FeedbackWidget called without a PostHog instance.")}),[u,l,s.id,null==(t=s.appearance)?void 0:t.widgetType,null==(n=s.appearance)?void 0:n.widgetSelector,null==(r=s.appearance)?void 0:r.borderColor]),dc({survey:s,setSurveyVisible:f}),!d)return null;var y=function(){setTimeout((function(){h(!1)}),200)};return Ol(zi,{children:["tab"===(null==(i=s.appearance)?void 0:i.widgetType)&&Ol("button",{className:"ph-survey-widget-tab",onClick:function(){return h(!_)},disabled:l,children:(null==(o=s.appearance)?void 0:o.widgetLabel)||""}),_&&Ol(pc,{posthog:u,survey:s,forceDisableHtml:a,style:g,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var vc=function(e){var t,n,r=e.question,i=e.forceDisableHtml,o=e.displayQuestionIndex,s=e.appearance,a=e.onSubmit,u=e.onPreviewSubmit,l=e.initialValue,c=((t={})[No.Open]=Gl,t[No.Link]=Zl,t[No.Rating]=Ql,t[No.SingleChoice]=Xl,t[No.MultipleChoice]=Xl,t),d={question:r,forceDisableHtml:i,appearance:s,onPreviewSubmit:function(e){u(e)},onSubmit:function(e){a(e)},initialValue:l},f=((n={})[No.Open]={},n[No.Link]={},n[No.Rating]={displayQuestionIndex:o},n[No.SingleChoice]={displayQuestionIndex:o},n[No.MultipleChoice]={displayQuestionIndex:o},n),p=c[r.type],_=ki({},d,f[r.type]);return Bi(p,ki({},_,{key:r.id}))};function gc(e){return!gs(Event)&&mc(e,Event)}function mc(e,t){try{return e instanceof t}catch(e){return!1}}function yc(e){return bs(e)||!hs(e)&&!_s(e)}function bc(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return mc(e,Error)}}function wc(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function Sc(e){return wc(e,"DOMError")}es.__PosthogExtensions__=es.__PosthogExtensions__||{},es.__PosthogExtensions__.generateSurveys=cc,es.extendPostHogWithSurveys=cc;var kc=/\(error: (.*)\)/,xc=50,Ec="?";function Cc(e,t,n,r){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?Ec:t,in_app:!0};return gs(n)||(i.lineno=n),gs(r)||(i.colno=r),i}var Tc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Pc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ic=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mc=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e,t){void 0===t&&(t=0);for(var n=[],i=e.split("\n"),o=t;o<i.length;o++){var s=i[o];if(!(s.length>1024)){var a=kc.test(s)?s.replace(kc,"$1"):s;if(!a.match(/\S*Error: /)){for(var u,l=Si(r);!(u=l()).done;){var c=(0,u.value)(a);if(c){n.push(c);break}}if(n.length>=xc)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,xc).map((function(e){return ki({},e,{filename:e.filename||Oc(t).filename,function:e.function||Ec})}))}(n)}}.apply(void 0,[[30,function(e){var t=Tc.exec(e);if(t){var n=t[1],r=t[2],i=t[3];return Cc(n,Ec,+r,+i)}var o=Pc.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=Ic.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var a=Ac(o[1]||Ec,o[2]),u=a[0];return Cc(a[1],u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,function(e){var t=Fc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Rc.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||Ec,o=Ac(i,r);return i=o[0],Cc(r=o[1],i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Oc(e){return e[e.length-1]||{}}var Lc,qc,$c,Ac=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]:Ec,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};var Dc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Nc(e,t){void 0===t&&(t=0);var n=e.stacktrace||e.stack||"",r=function(e){if(e&&Hc.test(e.message))return 1;return 0}(e);try{var i=Mc,o=function(e,t){var n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var n=Object.keys(t);return $c&&n.length===qc||(qc=n.length,$c=n.reduce((function(n,r){Lc||(Lc={});var i=Lc[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,Lc[r]=[u,l];break}}return n}),{})),$c}(t);return e.forEach((function(e){e.filename&&(e.chunk_id=n[e.filename])})),e}(i(n,r),i);return o.slice(0,o.length-t)}catch(e){}return[]}var Hc=/Minified React error #\d+;/i;function Bc(e,t){var n,r,i=Nc(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(r=null==t?void 0:t.synthetic)&&void 0!==r&&r;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return String(t.error.message);return String(t)}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}}function jc(e,t){var n=Bc(e,t);return e.cause&&bc(e.cause)&&e.cause!==e?[n].concat(jc(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})):[n]}function zc(e,t){return{$exception_list:jc(e,t),$exception_level:"error"}}function Uc(e,t){var n,r,i,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var u=Nc(t.syntheticException,1);u.length&&(a.stacktrace={frames:u,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Vc(e){return ms(e)&&!ys(e)&&os.indexOf(e)>=0}function Wc(e,t){var n,r,i=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:gc(e)?e.constructor.name:"Error",a="Non-Error 'exception' captured with keys: "+function(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(!(i.length>t))return r===n.length||i.length<=t?i:i.slice(0,t)+"..."}return""}(e),u={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var l=Nc(null==t?void 0:t.syntheticException,1);l.length&&(u.stacktrace={frames:l,type:"raw"})}return{$exception_list:[u],$exception_level:Vc(e.level)?e.level:"error"}}function Gc(e,t){var n=e.error,r=e.event,i={$exception_list:[]},o=n||r;if(Sc(o)||function(e){return wc(e,"DOMException")}(o)){var s=o;if(function(e){return"stack"in e}(o))i=zc(o,t);else{var a=s.name||(Sc(s)?"DOMError":"DOMException"),u=s.message?a+": "+s.message:a;i=Uc(u,ki({},t,{overrideExceptionType:Sc(s)?"DOMError":"DOMException",defaultExceptionMessage:u}))}return"code"in s&&(i.$exception_DOMException_code=""+s.code),i}if(function(e){return wc(e,"ErrorEvent")}(o)&&o.error)return zc(o.error,t);if(bc(o))return zc(o,t);if(function(e){return wc(e,"Object")}(o)||gc(o))return Wc(o,t);if(gs(n)&&ms(r)){var l="Error",c=r,d=r.match(Dc);return d&&(l=d[1],c=d[2]),Uc(c,ki({},t,{overrideExceptionType:l,defaultExceptionMessage:c}))}return Uc(o,t)}function Zc(e){var t=function(e){if(yc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(e[0]);return yc(t)?Uc("Non-Error promise rejection captured with value: "+String(t),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Gc({event:t},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(t)})}var Qc=Ps("[ExceptionAutocapture]"),Yc={wrapOnError:function(e){var t=jo;t||Qc.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;o<r;o++)i[o]=arguments[o];var s=Gc({event:i[0],error:i[4]});return e(s),null!==(t=null==n?void 0: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}},wrapUnhandledRejection:function(e){var t=jo;t||Qc.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=Zc(o);return e(a),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}},wrapConsoleError:function(e){var t=console;t||Qc.info("console not available, cannot wrap console.error");var n=t.error;return t.error=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=r.join(" "),s=r.find((function(e){return e instanceof Error})),a=s?Gc({event:o,error:s}):Gc({event:o},{syntheticException:new Error("PostHog syntheticException")});return e(a),null==n?void 0:n.apply(void 0,r)},t.error.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=n}}};function Jc(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return _s(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}es.__PosthogExtensions__=es.__PosthogExtensions__||{},es.__PosthogExtensions__.errorWrappingFunctions=Yc,es.posthogErrorWrappingFunctions=Yc;var Xc=function(e,t){if(e){var n=e.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",i)}};es.__PosthogExtensions__=es.__PosthogExtensions__||{};var Kc={_patchFetch:function(e){return Jc(jo,"fetch",(function(t){return function(){var n=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){bi(o,r,i,s,a,"next",e)}function a(e){bi(o,r,i,s,a,"throw",e)}s(void 0)}))}}(Ei().mark((function n(r,i){var o;return Ei().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=new Request(r,i),Xc(e,o),n.abrupt("return",t(o));case 3:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}()}))},_patchXHR:function(e){return Jc(jo.XMLHttpRequest.prototype,"open",(function(t){return function(n,r,i,o,s){void 0===i&&(i=!0);var a=new Request(r);return Xc(e,a),t.call(this,n,a.url,i,o,s)}}))}};es.__PosthogExtensions__.tracingHeadersPatchFns=Kc,es.postHogTracingHeadersPatchFns=Kc;var ed="$people_distinct_id",td="__alias",nd="__timers",rd="$autocapture_disabled_server_side",id="$heatmaps_enabled_server_side",od="$exception_capture_enabled_server_side",sd="$error_tracking_suppression_rules",ad="$web_vitals_enabled_server_side",ud="$dead_clicks_enabled_server_side",ld="$web_vitals_allowed_metrics",cd="$session_recording_enabled_server_side",dd="$console_log_recording_enabled_server_side",fd="$session_recording_network_payload_capture",pd="$session_recording_masking",_d="$session_recording_canvas_recording",hd="$replay_sample_rate",vd="$replay_minimum_duration",gd="$replay_script_config",md="$sesid",yd="$session_is_sampled",bd="$session_recording_url_trigger_activated_session",wd="$session_recording_event_trigger_activated_session",Sd="$enabled_feature_flags",kd="$early_access_features",xd="$feature_flag_details",Ed="$stored_person_properties",Cd="$stored_group_properties",Td="$surveys",Pd="$surveys_activated",Id="$flag_call_reported",Fd="$user_state",Rd="$client_session_props",Md="$capture_rate_limit",Od="$initial_campaign_params",Ld="$initial_referrer_info",qd="$initial_person_info",$d="$epp",Ad="__POSTHOG_TOOLBAR__",Dd="$posthog_cookieless",Nd=[ed,td,"__cmpns",nd,cd,id,md,Sd,sd,Fd,kd,xd,Cd,Ed,Td,Id,Rd,Md,Od,Ld,$d,qd];function Hd(e){return e instanceof Element&&(e.id===Ad||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Bd(e){return!!e&&1===e.nodeType}function jd(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function zd(e){return!!e&&3===e.nodeType}function Ud(e){return!!e&&11===e.nodeType}function Vd(e){return e?as(e).split(/\s+/):[]}function Wd(e){var t=null==jo?void 0:jo.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Gd(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 Vd(t)}function Zd(e){return ws(e)?null:as(e).split(/(\s+)/).filter((function(e){return lf(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Qd(e){var t="";return ef(e)&&!tf(e)&&e.childNodes&&e.childNodes.length&&Rs(e.childNodes,(function(e){var n;zd(e)&&e.textContent&&(t+=null!==(n=Zd(e.textContent))&&void 0!==n?n:"")})),as(t)}function Yd(e){return gs(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Jd=["a","button","form","input","select","textarea","label"];function Xd(e){var t=e.parentNode;return!(!t||!Bd(t))&&t}function Kd(e,t,n,r,i){var o,s,a;if(void 0===n&&(n=void 0),!jo||!e||jd(e,"html")||!Bd(e))return!1;if(null!=(o=n)&&o.url_allowlist&&!Wd(n.url_allowlist))return!1;if(null!=(s=n)&&s.url_ignorelist&&Wd(n.url_ignorelist))return!1;if(null!=(a=n)&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var l=!1,c=[e],d=!0,f=e;f.parentNode&&!jd(f,"body");)if(Ud(f.parentNode))c.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=Xd(f)))break;if(r||Jd.indexOf(d.tagName.toLowerCase())>-1)l=!0;else{var p=jo.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(l=!0)}c.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(gs(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=Si(e);!(i=s()).done;)if(r=o())return r.v;return!1}(c,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(gs(n))return!0;for(var r,i,o=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}},s=Si(e);!(i=s()).done;)if(r=o())return r.v;return!1}(c,n))return!1;var _=jo.getComputedStyle(e);if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Jd.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function ef(e){for(var t=e;t.parentNode&&!jd(t,"body");t=t.parentNode){var n=Gd(t);if(ss(n,"ph-sensitive")||ss(n,"ph-no-capture"))return!1}if(ss(Gd(e),"ph-include"))return!0;var r=e.type||"";if(ms(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(ms(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function tf(e){return!!(jd(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||jd(e,"select")||jd(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var nf="(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})",rf=new RegExp("^(?:"+nf+")$"),of=new RegExp(nf),sf="\\d{3}-?\\d{2}-?\\d{4}",af=new RegExp("^("+sf+")$"),uf=new RegExp("("+sf+")");function lf(e,t){if(void 0===t&&(t=!0),ws(e))return!1;if(ms(e)){if(e=as(e),(t?rf:of).test((e||"").replace(/[- ]/g,"")))return!1;if((t?af:uf).test(e))return!1}return!0}function cf(e){var t=Qd(e);return lf(t=(t+" "+df(e)).trim())?t:""}function df(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Rs(e.childNodes,(function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=Qd(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+df(e)).trim())}catch(e){Ts.error("[AutoCapture]",e)}})),t}function ff(e){return 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=Si(e.attr_class);!(i=o()).done;){r+="."+i.value.replace(/"/g,"")}}var s=ki({},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 Ls(s).sort((function(e,t){var n=e[0],r=t[0];return n.localeCompare(r)})).forEach((function(e){var t=e[0],n=e[1];return a[pf(t.toString())]=pf(n.toString())})),r+=":",r+=Ls(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:_f(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Ls(e).filter((function(e){return 0===e[0].indexOf("attr__")})).forEach((function(e){var t=e[0],n=e[1];return r.attributes[t]=n})),r}))}(e))}function pf(e){return e.replace(/"|\\"/g,'\\"')}function _f(e){var t=e.attr__class;return t?ps(t)?t:Vd(t):void 0}var hf=function(){function e(){this.clicks=[]}return e.prototype.isRageClick=function(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1},e}(),vf=Ps("[AutoCapture]");function gf(e,t){return t.length>e?t.slice(0,e)+"...":t}function mf(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bd(t));return t}function yf(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};Jd.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=gf(1024,cf(e)):o.$el_text=gf(1024,Qd(e)));var s=Gd(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Rs(e.attributes,(function(n){var i;if((!tf(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==r||!r.includes(n.name))&&!t&&lf(n.value)&&(i=n.name,!ms(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=n.value;"class"===n.name&&(s=Vd(s).join(" ")),o["attr__"+n.name]=gf(1024,s)}}));for(var a=1,u=1,l=e;l=mf(l);)a++,l.tagName===e.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function bf(e,t){for(var n,r,i=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=[e],c=e;c.parentNode&&!jd(c,"body");)Ud(c.parentNode)?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,f=[],p={},_=!1,h=!1;if(Rs(l,(function(e){var t=ef(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&lf(_)&&_),ss(Gd(e),"ph-no-capture")&&(h=!0),f.push(yf(e,o,s,a));var n=function(e){if(!ef(e))return{};var t={};return Rs(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&&lf(r)&&(t[n]=r)}})),t}(e);Ms(p,n)})),h)return{props:{},explicitNoCapture:h};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?f[0].$el_text=cf(e):f[0].$el_text=Qd(e)),_){var v,g;f[0].attr__href=_;var m=null==(v=nu(_))?void 0:v.host,y=null==jo||null==(g=jo.location)?void 0:g.host;m&&y&&m!==y&&(d=_)}return{props:Ms({$event_type:i.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:ff(f)},null!=(n=f[0])&&n.$el_text?{$el_text:null==(r=f[0])?void 0:r.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}var wf=function(){function e(e){this._initialized=!1,this._isDisabledServerSide=null,this.rageclicks=new hf,this._elementsChainAsString=!1,this.instance=e,this._elementSelectors=null}var t=e.prototype;return t._addDomEventHandlers=function(){var e=this;if(this.isBrowserSupported()){if(jo&&Zo){var t=function(t){t=t||(null==jo?void 0:jo.event);try{e._captureEvent(t)}catch(e){vf.error("Failed to capture event",e)}};if(js(Zo,"submit",t,{capture:!0}),js(Zo,"change",t,{capture:!0}),js(Zo,"click",t,{capture:!0}),this._config.capture_copied_text){var n=function(t){t=t||(null==jo?void 0:jo.event),e._captureEvent(t,ns)};js(Zo,"copy",n,{capture:!0}),js(Zo,"cut",n,{capture:!0})}}}else vf.info("Disabling Automatic Event Collection because this browser is not supported")},t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)},t.onRemoteConfig=function(e){var t;(e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence)&&this.instance.persistence.register(((t={})[rd]=!!e.autocapture_opt_out,t));this._isDisabledServerSide=!!e.autocapture_opt_out,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==Zo?void 0:Zo.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,r=Yd(e);if(zd(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===ns;if(r&&Kd(r,e,this._config,i,i?["copy","cut"]:void 0)){var o=bf(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString}),s=o.props;if(o.explicitNoCapture)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),t===ns){var u,l=Zd(null==jo||null==(u=jo.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=c}return this.instance.capture(t,s),!0}}},t.isBrowserSupported=function(){return _s(null==Zo?void 0:Zo.querySelectorAll)},wi(e,[{key:"_config",get:function(){var e,t,n=hs(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null==(e=n.url_allowlist)?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null==(t=n.url_ignorelist)?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:"isEnabled",get:function(){var e,t,n=null==(e=this.instance.persistence)?void 0:e.props[rd],r=this._isDisabledServerSide;if(bs(r)&&!ks(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}}])}(),Sf="";var kf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xf(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Zo),Sf)return Sf;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_"+na();!Sf&&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",Sf=o)}return Sf}(e);if(!n){var r=function(e){var t=e.match(kf);return t?t[0]:""}(e);r!==n&&Ts.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ef={_is_supported:function(){return!!Zo},_error:function(e){Ts.error("cookieStore error: "+e)},_get:function(e){if(Zo){try{for(var t=e+"=",n=Zo.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;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}},_parse:function(e){var t;try{t=JSON.parse(Ef._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(Zo)try{var o="",s="",a=xf(Zo.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),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&&Ts.warn("cookieStore warning: large cookie, len="+l.length),Zo.cookie=l,l}catch(e){return}},_remove:function(e,t){try{Ef._set(e,"",-1,t)}catch(e){return}}},Cf=null,Tf={_is_supported:function(){if(!bs(Cf))return Cf;var e=!0;if(gs(jo))e=!1;else try{var t="__mplssupport__";Tf._set(t,"xyz"),'"xyz"'!==Tf._get(t)&&(e=!1),Tf._remove(t)}catch(t){e=!1}return e||Ts.error("localStorage unsupported; falling back to cookie store"),Cf=e,e},_error:function(e){Ts.error("localStorage error: "+e)},_get:function(e){try{return null==jo?void 0:jo.localStorage.getItem(e)}catch(e){Tf._error(e)}return null},_parse:function(e){try{return JSON.parse(Tf._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==jo||jo.localStorage.setItem(e,JSON.stringify(t))}catch(e){Tf._error(e)}},_remove:function(e){try{null==jo||jo.localStorage.removeItem(e)}catch(e){Tf._error(e)}}},Pf=["distinct_id",md,yd,$d,qd],If=ki({},Tf,{_parse:function(e){try{var t={};try{t=Ef._parse(e)||{}}catch(e){}var n=Ms(t,JSON.parse(Tf._get(e)||"{}"));return Tf._set(e,n),n}catch(e){}return null},_set:function(e,t,n,r,i,o){try{Tf._set(e,t,void 0,void 0,o);var s={};Pf.forEach((function(e){t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Ef._set(e,s,n,r,i,o)}catch(e){Tf._error(e)}},_remove:function(e,t){try{null==jo||jo.localStorage.removeItem(e),Ef._remove(e,t)}catch(e){Tf._error(e)}}}),Ff={},Rf={_is_supported:function(){return!0},_error:function(e){Ts.error("memoryStorage error: "+e)},_get:function(e){return Ff[e]||null},_parse:function(e){return Ff[e]||null},_set:function(e,t){Ff[e]=t},_remove:function(e){delete Ff[e]}},Mf=null,Of={_is_supported:function(){if(!bs(Mf))return Mf;if(Mf=!0,gs(jo))Mf=!1;else try{var e="__support__";Of._set(e,"xyz"),'"xyz"'!==Of._get(e)&&(Mf=!1),Of._remove(e)}catch(e){Mf=!1}return Mf},_error:function(e){Ts.error("sessionStorage error: ",e)},_get:function(e){try{return null==jo?void 0:jo.sessionStorage.getItem(e)}catch(e){Of._error(e)}return null},_parse:function(e){try{return JSON.parse(Of._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==jo||jo.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Of._error(e)}},_remove:function(e){try{null==jo||jo.sessionStorage.removeItem(e)}catch(e){Of._error(e)}}},Lf=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({}),qf=function(){function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return this.consent===Lf.DENIED||this.consent===Lf.PENDING&&this._config.opt_out_capturing_by_default},t.isOptedIn=function(){return!this.isOptedOut()},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&&!!Bs([null==Go?void 0:Go.doNotTrack,null==Go?void 0:Go.msDoNotTrack,es.doNotTrack],(function(e){return ss([!0,1,"1","yes"],e)}))},wi(e,[{key:"_config",get:function(){return this._instance.config}},{key:"consent",get:function(){return this._getDnt()?Lf.DENIED:this._storedConsent}},{key:"_storageKey",get:function(){var e=this._instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"_storedConsent",get:function(){var e=this._storage._get(this._storageKey);return"1"===e?Lf.GRANTED:"0"===e?Lf.DENIED:Lf.PENDING}},{key:"_storage",get:function(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?Tf:Ef;var t="localStorage"===e?Ef:Tf;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut("1"===t._get(this._storageKey)),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}(),$f=Ps("[Dead Clicks]"),Af=function(){return!0},Df=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(ud)),r=e.instance.config.capture_dead_clicks;return ks(r)?r:n},Nf=function(){function e(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}var t=e.prototype;return t.onRemoteConfig=function(e){var t;this.instance.persistence&&this.instance.persistence.register(((t={})[ud]=null==e?void 0:e.captureDeadClicks,t));this.startIfEnabled()},t.startIfEnabled=function(){var e=this;this.isEnabled(this)&&this._loadScript((function(){e._start()}))},t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(function(t){t?$f.error("failed to load script",t):e()}))},t._start=function(){var e;if(Zo){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=es.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=hs(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=es.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Zo),$f.info("starting...")}}else $f.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,$f.info("stopping..."))},wi(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Hf=Ps("[ExceptionAutocapture]"),Bf=function(){function e(e){var t,n=this;this._startCapturing=function(){var e;if(jo&&n.isEnabled&&null!=(e=es.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=es.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=es.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=es.__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){Hf.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[od]),this._config=this._requiredConfig(),this.startIfEnabled()}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 hs(e)?t=ki({},t,e):(gs(e)?this._remoteEnabled:e)&&(t=ki({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabled=function(){this.isEnabled&&(Hf.info("enabled"),this._loadScript(this._startCapturing))},t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",(function(t){if(t)return Hf.error("failed to load script",t);e()}))},t._stopCapturing=function(){var e,t,n;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(n=this._unwrapConsoleError)||n.call(this),this._unwrapConsoleError=void 0},t.onRemoteConfig=function(e){var t,n=e.autocaptureExceptions;(this._remoteEnabled=!!n||!1,this._config=this._requiredConfig(),this._instance.persistence)&&this._instance.persistence.register(((t={})[od]=this._remoteEnabled,t));this.startIfEnabled()},t.captureException=function(e){var t=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=t+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id(),this._instance.exceptions.sendExceptionEvent(e)},wi(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),jf=function(){function e(e){var t;this._instance=e,this._lastPathname=(null==jo||null==(t=jo.location)?void 0:t.pathname)||""}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&(Ts.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())},t.stop=function(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,Ts.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){var e,t;if(jo&&jo.history){var n=this;null!=(e=jo.history.pushState)&&e.__posthog_wrapped__||Jc(jo.history,"pushState",(function(e){return function(t,r,i){e.call(this,t,r,i),n._capturePageview("pushState")}})),null!=(t=jo.history.replaceState)&&t.__posthog_wrapped__||Jc(jo.history,"replaceState",(function(e){return function(t,r,i){e.call(this,t,r,i),n._capturePageview("replaceState")}})),this._setupPopstateListener()}},t._capturePageview=function(e){try{var t,n=null==jo||null==(t=jo.location)?void 0:t.pathname;if(!n)return;n!==this._lastPathname&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._lastPathname=n}catch(t){Ts.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};js(jo,"popstate",t),this._popstateListener=function(){jo&&jo.removeEventListener("popstate",t)}}},wi(e,[{key:"isEnabled",get:function(){return"history_change"===this._instance.config.capture_pageview}}])}();function zf(e){var t,n;return(null==(t=JSON.stringify(e,(n=[],function(e,t){if(hs(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))?void 0:t.length)||0}function Uf(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[Uf({size:zf(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),Uf({size:zf(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var Vf=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Vf||{}),Wf=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(Wf||{}),Gf="[SessionRecording]",Zf="redacted",Qf={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Yf=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Jf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Xf=["/s/","/e/","/i/"];function Kf(e,t,n,r){if(ws(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return ms(i)&&(i=parseInt(i)),i>n?Gf+" "+r+" body too large to record ("+i+" bytes)":e}function ep(e,t){if(ws(e))return e;var n=e;return lf(n,!1)||(n=Gf+" "+t+" body "+Zf),Rs(Jf,(function(e){var r,i;null!=(r=n)&&r.length&&-1!==(null==(i=n)?void 0:i.indexOf(e))&&(n=Gf+" "+t+" body "+Zf+" as might contain: "+e)})),n}var tp=function(e,t){var n,r,i,o={payloadSizeLimitBytes:Qf.payloadSizeLimitBytes,performanceEntryTypeToObserve:[].concat(Qf.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(t.payloadHostDenyList||[],Qf.payloadHostDenyList)},s=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,u=!1!==e.capture_performance&&t.recordPerformance,l=(n=o,i=Math.min(1e6,null!==(r=n.payloadSizeLimitBytes)&&void 0!==r?r:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=Kf(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Kf(e.responseBody,e.responseHeaders,i,"Response")),e}),c=function(t){return l(function(e,t){var n,r=nu(e.name),i=0===t.indexOf("http")?null==(n=nu(t))?void 0:n.pathname:t;"/"===i&&(i="");var o=null==r?void 0:r.pathname.replace(i||"","");if(!(r&&o&&Xf.some((function(e){return 0===o.indexOf(e)}))))return e}((r=(n=t).requestHeaders,ws(r)||Rs(Object.keys(null!=r?r:{}),(function(e){Yf.includes(e.toLowerCase())&&(r[e]=Zf)})),n),e.api_host));var n,r},d=_s(e.session_recording.maskNetworkRequestFn);return d&&_s(e.session_recording.maskCapturedNetworkRequestFn)&&Ts.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return ki({},t,{name:null==n?void 0:n.url})}),o.maskRequestFn=_s(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r=c(t);return r&&null!==(n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==n?n:void 0}:function(e){return function(e){if(!gs(e))return e.requestBody=ep(e.requestBody,"Request"),e.responseBody=ep(e.responseBody,"Response"),e}(c(e))},ki({},Qf,o,{recordHeaders:s,recordBody:a,recordPerformance:u,recordInitialRequests:u})};function np(e,t,n,r,i){return t>n&&(Ts.warn("min cannot be greater than max."),t=n),Ss(e)?e>n?(r&&Ts.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&Ts.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&Ts.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),np(i||n,t,n,r))}var rp=function(e,t){var n,r,i=this;void 0===t&&(t={}),this._bucketSize=100,this._refillRate=10,this._mutationBuckets={},this._loggedTracker={},this._refillBuckets=function(){Object.keys(i._mutationBuckets).forEach((function(e){i._mutationBuckets[e]=i._mutationBuckets[e]+i._refillRate,i._mutationBuckets[e]>=i._bucketSize&&delete i._mutationBuckets[e]}))},this._getNodeOrRelevantParent=function(e){var t=i._rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i._rrweb.mirror.getId(n),n]}return[e,t]},this._numberOfChanges=function(e){var t,n,r,i,o,s,a,u;return(null!==(t=null==(n=e.removes)?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null==(i=e.attributes)?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null==(s=e.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=e.adds)?void 0:u.length)&&void 0!==a?a:0)},this.throttleMutations=function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i._numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n=i._getNodeOrRelevantParent(e.id),r=n[0],o=n[1];return 0!==i._mutationBuckets[r]&&(i._mutationBuckets[r]=null!==(t=i._mutationBuckets[r])&&void 0!==t?t:i._bucketSize,i._mutationBuckets[r]=Math.max(i._mutationBuckets[r]-1,0),0===i._mutationBuckets[r]&&(i._loggedTracker[r]||(i._loggedTracker[r]=!0,null==i._options.onBlockedNode||i._options.onBlockedNode(r,o))),e)})));var r=i._numberOfChanges(t);return 0!==r||n===r?e:void 0},this._rrweb=e,this._options=t,this._refillRate=np(null!==(n=this._options.refillRate)&&void 0!==n?n:this._refillRate,0,100,"mutation throttling refill rate"),this._bucketSize=np(null!==(r=this._options.bucketSize)&&void 0!==r?r:this._bucketSize,0,100,"mutation throttling bucket size"),setInterval((function(){i._refillBuckets()}),1e3)};function ip(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<np(100*t,0,100)}var op="disabled",sp="sampled",ap="active",up="buffering",lp="paused",cp="trigger",dp=cp+"_activated",fp=cp+"_pending",pp=cp+"_"+op;function _p(e,t){return t.some((function(t){return"regex"===t.matching&&new RegExp(t.url).test(e)}))}var hp=function(){function e(e){this._matchers=e}var t=e.prototype;return t.triggerStatus=function(e){var t=this._matchers.map((function(t){return t.triggerStatus(e)}));return t.includes(dp)?dp:t.includes(fp)?fp:pp},t.stop=function(){this._matchers.forEach((function(e){return e.stop()}))},e}(),vp=function(){function e(e){this._matchers=e}var t=e.prototype;return t.triggerStatus=function(e){for(var t,n=new Set,r=Si(this._matchers);!(t=r()).done;){var i=t.value;n.add(i.triggerStatus(e))}switch(n.delete(pp),n.size){case 0:return pp;case 1:return Array.from(n)[0];default:return fp}},t.stop=function(){this._matchers.forEach((function(e){return e.stop()}))},e}(),gp=function(){function e(){}var t=e.prototype;return t.triggerStatus=function(){return fp},t.stop=function(){},e}(),mp=function(){function e(e){this._urlTriggers=[],this._urlBlocklist=[],this.urlBlocked=!1,this._instance=e}var t=e.prototype;return t.onRemoteConfig=function(e){var t,n;this._urlTriggers=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this._urlBlocklist=(null==(n=e.sessionRecording)?void 0:n.urlBlocklist)||[]},t._urlTriggerStatus=function(e){var t;return 0===this._urlTriggers.length?pp:(null==(t=this._instance)?void 0:t.get_property(bd))===e?dp:fp},t.triggerStatus=function(e){var t=this._urlTriggerStatus(e),n=t===dp?dp:t===fp?fp:pp;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:n}),n},t.checkUrlTriggerConditions=function(e,t,n){if(void 0!==jo&&jo.location.href){var r=jo.location.href,i=this.urlBlocked,o=_p(r,this._urlBlocklist);i&&o||(o&&!i?e():!o&&i&&t(),_p(r,this._urlTriggers)&&n("url"))}},t.stop=function(){},e}(),yp=function(){function e(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this._flaglistenerCleanup=function(){},this._instance=e}var t=e.prototype;return t.triggerStatus=function(){var e=fp;return ws(this.linkedFlag)&&(e=pp),this.linkedFlagSeen&&(e=dp),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e},t.onRemoteConfig=function(e,t){var n,r=this;if(this.linkedFlag=(null==(n=e.sessionRecording)?void 0:n.linkedFlag)||null,!ws(this.linkedFlag)&&!this.linkedFlagSeen){var i=ms(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,o=ms(this.linkedFlag)?null:this.linkedFlag.variant;this._flaglistenerCleanup=this._instance.onFeatureFlags((function(e,n){var s=!1;if(hs(n)&&i in n){var a=n[i];s=ks(a)?!0===a:o?a===o:!!a}r.linkedFlagSeen=s,s&&t(i,o)}))}},t.stop=function(){this._flaglistenerCleanup()},e}(),bp=function(){function e(e){this._eventTriggers=[],this._instance=e}var t=e.prototype;return t.onRemoteConfig=function(e){var t;this._eventTriggers=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]},t._eventTriggerStatus=function(e){var t;return 0===this._eventTriggers.length?pp:(null==(t=this._instance)?void 0:t.get_property(wd))===e?dp:fp},t.triggerStatus=function(e){var t=this._eventTriggerStatus(e),n=t===dp?dp:t===fp?fp:pp;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:n}),n},t.stop=function(){},e}();function wp(e){return e.isRecordingEnabled?up:op}function Sp(e){if(!e.receivedDecide)return up;if(!e.isRecordingEnabled)return op;if(e.urlTriggerMatching.urlBlocked)return lp;var t=!0===e.isSampled,n=new hp([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?sp:n===dp?ap:n===fp?up:!1===e.isSampled?op:ap}function kp(e){if(!e.receivedDecide)return up;if(!e.isRecordingEnabled)return op;if(e.urlTriggerMatching.urlBlocked)return lp;var t=new vp([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),n=t!==pp,r=ks(e.isSampled);return n&&t===fp?up:n&&t===pp||r&&!e.isSampled?op:!0===e.isSampled?sp:ap}var xp="[SessionRecording]",Ep=Ps(xp);function Cp(){var e;return null==es||null==(e=es.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var Tp=3e5,Pp=[Wf.MouseMove,Wf.MouseInteraction,Wf.Scroll,Wf.ViewportResize,Wf.Input,Wf.TouchMove,Wf.MediaInteraction,Wf.Drag],Ip=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}};function Fp(e){return function(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(zu(Uu(JSON.stringify(e))),!0)}function Rp(e){return e.type===Vf.Custom&&"sessionIdle"===e.data.tag}var Mp=function(){function e(e){var t=this;if(this._statusMatcher=wp,this._receivedDecide=!1,this._queuedRRWebEvents=[],this._isIdle="unknown",this._lastActivityTimestamp=Date.now(),this._triggerMatching=new gp,this._removePageViewCaptureHook=void 0,this._onSessionIdListener=void 0,this._persistDecideOnSessionListener=void 0,this._samplingSessionListener=void 0,this._removeEventTriggerCaptureHook=void 0,this._forceAllowLocalhostNetworkCapture=!1,this._onBeforeUnload=function(){t._flushBuffer()},this._onOffline=function(){t._tryAddCustomEvent("browser offline",{})},this._onOnline=function(){t._tryAddCustomEvent("browser online",{})},this._onVisibilityChange=function(){if(null!=Zo&&Zo.visibilityState){var e="window "+Zo.visibilityState;t._tryAddCustomEvent(e,{})}},this._instance=e,this._captureStarted=!1,this._endpoint="/s/",this._stopRrweb=void 0,this._receivedDecide=!1,!this._instance.sessionManager)throw Ep.error("started without valid sessionManager"),new Error(xp+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(xp+" cannot be used with __preview_experimental_cookieless_mode.");this._linkedFlagMatching=new yp(this._instance),this._urlTriggerMatching=new mp(this._instance),this._eventTriggerMatching=new bp(this._instance);var n=this._sessionManager.checkAndGetSessionAndWindowId(),r=n.sessionId,i=n.windowId;this._sessionId=r,this._windowId=i,this._buffer=this._clearBuffer(),this._sessionIdleThresholdMilliseconds>=this._sessionManager.sessionTimeoutMs&&Ep.warn("session_idle_threshold_ms ("+this._sessionIdleThresholdMilliseconds+") is greater than the session timeout ("+this._sessionManager.sessionTimeoutMs+"). Session will never be detected as idle")}var t=e.prototype;return t.startIfEnabledOrStop=function(e){var t=this;this._isRecordingEnabled?(this._startCapture(e),js(jo,"beforeunload",this._onBeforeUnload),js(jo,"offline",this._onOffline),js(jo,"online",this._onOnline),js(jo,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),ws(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this._instance.on("eventCaptured",(function(e){try{if("$pageview"===e.event){var n=null!=e&&e.properties.$current_url?t._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){Ep.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this._sessionManager.onSessionId((function(e,n,r){var i,o;r&&(t._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:n,changeReason:r}),null==(i=t._instance)||null==(i=i.persistence)||i.unregister(wd),null==(o=t._instance)||null==(o=o.persistence)||o.unregister(bd))})))):this.stopRecording()},t.stopRecording=function(){var e,t,n,r;this._captureStarted&&this._stopRrweb&&(this._stopRrweb(),this._stopRrweb=void 0,this._captureStarted=!1,null==jo||jo.removeEventListener("beforeunload",this._onBeforeUnload),null==jo||jo.removeEventListener("offline",this._onOffline),null==jo||jo.removeEventListener("online",this._onOnline),null==jo||jo.removeEventListener("visibilitychange",this._onVisibilityChange),this._clearBuffer(),clearInterval(this._fullSnapshotTimer),null==(e=this._removePageViewCaptureHook)||e.call(this),this._removePageViewCaptureHook=void 0,null==(t=this._removeEventTriggerCaptureHook)||t.call(this),this._removeEventTriggerCaptureHook=void 0,null==(n=this._onSessionIdListener)||n.call(this),this._onSessionIdListener=void 0,null==(r=this._samplingSessionListener)||r.call(this),this._samplingSessionListener=void 0,this._eventTriggerMatching.stop(),this._urlTriggerMatching.stop(),this._linkedFlagMatching.stop(),Ep.info("stopped"))},t._resetSampling=function(){var e;null==(e=this._instance.persistence)||e.unregister(yd)},t._makeSamplingDecision=function(e){var t,n,r=this._sessionId!==e,i=this._sampleRate;if(Ss(i)){var o=this._isSampled,s=r||!ks(o),a=s?ip(e,i):o;s&&(a?this._reportStarted(sp):Ep.warn("Sample rate ("+i+") has determined that this sessionId ("+e+") will not be sent to the server."),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:a})),null==(t=this._instance.persistence)||t.register(((n={})[yd]=a,n))}else this._resetSampling()},t.onRemoteConfig=function(e){var t,n,r,i,o=this;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),null!=(t=e.sessionRecording)&&t.endpoint)&&(this._endpoint=null==(i=e.sessionRecording)?void 0:i.endpoint);this._setupSampling(),"any"===(null==(n=e.sessionRecording)?void 0:n.triggerMatchType)?(this._statusMatcher=Sp,this._triggerMatching=new hp([this._eventTriggerMatching,this._urlTriggerMatching])):(this._statusMatcher=kp,this._triggerMatching=new vp([this._eventTriggerMatching,this._urlTriggerMatching])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(r=e.sessionRecording)?void 0:r.triggerMatchType}),this._urlTriggerMatching.onRemoteConfig(e),this._eventTriggerMatching.onRemoteConfig(e),this._linkedFlagMatching.onRemoteConfig(e,(function(e,t){o._reportStarted("linked_flag_matched",{flag:e,variant:t})})),this._receivedDecide=!0,this.startIfEnabledOrStop()},t._setupSampling=function(){var e=this;Ss(this._sampleRate)&&ws(this._samplingSessionListener)&&(this._samplingSessionListener=this._sessionManager.onSessionId((function(t){e._makeSamplingDecision(t)})))},t._persistRemoteConfig=function(e){var t=this;if(this._instance.persistence){var n,r=this._instance.persistence,i=function(){var n,i,o,s,a,u,l,c,d,f,p=null==(n=e.sessionRecording)?void 0:n.sampleRate,_=ws(p)?null:parseFloat(p);ws(_)&&t._resetSampling();var h=null==(i=e.sessionRecording)?void 0:i.minimumDurationMilliseconds;r.register(((f={})[cd]=!!e.sessionRecording,f[dd]=null==(o=e.sessionRecording)?void 0:o.consoleLogRecordingEnabled,f[fd]=ki({capturePerformance:e.capturePerformance},null==(s=e.sessionRecording)?void 0:s.networkPayloadCapture),f[pd]=null==(a=e.sessionRecording)?void 0:a.masking,f[_d]={enabled:null==(u=e.sessionRecording)?void 0:u.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},f[hd]=_,f[vd]=gs(h)?null:h,f[gd]=null==(d=e.sessionRecording)?void 0:d.scriptConfig,f))};i(),null==(n=this._persistDecideOnSessionListener)||n.call(this),this._persistDecideOnSessionListener=this._sessionManager.onSessionId(i)}},t.log=function(e,t){var n;void 0===t&&(t="log"),null==(n=this._instance.sessionRecording)||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})},t._startCapture=function(e){var t=this;if(!gs(Object.assign)&&!gs(Array.from)&&!(this._captureStarted||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var n;if(this._captureStarted=!0,this._sessionManager.checkAndGetSessionAndWindowId(),Cp())this._onScriptLoaded();else null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,this._scriptName,(function(e){if(e)return Ep.error("could not load recorder",e);t._onScriptLoaded()}));Ep.info("starting"),this.status===ap&&this._reportStarted(e||"recording_initialized")}},t._isInteractiveEvent=function(e){var t;return 3===e.type&&-1!==Pp.indexOf(null==(t=e.data)?void 0:t.source)},t._updateWindowAndSessionIds=function(e){var t=this._isInteractiveEvent(e);t||this._isIdle||e.timestamp-this._lastActivityTimestamp>this._sessionIdleThresholdMilliseconds&&(this._isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this._sessionIdleThresholdMilliseconds,bufferLength:this._buffer.data.length,bufferSize:this._buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this._isIdle)){var r="unknown"===this._isIdle;this._isIdle=!1,r||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this._isIdle){var i=this._sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=i.windowId,s=i.sessionId,a=this._sessionId!==s,u=this._windowId!==o;this._windowId=o,this._sessionId=s,a||u?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}},t._tryRRWebMethod=function(e){try{return e.rrwebMethod(),!0}catch(t){return this._queuedRRWebEvents.length<10?this._queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Ep.warn("could not emit queued rrweb event.",t,e),!1}},t._tryAddCustomEvent=function(e,t){return this._tryRRWebMethod(Ip((function(){return Cp().addCustomEvent(e,t)})))},t._tryTakeFullSnapshot=function(){return this._tryRRWebMethod(Ip((function(){return Cp().takeFullSnapshot()})))},t._onScriptLoaded=function(){for(var e,t,n,r,i=this,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this._instance.config.session_recording,a=0,u=Object.entries(s||{});a<u.length;a++){var l=u[a],c=l[0],d=l[1];c in o&&("maskInputOptions"===c?o.maskInputOptions=ki({password:!0},d):o[c]=d)}(this._canvasRecording&&this._canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this._canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this._canvasRecording.quality}),this._masking)&&(o.maskAllInputs=null===(t=this._masking.maskAllInputs)||void 0===t||t,o.maskTextSelector=null!==(n=this._masking.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(r=this._masking.blockSelector)&&void 0!==r?r:void 0);var f=Cp();if(f){this._mutationRateLimiter=null!==(e=this._mutationRateLimiter)&&void 0!==e?e:new rp(f,{refillRate:this._instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this._instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:function(e,t){var n="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";Ep.info(n,{node:t}),i.log(xp+" "+n,"warn")}});var p=this._gatherRRWebPlugins();this._stopRrweb=f(ki({emit:function(e){i.onRRwebEmit(e)},plugins:p},o)),this._lastActivityTimestamp=Date.now(),this._isIdle=ks(this._isIdle)?this._isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:p.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this._instance.config})}else Ep.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")},t._scheduleFullSnapshot=function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==this._isIdle){var t=this._fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),t))}},t._gatherRRWebPlugins=function(){var e,t,n=[],r=null==(e=es.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;r&&this._isConsoleLogCaptureEnabled&&n.push(r());var i=null==(t=es.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;this._networkPayloadCapture&&_s(i)&&(!tu.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(i(tp(this._instance.config,this._networkPayloadCapture))):Ep.info("NetworkCapture not started because we are on localhost."));return n},t.onRRwebEmit=function(e){var t,n=this;if(this._processQueuedEvents(),e&&hs(e)){if(e.type===Vf.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._urlTriggerMatching.checkUrlTriggerConditions((function(){return n._pauseRecording()}),(function(){return n._resumeRecording()}),(function(e){return n._activateTrigger(e)})),!this._urlTriggerMatching.urlBlocked||function(e){return e.type===Vf.Custom&&"recording paused"===e.data.tag}(e)){e.type===Vf.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Vf.FullSnapshot&&this._receivedDecide&&this._triggerMatching.triggerStatus(this.sessionId)===fp&&this._clearBuffer();var i=this._mutationRateLimiter?this._mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&hs(t)&&6===t.type&&hs(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(o),!0!==this._isIdle||Rp(o)){if(Rp(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,u=s.threshold;o.timestamp=a+u}}var l=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(zf(e)<1024)return e;try{if(e.type===Vf.FullSnapshot)return ki({},e,{data:Fp(e.data),cv:"2024-10"});if(e.type===Vf.IncrementalSnapshot&&e.data.source===Wf.Mutation)return ki({},e,{cv:"2024-10",data:ki({},e.data,{texts:Fp(e.data.texts),attributes:Fp(e.data.attributes),removes:Fp(e.data.removes),adds:Fp(e.data.adds)})});if(e.type===Vf.IncrementalSnapshot&&e.data.source===Wf.StyleSheetRule)return ki({},e,{cv:"2024-10",data:ki({},e.data,{adds:e.data.adds?Fp(e.data.adds):void 0,removes:e.data.removes?Fp(e.data.removes):void 0})})}catch(e){Ep.error("could not compress event - will use uncompressed event",e)}return e}(o):o,c={$snapshot_bytes:zf(l),$snapshot_data:l,$session_id:this._sessionId,$window_id:this._windowId};this.status!==op?this._captureSnapshotBuffered(c):this._clearBuffer()}}}}},t._pageViewFallBack=function(){if(!this._instance.config.capture_pageview&&jo){var e=this._maskUrl(jo.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}},t._processQueuedEvents=function(){var e=this;if(this._queuedRRWebEvents.length){var t=[].concat(this._queuedRRWebEvents);this._queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}},t._maskUrl=function(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null==(n=r=t.maskNetworkRequestFn(r))?void 0:n.url}return e},t._clearBuffer=function(){return this._buffer={size:0,data:[],sessionId:this._sessionId,windowId:this._windowId},this._buffer},t._flushBuffer=function(){var e=this;this._flushBufferTimer&&(clearTimeout(this._flushBufferTimer),this._flushBufferTimer=void 0);var t=this._minimumDuration,n=this._sessionDuration,r=Ss(n)&&n>=0,i=Ss(t)&&r&&n<t;if(this.status===up||this.status===lp||this.status===op||i)return this._flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this._buffer;this._buffer.data.length>0&&Uf(this._buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:ts.LIB_VERSION})}));return this._clearBuffer()},t._captureSnapshotBuffered=function(e){var t,n=this,r=2+((null==(t=this._buffer)?void 0:t.data.length)||0);!this._isIdle&&(this._buffer.size+e.$snapshot_bytes+r>943718.4||this._buffer.sessionId!==this._sessionId)&&(this._buffer=this._flushBuffer()),this._buffer.size+=e.$snapshot_bytes,this._buffer.data.push(e.$snapshot_data),this._flushBufferTimer||this._isIdle||(this._flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))},t._captureSnapshot=function(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})},t._activateTrigger=function(e){var t,n;this._triggerMatching.triggerStatus(this.sessionId)===fp&&(null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})["url"===e?bd:wd]=this._sessionId,n)),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))},t._pauseRecording=function(){this._urlTriggerMatching.urlBlocked||(this._urlTriggerMatching.urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Ep.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))},t._resumeRecording=function(){this._urlTriggerMatching.urlBlocked&&(this._urlTriggerMatching.urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Ep.info("recording resumed"))},t._addEventTriggerListener=function(){var e=this;0!==this._eventTriggerMatching._eventTriggers.length&&ws(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this._instance.on("eventCaptured",(function(t){try{e._eventTriggerMatching._eventTriggers.includes(t.event)&&e._activateTrigger("event")}catch(e){Ep.error("Could not activate event trigger",e)}})))},t.overrideLinkedFlag=function(){this._linkedFlagMatching.linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")},t.overrideSampling=function(){var e,t;null==(e=this._instance.persistence)||e.register(((t={})[yd]=!0,t)),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")},t.overrideTrigger=function(e){this._activateTrigger(e)},t._reportStarted=function(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Ep.info(e.replace("_"," "),t),ss(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)},wi(e,[{key:"sessionId",get:function(){return this._sessionId}},{key:"_sessionIdleThresholdMilliseconds",get:function(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}},{key:"started",get:function(){return this._captureStarted}},{key:"_sessionManager",get:function(){if(!this._instance.sessionManager)throw new Error(xp+" must be started with a valid sessionManager.");return this._instance.sessionManager}},{key:"_fullSnapshotIntervalMillis",get:function(){var e,t;return this._triggerMatching.triggerStatus(this.sessionId)===fp?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:Tp}},{key:"_isSampled",get:function(){var e=this._instance.get_property(yd);return ks(e)?e:null}},{key:"_sessionDuration",get:function(){var e,t,n=null==(e=this._buffer)?void 0:e.data[(null==(t=this._buffer)?void 0:t.data.length)-1],r=this._sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"_isRecordingEnabled",get:function(){var e=!!this._instance.get_property(cd),t=!this._instance.config.disable_session_recording;return jo&&e&&t}},{key:"_isConsoleLogCaptureEnabled",get:function(){var e=!!this._instance.get_property(dd),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"_canvasRecording",get:function(){var e,t,n,r,i,o,s=this._instance.config.session_recording.captureCanvas,a=this._instance.get_property(_d),u=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,l=null!==(n=null!==(r=null==s?void 0:s.canvasFps)&&void 0!==r?r:null==a?void 0:a.fps)&&void 0!==n?n:4,c=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:u,fps:np(l,0,12,"canvas recording fps",4),quality:np(c,0,1,"canvas recording quality",.4)}}},{key:"_networkPayloadCapture",get:function(){var e,t,n=this._instance.get_property(fd),r={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this._instance.config.session_recording)?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=hs(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,a=!!(ks(s)?s:null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"_masking",get:function(){var e,t,n,r,i,o,s=this._instance.get_property(pd),a={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(n=this._instance.config.session_recording)?void 0:n.blockSelector},u=null!==(r=null==a?void 0:a.maskAllInputs)&&void 0!==r?r:null==s?void 0:s.maskAllInputs,l=null!==(i=null==a?void 0:a.maskTextSelector)&&void 0!==i?i:null==s?void 0:s.maskTextSelector,c=null!==(o=null==a?void 0:a.blockSelector)&&void 0!==o?o:null==s?void 0:s.blockSelector;return gs(u)&&gs(l)&&gs(c)?void 0:{maskAllInputs:null==u||u,maskTextSelector:l,blockSelector:c}}},{key:"_sampleRate",get:function(){var e=this._instance.get_property(hd);return Ss(e)?e:null}},{key:"_minimumDuration",get:function(){var e=this._instance.get_property(vd);return Ss(e)?e:null}},{key:"status",get:function(){return this._receivedDecide?this._statusMatcher({receivedDecide:this._receivedDecide,isRecordingEnabled:this._isRecordingEnabled,isSampled:this._isSampled,urlTriggerMatching:this._urlTriggerMatching,eventTriggerMatching:this._eventTriggerMatching,linkedFlagMatching:this._linkedFlagMatching,sessionId:this.sessionId}):up}},{key:"_scriptName",get:function(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(gd))?void 0:e.script)||"recorder"}},{key:"sdkDebugProperties",get:function(){var e=this._sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this._buffer.data.length,$sdk_debug_replay_internal_buffer_size:this._buffer.size,$sdk_debug_current_session_duration:this._sessionDuration,$sdk_debug_session_start:e}}}])}(),Op=Ps("[SegmentIntegration]");function Lp(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||na()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Fd,"identified")),t()},i=n.user();"then"in i&&_s(i.then)?i.then((function(e){return r(e)})):r(i)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||Op.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Op.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Op.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var qp="posthog-js";function $p(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;return function(t){var n,s,u,l,c;if(!("*"===a||a.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(n=t.exception)?void 0:n.values)||[],p=f.map((function(e){return ki({},e,{stacktrace:e.stacktrace?ki({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((function(e){return ki({},e,{platform:"web:javascript"})}))}):void 0})})),_={$exception_message:(null==(s=f[0])?void 0:s.value)||t.message,$exception_type:null==(u=f[0])?void 0:u.type,$exception_personURL:d,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(l=f[0])?void 0:l.value)||t.message,$sentry_exception_type:null==(c=f[0])?void 0:c.type,$sentry_tags:t.tags};return r&&i&&(_.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),e.exceptions.sendExceptionEvent(_),t}}var Ap=function(e,t,n,r,i){this.name=qp,this.setupOnce=function(o){o($p(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}},Dp=null!=jo&&jo.location?su(jo.location.hash,"__posthog")||su(location.hash,"state"):null,Np="_postHogToolbarParams",Hp=Ps("[Toolbar]"),Bp=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Bp||{}),jp=function(){function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){es.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=es.ph_toolbar_state)&&void 0!==e?e:Bp.UNINITIALIZED},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),!jo||!Zo)return!1;e=null!=e?e:jo.location,n=null!=n?n:jo.history;try{if(!t){try{jo.localStorage.setItem("test","test"),jo.localStorage.removeItem("test")}catch(e){return!1}t=null==jo?void 0:jo.localStorage}var r,i=Dp||su(e.hash,"__posthog")||su(e.hash,"state"),o=i?qs((function(){return JSON.parse(atob(decodeURIComponent(i)))}))||qs((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(Np)||"{}")).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=es.ph_load_toolbar||es.ph_load_editor;!ws(t)&&_s(t)?t(e,this.instance):Hp.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Zo||!Zo.getElementById(Ad));if(!jo||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=ki({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(jo.localStorage.setItem(Np,JSON.stringify(ki({},i,{source:void 0}))),this._getToolbarState()===Bp.LOADED)this._callLoadToolbar(i);else if(this._getToolbarState()===Bp.UNINITIALIZED){var o;this._setToolbarState(Bp.LOADING),null==(o=es.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",(function(e){if(e)return Hp.error("[Toolbar] Failed to load",e),void t._setToolbarState(Bp.UNINITIALIZED);t._setToolbarState(Bp.LOADED),t._callLoadToolbar(i)})),js(jo,"turbolinks:load",(function(){t._setToolbarState(Bp.UNINITIALIZED),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}(),zp=Ps("[TracingHeaders]"),Up=function(){function e(e){var t=this;this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=function(){var e,n;gs(t._restoreXHRPatch)&&(null==(e=es.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(t._instance.sessionManager));gs(t._restoreFetchPatch)&&(null==(n=es.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)||n._patchFetch(t._instance.sessionManager))},this._instance=e}var t=e.prototype;return t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",(function(t){if(t)return zp.error("failed to load script",t);e()}))},t.startIfEnabledOrStop=function(){var e,t;this._instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)},e}(),Vp=Ps("[Web Vitals]"),Wp=9e5,Gp=function(){function e(e){var t,n=this;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(){clearTimeout(n._delayedFlushTimer),0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",n._buffer.metrics.reduce((function(e,t){var n;return ki({},e,((n={})["$web_vitals_"+t.name+"_event"]=ki({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))}),{})),n._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=function(e){var t,r=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(gs(r))Vp.error("Could not read session ID. Dropping metrics!");else{n._buffer=n._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=n._currentURL();if(!gs(i))if(ws(null==e?void 0:e.name)||ws(null==e?void 0:e.value))Vp.error("Invalid metric received",e);else if(n._maxAllowedValue&&e.value>=n._maxAllowedValue)Vp.error("Ignoring metric with value >= "+n._maxAllowedValue,e);else n._buffer.url!==i&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),gs(n._buffer.url)&&(n._buffer.url=i),n._buffer.firstMetricTimestamp=gs(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),n._buffer.metrics.push(ki({},e,{$current_url:i,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),n._buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()}},this._startCapturing=function(){var e,t,r,i,o=es.__PosthogExtensions__;if(!gs(o)&&!gs(o.postHogWebVitalsCallbacks)){var s=o.postHogWebVitalsCallbacks;e=s.onLCP,t=s.onCLS,r=s.onFCP,i=s.onINP}e&&t&&r&&i?(n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("FCP")>-1&&r(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n)),n._initialized=!0):Vp.error("web vitals callbacks not loaded - not starting")},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[ad]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(Vp.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){var t,n,r=hs(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=hs(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((t={})[ad]=r,t)),this._instance.persistence.register(((n={})[ld]=i,n)));this._enabledServerSide=r,this.startIfEnabled()},t._loadScript=function(e){var t,n;null!=(t=es.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"web-vitals",(function(t){t?Vp.error("failed to load script",t):e()}))},t._currentURL=function(){var e=jo?jo.location.href:void 0;return e||Vp.error("Could not determine current URL"),e},wi(e,[{key:"allowedMetrics",get:function(){var e,t,n=hs(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return gs(n)?(null==(t=this._instance.persistence)?void 0:t.props[ld])||["CLS","FCP","INP","LCP"]:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(hs(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"_maxAllowedValue",get:function(){var e=hs(this._instance.config.capture_performance)&&Ss(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Wp;return 0<e&&e<=6e4?Wp:e}},{key:"isEnabled",get:function(){var e=null==Qo?void 0:Qo.protocol;if("http:"!==e&&"https:"!==e)return Vp.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=hs(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ks(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ks(t)?t:this._enabledServerSide}}])}(),Zp=Ps("[Heatmaps]");function Qp(e){return hs(e)&&"clientX"in e&&"clientY"in e&&Ss(e.clientX)&&Ss(e.clientY)}var Yp=function(){function e(e){var t;this.rageclicks=new hf,this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[id])}var t=e.prototype;return t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Zp.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this._flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null==(t=this._deadClicksCapture)||t.stop(),this.getAndClearBuffer()}},t.onRemoteConfig=function(e){var t,n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[id]=n,t));this._enabledServerSide=n,this.startIfEnabled()},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){this._onClick(e.originalEvent,"deadclick")},t._setupListeners=function(){var e=this;jo&&Zo&&(js(jo,"beforeunload",this._flush.bind(this)),js(Zo,"click",(function(t){return e._onClick(t||(null==jo?void 0:jo.event))}),{capture:!0}),js(Zo,"mousemove",(function(t){return e._onMouseMove(t||(null==jo?void 0:jo.event))}),{capture:!0}),this._deadClicksCapture=new Nf(this.instance,Af,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabled(),this._initialized=!0)},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&&Bd(r)&&!jd(r,"body");){if(r===n)return!1;if(ss(t,null==jo?void 0:jo.getComputedStyle(r).position))return!0;r=Xd(r)}return!1}(Yd(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"),!Hd(e.target)&&Qp(e)){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(ki({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!Hd(e.target)&&Qp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))},t._capture=function(e){if(jo){var t=jo.location.href;this._buffer=this._buffer||{},this._buffer[t]||(this._buffer[t]=[]),this._buffer[t].push(e)}},t._flush=function(){this._buffer&&!vs(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},wi(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return hs(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return gs(this.instance.config.capture_heatmaps)?gs(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}}])}(),Jp=function(){function e(e){this._instance=e}var t=e.prototype;return t.doPageView=function(e,t){var n,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==jo?void 0:jo.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(!(gs(o)||gs(s)||gs(a)||gs(u)||gs(l)||gs(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?1:np(s/o,0,1),f=o<=1?1:np(a/o,0,1),p=u<=1?1:np(l/u,0,1),_=u<=1?1:np(c/u,0,1);r=Ms(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:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:_})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r},e}(),Xp=Ps("[Error tracking]"),Kp=function(){function e(e){var t,n;this._suppressionRules=[],this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property(sd))&&void 0!==t?t:[]}var t=e.prototype;return t.onRemoteConfig=function(e){var t,n,r,i=null!==(t=null==(n=e.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[];(this._suppressionRules=i,this._instance.persistence)&&this._instance.persistence.register(((r={})[sd]=this._suppressionRules,r))},t.sendExceptionEvent=function(e){this._matchesSuppressionRule(e)?Xp.info("Skipping exception capture because a suppression rule matched"):this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})},t._matchesSuppressionRule=function(e){var t=e.$exception_list;if(!t||!ps(t)||0===t.length)return!1;var n=t.reduce((function(e,t){var n=t.type,r=t.value;return ms(n)&&n.length>0&&e.$exception_types.push(n),ms(r)&&r.length>0&&e.$exception_messages.push(r),e}),{$exception_types:[],$exception_messages:[]});return this._suppressionRules.some((function(e){var t=e.values.map((function(e){var t=el[e.operator],r=ps(e.value)?e.value:[e.value],i=n[e.key];return r.length>0&&t(r,i)}));return"OR"===e.type?t.some(Boolean):t.every(Boolean)}))},e}(),e_="https?://(.*)",t_=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],n_=Os(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],t_),r_="<masked>";function i_(e,t,n){if(!Zo)return{};var r=t?Os([],t_,n||[]):[];return o_(ou(Zo.URL,r,r_),e)}function o_(e,t){var n=n_.concat(t||[]),r={};return Rs(n,(function(t){var n=iu(e,t);r[t]=n||null})),r}function s_(e){var t=function(e){return e?0===e.search(e_+"google.([^/?]*)")?"google":0===e.search(e_+"bing.com")?"bing":0===e.search(e_+"yahoo.com")?"yahoo":0===e.search(e_+"duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",r={};if(!bs(t)){r.$search_engine=t;var i=Zo?iu(Zo.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function a_(){return navigator.language||navigator.userLanguage}function u_(){return(null==Zo?void 0:Zo.referrer)||"$direct"}function l_(e,t){var n=e?Os([],t_,t||[]):[],r=null==Qo?void 0:Qo.href.substring(0,1e3);return{r:u_().substring(0,1e3),u:r?ou(r,n,r_):void 0}}function c_(e){var t,n=e.r,r=e.u,i={$referrer:n,$referring_domain:null==n?void 0:"$direct"==n?"$direct":null==(t=nu(n))?void 0:t.host};if(r){i.$current_url=r;var o=nu(r);i.$host=null==o?void 0:o.host,i.$pathname=null==o?void 0:o.pathname;var s=o_(r);Ms(i,s)}if(n){var a=s_(n);Ms(i,a)}return i}function d_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function f_(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function p_(e,t){if(!Ko)return{};var n,r=e?Os([],t_,t||[]):[],i=function(e){for(var t=0;t<Xa.length;t++){var n=Xa[t],r=n[0],i=n[1],o=r.exec(e),s=o&&(_s(i)?i(o,e):i);if(s)return s}return["",""]}(Ko),o=i[0],s=i[1];return Ms(As({$os:o,$os_version:s,$browser:Qa(Ko,navigator.vendor),$device:Ka(Ko),$device_type:eu(Ko),$timezone:d_(),$timezone_offset:f_()}),{$current_url:ou(null==Qo?void 0:Qo.href,r,r_),$host:null==Qo?void 0:Qo.host,$pathname:null==Qo?void 0:Qo.pathname,$raw_user_agent:Ko.length>1e3?Ko.substring(0,997)+"...":Ko,$browser_version:Ja(Ko,navigator.vendor),$browser_language:a_(),$browser_language_prefix:(n=a_(),"string"==typeof n?n.split("-")[0]:void 0),$screen_height:null==jo?void 0:jo.screen.height,$screen_width:null==jo?void 0:jo.screen.width,$viewport_height:null==jo?void 0:jo.innerHeight,$viewport_width:null==jo?void 0:jo.innerWidth,$lib:"web",$lib_version:ts.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var __=Ps("[FeatureFlags]"),h_="$active_feature_flags",v_="$override_feature_flags",g_="$feature_flag_payloads",m_="$override_feature_flag_payloads",y_="$feature_flag_request_id",b_=function(e){for(var t,n={},r=Si(Ls(e||{}));!(t=r()).done;){var i=t.value,o=i[0],s=i[1];s&&(n[o]=s)}return n},w_=function(e){var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((function(e){var n;return[e,null!==(n=t[e].variant)&&void 0!==n?n:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((function(e){return t[e].enabled})).filter((function(e){var n;return null==(n=t[e].metadata)?void 0:n.payload})).map((function(e){var n;return[e,null==(n=t[e].metadata)?void 0:n.payload]})))):__.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},S_=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({}),k_=function(){function e(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._decideCalled=!1,this._flagsLoadedFromRemote=!1,this._instance=e,this.featureFlagEventHandlers=[]}var t=e.prototype;return t.decide=function(){if(this._instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._instance.get_property(xd),t=this._instance.get_property(v_),n=this._instance.get_property(m_);if(!n&&!t)return e||{};for(var r,i=Ms({},e||{}),o=Si([].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=gs(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,f=gs(c)?l.variant:"string"==typeof c?c:void 0,p=null==n?void 0:n[u],_=ki({},l,{enabled:d,variant:d?null!=f?f:null==l?void 0:l.variant:void 0});if(d!==(null==l?void 0:l.enabled)&&(_.original_enabled=null==l?void 0:l.enabled),f!==(null==l?void 0:l.variant)&&(_.original_variant=null==l?void 0:l.variant),p)_.metadata=ki({},null==l?void 0:l.metadata,{payload:p,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload});i[u]=_}return this._override_warning||(__.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i},t.getFlagVariants=function(){var e=this._instance.get_property(Sd),t=this._instance.get_property(v_);if(!t)return e||{};for(var n=Ms({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(__.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n},t.getFlagPayloads=function(){var e=this._instance.get_property(g_),t=this._instance.get_property(m_);if(!t)return e||{};for(var n=Ms({},e||{}),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(__.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._instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((function(){e._callDecideEndpoint()}),5))},t._clearDebouncer=function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0},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._callDecideEndpoint=function(e){var t,n=this;if(this._clearDebouncer(),!this._instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ki({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Ed)||{}),group_properties:this._instance.get_property(Cd)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var i=this._instance.config.__preview_flags_v2&&this._instance.config.__preview_remote_config;i&&(r.timezone=d_()),this._requestInFlight=!0,this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("api",i?"/flags/?v=2":"/decide/?v=4"),data:r,compression:this._instance.config.disable_compression?void 0:is.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:function(e){var t,i,o=!0;(200===e.statusCode&&(n._additionalReloadRequested||(n.$anon_distinct_id=void 0),o=!1),n._requestInFlight=!1,n._decideCalled)||(n._decideCalled=!0,n._instance._onRemoteConfig(null!==(i=e.json)&&void 0!==i?i:{}));if(!r.disable_flags||n._additionalReloadRequested)if(n._flagsLoadedFromRemote=!o,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(S_.FeatureFlags))__.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var s;if(!r.disable_flags)n.receivedFeatureFlags(null!==(s=e.json)&&void 0!==s?s:{},o);n._additionalReloadRequested&&(n._additionalReloadRequested=!1,n._callDecideEndpoint())}}})}},t.getFeatureFlag=function(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,i=this._instance.get_property(y_)||void 0,o=this._instance.get_property(Id)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(r))){var s,a,u,l,c,d,f,p,_,h;ps(o[e])?o[e].push(r):o[e]=[r],null==(s=this._instance.persistence)||s.register(((a={})[Id]=o,a));var v=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:i,$feature_flag_bootstrapped_response:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlags)?void 0:u[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};gs(null==v||null==(c=v.metadata)?void 0:c.version)||(g.$feature_flag_version=v.metadata.version);var m,y=null!==(d=null==v||null==(f=v.reason)?void 0:f.description)&&void 0!==d?d:null==v||null==(p=v.reason)?void 0:p.code;if(y&&(g.$feature_flag_reason=y),null!=v&&null!=(_=v.metadata)&&_.id&&(g.$feature_flag_id=v.metadata.id),gs(null==v?void 0:v.original_variant)&&gs(null==v?void 0:v.original_enabled)||(g.$feature_flag_original_response=gs(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(h=v.metadata)&&h.original_payload)g.$feature_flag_original_payload=null==v||null==(m=v.metadata)?void 0:m.original_payload;this._instance.capture("$feature_flag_called",g)}return n}__.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")},t.getFeatureFlagDetails=function(e){return this.getFlagsWithDetails()[e]},t.getFeatureFlagPayload=function(e){return this.getFlagPayloads()[e]},t.getRemoteConfigPayload=function(e,t){var n=this._instance.config.token;this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:is.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:function(n){var r,i=null==(r=n.json)?void 0:r.featureFlagPayloads;t((null==i?void 0:i[e])||void 0)}})},t.isFeatureEnabled=function(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);__.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")},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){if(this._instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),i=this.getFlagsWithDetails();!function(e,t,n,r,i){var o,s;void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={});var a=w_(e),u=a.flags,l=a.featureFlags,c=a.featureFlagPayloads;if(l){var d=e.requestId;if(ps(l)){var f;__.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(l)for(var _=0;_<l.length;_++)p[l[_]]=!0;t&&t.register(((f={})[h_]=l,f[Sd]=p,f))}else{var h=l,v=c,g=u;e.errorsWhileComputingFlags&&(h=ki({},n,h),v=ki({},r,v),g=ki({},i,g)),t&&t.register(ki(((o={})[h_]=Object.keys(b_(h)),o[Sd]=h||{},o[g_]=v||{},o[xd]=g||{},o),d?((s={})[y_]=d,s):{}))}}}(e,this._instance.persistence,n,r,i),this._fireFeatureFlagsCallbacks(t)}},t.override=function(e,t){void 0===t&&(t=!1),__.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})},t.overrideFeatureFlags=function(e){if(!this._instance.__loaded||!this._instance.persistence)return __.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(v_),this._instance.persistence.unregister(m_),void this._fireFeatureFlagsCallbacks();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,n=e;if(this._override_warning=Boolean(null!==(t=n.suppressWarning)&&void 0!==t&&t),"flags"in n)if(!1===n.flags)this._instance.persistence.unregister(v_);else if(n.flags)if(ps(n.flags)){for(var r,i={},o=0;o<n.flags.length;o++)i[n.flags[o]]=!0;this._instance.persistence.register(((r={})[v_]=i,r))}else{var s;this._instance.persistence.register(((s={})[v_]=n.flags,s))}if("payloads"in n)if(!1===n.payloads)this._instance.persistence.unregister(m_);else if(n.payloads){var a;this._instance.persistence.register(((a={})[m_]=n.payloads,a))}this._fireFeatureFlagsCallbacks()}else this._fireFeatureFlagsCallbacks()},t.onFeatureFlags=function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}},t.updateEarlyAccessFeatureEnrollment=function(e,t){var n,r,i,o,s=(this._instance.get_property(kd)||[]).find((function(t){return t.flagKey===e})),a=((n={})["$feature_enrollment/"+e]=t,n),u={$feature_flag:e,$feature_enrollment:t,$set:a};s&&(u.$early_access_feature_name=s.name),this._instance.capture("$feature_enrollment_update",u),this.setPersonPropertiesForFlags(a,!1);var l=ki({},this.getFlagVariants(),((r={})[e]=t,r));null==(i=this._instance.persistence)||i.register(((o={})[h_]=Object.keys(b_(l)),o[Sd]=l,o)),this._fireFeatureFlagsCallbacks()},t.getEarlyAccessFeatures=function(e,t,n){var r=this;void 0===t&&(t=!1);var i=this._instance.get_property(kd),o=n?"&"+n.map((function(e){return"stage="+e})).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:function(t){var n,i;if(t.json){var o=t.json.earlyAccessFeatures;return null==(n=r._instance.persistence)||n.register(((i={})[kd]=o,i)),e(o)}}})},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._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))},t.setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=this._instance.get_property(Ed)||{};this._instance.register(((n={})[Ed]=ki({},r,e),n)),t&&this._instance.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(){this._instance.unregister(Ed)},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=this._instance.get_property(Cd)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(t){r[t]=ki({},r[t],e[t]),delete e[t]})),this._instance.register(((n={})[Cd]=ki({},r,e),n)),t&&this._instance.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._instance.get_property(Cd)||{};this._instance.register(((n={})[Cd]=ki({},r,((t={})[e]={},t)),n))}else this._instance.unregister(Cd)},wi(e,[{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),x_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],E_=function(){function e(e){this._config=e,this.props={},this._campaign_params_saved=!1,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.load(),e.debug&&Ts.info("Persistence loaded",e.persistence,ki({},this.props)),this.update_config(e,e),this.save()}var t=e.prototype;return t._buildStorage=function(e){-1===x_.indexOf(e.persistence.toLowerCase())&&(Ts.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Tf._is_supported()?Tf:"localstorage+cookie"===t&&If._is_supported()?If:"sessionstorage"===t&&Of._is_supported()?Of:"memory"===t?Rf:"cookie"===t?Ef:If._is_supported()?If:Ef},t.properties=function(){var e={};return Rs(this.props,(function(t,n){if(n===Sd&&hs(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/"+r[i]]=t[r[i]];else s=n,a=!1,(bs(o=Nd)?a:Wo&&o.indexOf===Wo?-1!=o.indexOf(s):(Rs(o,(function(e){if(a||(a=e===s))return Is})),a))||(e[n]=t);var o,s,a})),e},t.load=function(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=Ms({},e))}},t.save=function(){this._disabled||this._storage._set(this._name,this.props,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)},t.remove=function(){this._storage._remove(this._name,!1),this._storage._remove(this._name,!0)},t.clear=function(){this.remove(),this.props={}},t.register_once=function(e,t,n){var r=this;if(hs(e)){gs(t)&&(t="None"),this._expire_days=gs(n)?this._default_expiry:n;var i=!1;if(Rs(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(hs(e)){this._expire_days=gs(t)?this._default_expiry:t;var r=!1;if(Rs(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1},t.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},t.update_campaign_params=function(){if(!this._campaign_params_saved){var e=i_(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);vs(As(e))||this.register(e),this._campaign_params_saved=!0}},t.update_search_keyword=function(){var e;this.register((e=null==Zo?void 0:Zo.referrer)?s_(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:u_(),$referring_domain:null!=Zo&&Zo.referrer&&(null==(e=nu(Zo.referrer))?void 0:e.host)||"$direct"},void 0)},t.set_initial_person_info=function(){var e;this.props[Od]||this.props[Ld]||this.register_once(((e={})[qd]=l_(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),e),void 0)},t.get_initial_props=function(){var e=this,t={};Rs([Ld,Od],(function(n){var r=e.props[n];r&&Rs(r,(function(e,n){t["$initial_"+us(n)]=e}))}));var n,r,i=this.props[qd];if(i){var o=(n=c_(i),r={},Rs(n,(function(e,t){r["$initial_"+us(t)]=e})),r);Ms(t,o)}return t},t.safe_merge=function(e){return Rs(this.props,(function(t,n){n in e||(e[n]=t)})),e},t.update_config=function(e,t){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this._buildStorage(e),r=this.props;this.clear(),this._storage=n,this.props=r,this.save()}},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(),this.save())},t.set_secure=function(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())},t.set_event_timer=function(e,t){var n=this.props[nd]||{};n[e]=t,this.props[nd]=n,this.save()},t.remove_event_timer=function(e){var t=(this.props[nd]||{})[e];return gs(t)||(delete this.props[nd][e],this.save()),t},t.get_property=function(e){return this.props[e]},t.set_property=function(e,t){this.props[e]=t,this.save()},e}(),C_=function(){function e(){this._events={},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=Si(this._events[e]||[]);!(n=r()).done;){(0,n.value)(t)}for(var i,o=Si(this._events["*"]||[]);!(i=o()).done;){(0,i.value)(e,t)}},e}(),T_=function(){function e(e){var t=this;this._debugEventEmitter=new C_,this._checkStep=function(e,n){return t._checkStepEvent(e,n)&&t._checkStepUrl(e,n)&&t._checkStepElement(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,this._actionEvents=new Set,this._actionRegistry=new Set}var t=e.prototype;return t.init=function(){var e,t=this;if(!gs(null==(e=this._instance)?void 0:e._addCaptureHook)){var n;null==(n=this._instance)||n._addCaptureHook((function(e,n){t.on(e,n)}))}},t.register=function(e){var t,n,r=this;if(!gs(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null==(t=r._actionRegistry)||t.add(e),null==(n=e.steps)||n.forEach((function(e){var t;null==(t=r._actionEvents)||t.add((null==e?void 0:e.event)||"")}))})),null!=(n=this._instance)&&n.autocapture)){var i,o=new Set;e.forEach((function(e){var t;null==(t=e.steps)||t.forEach((function(e){null!=e&&e.selector&&o.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(o)}},t.on=function(e,t){var n,r=this;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(null==t?void 0:t.event))&&this._actionRegistry&&(null==(n=this._actionRegistry)?void 0:n.size)>0&&this._actionRegistry.forEach((function(e){r._checkAction(t,e)&&r._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=Si(t.steps);!(n=r()).done;){var i=n.value;if(this._checkStep(e,i))return!0}return!1},t.onAction=function(e,t){return this._debugEventEmitter.on(e,t)},t._checkStepUrl=function(t,n){if(null!=n&&n.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!e._matchString(i,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||"contains"))return!1}return!0},e._matchString=function(t,n,r){switch(r){case"regex":return!!jo&&Xu(t,n);case"exact":return n===t;case"contains":var i=e._escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Xu(t,i);default:return!1}},e._escapeStringRegexp=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},t._checkStepElement=function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this._getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e._matchString(t.href||"",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||"exact"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e._matchString(t.text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")&&!e._matchString(t.$el_text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")))})))return!1;if(null!=n&&n.selector){var r,i=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(!i)return!1;if(!i.includes(null==n?void 0:n.selector))return!1}return!0},t._getElementsList=function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements},e}(),P_=function(){function e(e){this._instance=e,this._eventToSurveys=new Map,this._actionToSurveys=new Map}var t=e.prototype;return t.register=function(e){var t;gs(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedSurveys(e),this._setupActionBasedSurveys(e))},t._setupActionBasedSurveys=function(e){var t=this,n=e.filter((function(e){var t,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0}));if(0!==n.length){if(null==this._actionMatcher){this._actionMatcher=new T_(this._instance),this._actionMatcher.init();this._actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,r,i,o,s;e.conditions&&null!=(n=e.conditions)&&n.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(o=t._actionMatcher)||o.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((function(n){if(n&&n.name){var r=t._actionToSurveys.get(n.name);r&&r.push(e.id),t._actionToSurveys.set(n.name,r||[e.id])}})))}))}},t._setupEventBasedSurveys=function(e){var t,n=this;if(0!==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})).length){null==(t=this._instance)||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach((function(t){if(t&&t.name){var r=n._eventToSurveys.get(t.name);r&&r.push(e.id),n._eventToSurveys.set(t.name,r||[e.id])}}))}))}},t.onEvent=function(e,t){var n,r=(null==(n=this._instance)||null==(n=n.persistence)?void 0:n.props[Pd])||[];if("survey shown"===e&&t&&r.length>0){var i;zs.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var o=null==t||null==(i=t.properties)?void 0:i.$survey_id;if(o){var s=r.indexOf(o);s>=0&&(r.splice(s,1),this._updateActivatedSurveys(r))}}else this._eventToSurveys.has(e)&&(zs.info("survey event matched, updating activated surveys",{event:e,surveys:this._eventToSurveys.get(e)}),this._updateActivatedSurveys(r.concat(this._eventToSurveys.get(e)||[])))},t.onAction=function(e){var t,n=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[Pd])||[];this._actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this._actionToSurveys.get(e)||[]))},t._updateActivatedSurveys=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Pd]=[].concat(new Set(e)),n))},t.getSurveys=function(){var e,t=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[Pd];return t||[]},t.getEventToSurveys=function(){return this._eventToSurveys},t._getActionMatcher=function(){return this._actionMatcher},e}(),I_=function(){function e(e){this._surveyManager=null,this._isFetchingSurveys=!1,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._instance=e,this._surveyEventReceiver=null}var t=e.prototype;return t.onRemoteConfig=function(e){var t=e.surveys;if(ws(t))return zs.warn("Decide not loaded yet. Not loading surveys.");var n=ps(t);this._hasSurveys=n?t.length>0:t,zs.info("decide response received, hasSurveys: "+this._hasSurveys),this._hasSurveys&&this.loadIfEnabled()},t.reset=function(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(null!=n&&n.startsWith(Gs)||null!=n&&n.startsWith(Zs))&&e.push(n)}e.forEach((function(e){return localStorage.removeItem(e)}))},t.loadIfEnabled=function(){var e=this;if(!this._surveyManager)if(this._isInitializingSurveys)zs.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)zs.info("Disabled. Not loading surveys.");else if(this._hasSurveys){var t=null==es?void 0:es.__PosthogExtensions__;if(t){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)return void this._completeSurveyInitialization(n);var r=t.loadExternalDependency;if(!r)return void this._handleSurveyLoadError("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(function(n){n||!t.generateSurveys?e._handleSurveyLoadError("Could not load surveys script",n):e._completeSurveyInitialization(t.generateSurveys)}))}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}else zs.error("PostHog Extensions not found.")}else zs.info("No surveys to load.")},t._completeSurveyInitialization=function(e){this._surveyManager=e(this._instance),this._surveyEventReceiver=new P_(this._instance),zs.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})},t._handleSurveyLoadError=function(e,t){zs.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=this;if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return zs.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(Td);if(r&&!t)return e(r,{isLoaded:!0});if(this._isFetchingSurveys)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:function(t){var r,i;n._isFetchingSurveys=!1;var o=t.statusCode;if(200!==o||!t.json){var s="Surveys API could not be loaded, status: "+o;return zs.error(s),e([],{isLoaded:!1,error:s})}var a,u=t.json.surveys||[],l=u.filter((function(e){return Us(e)&&(Vs(e)||Ws(e))}));l.length>0&&(null==(a=n._surveyEventReceiver)||a.register(l));return null==(r=n._instance.persistence)||r.register(((i={})[Td]=u,i)),e(u,{isLoaded:!0})}})}catch(e){throw this._isFetchingSurveys=!1,e}},t._notifySurveyCallbacks=function(e){for(var t,n=Si(this._surveyCallbacks);!(t=n()).done;){var r=t.value;try{e.isLoaded?this.getSurveys(r):r([],e)}catch(e){zs.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!ws(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);zs.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(ws(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(ws(this._surveyManager))return zs.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return ws(this._surveyManager)?(zs.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):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._checkSurveyEligibility(o);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))},t.renderSurvey=function(e,t){if(ws(this._surveyManager))zs.warn("init was not called");else{var n=this._getSurveyById(e),r=null==Zo?void 0:Zo.querySelector(t);n?r?this._surveyManager.renderSurvey(n,r):zs.warn("Survey element not found"):zs.warn("Survey not found")}},e}(),F_=Ps("[RateLimiter]"),R_=function(){function e(e){var t,n,r=this;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){F_.info((e||"events")+" is quota limited."),r.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void F_.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(n=e.config.rate_limiting)?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),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=(new Date).getTime(),o=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property(Md))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||e||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null==(r=this.instance.persistence)||r.set_property(Md,o),{isRateLimited:s,remainingTokens:o.tokens}},t.isServerRateLimited=function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t},e}(),M_=Ps("[RemoteConfig]"),O_=function(){function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,r=this;null!=(t=es.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=es.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",(function(){return e(r.remoteConfig)})):(M_.error("PostHog Extensions not found. Cannot load remote config."),e())},t._loadRemoteConfigJSON=function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:function(t){e(t.json)}})},t.load=function(){var e=this;try{if(this.remoteConfig)return M_.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance.config.advanced_disable_decide)return void M_.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((function(t){if(!t)return M_.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON((function(t){e._onRemoteConfig(t)}));e._onRemoteConfig(t)}))}catch(e){M_.error("Error loading remote config",e)}},t._onRemoteConfig=function(e){e?this._instance.config.__preview_remote_config?(this._instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):M_.info("__preview_remote_config is disabled. Logging config instead",e):M_.error("Failed to fetch remote config from PostHog.")},wi(e,[{key:"remoteConfig",get:function(){var e;return null==(e=es._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),L_=3e3,q_=function(){function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=np((null==t?void 0:t.flush_interval_ms)||L_,250,5e3,"flush interval",L_),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._sendRequest(ki({},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&&ps(n.data)&&Rs(n.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e._sendRequest(n)};for(var r in t)n()}}),this._flushTimeoutMs))},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return Rs(this._queue,(function(t){var n,r=t,i=(r?r.batchKey:null)||r.url;gs(e[i])&&(e[i]=ki({},r,{data:[]})),null==(n=e[i].data)||n.push(r.data)})),this._queue=[],e},e}(),$_=["retriesPerformedSoFar"];var A_=function(){function e(e){var t=this;this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!gs(jo)&&"onLine"in jo.navigator&&(this._areWeOnline=jo.navigator.onLine,js(jo,"online",(function(){t._areWeOnline=!0,t._flush()})),js(jo,"offline",(function(){t._areWeOnline=!1})))}var t=e.prototype;return t.retriableRequest=function(e){var t=this,n=e.retriesPerformedSoFar,r=xi(e,$_);Ss(n)&&n>0&&(r.url=Zu(r.url,{retry_count:n})),this._instance._send_request(ki({},r,{callback:function(e){200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?t._enqueue(ki({retriesPerformedSoFar:n},r)):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)*(r-n);return Math.ceil(r+i)}(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)"),Ts.warn(i),this._isPolling||(this._isPolling=!0,this._poll())},t._poll=function(){var e=this;this._poller&&clearTimeout(this._poller),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 n.retryAt<e||(t.push(n),!1)}));if(this._queue=t,n.length>0)for(var r,i=Si(n);!(r=i()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}},t.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);for(var e,t=Si(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(ki({},n,{transport:"sendBeacon"}))}catch(e){Ts.error(e)}}this._queue=[]},wi(e,[{key:"length",get:function(){return this._queue.length}}])}(),D_=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(){js(jo,"scroll",this._updateScrollData,{capture:!0}),js(jo,"scrollend",this._updateScrollData,{capture:!0}),js(jo,"resize",this._updateScrollData)},t.scrollElement=function(){if(!this._instance.config.scroll_root_selector)return null==jo?void 0:jo.document.documentElement;for(var e,t=Si(ps(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);!(e=t()).done;){var n=e.value,r=null==jo?void 0:jo.document.querySelector(n);if(r)return r}},t.scrollY=function(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return jo&&(jo.scrollY||jo.pageYOffset||jo.document.documentElement.scrollTop)||0},t.scrollX=function(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return jo&&(jo.scrollX||jo.pageXOffset||jo.document.documentElement.scrollLeft)||0},e}(),N_=function(e){return l_(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties)},H_=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={})[Rd]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||N_,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Rd]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?c_(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}},t.getSessionProps=function(){var e={};return Rs(As(this.getSetOnceProps()),(function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+us(n)]=t})),e},e}(),B_=Ps("[SessionId]"),j_=function(){function e(e,t,n){var r;if(this._sessionIdChangedHandlers=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||na,this._windowIdGenerator=n||na;var i=this._config.persistence_name||this._config.token,o=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*np(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+i+"_window_id",this._primary_window_exists_storage_key="ph_"+i+"_primary_window_exists",this._canUseSessionStorage()){var s=Of._parse(this._window_id_storage_key),a=Of._parse(this._primary_window_exists_storage_key);s&&!a?this._windowId=s:Of._remove(this._window_id_storage_key),Of._set(this._primary_window_exists_storage_key,!0)}if(null!=(r=this._config.bootstrap)&&r.sessionID)try{var u=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)}(this._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),u)}catch(e){B_.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}var t=e.prototype;return t.onSessionId=function(e){var t=this;return gs(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&&Of._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Of._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Of._parse(this._window_id_storage_key):null},t._setSessionId=function(e,t,n){var r;e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register(((r={})[md]=[t,e,n],r)))},t._getSessionId=function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this._persistence.props[md];return ps(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},t.resetSessionId=function(){this._setSessionId(null,null,null)},t._listenToReloadWindow=function(){var e=this;js(jo,"beforeunload",(function(){e._canUseSessionStorage()&&Of._remove(e._primary_window_exists_storage_key)}),{capture:!1})},t.checkAndGetSessionAndWindowId=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this._config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),r=this._getSessionId(),i=r[0],o=r[1],s=r[2],a=this._getWindowId(),u=Ss(s)&&s>0&&Math.abs(n-s)>864e5,l=!1,c=!o,d=!e&&Math.abs(n-i)>this.sessionTimeoutMs;c||d||u?(o=this._sessionIdGenerator(),a=this._windowIdGenerator(),B_.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}}),s=n,l=!0):a||(a=this._windowIdGenerator(),l=!0);var f=0===i||!e||u?n:i,p=0===s?(new Date).getTime():s;return this._setWindowId(a),this._setSessionId(o,f,p),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((function(e){return e(o,a,l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0)})),{sessionId:o,windowId:a,sessionStartTimestamp:p,changeReason:l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:i}},t._resetIdleTimer=function(){var e=this;clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((function(){e.resetSessionId()}),1.1*this.sessionTimeoutMs)},wi(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),z_=["$set_once","$set"],U_=Ps("[SiteApps]"),V_=function(){function e(e){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.init=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);d<f.length;d++){var p=f[d],_=p[0],h=p[1];u[_]={id:l[_],type:_,properties:h}}var v=e.$set_once,g=e.$set;return{event:ki({},xi(e,z_),{properties:ki({},e.properties,g?{$set:ki({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},v?{$set_once:ki({},null!==(r=null==(i=e.properties)?void 0:i.$set_once)&&void 0!==r?r:{},v)}:{}),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.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(U_.info("Processing "+t._bufferedInvocations.length+" events for site app with id "+e.id),t._bufferedInvocations.forEach((function(e){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,U_.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),i&&r()};try{var s=e.init({posthog:this._instance,callback:function(e){o(e)}}).processEvent;s&&(n.processEvent=s),i=!0}catch(t){U_.error("Error while initializing PostHog app with config id "+e.id,t),o(!1)}if(i&&n.loaded)try{r()}catch(t){U_.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=Si(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=Si(t);!(i=o()).done;){var s=i.value;this.setupSiteApp(s)}},t._onCapturedEvent=function(e){if(0!==Object.keys(this.apps).length)for(var t=this.globalsForEvent(e),n=0,r=Object.values(this.apps);n<r.length;n++){var i=r[n];try{null==i.processEvent||i.processEvent(t)}catch(t){U_.error("Error while processing event "+e.event+" for site app "+i.id,t)}}},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 U_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this._stopBuffering)||n.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled)for(var o,s=function(){var e,t=o.value,n=t.id,r=t.url;es["__$$ph_site_app_"+n]=i._instance,null==(e=es.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,(function(e){if(e)return U_.error("Error while initializing PostHog app with config id "+n,e)}))},a=Si(e.siteApps);!(o=a()).done;)s();else U_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')},wi(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"siteAppLoaders",get:function(){var e;return null==(e=es._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),W_=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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"],G_=function(e,t){if(!e)return!1;var n=e.toLowerCase();return W_.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Z_=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&G_(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((function(e){return G_(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver},Q_=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Y_="i.posthog.com",J_=function(){function e(e){this._regionCache={},this.instance=e}return e.prototype.endpointFor=function(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===Q_.CUSTOM)return this.apiHost+t;var n=Y_+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}},wi(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:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Y_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Q_.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Q_.EU:this._regionCache[this.apiHost]=Q_.CUSTOM),this._regionCache[this.apiHost]}}])}(),X_={icontains:function(e,t){return!!jo&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return!!jo&&-1===t.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return!!jo&&Xu(t.href,e)},not_regex:function(e,t){return!!jo&&!Xu(t.href,e)},exact:function(e,t){return t.href===e},is_not:function(e,t){return t.href!==e}},K_=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;if(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);ms(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._applyTransforms(t.name,o,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((function(e){n.onFeatureFlags(e)}))}var t=e.prototype;return t.onFeatureFlags=function(t){var n=this;if(this._is_bot())e._logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ws(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=iu(null==n?void 0:n.search,"__experiment_id"),i=iu(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._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()},t.getWebExperiments=function(e,t,n){if(this._instance.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._instance.config.token),method:"GET",callback:function(t){if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})},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){return!ws(t.conditions)&&(e._matchUrlConditions(t)&&e._matchUTMConditions(t))},e._matchUrlConditions=function(t){var n;if(ws(t.conditions)||ws(null==(n=t.conditions)?void 0:n.url))return!0;var r,i,o,s=e.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||X_[null!==(i=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))},e.getWindowLocation=function(){return null==jo?void 0:jo.location},e._matchUTMConditions=function(e){var t;if(ws(e.conditions)||ws(null==(t=e.conditions)?void 0:t.utm))return!0;var n=i_();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,p=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,_=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&&p&&_&&f}return!1},e._logInfo=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Ts.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo("Refusing to render web experiment since the viewer is a likely bot"):"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 Go&&this._instance?Z_(Go,this._instance.config.custom_blocked_useragents):void 0},e}(),eh={},th=function(){},nh="posthog",rh=!Wu&&-1===(null==Ko?void 0:Ko.indexOf("MSIE"))&&-1===(null==Ko?void 0:Ko.indexOf("Mozilla")),ih=function(){var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Hs(null==Zo?void 0:Zo.location),persistence:"localStorage+cookie",persistence_name:"",loaded:th,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Qo&&ms(null==Qo?void 0:Qo.search)&&-1!==Qo.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==jo||null==(e=jo.location)?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;Ts.error(t)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:L_},_onCapture:th}},oh=function(e){var t={};gs(e.process_person)||(t.person_profiles=e.process_person),gs(e.xhr_headers)||(t.request_headers=e.xhr_headers),gs(e.cookie_name)||(t.persistence_name=e.cookie_name),gs(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),gs(e.store_google)||(t.save_campaign_params=e.store_google),gs(e.verbose)||(t.debug=e.verbose);var n=Ms({},t,e);return ps(e.property_blacklist)&&(gs(e.property_denylist)?n.property_denylist=e.property_blacklist:ps(e.property_denylist)?n.property_denylist=[].concat(e.property_blacklist,e.property_denylist):Ts.error("Invalid value for property_denylist config: "+e.property_denylist)),n},sh=function(){return wi((function(){this.__forceAllowLocalhost=!1}),[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Ts.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),ah=function(){function e(){var e=this;this.webPerformance=new sh,this._personProcessingSetOncePropertiesSent=!1,this.version=ts.LIB_VERSION,this._internalEventEmitter=new C_,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ih(),this.SentryIntegration=Ap,this.sentryIntegration=function(t){return function(e,t){var n=$p(e,t);return{name:qp,processEvent:function(e){return n(e)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new k_(this),this.toolbar=new jp(this),this.scrollManager=new D_(this),this.pageViewManager=new Jp(this),this.surveys=new I_(this),this.experiments=new K_(this),this.exceptions=new Kp(this),this.rateLimiter=new R_(this),this.requestRouter=new J_(this),this.consent=new qf(this),this.people={set:function(t,n,r){var i,o=ms(t)?((i={})[t]=n,i):t;e.setPersonProperties(o),null==r||r({})},set_once:function(t,n,r){var i,o=ms(t)?((i={})[t]=n,i):t;e.setPersonProperties(void 0,o),null==r||r({})}},this.on("eventCaptured",(function(e){return Ts.info('send "'+(null==e?void 0:e.event)+'"',e)}))}var t=e.prototype;return t.init=function(t,n,r){if(r&&r!==nh){var i,o=null!==(i=eh[r])&&void 0!==i?i:new e;return o._init(t,n,r),eh[r]=o,eh[nh][r]=o,o}return this._init(t,n,r)},t._init=function(e,t,n){var r,i,o=this;if(void 0===t&&(t={}),gs(e)||ys(e))return Ts.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 Ts.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],t.person_profiles&&(this._initialPersonProfilesConfig=t.person_profiles),this.set_config(Ms({},ih(),oh(t),{name:n,token:e})),this.config.on_xhr_error&&Ts.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:is.GZipJS,this.persistence=new E_(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new E_(ki({},this.config,{persistence:"sessionStorage"}));var s=ki({},this.persistence.props),a=ki({},this.sessionPersistence.props);if(this._requestQueue=new q_((function(e){return o._send_retriable_request(e)}),this.config.request_queue_config),this._retryQueue=new A_(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new j_(this),this.sessionPropsManager=new H_(this,this.sessionManager,this.persistence)),new Up(this).startIfEnabledOrStop(),this.siteApps=new V_(this),null==(r=this.siteApps)||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Mp(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new wf(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Yp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Gp(this),this.exceptionObserver=new Bf(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Nf(this,Df),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new jf(this),this.historyAutocapture.startIfEnabled(),ts.DEBUG=ts.DEBUG||this.config.debug,ts.DEBUG&&Ts.info("Starting in debug mode",{this:this,config:t,thisC:ki({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null==(i=t.bootstrap)?void 0:i.distinctID)){var u,l,c=this.config.get_device_id(na()),d=null!=(u=t.bootstrap)&&u.isIdentifiedID?c:t.bootstrap.distinctID;this.persistence.set_property(Fd,null!=(l=t.bootstrap)&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var f,p,_=Object.keys((null==(f=t.bootstrap)?void 0:f.featureFlags)||{}).filter((function(e){var n;return!(null==(n=t.bootstrap)||null==(n=n.featureFlags)||!n[e])})).reduce((function(e,n){var r;return e[n]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[n])||!1,e}),{}),h=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter((function(e){return _[e]})).reduce((function(e,n){var r,i;null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[n]&&(e[n]=null==(i=t.bootstrap)||null==(i=i.featureFlagPayloads)?void 0:i[n]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:h})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Dd,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(na());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(Fd,"anonymous")}return js(jo,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Lp(this,(function(){return o._loaded()})):this._loaded(),_s(this.config._onCapture)&&this.config._onCapture!==th&&(Ts.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(function(e){return o.config._onCapture(e.event,e)}))),this},t._onRemoteConfig=function(e){var t,n,r,i,o,s,a,u,l=this;if(!Zo||!Zo.body)return Ts.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){l._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ss(e.supportedCompression,is.GZipJS)?is.GZipJS:ss(e.supportedCompression,is.Base64)?is.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null==(n=this.siteApps)||n.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(i=this.autocapture)||i.onRemoteConfig(e),null==(o=this.heatmaps)||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(s=this.webVitalsAutocapture)||s.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)},t._loaded=function(){var e=this;try{this.config.loaded(this)}catch(e){Ts.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){e.consent.isOptedIn()&&e._captureInitialPageview()}),1),new O_(this).load(),this.featureFlags.decide()},t._start_queue_if_opted_in=function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())},t._dom_loaded=function(){var e=this;this.has_opted_out_capturing()||Fs(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;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})},t._send_request=function(e){var t=this;this.__loaded&&(rh?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Zu(e.url,{ip:this.config.ip?1:0}),e.headers=ki({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,r,i=ki({},e);i.timeout=i.timeout||6e4,i.url=Zu(i.url,{_:(new Date).getTime().toString(),ver:ts.LIB_VERSION,compression:i.compression});var o=null!==(t=i.transport)&&void 0!==t?t:"fetch",s=null!==(n=null==(r=Bs(Ju,(function(e){return e.transport===o})))?void 0:r.method)&&void 0!==n?n:Ju[0].method;if(!s)throw new Error("No available transport method");s(i)}(ki({},e,{callback:function(n){t.rateLimiter.checkForLimiting(n),n.statusCode>=400&&(null==t.config.on_request_error||t.config.on_request_error(n)),null==e.callback||e.callback(n)}}))))},t._send_retriable_request=function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)},t._execute_array=function(e){var t,n=this,r=[],i=[],o=[];Fs(e,(function(e){e&&(t=e[0],ps(t)?o.push(e):_s(e)?e.call(n):ps(e)&&"alias"===t?r.push(e):ps(e)&&-1!==t.indexOf("capture")&&_s(n[t])?o.push(e):i.push(e))}));var s=function(e,t){Fs(e,(function(e){if(ps(e[0])){var n=t;Rs(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)},t._hasBootstrappedFeatureFlags=function(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1},t.push=function(e){this._execute_array([e])},t.capture=function(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!gs(e)&&ms(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var i=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==i||!i.isRateLimited){null!=t&&t.$current_url&&!ms(null==t?void 0:t.$current_url)&&(Ts.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,s=(null==n?void 0:n.timestamp)||o,a=na(),u={uuid:a,event:e,properties:this.calculateEventProperties(e,t||{},s,a)};i&&(u.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),(null==n?void 0:n.$set)&&(u.$set=null==n?void 0:n.$set);var l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(u.$set_once=l),(u=Ds(u,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,gs(null==n?void 0:n.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=ki({},u.properties.$set,u.$set);if(vs(c)||this.setPersonPropertiesForFlags(c),!ws(this.config.before_send)){var d=this._runBeforeSend(u);if(!d)return;u=d}this._internalEventEmitter.emit("eventCaptured",u);var f={method:"POST",url:null!==(r=null==n?void 0:n._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),u}Ts.critical("This capture call is ignored due to client rate limiting.")}}else Ts.error("No event name provided to posthog.capture")}else Ts.uninitializedWarning("posthog.capture")},t._addCaptureHook=function(e){return this.on("eventCaptured",(function(t){return e(t.event,t)}))},t.calculateEventProperties=function(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var o=i?void 0:this.persistence.remove_event_timer(e),s=ki({},t);if(s.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),"$snapshot"===e){var a=ki({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!ms(s.distinct_id)&&!Ss(s.distinct_id)||ys(s.distinct_id))&&Ts.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,l=p_(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime()),d=c.sessionId,f=c.windowId;s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&Ms(s,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Ms(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){s.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Q_.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=Ms(s,u),"$pageview"===e&&Zo&&(s.title=Zo.title),!gs(o)){var _=n.getTime()-o;s.$duration=parseFloat((_/1e3).toFixed(3))}Ko&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Ms({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),ps(this.config.property_denylist)?Rs(this.config.property_denylist,(function(e){delete s[e]})):Ts.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(Ts.error("sanitize_properties is deprecated. Use before_send instead"),s=h(s,e));var v=this._hasPersonProcessing();return s.$process_person_profile=v,v&&!i&&this._requirePersonProcessing("_calculate_event_properties"),s},t._calculate_set_once_properties=function(e){var t;if(!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var n=this.persistence.get_initial_props(),r=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),i=Ms({},n,r||{},e||{}),o=this.config.sanitize_properties;return o&&(Ts.error("sanitize_properties is deprecated. Use before_send instead"),i=o(i,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,vs(i)?void 0:i},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)},t.register_for_session=function(e){var t;null==(t=this.sessionPersistence)||t.register(e)},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)},t._register_single=function(e,t){var n;this.register(((n={})[e]=t,n))},t.getFeatureFlag=function(e,t){return this.featureFlags.getFeatureFlag(e,t)},t.getFeatureFlagPayload=function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}},t.isFeatureEnabled=function(e,t){return this.featureFlags.isFeatureEnabled(e,t)},t.reloadFeatureFlags=function(){this.featureFlags.reloadFeatureFlags()},t.updateEarlyAccessFeatureEnrollment=function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)},t.getEarlyAccessFeatures=function(e,t,n){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)},t.on=function(e,t){return this._internalEventEmitter.on(e,t)},t.onFeatureFlags=function(e){return this.featureFlags.onFeatureFlags(e)},t.onSurveysLoaded=function(e){return this.surveys.onSurveysLoaded(e)},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.getSurveys(e,t)},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)},t.renderSurvey=function(e,t){this.surveys.renderSurvey(e,t)},t.canRenderSurvey=function(e){return this.surveys.canRenderSurvey(e)},t.canRenderSurveyAsync=function(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)},t.identify=function(e,t,n){if(!this.__loaded||!this.persistence)return Ts.uninitializedWarning("posthog.identify");if(Ss(e)&&(e=e.toString(),Ts.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))Ts.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(td)&&(this.unregister(td),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Fd)||"anonymous");e!==r&&o?(this.persistence.set_property(Fd,"identified"),this.setPersonPropertiesForFlags(ki({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=Ku(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Id))}}else Ts.error("Unique user id has not been set in posthog.identify")},t.setPersonProperties=function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=Ku(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags(ki({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n):Ts.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.group=function(e,t,n){var r;if(e&&t){if(this._requirePersonProcessing("posthog.group")){var i,o=this.getGroups();if(o[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ki({},o,(r={},r[e]=t,r))}),n)this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(((i={})[e]=n,i));o[e]===t||n||this.reloadFeatureFlags()}}else Ts.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){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)},t.resetPersonPropertiesForFlags=function(){this.featureFlags.resetPersonPropertiesForFlags()},t.setGroupPropertiesForFlags=function(e,t){void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)},t.resetGroupPropertiesForFlags=function(e){this.featureFlags.resetGroupPropertiesForFlags(e)},t.reset=function(e){var t,n,r,i;if(Ts.info("reset"),!this.__loaded)return Ts.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(n=this.sessionPersistence)||n.clear(),this.surveys.reset(),null==(r=this.persistence)||r.set_property(Fd,"anonymous"),null==(i=this.sessionManager)||i.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Dd,$device_id:null},"");else{var s=this.config.get_device_id(na());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)},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.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(null!=e&&e.withTimestamp&&r){var o,s=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i},t.alias=function(e,t){return e===this.get_property(ed)?(Ts.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(gs(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(td,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Ts.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t,n,r,i,o=ki({},this.config);hs(e)&&(Ms(this.config,oh(e)),null==(t=this.persistence)||t.update_config(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new E_(ki({},this.config,{persistence:"sessionStorage"})),Tf._is_supported()&&"true"===Tf._get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(ts.DEBUG=!0,Ts.info("set_config",JSON.stringify({config:e,oldConfig:o,newConfig:ki({},this.config)},null,2))),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(i=this.heatmaps)||i.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())},t.startSessionRecording=function(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,i,o,s,a;if(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),n.sampling)null==(i=this.sessionRecording)||i.overrideSampling();if(n.linked_flag)null==(o=this.sessionRecording)||o.overrideLinkedFlag();if(n.url_trigger)null==(s=this.sessionRecording)||s.overrideTrigger("url");if(n.event_trigger)null==(a=this.sessionRecording)||a.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){var n=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(ki({},Gc(function(e){return e instanceof Error}(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))},t.loadToolbar=function(e){return this.toolbar.loadToolbar(e)},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:nh;return t!==nh&&(t=nh+"."+t),t},t._isIdentified=function(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Fd))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Fd))},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&vs(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[td])&&(null==(t=this.persistence)||null==(t=t.props)||!t[$d]))},t._shouldCapturePageleave=function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)},t.createPersonProfile=function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})},t._requirePersonProcessing=function(e){return"never"===this.config.person_profiles?(Ts.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single($d,!0),!0)},t._sync_opt_out_with_persistence=function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null==(e=this.persistence)?void 0:e._disabled)!==s&&(null==(n=this.persistence)||n.set_disabled(s));(null==(t=this.sessionPersistence)?void 0:t._disabled)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s))},t.opt_in_capturing=function(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),gs(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()},t.opt_out_capturing=function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()},t.has_opted_in_capturing=function(){return this.consent.isOptedIn()},t.has_opted_out_capturing=function(){return this.consent.isOptedOut()},t.clear_opt_in_out_capturing=function(){this.consent.reset(),this._sync_opt_out_with_persistence()},t._is_bot=function(){return Go?Z_(Go,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Zo&&("visible"===Zo.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Zo.title},{send_instantly:!0}),this._visibilityStateListener&&(Zo.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),js(Zo,"visibilitychange",this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==jo||jo.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==jo||jo.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))},t._runBeforeSend=function(e){if(ws(this.config.before_send))return e;for(var t,n=e,r=Si(ps(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(t=r()).done;){if(n=(0,t.value)(n),ws(n)){var i="Event '"+e.event+"' was rejected in beforeSend function";return Es(e.event)?Ts.warn(i+". This can cause unexpected behavior."):Ts.info(i),null}n.properties&&!vs(n.properties)||Ts.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n},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)})},wi(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}}])}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=$s(e.prototype[t[n]])}(ah,["identify"]);var uh,lh;uh=eh[nh]=new ah,(lh=es.posthog)&&Rs(lh._i,(function(e){if(e&&ps(e)){var t=uh.init(e[0],e[1],e[2]),n=lh[e[2]]||lh;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),es.posthog=uh,function(){function e(){e.done||(e.done=!0,rh=!1,Rs(eh,(function(e){e._dom_loaded()})))}null!=Zo&&Zo.addEventListener?"complete"===Zo.readyState?e():js(Zo,"DOMContentLoaded",e,{capture:!1}):jo&&Ts.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.es5.js.map