(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[10],{73884:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(60974).Z)("ArrowRightCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"m12 16 4-4-4-4",key:"1i9zcv"}]])},98553:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(60974).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},61616:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(60974).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},24248:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(60974).Z)("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},76311:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(60974).Z)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},93483:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(60974).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},24235:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});let r=n(97295)._(n(719)).default.createContext(null)},4094:function(e){e.exports={style:{fontFamily:"'__Inter_ce1ab9', '__Inter_Fallback_ce1ab9'",fontStyle:"normal"},className:"__className_ce1ab9",variable:"__variable_ce1ab9"}},76471:function(e){e.exports={style:{fontFamily:"'__Roboto_Mono_633fb3', '__Roboto_Mono_Fallback_633fb3'",fontStyle:"normal"},className:"__className_633fb3",variable:"__variable_633fb3"}},32846:function(e,t,n){e.exports=n(21954)},96520:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(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,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||g(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(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 m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}n.d(t,{ZP:function(){return nQ}});var y,b,w={DEBUG:!1,LIB_VERSION:"1.105.7"},k=Array.isArray,E=Object.prototype,S=E.hasOwnProperty,R=E.toString,F=k||function(e){return"[object Array]"===R.call(e)},P=function(e){return"[object Uint8Array]"===R.call(e)},C=function(e){return"function"==typeof e},x=function(e){return e===Object(e)&&!F(e)},M=function(e){return void 0===e},T=function(e){return"[object String]"==R.call(e)},I=function(e){return null===e},O=function(e){return"[object Number]"==R.call(e)},A=function(e){return"[object Boolean]"===R.call(e)},D="undefined"!=typeof window?window:void 0,L="undefined"!=typeof globalThis?globalThis:D,$=Array.prototype,q=$.forEach,N=$.indexOf,B=null==L?void 0:L.navigator,j=null==L?void 0:L.document,H=null==L?void 0:L.location,W=null==L?void 0:L.fetch,V=null==L?void 0:L.XMLHttpRequest,U=null==B?void 0:B.userAgent,Z=null!=D?D:{},G="[PostHog.js]",z={_log:function(e){if(D&&(w.DEBUG||Z.POSTHOG_DEBUG)&&!M(D.console)&&D.console){for(var t=("__rrweb_original__"in D.console[e])?D.console[e].__rrweb_original__:D.console[e],n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[G].concat(r))}},info:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];z._log.apply(z,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];z._log.apply(z,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];z._log.apply(z,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[G].concat(n))},uninitializedWarning:function(e){z.error("You must initialize PostHog before calling ".concat(e))}},K={},Y=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Q(e,t,n){if(F(e)){if(q&&e.forEach===q)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===K)return}}}function J(e,t,n){if(!I(e)&&!M(e)){if(F(e))return Q(e,t,n);for(var r in e)if(S.call(e,r)&&t.call(n,e[r],r)===K)return}}var X=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Q(n,function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e};function ee(e,t){return -1!==e.indexOf(t)}function et(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var en=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},er=function(e){try{return e()}catch(e){return}},eo=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(e)}}},ei=function(e){var t={};return J(e,function(e,n){T(e)&&e.length>0&&(t[n]=e)}),t};function es(e){var t,n,r,o,i,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",c=[];if(!e)return e;e=ea(e);do t=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=i>>12&63,r=i>>6&63,o=63&i,c[u++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(o);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}var ea=function(e){var t,n,r,o,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<r;o++){var s=e.charCodeAt(o),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),I(a)||(n>t&&(i+=e.substring(t,n)),i+=a,t=n=o+1)}return n>t&&(i+=e.substring(t,e.length)),i},eu=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,o,i){if(t){if(t.addEventListener&&!o)t.addEventListener(n,r,!!i);else{var s="on"+n,a=t[s];t[s]=function(n){if(n=n||e(null==D?void 0:D.event)){var o,i=!0;C(a)&&(o=a(n));var s=r.call(t,n);return!1!==o&&!1!==s||(i=!1),i}}}}else z.error("No valid element provided to register_event")}}();function el(e,t){var n=function(){if(!j)return t("document not found");var n=j.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,o=j.querySelectorAll("body > script");o.length>0?null===(r=o[0].parentNode)||void 0===r||r.insertBefore(n,o[0]):j.body.appendChild(n)};null!=j&&j.body?n():null==j||j.addEventListener("DOMContentLoaded",n)}function ec(e){return e?Y(e).split(/\s+/):[]}function ed(e){var t="";switch(i(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return ec(t)}function ef(e){var t="";return em(e)&&!ey(e)&&e.childNodes&&e.childNodes.length&&J(e.childNodes,function(e){ev(e)&&e.textContent&&(t+=Y(e.textContent).split(/(\s+)/).filter(eb).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Y(t)}function ep(e){return!!e&&1===e.nodeType}function eh(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ev(e){return!!e&&3===e.nodeType}function eg(e){return!!e&&11===e.nodeType}var e_=["a","button","form","input","select","textarea","label"];function em(e){for(var t=e;t.parentNode&&!eh(t,"body");t=t.parentNode){var n=ed(t);if(ee(n,"ph-sensitive")||ee(n,"ph-no-capture"))return!1}if(ee(ed(e),"ph-include"))return!0;var r=e.type||"";if(T(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!(T(o)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,"")))}function ey(e){return!!(eh(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||eh(e,"select")||eh(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function eb(e){return!(I(e)||M(e)||T(e)&&(e=Y(e),/^(?:(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}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function ew(e){var t=ef(e);return eb(t="".concat(t," ").concat(function e(t){var n="";return t&&t.childNodes&&t.childNodes.length&&J(t.childNodes,function(t){var r;if(t&&"span"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))try{var o=ef(t);n="".concat(n," ").concat(o).trim(),t.childNodes&&t.childNodes.length&&(n="".concat(n," ").concat(e(t)).trim())}catch(e){z.error(e)}}),n}(e)).trim())?t:""}function ek(e){return e.replace(/"|\\"/g,'\\"')}var eE=function(){function e(t){s(this,e),this.clicks=[],this.enabled=t}return u(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;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}(),eS="$people_distinct_id",eR="__alias",eF="__timers",eP="$autocapture_disabled_server_side",eC="$session_recording_enabled_server_side",ex="$console_log_recording_enabled_server_side",eM="$session_recording_recorder_version_server_side",eT="$session_recording_network_payload_capture",eI="$session_recording_canvas_recording",eO="$sesid",eA="$session_is_sampled",eD="$enabled_feature_flags",eL="$early_access_features",e$="$stored_person_properties",eq="$stored_group_properties",eN="$surveys",eB="$flag_call_reported",ej="$user_state",eH="$posthog_quota_limited",eW="$client_session_props",eV=[eS,eR,"__cmpns",eF,eC,eO,eD,ej,eH,eL,eq,e$,eN,eB,eW];function eU(e,t){return t.length>e?t.slice(0,e)+"...":t}var eZ={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=I(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[eP]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ep(t));return t},_getAugmentPropertiesFromElement:function(e){if(!em(e))return{};var t={};return J(e.attributes,function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&eb(r)&&(t[n]=r)}}),t},_getPropertiesFromElement:function(e,t,n){var r,o=e.tagName.toLowerCase(),i={tag_name:o};e_.indexOf(o)>-1&&!n&&("a"===o.toLowerCase()||"button"===o.toLowerCase()?i.$el_text=eU(1024,ew(e)):i.$el_text=eU(1024,ef(e)));var s=ed(e);s.length>0&&(i.classes=s.filter(function(e){return""!==e}));var a=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;J(e.attributes,function(n){var r;if((!ey(e)||-1!==["name","id","class"].indexOf(n.name))&&(null==a||!a.includes(n.name))&&!t&&eb(n.value)&&(!T(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=n.value;"class"===n.name&&(o=ec(o).join(" ")),i["attr__"+n.name]=eU(1024,o)}});for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return i.nth_child=u,i.nth_of_type=l,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return J(null==j?void 0:j.querySelectorAll(e.css_selector),function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),eb(n)&&t.push(n)}),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return J(this._customProperties,function(r){J(r.event_selectors,function(o){J(null==j?void 0:j.querySelectorAll(o),function(o){ee(e,o)&&em(o)&&(n[r.name]=t._extractCustomPropertyValue(r))})})}),n},_getEventTarget:function(e){var t;return M(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null},_captureEvent:function(e,t){var n,r=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",a=this._getEventTarget(e);if(ev(a)&&(a=a.parentNode||null),"$autocapture"===s&&"click"===e.type&&e instanceof MouseEvent&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"),a&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!D||!e||eh(e,"html")||!ep(e))return!1;if(null!=n&&n.url_allowlist){var r=D.location.href,o=n.url_allowlist;if(o&&!o.some(function(e){return r.match(e)}))return!1}if(null!=n&&n.dom_event_allowlist){var s=n.dom_event_allowlist;if(s&&!s.some(function(e){return t.type===e}))return!1}for(var a=!1,u=[e],l=!0,c=e;c.parentNode&&!eh(c,"body");)if(eg(c.parentNode))u.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=c.parentNode||!1))break;if(e_.indexOf(l.tagName.toLowerCase())>-1)a=!0;else{var d=D.getComputedStyle(l);d&&"pointer"===d.getPropertyValue("cursor")&&(a=!0)}u.push(l),c=l}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(M(n))return!0;var r,o=m(e);try{for(o.s();!(r=o.n()).done;){var s=function(){var e=r.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}}();if("object"===i(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(u,n)||!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(M(n))return!0;var r,o=m(e);try{for(o.s();!(r=o.n()).done;){var s=function(){var e=r.value;if(n.some(function(t){return e.matches(t)}))return{v:!0}}();if("object"===i(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(u,n))return!1;var f=D.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return a?"click"===t.type:"click"===t.type&&(e_.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(a,e,this.config)){for(var u,l,c=[a],d=a;d.parentNode&&!eh(d,"body");)eg(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var f,p=[],v={},g=!1;if(J(c,function(e){var n=em(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=n&&eb(f)&&f),ee(ed(e),"ph-no-capture")&&(g=!0),p.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text)),X(v,r._getAugmentPropertiesFromElement(e))}),t.config.mask_all_text||("a"===a.tagName.toLowerCase()||"button"===a.tagName.toLowerCase()?p[0].$el_text=ew(a):p[0].$el_text=ef(a)),f&&(p[0].attr__href=f),g)return!1;var _=X(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:p.map(function(e){var t,n,r,o={text:null===(n=e.$el_text)||void 0===n?void 0:n.slice(0,400),tag_name:e.tag_name,href:null===(r=e.attr__href)||void 0===r?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?F(t)?t:ec(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return et(e).filter(function(e){return 0===h(e,1)[0].indexOf("attr__")}).forEach(function(e){var t=h(e,2),n=t[0],r=t[1];return o.attributes[n]=r}),o}).map(function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();var i,s=m(e.attr_class);try{for(s.s();!(i=s.n()).done;){var a=i.value;r+=".".concat(a.replace(/"/g,""))}}catch(e){s.e(e)}finally{s.f()}}var u=o(o(o(o({},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),l={};return et(u).sort(function(e,t){var n=h(e,1)[0],r=h(t,1)[0];return n.localeCompare(r)}).forEach(function(e){var t=h(e,2),n=t[0],r=t[1];return l[ek(n.toString())]=ek(r.toString())}),r+=":"+et(u).map(function(e){var t=h(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')}).join("")}).join(";")}:{$elements:p},null!==(u=p[0])&&void 0!==u&&u.$el_text?{$el_text:null===(l=p[0])||void 0===l?void 0:l.$el_text}:{},this._getCustomProperties(c),v);return t.capture(s,_),!0}},_navigate:function(e){D&&(D.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(D&&j){var n=function(n){n=n||(null==D?void 0:D.event),t._captureEvent(n,e)};eu(j,"submit",n,!1,!0),eu(j,"change",n,!1,!0),eu(j,"click",n,!1,!0)}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;A(e.__autocapture)||(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(e){return new RegExp(e)})),this.rageclicks=new eE(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?z.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(l({},eP,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=M(t)?10:t,n=M(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return C(null==j?void 0:j.querySelectorAll)}};!function(e){for(var t in e)C(e[t])&&(e[t]=e[t].bind(e))}(eZ),function(e){for(var t in e)C(e[t])&&(e[t]=eo(e[t]))}(eZ);var eG="$active_feature_flags",ez="$override_feature_flags",eK="$feature_flag_payloads",eY=function(e){var t,n={},r=m(et(e||{}));try{for(r.s();!(t=r.n()).done;){var o=h(t.value,2),i=o[0],s=o[1];s&&(n[i]=s)}}catch(e){r.e(e)}finally{r.f()}return n},eQ=function(){function e(t){s(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(eD),t=this.instance.get_property(ez);if(!t)return e||{};for(var n=X({},e),r=Object.keys(t),o=0;o<r.length;o++)!1===t[r[o]]?delete n[r[o]]:n[r[o]]=t[r[o]];return this._override_warning||(z.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(eK)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(e$),r=this.instance.get_property(eq),o=es(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.requestRouter.endpointFor("decide","/decide/?v=3"),{data:o},{method:"POST"},this.instance._prepare_callback(function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()}))}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],o="".concat(r),i=this.instance.get_property(eB)||{};return!t.send_event&&"send_event"in t||e in i&&i[e].includes(o)||(F(i[e])?i[e].push(o):i[e]=[o],null===(n=this.instance.persistence)||void 0===n||n.register(l({},eB,i)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}z.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);z.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.featureFlags,s=e.featureFlagPayloads;if(i){if(F(i)){var a,u={};if(i)for(var c=0;c<i.length;c++)u[i[c]]=!0;t&&t.register((l(a={},eG,i),l(a,eD,u),a))}else{var d,f=i,p=s;e.errorsWhileComputingFlags&&(f=o(o({},n),f),p=o(o({},r),p)),t&&t.register((l(d={},eG,Object.keys(eY(f))),l(d,eD,f||{}),l(d,eK,p||{}),d))}}})(e,this.instance.persistence,t,n),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return z.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ez);else if(F(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(l({},ez,t))}else this.instance.persistence.register(l({},ez,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks();e(n.flags,n.flagVariants)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,r,i=l({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);var s=o(o({},this.getFlagVariants()),{},l({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((l(r={},eG,Object.keys(eY(s))),l(r,eD,s),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(eL);if(r&&!n)return e(r);this.instance._send_request(this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),{},{method:"GET"},function(n){var r,o=n.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(l({},eL,o)),e(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value: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},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),t=e.flags,n=e.flagVariants;this.featureFlagEventHandlers.forEach(function(e){return e(t,n)})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(e$)||{};this.instance.register(l({},e$,o(o({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(e$)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(eq)||{};0!==Object.keys(n).length&&Object.keys(n).forEach(function(t){n[t]=o(o({},n[t]),e[t]),delete e[t]}),this.instance.register(l({},eq,o(o({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(eq)||{};this.instance.register(l({},eq,o(o({},t),{},l({},e,{}))))}else this.instance.unregister(eq)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return O(e)&&isFinite(e)&&Math.floor(e)===e});var eJ="0123456789abcdef",eX=function(){function e(t){if(s(this,e),this.bytes=t,16!==t.length)throw TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+eJ.charAt(this.bytes[t]>>>4)+eJ.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value: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}}],[{key:"fromFieldsV7",value:function(t,n,r,o){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||t<0||n<0||r<0||o<0||t>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/1099511627776,i[1]=t/4294967296,i[2]=t/16777216,i[3]=t/65536,i[4]=t/256,i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=o>>>24,i[13]=o>>>16,i[14]=o>>>8,i[15]=o,new e(i)}}]),e}(),e0=function(){function e(){s(this,e),l(this,"timestamp",0),l(this,"counter",0),l(this,"random",new e3)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(M(e)){this.timestamp=0;var t=this.generateOrAbort();if(M(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value: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 eX.fromFieldsV7(this.timestamp,Math.trunc(this.counter/1073741824),1073741823&this.counter,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),e1=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw 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};D&&!M(D.crypto)&&crypto.getRandomValues&&(e1=function(e){return crypto.getRandomValues(e)});var e2,e3=function(){function e(){s(this,e),l(this,"buffer",new Uint32Array(8)),l(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(e1(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),e6=function(){return e5().toString()},e5=function(){return(e2||(e2=new e0)).generate()},e8="",e4=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,e7={is_supported:function(){return!!j},error:function(e){z.error("cookieStore error: "+e)},get:function(e){if(j){try{for(var t=e+"=",n=j.cookie.split(";").filter(function(e){return e.length}),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(e7.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,o){if(j)try{var i="",s="",a=function(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j;if(e8)return e8;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),o="dmn_chk_"+e6(),i=RegExp("(^|;)\\s*"+o+"=1");!e8&&r--;){var s=n.slice(r).join("."),a=o+"=1;domain=."+s;t.cookie=a,i.test(t.cookie)&&(t.cookie=a+";expires=Thu, 01 Jan 1970 00:00:00 GMT",e8=s)}return e8}(e);if(!n){var r,o=(r=e.match(e4))?r[0]:"";o!==n&&z.info("Warning: cookie subdomain discovery mismatch",o,n),n=o}return n?"; domain=."+n:""}return""}(j.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*36e5),i="; expires="+u.toUTCString()}o&&(s="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+l.length),j.cookie=l,l}catch(e){return}},remove:function(e,t){try{e7.set(e,"",-1,t)}catch(e){return}}},e9=null,te={is_supported:function(){if(!I(e9))return e9;var e=!0;if(M(D))e=!1;else try{var t="__mplssupport__";te.set(t,"xyz"),'"xyz"'!==te.get(t)&&(e=!1),te.remove(t)}catch(t){e=!1}return e||z.error("localStorage unsupported; falling back to cookie store"),e9=e,e},error:function(e){z.error("localStorage error: "+e)},get:function(e){try{return null==D?void 0:D.localStorage.getItem(e)}catch(e){te.error(e)}return null},parse:function(e){try{return JSON.parse(te.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==D||D.localStorage.setItem(e,JSON.stringify(t))}catch(e){te.error(e)}},remove:function(e){try{null==D||D.localStorage.removeItem(e)}catch(e){te.error(e)}}},tt=["distinct_id",eO,eA],tn=o(o({},te),{},{parse:function(e){try{var t={};try{t=e7.parse(e)||{}}catch(e){}var n=X(t,JSON.parse(te.get(e)||"{}"));return te.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,o){try{te.set(e,t);var i={};tt.forEach(function(e){t[e]&&(i[e]=t[e])}),Object.keys(i).length&&e7.set(e,i,n,r,o)}catch(e){te.error(e)}},remove:function(e,t){try{null==D||D.localStorage.removeItem(e),e7.remove(e,t)}catch(e){te.error(e)}}}),tr={},to={is_supported:function(){return!0},error:function(e){z.error("memoryStorage error: "+e)},get:function(e){return tr[e]||null},parse:function(e){return tr[e]||null},set:function(e,t){tr[e]=t},remove:function(e){delete tr[e]}},ti=null,ts={is_supported:function(){if(!I(ti))return ti;if(ti=!0,M(D))ti=!1;else try{var e="__support__";ts.set(e,"xyz"),'"xyz"'!==ts.get(e)&&(ti=!1),ts.remove(e)}catch(e){ti=!1}return ti},error:function(e){z.error("sessionStorage error: ",e)},get:function(e){try{return null==D?void 0:D.sessionStorage.getItem(e)}catch(e){ts.error(e)}return null},parse:function(e){try{return JSON.parse(ts.get(e))||null}catch(e){}return null},set:function(e,t){try{null==D||D.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ts.error(e)}},remove:function(e){try{null==D||D.sessionStorage.removeItem(e)}catch(e){ts.error(e)}}},ta=["localhost","127.0.0.1"],tu=!(!V||!("withCredentials"in new V))||!!W,tl=function(e){var t=null==j?void 0:j.createElement("a");return M(t)?null:(t.href=e,t)},tc=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),o=0;o<r.length;o++){var i=r[o].split("=");if(i[0]===t){n=i;break}}if(!F(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){z.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},td=function(e,t){var n=e.match(RegExp(t+"=([^&]*)"));return n?n[1]:null},tf={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gbraid","wbraid","fbclid","msclkid"].concat(e||[]),n={};return J(t,function(e){var t=j?tc(j.URL,e):"";t.length&&(n[e]=t)}),n},searchEngine:function(){var e=null==j?void 0:j.referrer;return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=tf.searchEngine(),t={};if(!I(e)){t.$search_engine=e;var n=j?tc(j.referrer,"yahoo"!=e?"q":"p"):"";n.length&&(t.ph_keyword=n)}return t},browser:function(e,t,n){return t=t||"",n||ee(e," OPR/")?ee(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":ee(e,"IEMobile")||ee(e,"WPDesktop")?"Internet Explorer Mobile":ee(e,"SamsungBrowser/")?"Samsung Internet":ee(e,"Edge")||ee(e,"Edg/")?"Microsoft Edge":ee(e,"FBIOS")?"Facebook Mobile":ee(e,"Chrome")?"Chrome":ee(e,"CriOS")?"Chrome iOS":ee(e,"UCWEB")||ee(e,"UCBrowser")?"UC Browser":ee(e,"FxiOS")?"Firefox iOS":ee(t,"Apple")||ee(e,"Safari")&&!ee(e,"Chrome")&&!ee(e,"Android")?ee(e,"Mobile")?"Mobile Safari":"Safari":ee(e,"Android")?"Android Mobile":ee(e,"Konqueror")||ee(e,"konqueror")?"Konqueror":ee(e,"Firefox")?"Firefox":ee(e,"MSIE")||ee(e,"Trident/")?"Internet Explorer":ee(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[tf.browser(e,t,n)];if(M(r))return null;for(var o=0;o<r.length;o++){var i=r[o],s=e.match(i);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var o=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return o&&o[1]?{os_name:"Mac OS X",os_version:[o[1],o[2],o[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return(null==j?void 0:j.referrer)||"$direct"},referringDomain:function(){var e;return null!=j&&j.referrer&&(null===(e=tl(j.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!U)return{};var e=tf.os(U);return X(ei({$os:e.os_name,$os_version:e.os_version,$browser:tf.browser(U,navigator.vendor,Z.opera),$device:tf.device(U),$device_type:tf.deviceType(U)}),{$current_url:null==H?void 0:H.href,$host:null==H?void 0:H.host,$pathname:null==H?void 0:H.pathname,$raw_user_agent:U.length>1e3?U.substring(0,997)+"...":U,$browser_version:tf.browserVersion(U,navigator.vendor,Z.opera),$browser_language:tf.browserLanguage(),$screen_height:null==D?void 0:D.screen.height,$screen_width:null==D?void 0:D.screen.width,$viewport_height:null==D?void 0:D.innerHeight,$viewport_width:null==D?void 0:D.innerWidth,$lib:"web",$lib_version:w.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:en()/1e3})},people_properties:function(){if(!U)return{};var e=tf.os(U);return X(ei({$os:e.os_name,$os_version:e.os_version,$browser:tf.browser(U,navigator.vendor,Z.opera)}),{$browser_version:tf.browserVersion(U,navigator.vendor,Z.opera)})}},tp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],th=function(){function e(t){s(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===tp.indexOf(t.persistence.toLowerCase())&&(z.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var r=t.persistence.toLowerCase();"localstorage"===r&&te.is_supported()?this.storage=te:"localstorage+cookie"===r&&tn.is_supported()?this.storage=tn:"sessionstorage"===r&&ts.is_supported()?this.storage=ts:"memory"===r?this.storage=to:"cookie"===r?this.storage=e7:tn.is_supported()?this.storage=tn:this.storage=e7,this.load(),this.update_config(t),this.save()}return u(e,[{key:"properties",value:function(){var e={};return J(this.props,function(t,n){if(n===eD&&x(t))for(var r,o=Object.keys(t),i=0;i<o.length;i++)e["$feature/".concat(o[i])]=t[o[i]];else r=!1,(I(eV)?r:N&&eV.indexOf===N?-1!=eV.indexOf(n):(J(eV,function(e){if(r||(r=e===n))return K}),r))||(e[n]=t)}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=X({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(x(e)){M(t)&&(t="None"),this.expire_days=M(n)?this.default_expiry:n;var o=!1;if(J(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,o=!0)}),o)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(x(e)){this.expire_days=M(t)?this.default_expiry:t;var r=!1;if(J(e,function(t,o){e.hasOwnProperty(o)&&n.props[o]!==t&&(n.props[o]=t,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(tf.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(tf.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||tf.referrer(),$referring_domain:this.props.$referring_domain||tf.referringDomain()})}},{key:"get_referrer_info",value:function(){return ei({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return J(this.props,function(t,n){n in e||(e[n]=t)}),e}},{key:"update_config",value:function(e){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)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[eF]||{};n[e]=t,this.props[eF]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[eF]||{})[e];return M(t)||(delete this.props[eF][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[ej]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[ej]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[eH]||{}}},{key:"set_quota_limits",value:function(e){this.props[eH]=e,this.save()}}]),e}(),tv=u(function e(t){var n,r,o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),l(this,"bucketSize",100),l(this,"refillRate",10),l(this,"mutationBuckets",{}),l(this,"loggedTracker",{}),l(this,"refillBuckets",function(){Object.keys(o.mutationBuckets).forEach(function(e){o.mutationBuckets[e]=o.mutationBuckets[e]+o.refillRate,o.mutationBuckets[e]>=o.bucketSize&&delete o.mutationBuckets[e]})}),l(this,"getNodeOrRelevantParent",function(e){var t=o.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[o.rrweb.mirror.getId(n),n]}return[e,t]}),l(this,"numberOfChanges",function(e){var t,n,r,o,i,s,a,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(o=e.attributes)||void 0===o?void 0:o.length)&&void 0!==r?r:0)+(null!==(i=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==i?i:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)}),l(this,"throttleMutations",function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=o.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(function(e){var t,n,r,i=h(o.getNodeOrRelevantParent(e.id),2),s=i[0],a=i[1];return 0!==o.mutationBuckets[s]&&(o.mutationBuckets[s]=null!==(t=o.mutationBuckets[s])&&void 0!==t?t:o.bucketSize,o.mutationBuckets[s]=Math.max(o.mutationBuckets[s]-1,0),0===o.mutationBuckets[s]&&(o.loggedTracker[s]||(o.loggedTracker[s]=!0,null===(n=(r=o.options).onBlockedNode)||void 0===n||n.call(r,s,a))),e)}));var r=o.numberOfChanges(t);return 0!==r||n===r?e:void 0}),this.rrweb=t,this.options=i,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval(function(){o.refillBuckets()},1e3)}),tg=((t6=tg||{})[t6.DomContentLoaded=0]="DomContentLoaded",t6[t6.Load=1]="Load",t6[t6.FullSnapshot=2]="FullSnapshot",t6[t6.IncrementalSnapshot=3]="IncrementalSnapshot",t6[t6.Meta=4]="Meta",t6[t6.Custom=5]="Custom",t6[t6.Plugin=6]="Plugin",t6),t_={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},tm=["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"],ty=["/s/","/e/","/i/vo/e/"];function tb(e,t,n,r){var o=null==t?void 0:t["content-length"];return M(o)?"[SessionReplay] no content-length header for ".concat(r,", cannot determine payload size"):o&&parseInt(o)>n?"[SessionReplay] ".concat(r," body too large to record"):e}var tw=function(e,t){var n,r,i=e.session_recording,s=!1!==i.recordHeaders&&t.recordHeaders,a=!1!==i.recordBody&&t.recordBody,u=!1!==i.recordPerformance&&t.recordPerformance,l=(r=Math.min(1e6,null!==(n=i.payloadSizeLimitBytes)&&void 0!==n?n:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=tb(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=tb(e.responseBody,e.responseHeaders,r,"Response")),e}),c=function(e){var t;return l(function(e){var t=tl(e.name);if(!(t&&t.pathname&&ty.includes(t.pathname)))return e}((Object.keys(null!==(t=e.requestHeaders)&&void 0!==t?t:{}).forEach(function(t){var n;tm.includes(t.toLowerCase())&&(null===(n=e.requestHeaders)||void 0===n||delete n[t])}),e)))},d=C(e.session_recording.maskNetworkRequestFn);return d&&C(e.session_recording.maskCapturedNetworkRequestFn)&&z.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 o(o({},t),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=C(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,o,i=c(t);return i&&null!==(n=null===(r=(o=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(o,i))&&void 0!==n?n:void 0}:void 0,i.maskRequestFn||(i.maskRequestFn=c),o(o(o({},t_),i),{},{recordHeaders:s,recordBody:a,recordPerformance:u,recordInitialRequests:u})};function tk(e,t){tM(!0,e,t)}function tE(e,t){tM(!1,e,t)}function tS(e,t){return"1"===tx(e,t)}function tR(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||D,n=null==t?void 0:t.navigator,r=!1;return J([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){ee([!0,1,"1","yes"],e)&&(r=!0)}),r}return!1}(t)||"0"===tx(e,t)}function tF(e,t){tP(t=t||{}).remove(tC(e,t),!!t.crossSubdomainCookie)}function tP(e){return"localStorage"===(e=e||{}).persistenceType?te:"localStorage+cookie"===e.persistenceType?tn:e7}function tC(e,t){return((t=t||{}).persistencePrefix||"__ph_opt_in_out_")+e}function tx(e,t){return tP(t).get(tC(e,t))}function tM(e,t,n){T(t)&&t.length?(tP(n=n||{}).set(tC(t,n),e?1:0,O(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):z.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function tT(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,o=e.config.opt_out_capturing_persistence_type,i=e.config.opt_out_capturing_cookie_prefix||void 0,s=e.config.window;n&&(t=tR(n,{respectDnt:r,persistenceType:o,persistencePrefix:i,window:s}))}catch(e){z.error("Unexpected error when checking capturing opt-out status: "+e)}return t}(t8=t5||(t5={}))[t8.Mutation=0]="Mutation",t8[t8.MouseMove=1]="MouseMove",t8[t8.MouseInteraction=2]="MouseInteraction",t8[t8.Scroll=3]="Scroll",t8[t8.ViewportResize=4]="ViewportResize",t8[t8.Input=5]="Input",t8[t8.TouchMove=6]="TouchMove",t8[t8.MediaInteraction=7]="MediaInteraction",t8[t8.StyleSheetRule=8]="StyleSheetRule",t8[t8.CanvasMutation=9]="CanvasMutation",t8[t8.Font=10]="Font",t8[t8.Log=11]="Log",t8[t8.Drag=12]="Drag",t8[t8.StyleDeclaration=13]="StyleDeclaration",t8[t8.Selection=14]="Selection",t8[t8.AdoptedStyleSheet=15]="AdoptedStyleSheet";var tI=[t5.MouseMove,t5.MouseInteraction,t5.Scroll,t5.ViewportResize,t5.Input,t5.TouchMove,t5.MediaInteraction,t5.Drag],tO=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},tA=function(){function e(t){var n=this;if(s(this,e),l(this,"queuedRRWebEvents",[]),l(this,"isIdle",!1),l(this,"_linkedFlagSeen",!1),l(this,"_lastActivityTimestamp",Date.now()),l(this,"windowId",null),l(this,"sessionId",null),l(this,"_linkedFlag",null),l(this,"_sampleRate",null),l(this,"_minimumDuration",null),l(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==D||D.addEventListener("beforeunload",function(){n._flushBuffer()}),null==D||D.addEventListener("offline",function(){n._tryAddCustomEvent("browser offline",{})}),null==D||D.addEventListener("online",function(){n._tryAddCustomEvent("browser online",{})}),!this.instance.sessionManager)throw z.error("Session recording started without valid sessionManager"),Error("Session recording started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return u(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw z.error("Session recording started without valid sessionManager"),Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return O(this._sampleRate)?this.instance.get_property(eA):null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?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(eC),t=!this.instance.config.disable_session_recording;return D&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(ex),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(eI);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"recordingVersion",get:function(){var e,t=this.instance.get_property(eM);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(eT),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},o=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),i=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return o||i||s?{recordHeaders:o,recordBody:i,recordPerformance:s}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?T(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":A(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?(this.startCaptureAndTrySendingQueuedSnapshots(),z.info("[SessionRecording] started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,z.info("[SessionRecording] stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n,r=this.sessionId!==e;if(O(this._sampleRate)){var o,i=this.isSampled;(o=r||!A(i)?Math.random()<this._sampleRate:i)||z.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(n=this.instance.persistence)||void 0===n||n.register(l({},eA,o))}else null===(t=this.instance.persistence)||void 0===t||t.register(l({},eA,null))}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,s,a,u,c,d,f,p,h=this;this.instance.persistence&&this.instance.persistence.register((l(p={},eC,!!e.sessionRecording),l(p,ex,null===(s=e.sessionRecording)||void 0===s?void 0:s.consoleLogRecordingEnabled),l(p,eM,null===(a=e.sessionRecording)||void 0===a?void 0:a.recorderVersion),l(p,eT,o({capturePerformance:e.capturePerformance},null===(u=e.sessionRecording)||void 0===u?void 0:u.networkPayloadCapture)),l(p,eI,{enabled:null===(c=e.sessionRecording)||void 0===c?void 0:c.recordCanvas,fps:null===(d=e.sessionRecording)||void 0===d?void 0:d.canvasFps,quality:null===(f=e.sessionRecording)||void 0===f?void 0:f.canvasQuality}),p));var v=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate;this._sampleRate=M(v)||I(v)?null:parseFloat(v);var g,_=null===(n=e.sessionRecording)||void 0===n?void 0:n.minimumDurationMilliseconds;if(this._minimumDuration=M(_)?null:_,this._linkedFlag=(null===(r=e.sessionRecording)||void 0===r?void 0:r.linkedFlag)||null,null!==(i=e.sessionRecording)&&void 0!==i&&i.endpoint&&(this._endpoint=null===(g=e.sessionRecording)||void 0===g?void 0:g.endpoint),O(this._sampleRate)&&this.sessionManager.onSessionId(function(e){h.makeSamplingDecision(e)}),T(this._linkedFlag)){var m=this._linkedFlag;this.instance.onFeatureFlags(function(e){h._linkedFlagSeen=e.includes(m)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:en()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!M(Object.assign)&&!(this._captureStarted||this.instance.config.disable_session_recording||tT(this.instance))){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var t="v2"===this.recordingVersion?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?el(this.instance.requestRouter.endpointFor("assets","/static/".concat(t,"?v=").concat(w.LIB_VERSION)),function(n){if(n)return z.error("Could not load ".concat(t),n);e._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==tI.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:3e5}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=r.windowId,i=r.sessionId,s=this.sessionId!==i,a=this.windowId!==o;this.windowId=o,this.sessionId=i,(n||-1===[2,4].indexOf(e.type)&&(a||s))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return z.warn("[Session-Recording] could not emit queued rrweb event.",t),this.queuedRRWebEvents.length<10&&this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(tO(function(){return n.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(tO(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=D.rrweb?D.rrweb.record:D.rrwebRecord;for(var r=this.instance.config.session_recording,i=0,s=Object.entries(r||{});i<s.length;i++){var a=h(s[i],2),u=a[0],l=a[1];u in n&&(n[u]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new tv(this.rrwebRecord,{onBlockedNode:function(e,n){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");z.info(r,{node:n}),t.log("[PostHog Recorder] "+r,"warn")}}),this._scheduleFullSnapshot();var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(o({emit:function(e){t.onRRwebEmit(e)},plugins:c},n)),this.instance._addCaptureHook(function(e){try{if("$pageview"===e){var n=D?t._maskUrl(D.location.href):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n}),t._tryTakeFullSnapshot()}}catch(e){z.error("Could not add $pageview to rrweb session",e)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:c.map(function(e){return null==e?void 0:e.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else z.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},3e5)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return Z.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(Z.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&C(Z.getRecordNetworkPlugin)&&(!ta.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(Z.getRecordNetworkPlugin(tw(this.instance.config,this.networkPayloadCapture))):z.info("[SessionReplay-NetworkCapture] not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&x(e)){if(e.type===tg.Meta){var t=this._maskUrl(e.data.href);if(!t)return;e.data.href=t}e.type===tg.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){if(e&&x(e)&&6===e.type&&x(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(n),o=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===tg.Custom){var i={$snapshot_bytes:o,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(i):this.clearBuffer()}}}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=v(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})})}}},{key:"_maskUrl",value: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?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=O(n)&&n>=0,o=O(t)&&r&&n<t;return"buffering"===this.status||o?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),I(this.buffer.sessionId)&&!I(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){n._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{method:"POST",_url:this.instance.requestRouter.endpointFor("capture_recordings",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:2===e.$snapshot_data.type}})}}]),e}(),tD=function(){function e(t){s(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t=es(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(e$),group_properties:this.instance.get_property(eq),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request(this.instance.requestRouter.endpointFor("decide","/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},function(t){return e.parseDecideResponse(t)})}},{key:"parseDecideResponse",value:function(e){var t,n=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),0!==(null==e?void 0:e.status)){if(!j||!j.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){n.parseDecideResponse(e)},500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),eZ.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e);var r=null==D?void 0:D.extendPostHogWithSurveys;e.surveys&&!r&&el(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),function(e){if(e)return z.error("Could not load surveys script",e);D.extendPostHogWithSurveys(n.instance)});var o=null==D?void 0:D.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&M(o)&&el(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),function(t){if(t)return z.error("Could not load exception autocapture script",t);D.extendPostHogWithExceptionAutocapture(n.instance,e)}),e.siteApps){if(this.instance.config.opt_in_site_apps){var i,s=m(e.siteApps);try{for(s.s();!(i=s.n()).done;)(function(){var e=i.value,t=e.id,r=e.url,o=n.instance.requestRouter.endpointFor("assets",r);Z["__$$ph_site_app_".concat(t)]=n.instance,el(o,function(e){e&&z.error("Error while initializing PostHog app with config id ".concat(t),e)})})()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&z.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}else z.error("Failed to fetch feature flags from PostHog.")}}]),e}(),tL=["source"],t$=null!=D&&D.location?td(D.location.hash,"__posthog")||td(location.hash,"state"):null,tq=function(){function e(t){s(this,e),this.instance=t}return u(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(o({},t))}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!D||!j)return!1;n=null!==(e=n)&&void 0!==e?e:D.location,o=null!==(t=o)&&void 0!==t?t:D.history;try{if(!r){try{D.localStorage.setItem("test","test"),D.localStorage.removeItem("test")}catch(e){return!1}r=null==D?void 0:D.localStorage}var i,s=t$||td(n.hash,"__posthog")||td(n.hash,"state"),a=s?er(function(){return JSON.parse(atob(decodeURIComponent(s)))})||er(function(){return JSON.parse(decodeURIComponent(s))}):null;return a&&"ph_authorize"===a.action?((i=a).source="url",i&&Object.keys(i).length>0&&(a.desiredHash?n.hash=a.desiredHash:o?o.replaceState("",j.title,n.pathname+n.search):n.hash="")):((i=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(!D||Z._postHogToolbarLoaded)return!1;Z._postHogToolbarLoaded=!0;var n=3e5*Math.floor(Date.now()/3e5),r=this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(n)),i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=o(o({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("api")},i?{instrument:!1}:{});s.source;var a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(s,tL);return D.localStorage.setItem("_postHogToolbarParams",JSON.stringify(a)),el(r,function(e){e?z.error("Failed to load toolbar",e):(Z.ph_load_toolbar||Z.ph_load_editor)(s,t.instance)}),eu(D,"turbolinks:load",function(){Z._postHogToolbarLoaded=!1,t.loadToolbar(s)}),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),tN=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;s(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return u(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),tB=function(e){c(n,tN);var t=p(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return s(this,n),(r=t.call(this,o)).handlePollRequest=e,r}return u(n,[{key:"enqueue",value:function(e,t,n){this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(e._event_queue.length>0){var t=e.formatQueue();for(var n in t)(function(n){var r=t[n],o=r.url,i=r.data,s=r.options;J(i,function(t,n){i[n].offset=Math.abs(i[n].timestamp-e.getTime()),delete i[n].timestamp}),e.handlePollRequest(o,i,s)})(n);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()},this._pollInterval)}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(v(n.filter(function(e){return 0===e.url.indexOf("/e")})),v(n.filter(function(e){return 0!==e.url.indexOf("/e")}))).map(function(t){var n=t.url,r=t.data,i=t.options;e.handlePollRequest(n,r,o(o({},i),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var e={};return J(this._event_queue,function(t){var n=t.url,r=t.data,o=t.options,i=(o?o._batchKey:null)||n;M(e[i])&&(e[i]={data:[],url:n,options:o}),o&&e[i].options&&e[i].options._metrics&&!e[i].options._metrics.rrweb_full_snapshot&&(e[i].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),e[i].data.push(r)}),e}}]),n}(),tj=Uint8Array,tH=Uint16Array,tW=Uint32Array,tV=new tj([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]),tU=new tj([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]),tZ=new tj([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tG=function(e,t){for(var n=new tH(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new tW(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},tz=tG(tV,2),tK=tz[0],tY=tz[1];tK[28]=258,tY[258]=28;for(var tQ=tG(tU,0)[1],tJ=new tH(32768),tX=0;tX<32768;++tX){var t0=(43690&tX)>>>1|(21845&tX)<<1;t0=(61680&(t0=(52428&t0)>>>2|(13107&t0)<<2))>>>4|(3855&t0)<<4,tJ[tX]=((65280&t0)>>>8|(255&t0)<<8)>>>1}var t1=function(e,t,n){for(var r=e.length,o=0,i=new tH(t);o<r;++o)++i[e[o]-1];var s,a=new tH(t);for(o=0;o<t;++o)a[o]=a[o-1]+i[o-1]<<1;if(n){s=new tH(1<<t);var u=15-t;for(o=0;o<r;++o)if(e[o])for(var l=o<<4|e[o],c=t-e[o],d=a[e[o]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)s[tJ[d]>>>u]=l}else for(s=new tH(r),o=0;o<r;++o)s[o]=tJ[a[e[o]-1]++]>>>15-e[o];return s},t2=new tj(288);for(tX=0;tX<144;++tX)t2[tX]=8;for(tX=144;tX<256;++tX)t2[tX]=9;for(tX=256;tX<280;++tX)t2[tX]=7;for(tX=280;tX<288;++tX)t2[tX]=8;var t3=new tj(32);for(tX=0;tX<32;++tX)t3[tX]=5;var t6,t5,t8,t4,t7=t1(t2,9,0),t9=t1(t3,5,0),ne=function(e){return(e/8>>0)+(7&e&&1)},nt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof tH?tH:e instanceof tW?tW:tj)(n-t);return r.set(e.subarray(t,n)),r},nn=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},nr=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},no=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new tj(0),0];if(1==o){var s=new tj(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!=o-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=i[0].s;for(r=1;r<o;++r)i[r].s>f&&(f=i[r].s);var p=new tH(f+1),h=ni(n[c-1],p,0);if(h>t){r=0;var v=0,g=h-t,_=1<<g;for(i.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<o;++r){var m=i[r].s;if(!(p[m]>t))break;v+=_-(1<<h-p[m]),p[m]=t}for(v>>>=g;v>0;){var y=i[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=i[r].s;p[b]==t&&(--p[b],++v)}h=t}return[new tj(p),h]},ni=function e(t,n,r){return -1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},ns=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new tH(++t),r=0,o=e[0],i=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return[n.subarray(0,r),t]},na=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},nu=function(e,t,n){var r=n.length,o=ne(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},nl=function(e,t,n,r,o,i,s,a,u,l,c){nn(t,c++,n),++o[256];for(var d=no(o,15),f=d[0],p=d[1],h=no(i,15),v=h[0],g=h[1],_=ns(f),m=_[0],y=_[1],b=ns(v),w=b[0],k=b[1],E=new tH(19),S=0;S<m.length;++S)E[31&m[S]]++;for(S=0;S<w.length;++S)E[31&w[S]]++;for(var R=no(E,7),F=R[0],P=R[1],C=19;C>4&&!F[tZ[C-1]];--C);var x,M,T,I,O=l+5<<3,A=na(o,t2)+na(i,t3)+s,D=na(o,f)+na(i,v)+s+14+3*C+na(E,F)+(2*E[16]+3*E[17]+7*E[18]);if(O<=A&&O<=D)return nu(t,c,e.subarray(u,u+l));if(nn(t,c,1+(D<A)),c+=2,D<A){x=t1(f,p,0),M=f,T=t1(v,g,0),I=v;var L=t1(F,P,0);for(nn(t,c,y-257),nn(t,c+5,k-1),nn(t,c+10,C-4),c+=14,S=0;S<C;++S)nn(t,c+3*S,F[tZ[S]]);c+=3*C;for(var $=[m,w],q=0;q<2;++q){var N=$[q];for(S=0;S<N.length;++S){var B=31&N[S];nn(t,c,L[B]),c+=F[B],B>15&&(nn(t,c,N[S]>>>5&127),c+=N[S]>>>12)}}}else x=t7,M=t2,T=t9,I=t3;for(S=0;S<a;++S)if(r[S]>255){nr(t,c,x[(B=r[S]>>>18&31)+257]),c+=M[B+257],B>7&&(nn(t,c,r[S]>>>23&31),c+=tV[B]);var j=31&r[S];nr(t,c,T[j]),c+=I[j],j>3&&(nr(t,c,r[S]>>>5&8191),c+=tU[j])}else nr(t,c,x[r[S]]),c+=M[r[S]];return nr(t,c,x[256]),c+M[256]},nc=new tW([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nd=new tj(0),nf=function(){for(var e=new tW(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),np=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=nf[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},nh=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},nv=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&&nh(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)}};(ng=t4||(t4={})).GZipJS="gzip-js",ng.Base64="base64";var ng,n_,nm=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=w.LIB_VERSION;var o=e.split("?");if(o.length>1){var i,s=m(o[1].split("&"));try{for(s.s();!(i=s.n()).done;){var a=i.value.split("=")[0];M(r[a])||delete r[a]}}catch(e){s.e(e)}finally{s.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return J(e,function(e,r){M(e)||M(r)||"undefined"===r||(t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)}),o.join(r)}(r)},ny=function e(t,n){var r;if(n.blob&&t.buffer)return new Blob([P(t)?t:t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var o=e(t,{method:"POST"});return new Blob([o],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(r=F(t)||P(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(r+="&compression="+t.compression),r)},nb=function(e){if(W&&"fetch"===e.options.transport){var t,n=ny(e.data,e.options),r=new Headers;J(r,function(e,t){r.append(t,e)}),"POST"!==e.options.method||e.options.blob||r.append("Content-Type","application/x-www-form-urlencoded");var i=e.url;return O(e.retriesPerformedSoFar)&&e.retriesPerformedSoFar>0&&(i=nm(i,{retry_count:e.retriesPerformedSoFar},{})),void W(i,{method:(null===(t=e.options)||void 0===t?void 0:t.method)||"GET",headers:r,keepalive:"POST"===e.options.method,body:n}).then(function(t){var n=t.status;return t.text().then(function(t){var i,s,a;if(null===(i=e.onResponse)||void 0===i||i.call(e,{statusCode:n,responseText:t}),200!==n)C(e.onError)&&e.onError({statusCode:n,responseText:t}),(n<400||n>500)&&e.retryQueue.enqueue(o(o({},e),{},{headers:r,retriesPerformedSoFar:(e.retriesPerformedSoFar||0)+1})),null===(s=e.callback)||void 0===s||s.call(e,{status:0});else try{null===(a=e.callback)||void 0===a||a.call(e,JSON.parse(t))}catch(e){z.error(e)}})}).catch(function(t){var n;z.error(t),null===(n=e.callback)||void 0===n||n.call(e,{status:0})})}return nw(e)},nw=function(e){var t=e.url,n=e.data,r=e.headers,o=e.options,i=e.callback,s=e.retriesPerformedSoFar,a=e.retryQueue,u=e.onError,l=e.timeout,c=e.onResponse;O(s)&&s>0&&(t=nm(t,{retry_count:s},{}));var d=new XMLHttpRequest;d.open(o.method||"GET",t,!0);var f=ny(n,o);J(r,function(e,t){d.setRequestHeader(t,e)}),"POST"!==o.method||o.blob||d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.timeout=void 0===l?6e4:l,d.withCredentials=!0,d.onreadystatechange=function(){if(4===d.readyState){var e,l={statusCode:d.status,responseText:d.responseText};if(null==c||c(l),200===d.status){if(i){try{e=JSON.parse(d.responseText)}catch(e){return void z.error(e)}i(e)}}else C(u)&&u(l),(d.status<400||d.status>500)&&a.enqueue({url:t,data:n,options:o,headers:r,retriesPerformedSoFar:(s||0)+1,callback:i}),null==i||i({status:0})}},d.send(f)},nk=function(e){c(n,tN);var t=p(n);function n(e,r){var o;return s(this,n),(o=t.call(this)).isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onRequestError=e,o.rateLimiter=r,!M(D)&&"onLine"in D.navigator&&(o.areWeOnline=D.navigator.onLine,D.addEventListener("online",function(){o._handleWeAreNowOnline()}),D.addEventListener("offline",function(){o.areWeOnline=!1})),o}return u(n,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n,r,o,i=(o=(Math.random()-.5)*((r=Math.min(18e5,n=3e3*Math.pow(2,t)))-n/2),Math.ceil(r+o)),s=new Date(Date.now()+i);this.queue.push({retryAt:s,requestData:e});var a="Enqueued failed request for retry in ".concat(i);navigator.onLine||(a+=" (Browser is offline)"),z.warn(a),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter(function(t){return t.retryAt<e});if(t.length>0){this.queue=this.queue.filter(function(t){return t.retryAt>=e});var n,r=m(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.requestData;this._executeXhrRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=m(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,i=n.data,s=n.options;if(this.rateLimiter.isRateLimited(s._batchKey))z.warn("[RetryQueue] is quota limited. Dropping request.");else try{null==D||D.navigator.sendBeacon(r,ny(i,o(o({},s),{},{sendBeacon:!0})))}catch(e){z.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,o=e.headers,i=e.callback,s=e.retriesPerformedSoFar;this.rateLimiter.isRateLimited(r._batchKey)||nb({url:t,data:n||{},options:r||{},headers:o||{},retriesPerformedSoFar:s||0,callback:i,retryQueue:this,onError:this.onRequestError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(),nE=function(){function e(t,n,r,o){s(this,e),l(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||e6,this._windowIdGenerator=o||e6;var i=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||1800;if(O(a)?a>1800?z.warn("session_idle_timeout_seconds cannot be  greater than 30 minutes. Using 30 minutes instead."):a<60&&z.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(z.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=1800),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),1800),this._window_id_storage_key="ph_"+i+"_window_id",this._primary_window_exists_storage_key="ph_"+i+"_primary_window_exists",this._canUseSessionStorage()){var u=ts.parse(this._window_id_storage_key),c=ts.parse(this._primary_window_exists_storage_key);u&&!c?this._windowId=u:ts.remove(this._window_id_storage_key),ts.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return M(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})}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&ts.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ts.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ts.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(l({},eO,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[eO];return F(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==D||D.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&ts.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=h(this._getSessionId(),3),r=n[0],o=n[1],i=n[2],s=this._getWindowId(),a=i&&i>0&&Math.abs(t-i)>864e5,u=!1,l=!o,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||a?(o=this._sessionIdGenerator(),s=this._windowIdGenerator(),z.info("[SessionId] new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:a}}),i=t,u=!0):s||(s=this._windowIdGenerator(),u=!0);var d=0===r||!e||a?t:r,f=0===i?(new Date).getTime():i;return this._setWindowId(s),this._setSessionId(o,d,f),u&&this._sessionIdChangedHandlers.forEach(function(e){return e(o,s)}),{sessionId:o,windowId:s,sessionStartTimestamp:f}}}]),e}();(nC=n_||(n_={})).US="us",nC.EU="eu",nC.CUSTOM="custom";var nS=function(){function e(t){s(this,e),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.replace(/\/$/,"")}},{key:"uiHost",get:function(){var e;return null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"")}},{key:"region",get:function(){switch(this.apiHost){case"https://app.posthog.com":case"https://us.posthog.com":return n_.US;case"https://eu.posthog.com":return n_.EU;default:return n_.CUSTOM}}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost)+t;if(!this.instance.config.__preview_ingestion_endpoints||this.region===n_.CUSTOM)return this.apiHost+t;var n="i.posthog.com"+t;switch(e){case"capture_events":return"https://".concat(this.region,"-c.").concat(n);case"capture_recordings":return"https://".concat(this.region,"-s.").concat(n);case"decide":return"https://".concat(this.region,"-d.").concat(n);case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,"-api.").concat(n)}}}]),e}(),nR=u(function e(t,n,r,o){s(this,e),this.name="posthog-js",this.setupOnce=function(e){e(function(e){if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var i,s,a,u,l,c=t.requestRouter.endpointFor("ui","/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=c,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],f={$exception_message:null===(s=d[0])||void 0===s?void 0:s.value,$exception_type:null===(a=d[0])||void 0===a?void 0:a.type,$exception_personURL:c,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(l=d[0])||void 0===l?void 0:l.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e})}}),nF=function(){function e(t){var n=this;s(this,e),l(this,"_hasSeenPageView",!1),l(this,"_updateScrollData",function(){n._pageViewData||(n._pageViewData=n._createPageViewData());var e,t,r,o,i=n._pageViewData,s=n._scrollY(),a=n._scrollHeight(),u=n._contentY(),l=n._contentHeight();i.lastScrollY=s,i.maxScrollY=Math.max(s,null!==(e=i.maxScrollY)&&void 0!==e?e:0),i.maxScrollHeight=Math.max(a,null!==(t=i.maxScrollHeight)&&void 0!==t?t:0),i.lastContentY=u,i.maxContentY=Math.max(u,null!==(r=i.maxContentY)&&void 0!==r?r:0),i.maxContentHeight=Math.max(l,null!==(o=i.maxContentHeight)&&void 0!==o?o:0)}),this._instance=t}return u(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==D?void 0:D.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,t;return this._hasSeenPageView?(t=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,t=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),o({$prev_pageview_pathname:null===(e=t)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(t))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return o({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,o=e.maxContentHeight,i=e.lastContentY,s=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),o=Math.ceil(o),i=Math.ceil(i),s=Math.ceil(s),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:nP(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:nP(r/t,0,1),$prev_pageview_last_content:i,$prev_pageview_last_content_percentage:o<=1?1:nP(i/o,0,1),$prev_pageview_max_content:s,$prev_pageview_max_content_percentage:o<=1?1:nP(s/o,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==D||D.addEventListener("scroll",this._updateScrollData,!0),null==D||D.addEventListener("scrollend",this._updateScrollData,!0),null==D||D.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==D||D.removeEventListener("scroll",this._updateScrollData),null==D||D.removeEventListener("scrollend",this._updateScrollData),null==D||D.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollElement",value:function(){if(!this._instance.config.scroll_root_selector)return null==D?void 0:D.document.documentElement;var e,t=m(F(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==D?void 0:D.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"_scrollHeight",value:function(){var e=this._scrollElement();return e?Math.max(0,e.scrollHeight-e.clientHeight):0}},{key:"_scrollY",value:function(){if(this._instance.config.scroll_root_selector){var e=this._scrollElement();return e&&e.scrollTop||0}return D&&(D.scrollY||D.pageYOffset||D.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){var e=this._scrollElement();return(null==e?void 0:e.scrollHeight)||0}},{key:"_contentY",value:function(){var e=this._scrollElement(),t=(null==e?void 0:e.clientHeight)||0;return this._scrollY()+t}}]),e}();function nP(e,t,n){return Math.max(t,Math.min(e,n))}var nC,nx,nM,nT,nI={icontains:function(e){return!!D&&D.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){var t;return!!D&&(t=D.location.href,!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(e)&&new RegExp(e).test(t))},exact:function(e){return(null==D?void 0:D.location.href)===e}},nO=function(){function e(t){s(this,e),this.instance=t}return u(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(eN);if(r&&!n)return e(r);this.instance._send_request(this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),{},{method:"GET"},function(n){var r,o=n.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(l({},eN,o)),e(o)})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(function(n){return e(n.filter(function(e){return!(!e.start_date||e.end_date)}).filter(function(e){if(!e.conditions)return!0;var t,n,r,o,i=null===(t=e.conditions)||void 0===t||!t.url||nI[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),s=null===(o=e.conditions)||void 0===o||!o.selector||(null==j?void 0:j.querySelector(e.conditions.selector));return i&&s}).filter(function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}))},n)}}]),e}(),nA=function(){function e(){var t=this;s(this,e),l(this,"limits",{}),l(this,"checkForLimiting",function(e){var n=e.responseText;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(function(e){z.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+6e4})}catch(e){return void z.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:n})}})}return u(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),nD=function(){return o({initialPathName:(null==H?void 0:H.pathname)||"",referringDomain:tf.referringDomain()},tf.campaignParams())},nL=function(){function e(t,n,r){var o=this;s(this,e),l(this,"_onSessionIdCallback",function(e){var t=o._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:o._sessionSourceParamGenerator()};o._persistence.register(l({},eW,n))}}),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||nD,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[eW]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),n$=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],nq=function(e,t){if(!e)return!1;var n=e.toLowerCase();return n$.concat(t||[]).some(function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)})};(nG=nx||(nx={}))[nG.INIT_MODULE=0]="INIT_MODULE",nG[nG.INIT_SNIPPET=1]="INIT_SNIPPET";var nN=function(){},nB={},nj="posthog",nH=!tu&&-1===(null==U?void 0:U.indexOf("MSIE"))&&-1===(null==U?void 0:U.indexOf("Mozilla")),nW=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:!!T(n=null==(t=null==j?void 0:j.location)?void 0:t.hostname)&&"herokuapp.com"!==n.split(".").slice(-2).join("."),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:nN,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==D||null===(e=D.location)||void 0===e?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_blacklist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.responseText;z.error(t)},get_device_id:function(e){return e},_onCapture:nN,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},nV=function(e,t,n,r){var o,i=n!==nj&&nT?n?nT[n]:void 0:nT,s={initComplete:!1,syncCode:!1},a=function(e){return function(t){s[e]||(s[e]=!0,s.initComplete&&s.syncCode&&(null==r||r(t)))}};if(i&&nM===nx.INIT_MODULE)o=i;else{if(i&&!F(i))return void z.error("You have already initialized "+n);o=new nZ}return o._init(e,t,n,a("initComplete")),o.toolbar.maybeLoadToolbar(),o.sessionRecording=new tA(o),o.sessionRecording.startRecordingIfEnabled(),o.config.disable_scroll_properties||o.pageViewManager.startMeasuringScrollPosition(),o.__autocapture=o.config.autocapture,eZ._setIsAutocaptureEnabled(o),eZ._isAutocaptureEnabled&&(o.__autocapture=o.config.autocapture,eZ.enabledForProject(o.config.token,100,100)?eZ.isBrowserSupported()?eZ.init(o):(o.__autocapture=!1,z.info("Disabling Automatic Event Collection because this browser is not supported")):(o.__autocapture=!1,z.info("Not in active bucket: disabling Automatic Event Collection."))),w.DEBUG=w.DEBUG||o.config.debug,!M(i)&&F(i)&&(o._execute_array.call(o.people,i.people),o._execute_array(i)),a("syncCode")(o),o},nU=function(){function e(){s(this,e),l(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),nZ=function(){function e(){var t=this;s(this,e),l(this,"webPerformance",new nU),this.config=nW(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=nR,this.segmentIntegration=function(){var e;return Promise&&Promise.resolve||z.warn("This browser does not have Promise support, and can not use the segment integration"),e=function(e,n){e.event.userId||e.event.anonymousId===t.get_distinct_id()||t.reset(),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(t.register({distinct_id:e.event.userId}),t.reloadFeatureFlags());var r=t._calculate_event_properties(n,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(t){return e(t,t.event.event)},page:function(t){return e(t,"$pageview")},identify:function(t){return e(t,"$identify")},screen:function(t){return e(t,"$screen")}}},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new eQ(this),this.toolbar=new tq(this),this.pageViewManager=new nF(this),this.surveys=new nO(this),this.rateLimiter=new nA,this.requestRouter=new nS(this),this.people={set:function(e,n,r){var o=T(e)?l({},e,n):e;t.setPersonProperties(o),null==r||r({})},set_once:function(e,n,r){var o=T(e)?l({},e,n):e;t.setPersonProperties(void 0,o),null==r||r({})}}}return u(e,[{key:"init",value:function(e,t,n){if(M(n))z.critical("You must name your new library: init(token, config, name)");else{if(n!==nj){var r=nV(e,t,n,function(e){nT[n]=e,e._loaded()});return nT[n]=r,r}z.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r,i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,u=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,c={segmentRegister:!1,syncCode:!1},d=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==u||u(i)))}};if(s.request_headers=s.request_headers||s.xhr_headers,this.set_config(X({},nW(),s,{name:a,token:e,callback_fn:(a===nj?a:nj+"."+a)+"._jsc"})),this._jsc=function(){},(null!=D&&null!==(t=D.rrweb)&&void 0!==t&&t.record||null!=D&&D.rrwebRecord)&&(this.__loaded_recorder_version=null==D||null===(l=D.rrweb)||void 0===l?void 0:l.version),this.persistence=new th(this.config),this._requestQueue=new tB(this._handle_queued_event.bind(this)),this._retryQueue=new nk(this.config.on_request_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new nE(this.config,this.persistence),this.sessionPropsManager=new nL(this.sessionManager,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new th(o(o({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),s.segment?(this.config.get_device_id=function(){return s.segment.user().anonymousId()},s.segment.user().id()&&(this.register({distinct_id:s.segment.user().id()}),this.persistence.set_user_state("identified")),s.segment.register(this.segmentIntegration()).then(d("segmentRegister"))):d("segmentRegister")(),void 0!==(null===(n=s.bootstrap)||void 0===n?void 0:n.distinctID)){var f,p,h=this.config.get_device_id(e6()),v=null!==(f=s.bootstrap)&&void 0!==f&&f.isIdentifiedID?h:s.bootstrap.distinctID;this.persistence.set_user_state(null!==(p=s.bootstrap)&&void 0!==p&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:v})}if(this._hasBootstrappedFeatureFlags()){var g,_,m=Object.keys((null===(g=s.bootstrap)||void 0===g?void 0:g.featureFlags)||{}).filter(function(e){var t,n;return!(null===(t=s.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])}).reduce(function(e,t){var n,r;return e[t]=(null===(n=s.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e},{}),y=Object.keys((null===(_=s.bootstrap)||void 0===_?void 0:_.featureFlagPayloads)||{}).filter(function(e){return m[e]}).reduce(function(e,t){var n,r,o,i;return null!==(n=s.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(o=s.bootstrap)||void 0===o||null===(i=o.featureFlagPayloads)||void 0===i?void 0:i[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:y})}if(!this.get_distinct_id()){var b=this.config.get_device_id(e6());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_user_state("anonymous")}null==D||null===(r=D.addEventListener)||void 0===r||r.call(D,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),d("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var t;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var n,r={},o=m(e.supportedCompression);try{for(o.s();!(n=o.n()).done;)r[n.value]=!0}catch(e){o.e(e)}finally{o.f()}this.compression=r}null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString),e.__preview_ingestion_endpoints&&(this.config.__preview_ingestion_endpoints=e.__preview_ingestion_endpoints)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&j&&this.capture("$pageview",{title:j.title},{send_instantly:!0}),e||(new tD(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Q(this.__request_queue,function(t){e._send_request.apply(e,v(t))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(M(e))return null;if(tu)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.config.callback_fn+"["+r+"]";return n[r]=function(o){delete n[r],e(o,t)},o}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||nB,nN)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var i,s,a,u,l,c,d,f=h((this.compression[t4.GZipJS]?t4.GZipJS:t4.Base64)===t4.GZipJS?[(i=function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new tj(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},s=0;s<n;++s){if(o+5>r.length){var a=new tj(o+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);u<128||t?i(u):(u<2048?i(192|u>>>6):(u>55295&&u<57344?(i(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),i(128|u>>>12&63)):i(224|u>>>12),i(128|u>>>6&63)),i(128|63&u))}return nt(r,0,o)}(t),s={mtime:0},a=np(),u=i.length,a.p(i),d=(l=10+(s.filename&&s.filename.length+1||0),c=function(e,t,n,r,o,i){var s=e.length,a=new tj(r+s+5*(1+Math.floor(s/7e3))+o),u=a.subarray(r,a.length-o),l=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?l=nu(u,l,e.subarray(c,d)):(u[c]=i,l=nu(u,l,e.subarray(c,s)))}else{for(var f=nc[t-1],p=f>>>13,h=8191&f,v=(1<<n)-1,g=new tH(32768),_=new tH(v+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&v},w=new tW(25e3),k=new tH(288),E=new tH(32),S=0,R=0,F=(c=0,0),P=0,C=0;c<s;++c){var x=b(c),M=32767&c,T=_[x];if(g[M]=T,_[x]=M,P<=c){var I=s-c;if((S>7e3||F>24576)&&I>423){l=nl(e,u,0,w,k,E,R,F,C,c-C,l),F=S=R=0,C=c;for(var O=0;O<286;++O)k[O]=0;for(O=0;O<30;++O)E[O]=0}var A=2,D=0,L=h,$=M-T&32767;if(I>2&&x==b(c-$))for(var q=Math.min(p,I)-1,N=Math.min(32767,c),B=Math.min(258,I);$<=N&&--L&&M!=T;){if(e[c+A]==e[c+A-$]){for(var j=0;j<B&&e[c+j]==e[c+j-$];++j);if(j>A){if(A=j,D=$,j>q)break;var H=Math.min($,j-2),W=0;for(O=0;O<H;++O){var V=c-$+O+32768&32767,U=V-g[V]+32768&32767;U>W&&(W=U,T=V)}}}$+=(M=T)-(T=g[M])+32768&32767}if(D){w[F++]=268435456|tY[A]<<18|tQ[D];var Z=31&tY[A],G=31&tQ[D];R+=tV[Z]+tU[G],++k[257+Z],++E[G],P=c+A,++S}else w[F++]=e[c],++k[e[c]]}}l=nl(e,u,i,w,k,E,R,F,C,c-C,l),i||(l=nu(u,l,nd))}return nt(a,0,r+ne(l)+o)}(i,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+s.mem,l,8,!0)).length,nv(c,s),nh(c,d-8,a.d()),nh(c,d-4,u),c),o(o({},n),{},{blob:!0,urlQueryArgs:{compression:t4.GZipJS}})]:[{data:es(t)},n],2),p=f[0],v=f[1];this._send_request(e,p,v,r)}},{key:"_send_request",value:function(e,t,n,r){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(n._batchKey)){if(nH)this.__request_queue.push([e,t,n,r]);else{n=X({method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose},n||{}),tu||(n.method="GET");var i=D&&"sendBeacon"in D.navigator&&"sendBeacon"===n.transport;if(e=nm(e,n.urlQueryArgs||{},{ip:this.config.ip}),i)try{null==D||D.navigator.sendBeacon(e,ny(t,o(o({},n),{},{sendBeacon:!0})))}catch(e){}else if(tu||!j)try{nb({url:e,data:t,headers:this.config.request_headers,options:n,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onError:this.config.on_request_error,onResponse:this.rateLimiter.checkForLimiting})}catch(e){z.error(e)}else{var s,a=j.createElement("script");a.type="text/javascript",a.async=!0,a.defer=!0,a.src=e;var u=j.getElementsByTagName("script")[0];null===(s=u.parentNode)||void 0===s||s.insertBefore(a,u)}}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],o=[],i=[];Q(e,function(e){e&&(F(t=e[0])?i.push(e):C(e)?e.call(n):F(e)&&"alias"===t?r.push(e):F(e)&&-1!==t.indexOf("capture")&&C(n[t])?i.push(e):o.push(e))});var s=function(e,t){Q(e,function(e){if(F(e[0])){var n=t;J(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(o,this),s(i,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nB;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return z.uninitializedWarning("posthog.capture");if(!tT(this)){var i=(r=r||nB).transport;if(i&&(r.transport=i),!M(e)&&T(e)){if(!U||this.config.opt_out_useragent_filter||!nq(U,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s,a,u,l,c={uuid:e6(),event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&(c.$set=r.$set,c.$set_once=r.$set_once),(s=c,a=r._noTruncate?null:this.config.properties_string_max_length,u=function(e){return T(e)&&!I(a)?e.slice(0,a):e},l=new Set,c=function e(t,n){var r;return t!==Object(t)?u?u(t,n):t:l.has(t)?void 0:(l.add(t),F(t)?(r=[],Q(t,function(t){r.push(e(t))})):(r={},J(t,function(t,n){l.has(t)||(r[n]=e(t,n))})),r)}(s)).timestamp=r.timestamp||new Date;var d=o(o({},c.properties.$set),c.$set);(function(e){if(x(e)){for(var t in e)if(S.call(e,t))return!1;return!0}return!1})(d)||this.setPersonPropertiesForFlags(d),z.info("send",c);var f=JSON.stringify(c),p=null!==(n=r._url)&&void 0!==n?n:this.requestRouter.endpointFor("capture_events",this.analyticsDefaultEndpoint),h=r!==nB;return!this.config.request_batching||h&&!r._batchKey||r.send_instantly?this.__compress_and_send_json_request(p,f,r):this._requestQueue.enqueue(p,c,r),this._invokeCaptureHooks(e,c),c}}else z.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),J(this.__captureHooks,function(t){return t(e)})}},{key:"_calculate_event_properties",value:function(e,t){if(!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),r=o({},t);if(r.token=this.config.token,"$snapshot"===e){var i=o(o({},this.persistence.properties()),this.sessionPersistence.properties());return r.distinct_id=i.distinct_id,r}var s=tf.properties();if(this.sessionManager){var a=this.sessionManager.checkAndGetSessionAndWindowId(),u=a.sessionId,l=a.windowId;r.$session_id=u,r.$window_id=l}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var c=this.sessionPropsManager.getSessionProps();r=X(r,c)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),r=X(r,d)}if("$pageview"===e&&j&&(r.title=j.title),"$performance_event"===e){var f=this.persistence.properties();return r.distinct_id=f.distinct_id,r.$current_url=s.$current_url,r}if(!M(n)){var p=(new Date).getTime()-n;r.$duration=parseFloat((p/1e3).toFixed(3))}U&&this.config.opt_out_useragent_filter&&(r.$browser_type=nq(U,this.config.custom_blocked_useragents)?"bot":"browser"),r=X({},tf.properties(),this.persistence.properties(),this.sessionPersistence.properties(),r);var h=this.config.property_blacklist;F(h)?J(h,function(e){delete r[e]}):z.error("Invalid value for property_blacklist config: "+h);var v=this.config.sanitize_properties;return v&&(r=v(r,e)),r}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(l({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(O(e)&&(e=e.toString(),z.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()))z.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(eR)&&(this.unregister(eR),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(eB))}}else z.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,n){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:o(o({},r),{},l({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(l({},e,n))),r[e]===t||n||this.reloadFeatureFlags()}else z.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){if(!this.__loaded)return z.uninitializedWarning("posthog.reset");var t,n,r,o,i=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(o=this.sessionManager)||void 0===o||o.resetSessionId();var s=this.config.get_device_id(e6());this.register_once({distinct_id:s,$device_id:e?s:i},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,o=this.requestRouter.endpointFor("ui","/replay/"+n);if(null!=e&&e.withTimestamp&&r){var i,s=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!r)return o;var a=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0);o+="?t=".concat(a)}return o}},{key:"alias",value:function(e,t){return e===this.get_property(eS)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):(M(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(eR,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t,n,r=o({},this.config);if(x(e)&&(X(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),null===(t=this.persistence)||void 0===t||t.update_config(this.config),null===(n=this.sessionPersistence)||void 0===n||n.update_config(this.config),te.is_supported()&&"true"===te.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(w.DEBUG=!0),this.sessionRecording&&!M(e.disable_session_recording))){var i=r.disable_session_recording!==e.disable_session_recording,s=!tT(this)&&!e.disable_session_recording&&!this.sessionRecording.started;(i||s)&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled())}}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:nj;return t!==nj&&(t=nj+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&te.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_capturing()&&(this.config.opt_out_capturing_by_default||e7.get("ph_optout"))&&(e7.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,o,i;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||null===(o=this.persistence)||void 0===o||o.set_disabled(r),this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||null===(i=this.sessionPersistence)||void 0===i||i.set_disabled(r)}},{key:"_gdpr_call_func",value:function(e,t){return t=X({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),te.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.config.token,{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=X({enable_persistence:!0},e||{}),this._gdpr_call_func(tk,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=X({clear_persistence:!0},e||{});this._gdpr_call_func(tE,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(tS,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(tR,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=X({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(tF,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==D||D.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==D||D.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=eo(e.prototype[t[n]])}(nZ,["identify"]);var nG,nz,nK,nY={};(y=nz||(nz={})).Popover="popover",y.API="api",y.Widget="widget",(b=nK||(nK={})).Open="open",b.MultipleChoice="multiple_choice",b.SingleChoice="single_choice",b.Rating="rating",b.Link="link";var nQ=(nM=nx.INIT_MODULE,(nT=new nZ).init=function(e,t,n){if(n)return nT[n]||(nT[n]=nY[n]=nV(e||"",t||{},n,function(e){nT[n]=nY[n]=e,e._loaded()})),nT[n];var r=nT;return nY[nj]?r=nY[nj]:e&&(r=nV(e,t||{},nj,function(e){nY[nj]=e,e._loaded()}),nY[nj]=r),nT=r,nM===nx.INIT_SNIPPET&&(Z[nj]=nT),J(nY,function(e,t){t!==nj&&(nT[t]=e)}),r},nT.init(),function(){function e(){e.done||(e.done=!0,nH=!1,J(nY,function(e){e._dom_loaded()}))}null!=j&&j.addEventListener&&("complete"===j.readyState?e():j.addEventListener("DOMContentLoaded",e,!1)),D&&eu(D,"load",e,!0)}(),nT)},16099:function(e,t,n){"use strict";n.d(t,{U0:function(){return a},zf:function(){return s}});var r=n(96520),o=n(719),i=(0,o.createContext)({client:r.ZP});function s(e){var t=e.children,n=e.client,s=e.apiKey,a=e.options,u=(0,o.useMemo)(function(){return(n&&s&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n)?n:(s&&(r.ZP.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),r.ZP.init(s,a)),r.ZP)},[n,s]);return o.createElement(i.Provider,{value:{client:u}},t)}var a=function(){return(0,o.useContext)(i).client}},37631:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var r=n(719),o=n(76932),i=n(3191),s=n(90832);function a(e){let t=e+"CollectionProvider",[n,a]=(0,o.b)(t),[u,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=e+"CollectionSlot",d=r.forwardRef((e,t)=>{let{scope:n,children:o}=e,a=l(c,n),u=(0,i.e)(t,a.collectionRef);return r.createElement(s.g7,{ref:u},o)}),f=e+"CollectionItemSlot",p="data-radix-collection-item";return[{Provider:e=>{let{scope:t,children:n}=e,o=r.useRef(null),i=r.useRef(new Map).current;return r.createElement(u,{scope:t,itemMap:i,collectionRef:o},n)},Slot:d,ItemSlot:r.forwardRef((e,t)=>{let{scope:n,children:o,...a}=e,u=r.useRef(null),c=(0,i.e)(t,u),d=l(f,n);return r.useEffect(()=>(d.itemMap.set(u,{ref:u,...a}),()=>void d.itemMap.delete(u))),r.createElement(s.g7,{[p]:"",ref:c},o)})},function(t){let n=l(e+"CollectionConsumer",t);return r.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},a]}},29250:function(e,t,n){"use strict";let r;n.d(t,{oC:function(){return t6},VY:function(){return t0},ZA:function(){return t1},ck:function(){return t3},wU:function(){return t4},__:function(){return t2},Uv:function(){return tX},Ee:function(){return t5},Rk:function(){return t8},fC:function(){return tQ},Z0:function(){return t7},Tr:function(){return t9},tu:function(){return nt},fF:function(){return ne},xz:function(){return tJ}});var o,i,s,a,u,l,c=n(61246),d=n(719),f=n(91036),p=n(3191),h=n(76932),v=n(65167),g=n(63859),_=n(37631);let m=(0,d.createContext)(void 0);function y(e){let t=(0,d.useContext)(m);return e||t||"ltr"}var b=n(71477);let w=0;function k(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var E=n(56396);let S="focusScope.autoFocusOnMount",R="focusScope.autoFocusOnUnmount",F={bubbles:!1,cancelable:!0},P=(0,d.forwardRef)((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,u]=(0,d.useState)(null),l=(0,E.W)(o),f=(0,E.W)(i),h=(0,d.useRef)(null),v=(0,p.e)(t,e=>u(e)),_=(0,d.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,d.useEffect)(()=>{if(r){function e(e){if(_.paused||!a)return;let t=e.target;a.contains(t)?h.current=t:M(h.current,{select:!0})}function t(e){if(_.paused||!a)return;let t=e.relatedTarget;null===t||a.contains(t)||M(h.current,{select:!0})}document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&M(a)});return a&&n.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,a,_.paused]),(0,d.useEffect)(()=>{if(a){T.add(_);let e=document.activeElement;if(!a.contains(e)){let t=new CustomEvent(S,F);a.addEventListener(S,l),a.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(M(r,{select:t}),document.activeElement!==n)return}(C(a).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&M(a))}return()=>{a.removeEventListener(S,l),setTimeout(()=>{let t=new CustomEvent(R,F);a.addEventListener(R,f),a.dispatchEvent(t),t.defaultPrevented||M(null!=e?e:document.body,{select:!0}),a.removeEventListener(R,f),T.remove(_)},0)}}},[a,l,f,_]);let m=(0,d.useCallback)(e=>{if(!n&&!r||_.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[r,i]=function(e){let t=C(e);return[x(t,e),x(t.reverse(),e)]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&M(i,{select:!0})):(e.preventDefault(),n&&M(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,_.paused]);return(0,d.createElement)(g.WV.div,(0,c.Z)({tabIndex:-1},s,{ref:v,onKeyDown:m}))});function C(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function x(e,t){for(let n of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function M(e,{select:t=!1}={}){if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}let T=(r=[],{add(e){let t=r[0];e!==t&&(null==t||t.pause()),(r=I(r,e)).unshift(e)},remove(e){var t;null===(t=(r=I(r,e))[0])||void 0===t||t.resume()}});function I(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var O=n(96036),A=n(54322),D=n(7733),L=n(29862);let $="rovingFocusGroup.onEntryFocus",q={bubbles:!1,cancelable:!0},N="RovingFocusGroup",[B,j,H]=(0,_.B)(N),[W,V]=(0,h.b)(N,[H]),[U,Z]=W(N),G=(0,d.forwardRef)((e,t)=>(0,d.createElement)(B.Provider,{scope:e.__scopeRovingFocusGroup},(0,d.createElement)(B.Slot,{scope:e.__scopeRovingFocusGroup},(0,d.createElement)(z,(0,c.Z)({},e,{ref:t}))))),z=(0,d.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:l,...h}=e,_=(0,d.useRef)(null),m=(0,p.e)(t,_),b=y(i),[w=null,k]=(0,v.T)({prop:s,defaultProp:a,onChange:u}),[S,R]=(0,d.useState)(!1),F=(0,E.W)(l),P=j(n),C=(0,d.useRef)(!1),[x,M]=(0,d.useState)(0);return(0,d.useEffect)(()=>{let e=_.current;if(e)return e.addEventListener($,F),()=>e.removeEventListener($,F)},[F]),(0,d.createElement)(U,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:w,onItemFocus:(0,d.useCallback)(e=>k(e),[k]),onItemShiftTab:(0,d.useCallback)(()=>R(!0),[]),onFocusableItemAdd:(0,d.useCallback)(()=>M(e=>e+1),[]),onFocusableItemRemove:(0,d.useCallback)(()=>M(e=>e-1),[])},(0,d.createElement)(g.WV.div,(0,c.Z)({tabIndex:S||0===x?-1:0,"data-orientation":r},h,{ref:m,style:{outline:"none",...e.style},onMouseDown:(0,f.M)(e.onMouseDown,()=>{C.current=!0}),onFocus:(0,f.M)(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent($,q);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);Q([e.find(e=>e.active),e.find(e=>e.id===w),...e].filter(Boolean).map(e=>e.ref.current))}}C.current=!1}),onBlur:(0,f.M)(e.onBlur,()=>R(!1))})))}),K=(0,d.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=(0,O.M)(),u=i||a,l=Z("RovingFocusGroupItem",n),p=l.currentTabStopId===u,h=j(n),{onFocusableItemAdd:v,onFocusableItemRemove:_}=l;return(0,d.useEffect)(()=>{if(r)return v(),()=>_()},[r,v,_]),(0,d.createElement)(B.ItemSlot,{scope:n,id:u,focusable:r,active:o},(0,d.createElement)(g.WV.span,(0,c.Z)({tabIndex:p?0:-1,"data-orientation":l.orientation},s,{ref:t,onMouseDown:(0,f.M)(e.onMouseDown,e=>{r?l.onItemFocus(u):e.preventDefault()}),onFocus:(0,f.M)(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:(0,f.M)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let o=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return Y[o]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){var n,r;"prev"===t&&o.reverse();let i=o.indexOf(e.currentTarget);o=l.loop?(n=o,r=i+1,n.map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>Q(o))}})})))}),Y={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Q(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}var J=n(90832),X=new WeakMap,ee=new WeakMap,et={},en=0,er=function(e){return e&&(e.host||er(e.parentNode))},eo=function(e,t,n,r){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=er(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});et[n]||(et[n]=new WeakMap);var i=et[n],s=[],a=new Set,u=new Set(o),l=function(e){!e||a.has(e)||(a.add(e),l(e.parentNode))};o.forEach(l);var c=function(e){!e||u.has(e)||Array.prototype.forEach.call(e.children,function(e){if(a.has(e))c(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,u=(X.get(e)||0)+1,l=(i.get(e)||0)+1;X.set(e,u),i.set(e,l),s.push(e),1===u&&o&&ee.set(e,!0),1===l&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}})};return c(t),a.clear(),en++,function(){s.forEach(function(e){var t=X.get(e)-1,o=i.get(e)-1;X.set(e,t),i.set(e,o),t||(ee.has(e)||e.removeAttribute(r),ee.delete(e)),o||e.removeAttribute(n)}),--en||(X=new WeakMap,X=new WeakMap,ee=new WeakMap,et={})}},ei=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),eo(r,o,n,"aria-hidden")):function(){return null}},es=n(90701),ea="right-scroll-bar-position",eu="width-before-scroll-bar";function el(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ec=new WeakMap,ed=(void 0===o&&(o={}),(void 0===i&&(i=function(e){return e}),s=[],a=!1,u={read:function(){if(a)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:null},useMedium:function(e){var t=i(e,a);return s.push(t),function(){s=s.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(a=!0;s.length;){var t=s;s=[],t.forEach(e)}s={push:function(t){return e(t)},filter:function(){return s}}},assignMedium:function(e){a=!0;var t=[];if(s.length){var n=s;s=[],n.forEach(e),t=s}var r=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(r)};o(),s={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),s}}}}).options=(0,es.pi)({async:!0,ssr:!1},o),u),ef=function(){},ep=d.forwardRef(function(e,t){var n,r,o,i,s=d.useRef(null),a=d.useState({onScrollCapture:ef,onWheelCapture:ef,onTouchMoveCapture:ef}),u=a[0],l=a[1],c=e.forwardProps,f=e.children,p=e.className,h=e.removeScrollBar,v=e.enabled,g=e.shards,_=e.sideCar,m=e.noIsolation,y=e.inert,b=e.allowPinchZoom,w=e.as,k=(0,es._T)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=(n=[s,t],r=function(e){return n.forEach(function(t){return el(t,e)})},(o=(0,d.useState)(function(){return{value:null,callback:r,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=r,i=o.facade,d.useLayoutEffect(function(){var e=ec.get(i);if(e){var t=new Set(e),r=new Set(n),o=i.current;t.forEach(function(e){r.has(e)||el(e,null)}),r.forEach(function(e){t.has(e)||el(e,o)})}ec.set(i,n)},[n]),i),S=(0,es.pi)((0,es.pi)({},k),u);return d.createElement(d.Fragment,null,v&&d.createElement(_,{sideCar:ed,removeScrollBar:h,shards:g,noIsolation:m,inert:y,setCallbacks:l,allowPinchZoom:!!b,lockRef:s}),c?d.cloneElement(d.Children.only(f),(0,es.pi)((0,es.pi)({},S),{ref:E})):d.createElement(void 0===w?"div":w,(0,es.pi)({},S,{className:p,ref:E}),f))});ep.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ep.classNames={fullWidth:eu,zeroRight:ea};var eh=function(e){var t=e.sideCar,n=(0,es._T)(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return d.createElement(r,(0,es.pi)({},n))};eh.isSideCarExport=!0;var ev=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=l||n.nc;return t&&e.setAttribute("nonce",t),e}())){var o,i;(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eg=function(){var e=ev();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},e_=function(){var e=eg();return function(t){return e(t.styles,t.dynamic),null}},em={left:0,top:0,right:0,gap:0},ey=function(e){return parseInt(e||"",10)||0},eb=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[ey(n),ey(r),ey(o)]},ew=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return em;var t=eb(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ek=e_(),eE=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(r,";\n   padding-right: ").concat(a,"px ").concat(r,";\n  }\n  body {\n    overflow: hidden ").concat(r,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n    padding-left: ".concat(o,"px;\n    padding-top: ").concat(i,"px;\n    padding-right: ").concat(s,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(a,"px ").concat(r,";\n    "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(ea," {\n    right: ").concat(a,"px ").concat(r,";\n  }\n  \n  .").concat(eu," {\n    margin-right: ").concat(a,"px ").concat(r,";\n  }\n  \n  .").concat(ea," .").concat(ea," {\n    right: 0 ").concat(r,";\n  }\n  \n  .").concat(eu," .").concat(eu," {\n    margin-right: 0 ").concat(r,";\n  }\n  \n  body {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n  }\n")},eS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r,i=d.useMemo(function(){return ew(o)},[o]);return d.createElement(ek,{styles:eE(i,!t,o,n?"":"!important")})},eR=!1;if("undefined"!=typeof window)try{var eF=Object.defineProperty({},"passive",{get:function(){return eR=!0,!0}});window.addEventListener("test",eF,eF),window.removeEventListener("test",eF,eF)}catch(e){eR=!1}var eP=!!eR&&{passive:!1},eC=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&"TEXTAREA"!==e.tagName&&"visible"===n[t])},ex=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),eM(e,n)){var r=eT(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},eM=function(e,t){return"v"===e?eC(t,"overflowY"):eC(t,"overflowX")},eT=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eI=function(e,t,n,r,o){var i,s=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),a=s*r,u=n.target,l=t.contains(u),c=!1,d=a>0,f=0,p=0;do{var h=eT(e,u),v=h[0],g=h[1]-h[2]-s*v;(v||g)&&eM(e,u)&&(f+=g,p+=v),u=u.parentNode}while(!l&&u!==document.body||l&&(t.contains(u)||t===u));return d&&(o&&0===f||!o&&a>f)?c=!0:!d&&(o&&0===p||!o&&-a>p)&&(c=!0),c},eO=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eA=function(e){return[e.deltaX,e.deltaY]},eD=function(e){return e&&"current"in e?e.current:e},eL=0,e$=[],eq=(ed.useMedium(function(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(eL++)[0],i=d.useState(function(){return e_()})[0],s=d.useRef(e);d.useEffect(function(){s.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(0,es.ev)([e.lockRef.current],(e.shards||[]).map(eD),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!s.current.allowPinchZoom;var o,i=eO(e),a=n.current,u="deltaX"in e?e.deltaX:a[0]-i[0],l="deltaY"in e?e.deltaY:a[1]-i[1],c=e.target,d=Math.abs(u)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=ex(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=ex(d,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(u||l)&&(r.current=o),!o)return!0;var p=r.current||o;return eI(p,t,e,"h"===p?u:l,!0)},[]),u=d.useCallback(function(e){if(e$.length&&e$[e$.length-1]===i){var n="deltaY"in e?eA(e):eO(e),r=t.current.filter(function(t){var r;return t.name===e.type&&t.target===e.target&&(r=t.delta)[0]===n[0]&&r[1]===n[1]})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var o=(s.current.shards||[]).map(eD).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?a(e,o[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),l=d.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),c=d.useCallback(function(e){n.current=eO(e),r.current=void 0},[]),f=d.useCallback(function(t){l(t.type,eA(t),t.target,a(t,e.lockRef.current))},[]),p=d.useCallback(function(t){l(t.type,eO(t),t.target,a(t,e.lockRef.current))},[]);d.useEffect(function(){return e$.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,eP),document.addEventListener("touchmove",u,eP),document.addEventListener("touchstart",c,eP),function(){e$=e$.filter(function(e){return e!==i}),document.removeEventListener("wheel",u,eP),document.removeEventListener("touchmove",u,eP),document.removeEventListener("touchstart",c,eP)}},[]);var h=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(i,{styles:"\n  .block-interactivity-".concat(o," {pointer-events: none;}\n  .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,h?d.createElement(eS,{gapMode:"margin"}):null)}),eh),eN=d.forwardRef(function(e,t){return d.createElement(ep,(0,es.pi)({},e,{ref:t,sideCar:eq}))});eN.classNames=ep.classNames;let eB=["Enter"," "],ej=["ArrowUp","PageDown","End"],eH=["ArrowDown","PageUp","Home",...ej],eW={ltr:[...eB,"ArrowRight"],rtl:[...eB,"ArrowLeft"]},eV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eU="Menu",[eZ,eG,ez]=(0,_.B)(eU),[eK,eY]=(0,h.b)(eU,[ez,A.D7,V]),eQ=(0,A.D7)(),eJ=V(),[eX,e0]=eK(eU),[e1,e2]=eK(eU),e3=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e,o=eQ(n);return(0,d.createElement)(A.ee,(0,c.Z)({},o,r,{ref:t}))}),e6="MenuPortal",[e5,e8]=eK(e6,{forceMount:void 0}),e4="MenuContent",[e7,e9]=eK(e4),te=(0,d.forwardRef)((e,t)=>{let n=e8(e4,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=e0(e4,e.__scopeMenu),s=e2(e4,e.__scopeMenu);return(0,d.createElement)(eZ.Provider,{scope:e.__scopeMenu},(0,d.createElement)(L.z,{present:r||i.open},(0,d.createElement)(eZ.Slot,{scope:e.__scopeMenu},s.modal?(0,d.createElement)(tt,(0,c.Z)({},o,{ref:t})):(0,d.createElement)(tn,(0,c.Z)({},o,{ref:t})))))}),tt=(0,d.forwardRef)((e,t)=>{let n=e0(e4,e.__scopeMenu),r=(0,d.useRef)(null),o=(0,p.e)(t,r);return(0,d.useEffect)(()=>{let e=r.current;if(e)return ei(e)},[]),(0,d.createElement)(tr,(0,c.Z)({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:(0,f.M)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),tn=(0,d.forwardRef)((e,t)=>{let n=e0(e4,e.__scopeMenu);return(0,d.createElement)(tr,(0,c.Z)({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),tr=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:h,onFocusOutside:v,onInteractOutside:g,onDismiss:_,disableOutsideScroll:m,...y}=e,E=e0(e4,n),S=e2(e4,n),R=eQ(n),F=eJ(n),C=eG(n),[x,M]=(0,d.useState)(null),T=(0,d.useRef)(null),I=(0,p.e)(t,T,E.onContentChange),O=(0,d.useRef)(0),D=(0,d.useRef)(""),L=(0,d.useRef)(0),$=(0,d.useRef)(null),q=(0,d.useRef)("right"),N=(0,d.useRef)(0),B=m?eN:d.Fragment,j=m?{as:J.g7,allowPinchZoom:!0}:void 0,H=e=>{var t,n;let r=D.current+e,o=C().filter(e=>!e.disabled),i=document.activeElement,s=null===(t=o.find(e=>e.ref.current===i))||void 0===t?void 0:t.textValue,a=function(e,t,n){var r;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=(r=Math.max(n?e.indexOf(n):-1,0),e.map((t,n)=>e[(r+n)%e.length]));1===o.length&&(i=i.filter(e=>e!==n));let s=i.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}(o.map(e=>e.textValue),r,s),u=null===(n=o.find(e=>e.textValue===a))||void 0===n?void 0:n.ref.current;!function e(t){D.current=t,window.clearTimeout(O.current),""!==t&&(O.current=window.setTimeout(()=>e(""),1e3))}(r),u&&setTimeout(()=>u.focus())};(0,d.useEffect)(()=>()=>window.clearTimeout(O.current),[]),(0,d.useEffect)(()=>{var e,t;let n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:k()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:k()),w++,()=>{1===w&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),w--}},[]);let W=(0,d.useCallback)(e=>{var t,n,r;return q.current===(null===(t=$.current)||void 0===t?void 0:t.side)&&!!(r=null===(n=$.current)||void 0===n?void 0:n.area)&&function(e,t){let{x:n,y:r}=e,o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let s=t[e].x,a=t[e].y,u=t[i].x,l=t[i].y;a>r!=l>r&&n<(u-s)*(r-a)/(l-a)+s&&(o=!o)}return o}({x:e.clientX,y:e.clientY},r)},[]);return(0,d.createElement)(e7,{scope:n,searchRef:D,onItemEnter:(0,d.useCallback)(e=>{W(e)&&e.preventDefault()},[W]),onItemLeave:(0,d.useCallback)(e=>{var t;W(e)||(null===(t=T.current)||void 0===t||t.focus(),M(null))},[W]),onTriggerLeave:(0,d.useCallback)(e=>{W(e)&&e.preventDefault()},[W]),pointerGraceTimerRef:L,onPointerGraceIntentChange:(0,d.useCallback)(e=>{$.current=e},[])},(0,d.createElement)(B,j,(0,d.createElement)(P,{asChild:!0,trapped:o,onMountAutoFocus:(0,f.M)(i,e=>{var t;e.preventDefault(),null===(t=T.current)||void 0===t||t.focus()}),onUnmountAutoFocus:s},(0,d.createElement)(b.XB,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:h,onFocusOutside:v,onInteractOutside:g,onDismiss:_},(0,d.createElement)(G,(0,c.Z)({asChild:!0},F,{dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:M,onEntryFocus:(0,f.M)(u,e=>{S.isUsingKeyboardRef.current||e.preventDefault()})}),(0,d.createElement)(A.VY,(0,c.Z)({role:"menu","aria-orientation":"vertical","data-state":tF(E.open),"data-radix-menu-content":"",dir:S.dir},R,y,{ref:I,style:{outline:"none",...y.style},onKeyDown:(0,f.M)(y.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&H(e.key));let o=T.current;if(e.target!==o||!eH.includes(e.key))return;e.preventDefault();let i=C().filter(e=>!e.disabled).map(e=>e.ref.current);ej.includes(e.key)&&i.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(i)}),onBlur:(0,f.M)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),D.current="")}),onPointerMove:(0,f.M)(e.onPointerMove,tx(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?"right":"left";q.current=t,N.current=e.clientX}}))})))))))}),to=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,d.createElement)(g.WV.div,(0,c.Z)({role:"group"},r,{ref:t}))}),ti=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,d.createElement)(g.WV.div,(0,c.Z)({},r,{ref:t}))}),ts="MenuItem",ta="menu.itemSelect",tu=(0,d.forwardRef)((e,t)=>{let{disabled:n=!1,onSelect:r,...o}=e,i=(0,d.useRef)(null),s=e2(ts,e.__scopeMenu),a=e9(ts,e.__scopeMenu),u=(0,p.e)(t,i),l=(0,d.useRef)(!1);return(0,d.createElement)(tl,(0,c.Z)({},o,{ref:u,disabled:n,onClick:(0,f.M)(e.onClick,()=>{let e=i.current;if(!n&&e){let t=new CustomEvent(ta,{bubbles:!0,cancelable:!0});e.addEventListener(ta,e=>null==r?void 0:r(e),{once:!0}),(0,g.jH)(e,t),t.defaultPrevented?l.current=!1:s.onClose()}}),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),l.current=!0},onPointerUp:(0,f.M)(e.onPointerUp,e=>{var t;l.current||null===(t=e.currentTarget)||void 0===t||t.click()}),onKeyDown:(0,f.M)(e.onKeyDown,e=>{let t=""!==a.searchRef.current;!n&&(!t||" "!==e.key)&&eB.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})}))}),tl=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=e9(ts,n),a=eJ(n),u=(0,d.useRef)(null),l=(0,p.e)(t,u),[h,v]=(0,d.useState)(!1),[_,m]=(0,d.useState)("");return(0,d.useEffect)(()=>{let e=u.current;if(e){var t;m((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}},[i.children]),(0,d.createElement)(eZ.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:_},(0,d.createElement)(K,(0,c.Z)({asChild:!0},a,{focusable:!r}),(0,d.createElement)(g.WV.div,(0,c.Z)({role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:l,onPointerMove:(0,f.M)(e.onPointerMove,tx(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus())})),onPointerLeave:(0,f.M)(e.onPointerLeave,tx(e=>s.onItemLeave(e))),onFocus:(0,f.M)(e.onFocus,()=>v(!0)),onBlur:(0,f.M)(e.onBlur,()=>v(!1))}))))}),tc=(0,d.forwardRef)((e,t)=>{let{checked:n=!1,onCheckedChange:r,...o}=e;return(0,d.createElement)(tg,{scope:e.__scopeMenu,checked:n},(0,d.createElement)(tu,(0,c.Z)({role:"menuitemcheckbox","aria-checked":tP(n)?"mixed":n},o,{ref:t,"data-state":tC(n),onSelect:(0,f.M)(o.onSelect,()=>null==r?void 0:r(!!tP(n)||!n),{checkForDefaultPrevented:!1})})))}),[td,tf]=eK("MenuRadioGroup",{value:void 0,onValueChange:()=>{}}),tp=(0,d.forwardRef)((e,t)=>{let{value:n,onValueChange:r,...o}=e,i=(0,E.W)(r);return(0,d.createElement)(td,{scope:e.__scopeMenu,value:n,onValueChange:i},(0,d.createElement)(to,(0,c.Z)({},o,{ref:t})))}),th=(0,d.forwardRef)((e,t)=>{let{value:n,...r}=e,o=tf("MenuRadioItem",e.__scopeMenu),i=n===o.value;return(0,d.createElement)(tg,{scope:e.__scopeMenu,checked:i},(0,d.createElement)(tu,(0,c.Z)({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":tC(i),onSelect:(0,f.M)(r.onSelect,()=>{var e;return null===(e=o.onValueChange)||void 0===e?void 0:e.call(o,n)},{checkForDefaultPrevented:!1})})))}),tv="MenuItemIndicator",[tg,t_]=eK(tv,{checked:!1}),tm=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,forceMount:r,...o}=e,i=t_(tv,n);return(0,d.createElement)(L.z,{present:r||tP(i.checked)||!0===i.checked},(0,d.createElement)(g.WV.span,(0,c.Z)({},o,{ref:t,"data-state":tC(i.checked)})))}),ty=(0,d.forwardRef)((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,d.createElement)(g.WV.div,(0,c.Z)({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),tb=((e,t)=>{let{__scopeMenu:n,...r}=e,o=eQ(n);return(0,d.createElement)(A.Eh,(0,c.Z)({},o,r,{ref:t}))},"MenuSub"),[tw,tk]=eK(tb),tE="MenuSubTrigger",tS=(0,d.forwardRef)((e,t)=>{let n=e0(tE,e.__scopeMenu),r=e2(tE,e.__scopeMenu),o=tk(tE,e.__scopeMenu),i=e9(tE,e.__scopeMenu),s=(0,d.useRef)(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=i,l={__scopeMenu:e.__scopeMenu},h=(0,d.useCallback)(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return(0,d.useEffect)(()=>h,[h]),(0,d.useEffect)(()=>{let e=a.current;return()=>{window.clearTimeout(e),u(null)}},[a,u]),(0,d.createElement)(e3,(0,c.Z)({asChild:!0},l),(0,d.createElement)(tl,(0,c.Z)({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":tF(n.open)},e,{ref:(0,p.F)(t,o.onTriggerChange),onClick:t=>{var r;null===(r=e.onClick)||void 0===r||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:(0,f.M)(e.onPointerMove,tx(t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:(0,f.M)(e.onPointerLeave,tx(e=>{var t,r;h();let o=null===(t=n.content)||void 0===t?void 0:t.getBoundingClientRect();if(o){let t=null===(r=n.content)||void 0===r?void 0:r.dataset.side,s="right"===t,u=o[s?"left":"right"],l=o[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+(s?-5:5),y:e.clientY},{x:u,y:o.top},{x:l,y:o.top},{x:l,y:o.bottom},{x:u,y:o.bottom}],side:t}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:(0,f.M)(e.onKeyDown,t=>{let o=""!==i.searchRef.current;if(!e.disabled&&(!o||" "!==t.key)&&eW[r.dir].includes(t.key)){var s;n.onOpenChange(!0),null===(s=n.content)||void 0===s||s.focus(),t.preventDefault()}})})))}),tR=(0,d.forwardRef)((e,t)=>{let n=e8(e4,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=e0(e4,e.__scopeMenu),s=e2(e4,e.__scopeMenu),a=tk("MenuSubContent",e.__scopeMenu),u=(0,d.useRef)(null),l=(0,p.e)(t,u);return(0,d.createElement)(eZ.Provider,{scope:e.__scopeMenu},(0,d.createElement)(L.z,{present:r||i.open},(0,d.createElement)(eZ.Slot,{scope:e.__scopeMenu},(0,d.createElement)(tr,(0,c.Z)({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:l,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null===(t=u.current)||void 0===t||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,f.M)(e.onFocusOutside,e=>{e.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,f.M)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,f.M)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=eV[s.dir].includes(e.key);if(t&&n){var r;i.onOpenChange(!1),null===(r=a.trigger)||void 0===r||r.focus(),e.preventDefault()}})})))))});function tF(e){return e?"open":"closed"}function tP(e){return"indeterminate"===e}function tC(e){return tP(e)?"indeterminate":e?"checked":"unchecked"}function tx(e){return t=>"mouse"===t.pointerType?e(t):void 0}let tM=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=eQ(t),[u,l]=(0,d.useState)(null),c=(0,d.useRef)(!1),f=(0,E.W)(i),p=y(o);return(0,d.useEffect)(()=>{let e=()=>{c.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>c.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,d.createElement)(A.fC,a,(0,d.createElement)(eX,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:l},(0,d.createElement)(e1,{scope:t,onClose:(0,d.useCallback)(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:p,modal:s},r)))},tT=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=e0(e6,t);return(0,d.createElement)(e5,{scope:t,forceMount:n},(0,d.createElement)(L.z,{present:n||i.open},(0,d.createElement)(D.h,{asChild:!0,container:o},r)))},tI=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=e0(tb,t),s=eQ(t),[a,u]=(0,d.useState)(null),[l,c]=(0,d.useState)(null),f=(0,E.W)(o);return(0,d.useEffect)(()=>(!1===i.open&&f(!1),()=>f(!1)),[i.open,f]),(0,d.createElement)(A.fC,s,(0,d.createElement)(eX,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:c},(0,d.createElement)(tw,{scope:t,contentId:(0,O.M)(),triggerId:(0,O.M)(),trigger:a,onTriggerChange:u},n)))},tO="DropdownMenu",[tA,tD]=(0,h.b)(tO,[eY]),tL=eY(),[t$,tq]=tA(tO),tN=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=tq("DropdownMenuTrigger",n),s=tL(n);return(0,d.createElement)(e3,(0,c.Z)({asChild:!0},s),(0,d.createElement)(g.WV.button,(0,c.Z)({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:(0,p.F)(t,i.triggerRef),onPointerDown:(0,f.M)(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:(0,f.M)(e.onKeyDown,e=>{!r&&(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})))}),tB=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tq("DropdownMenuContent",n),i=tL(n),s=(0,d.useRef)(!1);return(0,d.createElement)(te,(0,c.Z)({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:(0,f.M)(e.onCloseAutoFocus,e=>{var t;s.current||null===(t=o.triggerRef.current)||void 0===t||t.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,f.M)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!o.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),tj=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(to,(0,c.Z)({},o,r,{ref:t}))}),tH=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(ti,(0,c.Z)({},o,r,{ref:t}))}),tW=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(tu,(0,c.Z)({},o,r,{ref:t}))}),tV=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(tc,(0,c.Z)({},o,r,{ref:t}))}),tU=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(tp,(0,c.Z)({},o,r,{ref:t}))}),tZ=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(th,(0,c.Z)({},o,r,{ref:t}))}),tG=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(tm,(0,c.Z)({},o,r,{ref:t}))}),tz=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(ty,(0,c.Z)({},o,r,{ref:t}))}),tK=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(tS,(0,c.Z)({},o,r,{ref:t}))}),tY=(0,d.forwardRef)((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,o=tL(n);return(0,d.createElement)(tR,(0,c.Z)({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),tQ=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,u=tL(t),l=(0,d.useRef)(null),[f=!1,p]=(0,v.T)({prop:o,defaultProp:i,onChange:s});return(0,d.createElement)(t$,{scope:t,triggerId:(0,O.M)(),triggerRef:l,contentId:(0,O.M)(),open:f,onOpenChange:p,onOpenToggle:(0,d.useCallback)(()=>p(e=>!e),[p]),modal:a},(0,d.createElement)(tM,(0,c.Z)({},u,{open:f,onOpenChange:p,dir:r,modal:a}),n))},tJ=tN,tX=e=>{let{__scopeDropdownMenu:t,...n}=e,r=tL(t);return(0,d.createElement)(tT,(0,c.Z)({},r,n))},t0=tB,t1=tj,t2=tH,t3=tW,t6=tV,t5=tU,t8=tZ,t4=tG,t7=tz,t9=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=tL(t),[a=!1,u]=(0,v.T)({prop:r,defaultProp:i,onChange:o});return(0,d.createElement)(tI,(0,c.Z)({},s,{open:a,onOpenChange:u}),n)},ne=tK,nt=tY},25665:function(e,t,n){"use strict";n.d(t,{Dx:function(){return K},aU:function(){return Q},dk:function(){return Y},fC:function(){return z},l_:function(){return G},x8:function(){return J},zt:function(){return Z}});var r=n(61246),o=n(719),i=n(86731),s=n(91036),a=n(3191),u=n(37631),l=n(76932),c=n(71477),d=n(7733),f=n(29862),p=n(63859),h=n(56396),v=n(65167),g=n(6995),_=n(72872);let m="ToastProvider",[y,b,w]=(0,u.B)("Toast"),[k,E]=(0,l.b)("Toast",[w]),[S,R]=k(m),F=e=>{let{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=e,[u,l]=(0,o.useState)(null),[c,d]=(0,o.useState)(0),f=(0,o.useRef)(!1),p=(0,o.useRef)(!1);return(0,o.createElement)(y.Provider,{scope:t},(0,o.createElement)(S,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:c,viewport:u,onViewportChange:l,onToastAdd:(0,o.useCallback)(()=>d(e=>e+1),[]),onToastRemove:(0,o.useCallback)(()=>d(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p},a))};F.propTypes={label:e=>e.label&&"string"==typeof e.label&&!e.label.trim()?Error(`Invalid prop \`label\` supplied to \`${m}\`. Expected non-empty \`string\`.`):null};let P=["F8"],C="toast.viewportPause",x="toast.viewportResume",M=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,hotkey:i=P,label:s="Notifications ({hotkey})",...u}=e,l=R("ToastViewport",n),d=b(n),f=(0,o.useRef)(null),h=(0,o.useRef)(null),v=(0,o.useRef)(null),g=(0,o.useRef)(null),_=(0,a.e)(t,g,l.onViewportChange),m=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=l.toastCount>0;(0,o.useEffect)(()=>{let e=e=>{var t;i.every(t=>e[t]||e.code===t)&&(null===(t=g.current)||void 0===t||t.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),(0,o.useEffect)(()=>{let e=f.current,t=g.current;if(w&&e&&t){let n=()=>{if(!l.isClosePausedRef.current){let e=new CustomEvent(C);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){let e=new CustomEvent(x);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},o=t=>{e.contains(t.relatedTarget)||r()},i=()=>{e.contains(document.activeElement)||r()};return e.addEventListener("focusin",n),e.addEventListener("focusout",o),e.addEventListener("pointermove",n),e.addEventListener("pointerleave",i),window.addEventListener("blur",n),window.addEventListener("focus",r),()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",n),e.removeEventListener("pointerleave",i),window.removeEventListener("blur",n),window.removeEventListener("focus",r)}}},[w,l.isClosePausedRef]);let k=(0,o.useCallback)(({tabbingDirection:e})=>{let t=d().map(t=>{let n=t.ref.current,r=[n,...function(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}(n)];return"forwards"===e?r:r.reverse()});return("forwards"===e?t.reverse():t).flat()},[d]);return(0,o.useEffect)(()=>{let e=g.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!n){var r,o,i;let n=document.activeElement,s=t.shiftKey;if(t.target===e&&s){null===(r=h.current)||void 0===r||r.focus();return}let a=k({tabbingDirection:s?"backwards":"forwards"}),u=a.findIndex(e=>e===n);U(a.slice(u+1))?t.preventDefault():s?null===(o=h.current)||void 0===o||o.focus():null===(i=v.current)||void 0===i||i.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[d,k]),(0,o.createElement)(c.I0,{ref:f,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:w?void 0:"none"}},w&&(0,o.createElement)(T,{ref:h,onFocusFromOutsideViewport:()=>{U(k({tabbingDirection:"forwards"}))}}),(0,o.createElement)(y.Slot,{scope:n},(0,o.createElement)(p.WV.ol,(0,r.Z)({tabIndex:-1},u,{ref:_}))),w&&(0,o.createElement)(T,{ref:v,onFocusFromOutsideViewport:()=>{U(k({tabbingDirection:"backwards"}))}}))}),T=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:i,...s}=e,a=R("ToastFocusProxy",n);return(0,o.createElement)(_.T,(0,r.Z)({"aria-hidden":!0,tabIndex:0},s,{ref:t,style:{position:"fixed"},onFocus:e=>{var t;let n=e.relatedTarget;null!==(t=a.viewport)&&void 0!==t&&t.contains(n)||i()}}))}),I="Toast",O=(0,o.forwardRef)((e,t)=>{let{forceMount:n,open:i,defaultOpen:a,onOpenChange:u,...l}=e,[c=!0,d]=(0,v.T)({prop:i,defaultProp:a,onChange:u});return(0,o.createElement)(f.z,{present:n||c},(0,o.createElement)(L,(0,r.Z)({open:c},l,{ref:t,onClose:()=>d(!1),onPause:(0,h.W)(e.onPause),onResume:(0,h.W)(e.onResume),onSwipeStart:(0,s.M)(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:(0,s.M)(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${n}px`)}),onSwipeCancel:(0,s.M)(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:(0,s.M)(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${n}px`),d(!1)})})))}),[A,D]=k(I,{onClose(){}}),L=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,type:u="foreground",duration:l,open:d,onClose:f,onEscapeKeyDown:v,onPause:g,onResume:_,onSwipeStart:m,onSwipeMove:b,onSwipeCancel:w,onSwipeEnd:k,...E}=e,S=R(I,n),[F,P]=(0,o.useState)(null),M=(0,a.e)(t,e=>P(e)),T=(0,o.useRef)(null),O=(0,o.useRef)(null),D=l||S.duration,L=(0,o.useRef)(0),q=(0,o.useRef)(D),N=(0,o.useRef)(0),{onToastAdd:B,onToastRemove:j}=S,H=(0,h.W)(()=>{var e;(null==F?void 0:F.contains(document.activeElement))&&(null===(e=S.viewport)||void 0===e||e.focus()),f()}),U=(0,o.useCallback)(e=>{e&&e!==1/0&&(window.clearTimeout(N.current),L.current=new Date().getTime(),N.current=window.setTimeout(H,e))},[H]);(0,o.useEffect)(()=>{let e=S.viewport;if(e){let t=()=>{U(q.current),null==_||_()},n=()=>{let e=new Date().getTime()-L.current;q.current=q.current-e,window.clearTimeout(N.current),null==g||g()};return e.addEventListener(C,n),e.addEventListener(x,t),()=>{e.removeEventListener(C,n),e.removeEventListener(x,t)}}},[S.viewport,D,g,_,U]),(0,o.useEffect)(()=>{d&&!S.isClosePausedRef.current&&U(D)},[d,D,S.isClosePausedRef,U]),(0,o.useEffect)(()=>(B(),()=>j()),[B,j]);let Z=(0,o.useMemo)(()=>F?function e(t){let n=[];return Array.from(t.childNodes).forEach(t=>{if(t.nodeType===t.TEXT_NODE&&t.textContent&&n.push(t.textContent),t.nodeType===t.ELEMENT_NODE){let r=t.ariaHidden||t.hidden||"none"===t.style.display,o=""===t.dataset.radixToastAnnounceExclude;if(!r){if(o){let e=t.dataset.radixToastAnnounceAlt;e&&n.push(e)}else n.push(...e(t))}}}),n}(F):null,[F]);return S.viewport?(0,o.createElement)(o.Fragment,null,Z&&(0,o.createElement)($,{__scopeToast:n,role:"status","aria-live":"foreground"===u?"assertive":"polite","aria-atomic":!0},Z),(0,o.createElement)(A,{scope:n,onClose:H},(0,i.createPortal)((0,o.createElement)(y.ItemSlot,{scope:n},(0,o.createElement)(c.fC,{asChild:!0,onEscapeKeyDown:(0,s.M)(v,()=>{S.isFocusedToastEscapeKeyDownRef.current||H(),S.isFocusedToastEscapeKeyDownRef.current=!1})},(0,o.createElement)(p.WV.li,(0,r.Z)({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":S.swipeDirection},E,{ref:M,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:(0,s.M)(e.onKeyDown,e=>{"Escape"!==e.key||(null==v||v(e.nativeEvent),e.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:(0,s.M)(e.onPointerDown,e=>{0===e.button&&(T.current={x:e.clientX,y:e.clientY})}),onPointerMove:(0,s.M)(e.onPointerMove,e=>{if(!T.current)return;let t=e.clientX-T.current.x,n=e.clientY-T.current.y,r=!!O.current,o=["left","right"].includes(S.swipeDirection),i=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,s=o?i(0,t):0,a=o?0:i(0,n),u="touch"===e.pointerType?10:2,l={x:s,y:a},c={originalEvent:e,delta:l};r?(O.current=l,W("toast.swipeMove",b,c,{discrete:!1})):V(l,S.swipeDirection,u)?(O.current=l,W("toast.swipeStart",m,c,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>u||Math.abs(n)>u)&&(T.current=null)}),onPointerUp:(0,s.M)(e.onPointerUp,e=>{let t=O.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),O.current=null,T.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};V(t,S.swipeDirection,S.swipeThreshold)?W("toast.swipeEnd",k,r,{discrete:!0}):W("toast.swipeCancel",w,r,{discrete:!0}),n.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})))),S.viewport))):null});L.propTypes={type:e=>e.type&&!["foreground","background"].includes(e.type)?Error(`Invalid prop \`type\` supplied to \`${I}\`. Expected \`foreground | background\`.`):null};let $=e=>{let{__scopeToast:t,children:n,...r}=e,i=R(I,t),[s,a]=(0,o.useState)(!1),[u,l]=(0,o.useState)(!1);return function(e=()=>{}){let t=(0,h.W)(e);(0,g.b)(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}(()=>a(!0)),(0,o.useEffect)(()=>{let e=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(e)},[]),u?null:(0,o.createElement)(d.h,{asChild:!0},(0,o.createElement)(_.T,r,s&&(0,o.createElement)(o.Fragment,null,i.label," ",n)))},q=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,...i}=e;return(0,o.createElement)(p.WV.div,(0,r.Z)({},i,{ref:t}))}),N=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,...i}=e;return(0,o.createElement)(p.WV.div,(0,r.Z)({},i,{ref:t}))}),B=(0,o.forwardRef)((e,t)=>{let{altText:n,...i}=e;return n?(0,o.createElement)(H,{altText:n,asChild:!0},(0,o.createElement)(j,(0,r.Z)({},i,{ref:t}))):null});B.propTypes={altText:e=>e.altText?null:Error("Missing prop `altText` expected on `ToastAction`")};let j=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,...i}=e,a=D("ToastClose",n);return(0,o.createElement)(H,{asChild:!0},(0,o.createElement)(p.WV.button,(0,r.Z)({type:"button"},i,{ref:t,onClick:(0,s.M)(e.onClick,a.onClose)})))}),H=(0,o.forwardRef)((e,t)=>{let{__scopeToast:n,altText:i,...s}=e;return(0,o.createElement)(p.WV.div,(0,r.Z)({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0},s,{ref:t}))});function W(e,t,n,{discrete:r}){let o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?(0,p.jH)(o,i):o.dispatchEvent(i)}let V=(e,t,n=0)=>{let r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return"left"===t||"right"===t?i&&r>n:!i&&o>n};function U(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}let Z=F,G=M,z=O,K=q,Y=N,Q=B,J=j},90701:function(e,t,n){"use strict";n.d(t,{_T:function(){return o},ev:function(){return i},pi:function(){return r}});var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function i(e,t,n){if(n||2==arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError}}]);