1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66849,(e,t,i)=>{"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(i){return t.resolve(e()).then(function(){return i})},function(i){return t.resolve(e()).then(function(){throw i})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},23911,(e,t,i)=>{"use strict";e.i(47167),Object.defineProperty(i,"__esModule",{value:!0}),e.r(66849),("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},96517,(e,t,i)=>{"use strict";e.i(47167),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"appBootstrap",{enumerable:!0,get:function(){return n}});let r=e.r(74575),s=e.r(22737);function n(e){var t,i;let n=(0,r.getAssetPrefix)();t=self.__next_s,i=()=>{e(n)},t&&t.length?t.reduce((e,[t,i])=>e.then(()=>new Promise((e,r)=>{let n=document.createElement("script");i&&(0,s.setAttributesFromProps)(n,i),t?(n.src=t,n.onload=()=>e(),n.onerror=r):i&&(n.innerHTML=i.children,setTimeout(e)),document.head.appendChild(n)})),Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{i()}):i()}window.next={version:"16.3.1",appDir:!0},("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},98569,(e,t,i)=>{"use strict";let r,s,n,o;e.i(47167),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"hydrate",{enumerable:!0,get:function(){return B}});let a=e.r(55682),l=e.r(43476);e.r(23911);let u=a._(e.r(88014)),h=a._(e.r(71645)),c=e.r(35326),d=e.r(42732),p=e.r(97238),v=e.r(51323),f=e.r(32120),g=e.r(92245),_=e.r(99781),m=a._(e.r(75530)),y=e.r(65716);e.r(8372);let b=e.r(50590),w=e.r(43369),x=e.r(32992),E=e.r(76138),k=c.createFromReadableStream,S=c.createFromFetch,P=document,O=self.__next_instant_test?self.__next_instant_test:void 0,I=new TextEncoder,F=!1,R=!1,C=null;function T(e){if(0===e[0])n=[];else if(1===e[0]){if(!n)throw Object.defineProperty(Error("Unexpected server data: missing bootstrap script."),"__NEXT_ERROR_CODE",{value:"E18",enumerable:!1,configurable:!0});o?o.enqueue(I.encode(e[1])):n.push(e[1])}else if(2===e[0])C=e[1];else if(3===e[0]){if(!n)throw Object.defineProperty(Error("Unexpected server data: missing bootstrap script."),"__NEXT_ERROR_CODE",{value:"E18",enumerable:!1,configurable:!0});let i=atob(e[1]),r=new Uint8Array(i.length);for(var t=0;t<i.length;t++)r[t]=i.charCodeAt(t);o?o.enqueue(r):n.push(r)}}let M=function(){o&&!R&&(o.close(),R=!0,n=void 0),F=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",M,!1):setTimeout(M);let $=self.__next_f=self.__next_f||[];$.forEach(T),$.length=0,$.push=T;let A=new ReadableStream({start(e){n&&(n.forEach(t=>{e.enqueue("string"==typeof t?I.encode(t):t)}
1),F&&!R)&&(null===e.desiredSize||e.desiredSize<0?O||e.error(Object.defineProperty(Error("The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection."),"__NEXT_ERROR_CODE",{value:"E117",enumerable:!1,configurable:!0})):e.close(),R=!0,n=void 0),o=e}});if(O)s=Promise.resolve(S(O,{callServer:f.callServer,findSourceMapURL:g.findSourceMapURL,debugChannel:r,unstable_allowPartialStream:!0})).then(async e=>(0,b.createInitialRSCPayloadFromFallbackPrerender)(await O,e));else if(window.__NEXT_CLIENT_RESUME){let e=window.__NEXT_CLIENT_RESUME;s=Promise.resolve(S(e,{callServer:f.callServer,findSourceMapURL:g.findSourceMapURL,debugChannel:r})).then(async t=>(0,b.createInitialRSCPayloadFromFallbackPrerender)(await e,t))}else s=k(A,{callServer:f.callServer,findSourceMapURL:g.findSourceMapURL,debugChannel:r,startTime:0});function L({initialRSCPayload:e,actionQueue:t,webSocket:i,staticIndicatorState:r}){return(0,l.jsx)(m.default,{actionQueue:t,globalErrorState:e.G,webSocket:i,staticIndicatorState:r})}let D=h.default.StrictMode;function j({children:e}){return e}let N={onDefaultTransitionIndicator:function(){return()=>{}},onRecoverableError:p.onRecoverableError,onCaughtError:v.onCaughtError,onUncaughtError:v.onUncaughtError};async function B(e,t){let i,r,n=await s;n.b?(0,x.setNavigationBuildId)(n.b):(0,x.setNavigationBuildId)((0,w.getDeploymentId)()),(0,E.initializeRouterTransitionModules)(e);let o=Date.now(),a=(0,_.createMutableActionQueue)((0,y.createInitialRouterState)({navigatedAt:o,initialRSCPayload:n,initialFlightStreamForCache:null,location:window.location})),c=(0,l.jsx)(D,{children:(0,l.jsx)(d.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,l.jsx)(j,{children:(0,l.jsx)(L,{initialRSCPayload:n,actionQueue:a,webSocket:r,staticIndicatorState:i})})})});"__next_error__"===document.documentElement.id?u.default.createRoot(P,N).render(c):h.default.startTransition(()=>
1{u.default.hydrateRoot(P,c,{...N,formState:C})})}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},94553,(e,t,i)=>{"use strict";e.i(47167),Object.defineProperty(i,"__esModule",{value:!0}),e.r(23755);let r=e.r(96517);e.r(97238),window.next.turbopack=!0,self.__webpack_hash__="";let s=e.r(5526);(0,r.appBootstrap)(t=>{let{hydrate:i}=e.r(98569);i(s,t)}),("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},74575,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getAssetPrefix",{enumerable:!0,get:function(){return s}});let r=e.r(12718);function s(){let e=document.currentScript;if(!(e instanceof HTMLScriptElement))throw Object.defineProperty(new r.InvariantError(`Expected document.currentScript to be a <script> element. Received ${e} instead.`),"__NEXT_ERROR_CODE",{value:"E783",enumerable:!1,configurable:!0});let{pathname:t}=new URL(e.src),i=t.indexOf("/_next/");if(-1===i)throw Object.defineProperty(new r.InvariantError(`Expected document.currentScript src to contain '/_next/'. Received ${e.src} instead.`),"__NEXT_ERROR_CODE",{value:"E784",enumerable:!1,configurable:!0});return t.slice(0,i)}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},62634,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"AppRouterAnnouncer",{enumerable:!0,get:function(){return o}});let r=e.r(71645),s=e.r(74080),n="next-route-announcer";function o({tree:e}){let[t,i]=(0,r.useState)(null);(0,r.useEffect)(()=>(i(function(){let e=document.getElementsByName(n)[0];if(e?.shadowRoot?.childNodes[0])return e.shadowRoot.childNodes[0];{let e=document.createElement(n);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(n)[0];e?.isConnected&&document.body.removeChild(e)}),[]);let[a,l]=(0,r.useState)(""),u=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==u.current&&u.current!==e&&l(e),u.current=e},[e]),t?(0,s.createPortal)(a,t):null}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},75530,(e,t,i)=>{"use strict";e.i(47167),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return M}});let r=e.r(55682),s=e.r(90809),n=e.r(43476),o=s._(e.r(71645)),a=e.r(8372),l=e.r(88540),u=e.r(51191),h=e.r(61994),c=e.r(41538),d=e.r(94272),p=e.r(62634),v=e.r(58442),f=e.r(25018),g=e.r(1244),_=e.r(87250),m=e.r(52817),y=e.r(34727),b=e.r(78377),w=e.r(99781),x=e.r(24063),E=e.r(68391),k=e.r(91949),S=r._(e.r(94109)),P=r._(e.r(68027)),O=e.r(97367);e.r(43369);let I={};function F({appRouterState:e}){return(0,o.useInsertionEffect)(()=>{let{tree:t,pushRef:i,canonicalUrl:r,renderedSearch:s}=e,n={...i.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:{tree:t,renderedSearch:s}};i.pendingPush&&(0,u.createHrefFromUrl)(new URL(window.location.href))!==r?(i.pendingPush=!1,window.history.pushState(n,"",r)):window.history.replaceState(n,"",r),(0,d.setLastCommittedTree)(t)},[e]),(0,o.useEffect)(()=>{(0,k.pingVisibleLinks)(e.nextUrl,e.tree)},[e.nextUrl,e.tree]),null}function R(e){null==e&&(e={});let t=window.history.state,i=t?.__NA;i&&(e.__NA=i);let r=t?.__PRIVATE_NEXTJS_INTERNALS_TREE;return r&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=r),e}function C({headCacheNode:e}){let t=null!==e?e.head:null,i=null!==e?e.prefetchHead:null,r=null!==i?i:t;return(0,o.useDeferredValue)(t,r)}
1function T({actionQueue:e,globalError:t,webSocket:i,staticIndicatorState:r}){let s,u=(0,c.useActionQueue)(e),{canonicalUrl:d}=u,{searchParams:b,pathname:k}=(0,o.useMemo)(()=>{let e=new URL(d,"u"<typeof window?"http://n":window.location.href);return{searchParams:e.searchParams,pathname:(0,m.hasBasePath)(e.pathname)?(0,_.removeBasePath)(e.pathname):e.pathname}},[d]);(0,o.useEffect)(()=>{let e=(0,y.extractSourcePageFromFlightRouterState)(u.tree);void 0!==e?window.next.__internal_src_page=e:delete window.next.__internal_src_page},[u.tree]),(0,o.useEffect)(()=>{function e(e){e.persisted&&window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE&&(I.pendingMpaPath=void 0,(0,c.dispatchAppRouterAction)({type:l.ACTION_RESTORE,url:new URL(window.location.href),historyState:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[]),(0,o.useEffect)(()=>{function e(e){let t="reason"in e?e.reason:e.error;if((0,E.isRedirectError)(t)){e.preventDefault();let i=(0,x.getURLFromRedirectError)(t);"push"===(0,x.getRedirectTypeFromError)(t)?w.publicAppRouterInstance.push(i,{}):w.publicAppRouterInstance.replace(i,{})}}return window.addEventListener("error",e),window.addEventListener("unhandledrejection",e),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",e)}},[]);let{pushRef:P}=u;if(P.mpaNavigation){if(I.pendingMpaPath!==d){let e=window.location;P.pendingPush?e.assign(d):e.replace(d),I.pendingMpaPath=d}throw g.unresolvedThenable}(0,o.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),i=e=>{let t=window.location.href,i=window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,o.startTransition)(()=>{(0,c.dispatchAppRouterAction)({type:l.ACTION_RESTORE,url:new URL(e??t,t),historyState:i})})};window.history.pushState=function(t,r,s){return t?.__NA||t?._N||(t=R(t),s&&i(s)),e(t,r,s)},window.history.replaceState=function(e,r,s){return e?.__NA||e?._N||(e=R(e),s&&i(s)),t(e,r,s)};let r=e=>{if(e.state){if(!e.state.__NA)return void window.location.reload();(0,o.startTransition)(()=>{(0,w.dispatchTraverseAction)(window.location.href,e.state.__PRIVATE_NEXTJS_INTERNALS_TREE)})}};return window.addEventListener("popstate",r),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",r)}},[]);let{cache:M,tree:$,nextUrl:A,focusAndScrollRef:L,previousNextUrl:D}=u,j=(0,o.useMemo)(()=>(0,f.findHeadInCache)(M,$[1]),[M,$]),N=(0,o.useMemo)(()=>(0,y.getSelectedParams)($),[$]),B=(0,o.useMemo)(()=>({parentTree:$,parentCacheNode:M,parentSegmentPath:null,parentParams:{},parentLoadingData:null,debugNameContext:"/",url:d,isActive:!0}),[$,M,d]),q=(0,o.useMemo)(()=>({tree:$,focusAndScrollRef:L,nextUrl:A,previousNextUrl:D}),[$,L,A,D]);if(null!==j){let[e,t,i]=j;s=(0,n.jsx)(C,{headCacheNode:e},"u"<typeof window?i:t)}else s=null;let H=(0,n.jsxs)(v.RedirectBoundary,{children:[s,(0,n.jsx)(O.RootLayoutBoundary,{children:M.rsc}),(0,n.jsx)(p.AppRouterAnnouncer,{tree:$})]});return H=(0,n.jsx)(S.default,{errorComponent:t[0],errorStyles:t[1],children:H}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F,{appRouterState:u}),null,(0,n.jsx)(h.NavigationPromisesContext.Provider,{value:null,children:(0,n.jsx)(h.PathParamsContext.Provider,{value:N,children:(0,n.jsx)(h.PathnameContext.Provider,{value:k,children:(0,n.jsx)(h.SearchParamsContext.Provider,{value:b,children:(0,n.jsx)(a.GlobalLayoutRouterContext.Provider,{value:q,children:(0,n.jsx)(a.AppRouterContext.Provider,{value:w.publicAppRouterInstance,children:(0,n.jsx)(a.LayoutRouterContext.Provider,{value:B,children:H})})})})})})})]})}function M({actionQueue:e,globalErrorState:t,webSocket:i,staticIndicatorState:r}){(0,b.useNavFailureHandler)();let s=(0,n.jsx)(T,{actionQueue:e,globalError:t,webSocket:i,staticIndicatorState:r});return(0,n.jsx)(S.default,{errorComponent:P.default,children:s})}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esMo
1dule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},41624,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={GracefulDegradeBoundary:function(){return a},default:function(){return l}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=e.r(43476),o=e.r(71645);class a extends o.Component{constructor(e){super(e),this.state={hasError:!1},this.rootHtml="",this.htmlAttributes={},this.htmlRef=(0,o.createRef)()}static getDerivedStateFromError(e){return{hasError:!0}}componentDidMount(){let e=this.htmlRef.current;this.state.hasError&&e&&Object.entries(this.htmlAttributes).forEach(([t,i])=>{e.setAttribute(t,i)})}render(){let{hasError:e}=this.state;return("u">typeof window&&!this.rootHtml&&(this.rootHtml=document.documentElement.innerHTML,this.htmlAttributes=function(e){let t={};for(let i=0;i<e.attributes.length;i++){let r=e.attributes[i];t[r.name]=r.value}return t}(document.documentElement)),e)?(0,n.jsx)("html",{ref:this.htmlRef,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:this.rootHtml}}):this.props.children}}let l=a;("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},94109,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return u}});let r=e.r(55682),s=e.r(43476);e.r(71645);let n=r._(e.r(41624)),o=e.r(72383),a=e.r(82604),l="u">typeof window&&(0,a.isBot)(window.navigator.userAgent);function u({children:e,errorComponent:t,errorStyles:i,errorScripts:r}){return l?(0,s.jsx)(n.default,{children:e}):(0,s.jsx)(o.ErrorBoundary,{errorComponent:t,errorStyles:i,errorScripts:r,children:e})}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},65716,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"createInitialRouterState",{enumerable:!0,get:function(){return d}});let r=e.r(51191),s=e.r(34727),n=e.r(50590),o=e.r(95871),a=e.r(20896),l=e.r(9396),u=e.r(79027),h=e.r(87288),c=e.r(96167);function d({navigatedAt:e,initialRSCPayload:t,initialFlightStreamForCache:i,location:p}){let{c:v,f:f,q:g,i:_,S:m,s:y,l:b,h:w,r:x,p:E,d:k}=t,S=v.join("/"),{tree:P,seedData:O,head:I}=(0,n.getFlightDataPartsFromPath)(f[0]),F=p?(0,r.createHrefFromUrl)(p):S,R={metadataVaryPath:null,treeDivergedFromBase:!1},C=(0,a.convertRootFlightRouterStateToRouteTree)(P,g,R),T=R.metadataVaryPath,M=(0,o.createInitialCacheNodeForHydration)(e,C,O,I,(0,u.computeDynamicStaleAt)(e,k??u.UnknownDynamicStaleTime));if(null!==p&&null!==T){if((0,c.discoverKnownRoute)(Date.now(),p.pathname,p.search,null,null,C,T,_,F,m,!1),null!==O&&void 0!==y)if(void 0!==b&&null!=i)Promise.resolve(b).then(async e=>{let t=await (0,h.decodeStageUntilBoundary)(i,e,void 0),r=Date.now(),s=await (0,a.resolveStaleAt)(r,t.s);(0,a.writePrerenderResponseIntoCache)(r,l.FetchStrategy.PPR,t.f,void 0,t.h,t.r??null,s,P,g,!0,a.segmentCacheMap)}).catch(()=>{});else{let e=Date.now();(0,a.resolveStaleAt)(e,y).then(t=>{(0,a.writePrerenderResponseIntoCache)(e,l.FetchStrategy.PPR,f,void 0,w,x??null,t,P,g,!1,a.segmentCacheMap)}).catch(()=>{}),i?.cancel()}else i?.cancel();null!=E&&(0,a.processRuntimePrefetchStream)(Date.now(),E,P,g).then(e=>{null!==e&&(0,a.writeDynamicRenderResponseIntoCache)(Date.now(),l.FetchStrategy.PPRRuntime,e.flightDatas,e.buildId,e.isResponsePartial,e.headVaryParams,e.rootVaryParamsIterable,e.staleAt,e.navigationSeed,null,a.segmentCacheMap)}).catch(()=>{})}return{tree:M.route,cache:M.node,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{scrollRef:null,forceScroll:!1,onlyHashChange:!1,hashFragment:null},canonicalUrl:F,renderedSearch:g,nextUrl:((0,s.extractPathFromFlightRouterState)(P)||p?.pathname)??null,previousNextUrl:null,debugInfo:null}}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esMo
1dule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},25018,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"findHeadInCache",{enumerable:!0,get:function(){return n}});let r=e.r(13258),s=e.r(70725);function n(e,t){return function e(t,i,n,o){if(0===Object.keys(i).length)return[t,n,o];let a=Object.keys(i).filter(e=>"children"!==e);"children"in i&&a.unshift("children");let l=t.slots;if(null!==l)for(let t of a){let[o,a]=i[t];if(o===r.DEFAULT_SEGMENT_KEY)continue;let u=l[t];if(!u)continue;let h=e(u,a,n+"/"+(0,s.createRouterCacheKey)(o),n+"/"+(0,s.createRouterCacheKey)(o,!0));if(h)return h}return null}(e,t,"","")}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},51323,(e,t,i)=>{"use strict";e.i(47167),Object.defineProperty(i,"__esModule",{value:!0});var r={onCaughtError:function(){return d},onUncaughtError:function(){return p}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=e.r(55682),o=e.r(65713),a=e.r(32061),l=e.r(28279),u=e.r(72383),h=n._(e.r(68027)),c={decorateDevError:e=>e,handleClientError:()=>{},originConsoleError:console.error.bind(console)};function d(e,t){let i,r=t.errorBoundary?.constructor;if(i=i||r===u.ErrorBoundaryHandler&&t.errorBoundary.props.errorComponent===h.default)return p(e);(0,a.isBailoutToCSRError)(e)||(0,o.isNextRouterError)(e)||c.originConsoleError(e)}function p(e){(0,a.isBailoutToCSRError)(e)||(0,o.isNextRouterError)(e)||(0,l.reportGlobalError)(e)}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},28279,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"reportGlobalError",{enumerable:!0,get:function(){return r}});let r="function"==typeof reportError?reportError:e=>{globalThis.console.error(e)};("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},97238,(e,t,i)=>{"use strict";e.i(47167),Object.defineProperty(i,"__esModule",{value:!0});var r={isRecoverableError:function(){return h},onRecoverableError:function(){return c}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=e.r(55682),o=e.r(32061),a=n._(e.r(2023)),l=e.r(28279),u=new WeakSet;function h(e){return u.has(e)}let c=e=>{let t=(0,a.default)(e)&&"cause"in e?e.cause:e;(0,o.isBailoutToCSRError)(t)||(0,l.reportGlobalError)(t)};("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},62826,(e,t,i)=>{if(e.i(47167),/(?:^|;\s)__vercel_toolbar=1(?:;|$)/.test(document.cookie)){var r=document.createElement("script");r.src="https://vercel.live/_next-live/feedback/feedback.js",r.setAttribute("data-explicit-opt-in","true"),r.setAttribute("data-cookie-opt-in","true"),r.setAttribute("data-deployment-id","dpl_4ZtkdAV5ZnPYUV3jf6LckTNrpaEL"),(document.head||document.documentElement).appendChild(r)}},71217,e=>{"use strict";var t,i,r,s="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:s,o=null==n?void 0:n.navigator,a=null==n?void 0:n.document,l=null==n?void 0:n.location,u=null==n?void 0:n.fetch,h=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,c=null==n?void 0:n.AbortController,d=null==n?void 0:n.CompressionStream,p=null==o?void 0:o.userAgent;function v(){return!(!s||!1===s.navigator.onLine)}var f="u">typeof globalThis?globalThis:s;f&&"u"<typeof self&&(f.self=f),f&&"u"<typeof File&&(f.File=function(){});var g=null!=s?s:{},_={DEBUG:!1,LIB_VERSION:"0.5.0",LIB_NAME:"browser-common"};function m(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,s)}function y(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){m(n,r,s,o,a,"next",e)}function a(e){m(n,r,s,o,a,"throw",e)}o(void 0)})}}function b(){return(b=Object.assign.bind()).apply(null,arguments)}function w(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var x=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function E(e){return"string"==typeof e||e}function k(e){return"string"==typeof e?e:void 0}var S,P,O,I,F=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],R=((S={}).AnonymousId="anonymous_id",S.DistinctId="distinct_id",S.Props="props",S.EnablePersonProcessing="enable_person_processing",S.PersonMode="person_mode",S.FeatureFlagDetails="feature_flag_details",S.FeatureFlags="feature_flags",S.FeatureFlagPayloads="feature_flag_payloads",S.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",S.BootstrapFeatureFlags="bootstrap_feature_flags",S.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",S.OverrideFeatureFlags="override_feature_flags",S.Queue="queue",S.AiQueue="ai_queue",S.AiCaptureQueue="ai_capture_queue",S.LogsQueue="logs_queue",S.OptedOut="opted_out",S.SessionId="session_id",S.SessionStartTimestamp="session_start_timestamp",S.SessionLastTimestamp="session_timestamp",S.PersonProperties="person_properties",S.GroupProperties="group_properties",S.InstalledAppBuild="installed_app_build",S.InstalledAppVersion="installed_app_version",S.SessionReplay="session_replay",S.PushRegistered="push_registered",S.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",S.SurveyLastSeenDate="survey_last_seen_date",S.SurveysSeen="surveys_seen",S.Surveys="surveys",S.RemoteConfig="remote_config",S.FlagsEndpointWasHit="flags_endpoint_was_hit",S.DeviceId="device_id",S),C=((P={}).GZipJS="gzip-js",P.Base64="base64",P),T=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],M=["token"],$="NativeGzipValidationError",A=e=>e.length>=2&&31===e[0]&&139===e[1],L=(e,t)=>e===C.GZipJS||t===C.GZipJS||"gzip"===t,D=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),j=e=>
1{var t=Error("Native gzip produced invalid output: "+e);throw t.name=$,t},N=(O=y(function*(e,t){18>e.size&&j("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));A(i)&&8===i[2]||j("invalid-header");var r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(I)return I;I=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;I[e]=t>>>0}return I})(),i=0xffffffff,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&j("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&j("invalid-size")}),function(e,t){return O.apply(this,arguments)});function B(){return(B=y(function*(e,t,i){void 0===t&&(t=!0);try{var r,s=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(s).then(()=>o.close()).catch((r=y(function*(e){try{yield o.abort(e)}catch(e){}throw e}),function(e){return r.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield N(u,s),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var q=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],H=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return q.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function U(e,t){return -1!==e.indexOf(t)}var z=function(e){return e.trim()},V=function(e){return e.replace(/^\$/,"")};function G(e){var t,i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}var W=Object.prototype,J=W.hasOwnProperty,K=W.toString,Z=Array.isArray||function(e){return"[object Array]"===K.call(e)},Y=e=>"function"==typeof e,Q=e=>e===Object(e)&&!Z(e),X=e=>{if(Q(e)){for(var t in e)if(J.call(e,t))return!1;return!0}return!1},ee=e=>void 0===e,et=e=>"[object String]"==K.call(e),ei=e=>et(e)&&0===e.trim().length,er=e=>null===e,es=e=>ee(e)||er(e),en=e=>"[object Number]"==K.call(e)&&e==e,eo=e=>en(e)&&e>0,ea=e=>"[object Boolean]"===K.call(e),el=e=>U(T,e),eu=e=>U(M,e);function eh(e){return null===e||"object"!=typeof e}function ec(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ed(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ev(e,Error)}}function ep(e){return"u">typeof Event&&ev(e,Event)}function ev(e,t){try{return e instanceof t}catch(e){return!1}}var ef=[!0,"true",1,"1","yes"],eg=[!1,"false",0,"0","no"];function e_(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),en(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),e_(s||i,t,i,r))}class em{constructor(e){this.k={},this.S=e.S,this.C=e_(e.bucketSize,0,100,e.I),this.R=e_(e.refillRate,0,this.C,e.I),this.A=e_(e.refillInterval,0,864e5,e.I)}O(e,t){var i=Math.floor((t-e.lastAccess)/this.A);i>0&&(e.tokens=Math.min(e.tokens+i*this.R,this.C),e.lastAccess=e.lastAccess+i*this.A)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.k[r];return s?this.O(s,i):this.k[r]=s={tokens:this.C,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.S)||t.call(this,e)),0===s.tokens)}stop(){this.k={}}}var ey="Mobile",eb="Android",ew="Tablet",ex=eb+" "+ew,eE="iPad",ek="Apple",eS=ek+" Watch",eP="Safari",eO="BlackBerry",eI="Samsung",eF=eI+"Browser",eR=eI+" Internet",eC="Chrome",eT=eC+" OS",eM=eC+" iOS",e$="Internet Explorer",eA=e$+" "+ey,eL="Opera",eD=eL+" Mini",ej="Edge",eN="Microsoft "+ej,eB="Firefox",eq=eB+" iOS",eH="Nintendo",eU="PlayStation",ez="Xbox",eV=eb+" "+ey,eG=ey+" "+eP,eW="Windows",eJ=eW+" Phone",eK="Nokia",eZ="Ouya",eY="Generic",eQ=eY+" "+ey.toLowerCase(),eX=eY+" "+ew.toLowerCase(),e0="Konqueror",e1="Oculus Browser",e2="Vivaldi",e3="Yandex",e5="Whale",e6="DuckDuckGo",e8="Pale Moon",e4="Waterfox",e7="Brave",e9="Google Search App",te="(\\d+(\\.\\d+)?)",tt=RegExp("Version/"+te),ti=RegExp(ez,"i"),tr=RegExp(eU+" \\w+","i"),ts=RegExp(eH+" \\w+","i"),tn=RegExp(eO+"|PlayBook|BB10","i"),to={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ta=function(e,t,i,r){var s;return t=t||"",(null!=i&&i.brave?e7:null)||(null!=r&&r.detectGoogleSearchApp&&U(e,"GSA/")?e9:U(e," OPR/")&&U(e,"Mini")?eD:U(e," OPR/")?eL:tn.test(e)?eO:U(e,"IE"+ey)||U(e,"WPDesktop")?eA:U(e,"OculusBrowser")?e1:U(e,eF)?eR:U(e,ej)||U(e,"Edg/")?eN:U(e,e2+"/")?e2:U(e,"YaBrowser/")?e3:U(e,e5+"/")?e5:U(e,e6+"/")||U(e,"Ddg/")?e6:U(e,"FBIOS")?"Facebook "+ey:U(e,"UCWEB")||U(e,"UCBrowser")?"UC Browser":U(e,"CriOS")?eM:U(e,"CrMo")||U(e,eC)?eC:U(e,eb)&&U(e,eP)?e
1V:U(e,"FxiOS")?eq:U(e.toLowerCase(),e0.toLowerCase())?e0:U(e,e7+"/")?e7:(s=t)&&U(s,ek)||U(e,eP)&&!U(e,eC)&&!U(e,eb)?U(e,ey)?eG:eP:U(e,"PaleMoon/")?e8:U(e,e4+"/")?e4:U(e,eB)?eB:U(e,"MSIE")||U(e,"Trident/")?e$:U(e,"Gecko")?eB:"")},tl={[eA]:[RegExp("rv:"+te)],[eN]:[RegExp(ej+"?\\/"+te)],[eC]:[RegExp("("+eC+"|CrMo)\\/"+te)],[eM]:[RegExp("CriOS\\/"+te)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+te)],[eP]:[tt],[eG]:[tt],[eL]:[RegExp("(Opera|OPR)\\/"+te)],[eB]:[RegExp(eB+"\\/"+te)],[eq]:[RegExp("FxiOS\\/"+te)],[e0]:[RegExp("Konqueror[:/]?"+te,"i")],[eO]:[RegExp(eO+" "+te),tt],[eV]:[RegExp("android\\s"+te,"i")],[eR]:[RegExp(eF+"\\/"+te)],[e1]:[RegExp("OculusBrowser\\/"+te)],[e2]:[RegExp(e2+"\\/"+te)],[e3]:[RegExp("YaBrowser\\/"+te)],[e5]:[RegExp(e5+"\\/"+te)],[e7]:[RegExp(e7+"\\/"+te)],[e6]:[RegExp("(DuckDuckGo|Ddg)\\/"+te)],[e8]:[RegExp("PaleMoon\\/"+te)],[e4]:[RegExp(e4+"\\/"+te)],[e9]:[RegExp("GSA\\/"+te)],[e$]:[RegExp("(rv:|MSIE )"+te)],Mozilla:[RegExp("rv:"+te)]},tu=function(e,t,i,r){var s=tl[ta(e,t,i,r)];if(ee(s))return null;for(var n=0;s.length>n;n++){var o=e.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},th=[[RegExp(ez+"; "+ez+" (.*?)[);]","i"),e=>[ez,e&&e[1]||""]],[RegExp(eH,"i"),[eH,""]],[RegExp(eU,"i"),[eU,""]],[tn,[eO,""]],[RegExp(eW,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eJ,""];if(new RegExp(ey).test(t)&&!/IEMobile\b/.test(t))return[eW+" "+e
1y,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=to[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[eW,r]}return[eW,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ee(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+eb+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+eb+")","i"),e=>e&&e[2]?[eb,[e[2],e[3],e[4]||"0"].join(".")]:[eb,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eT,""]],[/Linux|debian/i,["Linux",""]]],tc=function(e){return ts.test(e)?eH:tr.test(e)?eU:ti.test(e)?ez:RegExp(eZ,"i").test(e)?eZ:RegExp("("+eJ+"|WPDesktop)","i").test(e)?eJ:/iPad/.test(e)?eE:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eS:tn.test(e)?eO:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eK,"i").test(e)?eK:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ey).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?eb:ex:RegExp("(pda|"+ey+")","i").test(e)?eQ:RegExp(ew,"i").test(e)&&!RegExp(ew+" pc","i").test(e)?eX:""},td=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tp(e,t){return"string"==typeof e&&td.test(e)?e:t()}function tv(e){return e?e.split("#")[0]:e}function tf(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function tg(e,t,i){return t_.apply(this,arguments)}function t_(){return(t_=y(function*(e,t,i){var r;try{return yield Promise.race([e,new Promise((e,s)=>{r=tf(()=>{try{null==i||i(),e()}catch(e){s(e)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}var tm={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},ty=tm.info;function tb(e){var t=[];for(var i in e){var r=e[i];er(r)||ee(r)||t.push({key:i,value:function e(t){if(ea(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Z(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}function tw(e,t,i){return b({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function tx(e,t,i,r){return{resourceLogs:[{resource:{attributes:tb(t)},scopeLogs:[{scope:{name:i,version:r},logRecords:e}]}]}}let tE=class{constructor(e,t,i,r,s,n,o){var a;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Oi=t,this.I=i,this.Ji=r,this.Ki=s,this.Xi=n,this.tn=o,this.en=null,this.rn=0,this.nn=0,this.sn=0,this.an=0,this.ln=!1,this.un=t.maxBufferSize,this.hn=Math.max(null!=(a=t.maxQueueSize)?a:t.maxBufferSize,t.maxBufferSize),this.dn=t.flushIntervalMs,this.vn=t.maxBatchRecordsPerPost,this.cn=t.rateCapWindowMs,this.fn=t.maxLogsPerInterval}reset(){this.pn(),this.en=null,this.sn=0,this.an=0,this.ln=!1,this.rn=0,this.nn=0,this.vn=this.Oi.maxBatchRecordsPerPost}onReconnect(){this.nn=0,this.gn()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.mn(e);if(null!==t)if(t.body){if(this.yn()){var i,r,s,n,o,a,l,u,h={record:(i=this.Ji(),s=(r=tm[t.level||"info"]||ty).text,n=r.number,o=String(Date.now())+"000000",a={},i.distinctId&&(a.posthogDistinctId=i.distinctId),i.sessionId&&(a.sessionId=i.sessionId),i.windowId&&(a["window.id"]=i.windowId),es(i.sessionStartTimestamp)||(a.sessionStartTimestamp=String(i.sessionStartTimestamp)),es(i.lastActivityTimestamp)||(a.lastActivityTimestamp=String(i.lastActivityTimestamp)),i.currentUrl&&(a["url.full"]=i.currentUrl),i.screenName&&(a["screen.name"]=i.screenName),i.appState&&(a["app.state"]=i.appState),i.activeFeatureFlags&&i.activeFeatureFlags.length>0&&(a.feature_flags=i.activeFeatureFlags),l=b({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:n,severityText:s,body:{stringValue:t.body},attributes:tb(l)},t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),ee(t.trace_flags)||(u.flags=t.trace_flags),u)};this.Ki(()=>this.bn(h))}}else this.I.info("Log was rejected in beforeSend function")}}mn(e){var t=this.Oi.beforeSend;if(!t)return e;var i=Z(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.I.info("Log was rejected in beforeSend function"),null;r=n}catch(e){return this.I.error("Error in beforeSend function for log:",e),null}return r}yn(){if(void 0===this.fn)return!0;var e=Date.now(),t=e-this.sn;return this.cn>t&&t>=0||(this.sn=e,this.an=0,this.ln=!1),this.fn>this.an?(this.an++,!0):(this.ln||(this.I.warn("captureLog dropping logs: exceeded "+this.fn+" logs per "+this.cn+"ms"),this.ln=!0),!1)}flush(){var e=this;return y(function*(){if(!e._instance.isDisabled)return e.en||(e.en=e._n().finally(()=>{e.en=null})),e.en})()}_n(){var e=this;return y(function*(){e.pn();var t=null!=(s=e._instance.getPersistedProperty(R.LogsQueue))?s:[];if(0!==t.length)for(var i=t.length,r=0;t.length>0&&i>r;){e.rn=0;var s,n,o,a=Math.min(t.length,e.vn),l=t.slice(0,a),u=tx(l.map(e=>e.record),e.wn(),null!=(n=e.tn)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.kn(u);if("too-large"===h.kind&&l.length>1)e.vn=Math.max(1,Math.floor(l.length/2)),e.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.vn);else if("retry-later"===h.kind||("too-large"===h.kind?e.I.warn("Dropping a single log record after 413 with batch size 1 â the record
1is larger than the server cap and cannot be split further."):"ok"===h.kind&&e.Oi.maxBatchRecordsPerPost>e.vn&&(e.vn=Math.min(e.Oi.maxBatchRecordsPerPost,e.vn+1)),yield e.xn(l.length),t=null!=(o=e._instance.getPersistedProperty(R.LogsQueue))?o:[],r+=l.length,"fatal"===h.kind))throw h.error}})()}xn(e){var t=this;return y(function*(){var i,r=Math.max(0,e-t.rn),s=null!=(i=t._instance.getPersistedProperty(R.LogsQueue))?i:[];t._instance.setPersistedProperty(R.LogsQueue,s.slice(r)),yield t.Xi()})()}wn(){return tw(this.Oi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}bn(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(R.LogsQueue))?t:[];this.hn>i.length||(i.shift(),this.rn++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(R.LogsQueue,i),this.un>i.length?this.Sn():this.gn()}}Sn(e){void 0===e&&(e=this.dn),this.Cn||(this.Cn=tf(()=>{this.Cn=void 0,this.gn()},e))}Tn(){var e=Math.min(Math.max(0,this.nn-1),6);return this.dn*Math.pow(2,e)}Mn(){var e=this._instance.getPersistedProperty(R.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return y(function*(){t.pn();var i=t.flush().catch(()=>{});void 0!==e?yield tg(i,e):yield i})()}flushWithTimeout(e){var t=this;return y(function*(){var i=t.flush();yield tg(i,e,()=>{i.catch(()=>{})})})()}gn(){this.flush().then(()=>{this.nn=0},e=>{this.nn++,this.I.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Mn()&&this.Sn(this.Tn())})}pn(){this.Cn&&(clearTimeout(this.Cn),this.Cn=void 0)}};var tk=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tS(e){return String(e)+"000000"}function tP(e,t,i,r){var s="";return r&&(s=Object.keys(r).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(r[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+s}let tO=class{constructor(e,t,i){this._instance=e,this.Oi=t,this.I=i,this.En=new Map,this.en=null,this.In=!1,this.Rn=new Map,this.Pn=new Set,this.An=0}count(e,t,i){void 0===t&&(t=1),this.Fn({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Fn({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Fn({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.en,r=(e=y(function*(){i&&(yield i.catch(()=>{})),yield t.On()}),function(){return e.apply(this,arguments)})().finally(()=>{this.en===r&&(this.en=null)});return this.en=r,r}drainWindow(){if(0===this.En.size)return null;var e=this.En;return this.En=new Map,this.In=!1,this.Rn=new Map,this.Pn=new Set,this.Ln(e)}reset(){this.An++,this.pn(),this.En=new Map,this.en=null,this.In=!1,this.Rn=new Map,this.Pn=new Set}Fn(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.mn(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.I.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?b({},t.attributes):void 0,r=tP(t.type,t.name,t.unit,i)}catch(e){return void this.I.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,r,s=this.En.get(r);if(!s){if(!this.$n())return;s={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.En.set(r,s)}var n=this.Rn.get(t.name);void 0===n?this.Rn.set(t.name,t.type):n===t.type||this.Pn.has(t.name)||(this.Pn.add(t.name),this.I.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Dn(s,t.value),this.Sn()}else this.I.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}$n(){return this.Oi.maxSeriesPerFlush>this.En.size||(this.In||(this.In=!0,this.I.warn("Metric series cap reached ("+this.Oi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Dn(e,t){var i;switch(e.type){case"count":e.total=(null!=(i=e.total)?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(tk.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,tk)]+=1}}mn(e){var t=this.Oi.beforeSend;if(!t)return e;var i=Z(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.I.info("Metric was rejected in beforeSend function"),null;r=n}catch(e){return this.I.error("Error in beforeSend function for metric:",e),null}return r}Sn(){this.Cn||(this.Cn=tf(()=>{this.Cn=void 0,this.flush().catch(e=>{this.I.error("Metrics flush failed:",e)})},this.Oi.flushIntervalMs))}pn(){this.Cn&&(clearTimeout(this.Cn),this.Cn=void 0)}On(){var e=this;return y(function*(){if(0!==e.En.size){var t=e.En;e.En=new Map,e.In=!1,e.Rn=new Map,e.Pn=new Set;var i=e.An,r=yield e._instance.Nn(e.Ln(t));if(i===e.An)switch(r.kind){case"ok":return;case"retry-later":return e.qn(t),void e.Sn();case"too-large":return void e.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.I.error("Failed to send metrics batch:",r.error)}}})()}Ln(e){var t,i,r,s,n,o,a;return t=this.jn(e),n=this.Oi,o=this._instance.getLibraryId(),a=this._instance.getLibraryVersion(),i=b({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":o,"telemetry.sdk.version":a}),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tb(i)},scopeMetrics:[{scope:{name:r,version:s},metrics:t}]}]}}jn(e){var t=tS(Date.now()),i=new Map;for(var r of e.values()){var s,n=tP(r.type,r.name,r.unit,void 0),o=i.get(n);o||(o=b({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,o));var a=tb(null!=(s=r.attributes)?s:{}),l=tS(r.windowStartMs);if("count"===r.type){var u,h={attributes:a,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=r.total)?u:0};o.sum.dataPoints.push(h)}else if("gauge"===r.type){var c,d={attributes:a,timeUnixNano:t,asDouble:null!=(c=r.last)?c:0};o.gauge.dataPoints.push(d)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:tk})}return Array.from(i.values())}qn(e){var t,i;for(var r of e){var s=r[0],n=r[1],o=this.En.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,n.windowStartMs),o.type){case"count":o.total=(null!=(t=o.total)?t:0)+(null!=(i=n.total)?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(o.hist){o.hist.count+=n.hist.count,o.hist.sum+=n.hist.sum,o.hist.min=Math.min(o.hist.min,n.hist.min),o.hist.max=Math.max(o.hist.max,n.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=n.hist.bucketCounts[a]}else o.hist=n.hist}else this.$n()&&this.En.set(s,n)}}};class tI{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return y(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Z(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),b({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return y(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,b({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return rx&&i.length===rw||(rw=i.length,rx=i.reduce((i,r)=>{rb||(rb={});var s=rb[r];if(s)i[s[0]]=s[1];else for(var n=e(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=t[r];if(l&&u){i[l]=u,rb[r]=[l,u];break}}return i},{})),rx}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return b({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function tF(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return ee(r)||(n.lineno=r),ee(s)||(n.colno=s),n}var tR=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},tC=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tM=/\((\S*)(?::(\d+))(?::(\d+))\)/,t$=(e,t)=>{var i=tC.exec(e);if(i)return tF(t,i[1],"?",+i[2],+i[3]);var r=tT.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var s=tM.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var n=tR(r[1]||"?",r[2]);return tF(t,n[1],n[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},tA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tD=(e,t)=>{var i=tA.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=tL.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var s=i[3],n=i[1]||"?",o=tR(n,s);return tF(t,s=o[1],n=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tj=/\(error: (.*)\)/;class tN{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=et(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return ec(e,"DOMException")}isDOMError(e){return ec(e,"DOMError")}}class tB{match(e){return ed(e)}coerce(e,t){var i,r=this.getStack(e);return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:null==(i=t.syntheticException)?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:void 0===r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class tq{match(e){return!!ec(e,"ErrorEvent")&&(null!=e.error||this.li(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,r=t.apply(e.message);return b({},r,{stack:null!=(i=this.hi(e))?i:r.stack,synthetic:!0})}li(e){return et(e.message)&&e.message.length>0}hi(e){if(et(e.filename)&&e.filename.length>0){var t,i,r=null!=(t=e.lineno)?t:0,s=null!=(i=e.colno)?i:0;return"Error\n at "+e.filename+":"+r+":"+s}}}var tH=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tU{match(e){return"string"==typeof e}coerce(e,t){var i,r=this.getInfos(e),s=r[0],n=r[1];return{type:null!=s?s:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(tH);return r&&(t=r[1],i=r[2]),[t,i]}}var tz=["fatal","error","warning","log","info","debug"];function tV(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");
1if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class tG{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(ep(e))return e.constructor.name;var t="name"in e?e.name:void 0;return et(t)&&!ei(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tV(e)}isSeverityLevel(e){return et(e)&&!ei(e)&&tz.indexOf(e)>=0}getStack(e){try{return et(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:et(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(ed(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tW{match(e){return ep(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tV(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tJ{match(e){return eh(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tK{match(e){return ec(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ep(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return eh(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var tZ="$message",tY="$timestamp",tQ=new Set([tZ,tY]),tX={enabled:!0,max_bytes:32768};function t0(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tX.enabled,max_bytes:function(e,t){if(!en(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tX.max_bytes)}:b({},tX)}class t1{constructor(e){this.Bn=[],this.Hn=0,this.Oi=t0(e)}setConfig(e){this.Oi=t0(e),this.zn()}add(e){var t=function(e){var t;try{t=G(e)}catch(e){return}try{var i=JSON.parse(t);if(!Q(i))return;var r=i[tZ],s=i[tY];if(!et(r)||0===r.trim().length||!et(s)&&!en(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,r=0;t.length>r;r++)"%"===t[r]?(i+=1,r+=2):i+=1;return i}(t.json);i>this.Oi.max_bytes||(this.Bn.push({step:t.step,bytes:i}),this.Hn+=i,this.zn())}}getAttachable(){return this.Bn.map(e=>e.step)}clear(){this.Bn=[],this.Hn=0}size(){return this.Bn.length}zn(){for(;this.Hn>this.Oi.max_bytes&&this.Bn.length>0;){var e=this.Bn.shift();e&&(this.Hn-=e.bytes)}}}var t2=function(e,t){var i=(void 0===t?{}:t).debugEnabled,r={F(t){if(s&&(_.DEBUG||s.POSTHOG_DEBUG||i)&&!ee(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.F("error",...t)},critical(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>t2(e+" "+t,i)};return r},t3=t2("[PostHog.js]"),t5=t3.createLogger,t6=t5("[ExternalScriptsLoader]"),t8=e=>{var t=null==a?void 0:a.querySelectorAll("script");
1if(t){for(var i=0;t.length>i;i++)if(t[i].src===e)return t[i]}},t4=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t6.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=t8(t);if(r){if(r.__posthog_loading_callback_fired)return i();var s=r.__posthog_loading_error;return s?i(s):(r.addEventListener("load",e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)}),void r.addEventListener("error",e=>{r.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!a)return i("document not found");if(t8(t))return t4(e,t,i);var r=a.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>{r.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)a.head.appendChild(r);else{var s,n=a.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):a.body.appendChild(r)}};null!=a&&a.body?n():null==a||a.addEventListener("DOMContentLoaded",n)},t7={},t9=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var r=e.config.strict_script_versioning;if(r){var s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=t7[s];if("fallback"===r&&n){if(t8(n))return void t4(e,n,i);delete t7[s]}t4(e,s,"fallback"===r?(r,n)=>{if(r)if("string"==typeof r)i(r);else{var o,a=t9(e,t);t7[s]=a;var l=t8(s);null==l||null==(o=l.parentNode)||o.removeChild(l),t4(e,a,i)}else i(void 0,n)}:i)}else t4(e,t9(e,t),i)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t4(e,o,i)}},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);t4(e,r,i)},_.DEBUG=!1,_.LIB_VERSION="1.418.5",_.LIB_NAME="web";var ie="$people_distinct_id",it="distinct_id",ii="$device_id",ir="$device_model",is="__alias",io="__timers",ia="$autocapture_disabled_server_side",il="$heatmaps_enabled_server_side",iu="$exception_capture_enabled_server_side",ih="$error_tracking_suppression_rules",ic="$error_tracking_capture_extension_exceptions",id="$web_vitals_enabled_server_side",ip="$dead_clicks_enabled_server_side",iv="$product_tours_enabled_server_side",ig="$web_vitals_allowed_metrics",i_="$session_recording_remote_config",im="$replay_sample_rate",iy="$replay_override_sampling",ib="$replay_override_linked_flag",iw="$replay_override_url_trigger",ix="$replay_override_event_trigger",iE="$sesid",ik="$session_is_sampled",iS="$enabled_feature_flags",iP="$active_feature_flags",iO="$early_access_features",iI="$feature_flag_details",iF="$feature_flag_payloads",iR="$feature_flag_request_id",iC="$minimal_flag_called_events",iT="$override_feature_flags",iM="$override_feature_flag_payloads",i$="$stored_person_properties",iA="$stored_group_properties",iL="$groups",iD="$surveys",ij="$surveys_loaded_at",iN="$surveys_activated",iB="$surveys_activated_session",iq="$surveys_activated_timestamps",iH="ph_product_tours",iU="$flag_call_reported",iz="$flag_call_reported_session_id",iV="$feature_flag_errors",iG="$feature_flag_evaluated_at",iW="$user_state",iJ="$client_session_props",iK="$capture_rate_limit",iZ="$initial_campaign_params",iY="$initial_referrer_info",iQ="$initial_person_info",iX="$epp",i0="$posthog_cookieless",i1="$cookieless_mode",i2="$sdk_debug_extensions_init_method",i3="$sdk_debug_extensions_init_time_ms",i5="$sdk_debug_recording_script_not_loaded",i6="PostHog loadExternalDependency extension not found.",i8="on_reject",i4="always",i7="anonymous",i9="identified",re="identified_only",rt="visibilitychange",ri="beforeunload",rr="$pageview",rs="$pageleave",rn="$identify",ro="$groupidentify";function ra(e,t){Z(e)&&e.forEach(t)}function rl(e,t){if(!es(e))if(Z(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)J.call(e,i)&&t(e[i],i)}var ru=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(e[n]=s[n]);return e};function rh(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var rc=function(e){try{return e()}catch(e){return}},rd=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){t3.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t3.critical(e)}}},rp=function(e){var t={};return rl(e,function(e,i){(et(e)&&e.length>0||en(e))&&(t[i]=e)}),t},rv=["herokuapp.com","vercel.app","netlify.app"];function rf(e,t,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}function rg(e){return"ph_toolbar_internal"===e.name}var r_=e=>{if(a){try{for(var t=e+"=",i=a.cookie.split(";").filter(e=>e.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return en(e)&&isFinite(e)&&Math.floor(e)===e});class rm{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>t||0>i||0>r||e>0xffffffffffff||t>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new rm(s)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new rm(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class ry{generate(){var e=this.generateOrAbort();if(!ee(e))return e;this.Tr=0;var t=this.generateOrAbort();if(ee(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Tr)this.Tr=e,this.Ir();else{if(this.Tr>=e+1e4)return;this.Er++,this.Er>0x3ffffffffff&&(this.Tr++,this.Ir())}return rm.fromFieldsV7(this.Tr,Math.trunc(this.Er/0x40000000),0x3fffffff&this.Er,this.Rr.nextUint32())}Ir(){this.Er=1024*this.Rr.nextUint32()+(1023&this.Rr.nextUint32())}constructor(){this.Tr=0,this.Er=0,this.Rr=new rS}}var rb,rw,rx,rE,rk=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!ee(s.crypto)&&crypto.getRandomValues&&(rk=e=>crypto.getRandomValues(e));class rS{nextUint32(){return this.ft.length>this.Ar||(rk(this.ft),this.Ar=0),this.ft[this.Ar++]}
1constructor(){this.ft=new Uint32Array(8),this.Ar=1/0}}var rP=()=>rO().toString(),rO=()=>(rE||(rE=new ry)).generate(),rI="",rF=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,rR={Lr:()=>!!a,Nr(e){t3.error("cookieStore error: "+e)},Fr:r_,Pr(e){var t;try{t=JSON.parse(rR.Fr(e))||{}}catch(e){}return t},Or(e,t,i,r,s){if(!a)return!1;try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),rI)return rI;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+rP();!rI&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",rI=n)}return rI}(e);if(!i){var r,s=(r=e.match(rF))?r[0]:"";s!==i&&t3.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(a.location.hostname,r);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}s&&(o="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&t3.warn("cookieStore warning: large cookie, len="+h.length),a.cookie=h,!0}catch(e){return!1}},Dr(e,t){if(null!=a&&a.cookie)try{rR.Or(e,"",-1,t)}catch(e){return}}},rC=null,rT={Lr(){if(!er(rC))return rC;var e=!0;if(ee(s))e=!1;else try{var t="__mplssupport__";rT.Or(t,"xyz"),'"xyz"'!==rT.Fr(t)&&(e=!1),rT.Dr(t)}catch(t){e=!1}return e||t3.error("localStorage unsupported; falling back to cookie store"),rC=e,e},Nr(e){t3.error("localStorage error: "+e)},Fr(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){rT.Nr(e)}return null},Pr(e){try{return JSON.parse(rT.Fr(e))||{}}catch(e){}return null},Or(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rT.Nr(e)}return!1},Dr(e){try{null==s||s.localStorage.removeItem(e)}catch(e){rT.Nr(e)}}},rM=[i$,iP,iS,iI,iF,iR,iG,iV,iU],r$=[ii,it,iE,ik,iX,iQ,iW],rA=["__proto__","constructor","prototype"],rL=e=>{if(!Q(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===rA.indexOf(i)&&(t[i]=e[i])}),t},rD=function(e,t){void 0===t&&(t=[]);var i={};return[...r$,...t].forEach(t=>{var r=e[t];ee(r)||er(r)||""===r||(i[t]=r)}),i},rj=e=>{for(var t=5381,i=0x811c9dc5,r=0;e.length>r;r++){var s=e.charCodeAt(r);t=33*t^s,i=Math.imul(i^s,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},rN=(e,t)=>({p:t,f:rj(JSON.stringify(e))}),rB=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=rR.Pr(e+"_cpm"),r=(null==i?void 0:i.f)===rj(t)&&Z(i.p);return{properties:r?i.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},rq=(e,t)=>t+"|"+(rR.Fr(e+"_cpm")||""),rH={},rU={Lr:()=>!0,Nr(e){t3.error("memoryStorage error: "+e)},Fr:e=>rH[e]||null,Pr:e=>rH[e]||null,Or:(e,t)=>(rH[e]=t,!0),Dr(e){delete rH[e]}},rz=null,rV={Lr(){if(!er(rz))return rz;if(rz=!0,ee(s))rz=!1;else try{var e="__support__";rV.Or(e,"xyz"),'"xyz"'!==rV.Fr(e)&&(rz=!1),rV.Dr(e)}catch(e){rz=!1}return rz},Nr(e){t3.error("sessionStorage error: ",e)},Fr(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){rV.Nr(e)}return null},Pr(e){try{return JSON.parse(rV.Fr(e))||null}catch(e){}return null},Or(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rV.Nr(e)}return!1},Dr(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){rV.Nr(e)}}};class rG{constructor(e){this._instance=e}get Oi(){return this._instance.config}get consent(){return this.Un()?0:this.Wn}isOptedOut(){return this.Oi.cookieless_mode===i4||this.isRejected()||-1===this.consent&&this.Oi.cookieless_mode===i8}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Oi.opt_out_capturing_by_default}optInOut(e){this.Vn.Or(this.Gn,+!!e,this.Oi.cookie_expiration,this.Oi.cross_subdomain_cookie,this.Oi.secure_cookie)}reset(){this.Vn.Dr(this.Gn,this.Oi.cross_subdomain_cookie)}get Gn(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get Wn(){var e=this.Vn.Fr(this.Gn);return U(ef,e)?1:U(eg,e)?0:-1}get Vn(){var e=this.Oi.opt_out_capturing_persistence_type,t="localStorage"===e?rT:rR;if(!this.Zn||this.Zn!==t){this.Zn=t;var i="localStorage"===e?rR:rT;i.Fr(this.Gn)&&(this.Zn.Fr(this.Gn)||this.optInOut(U(ef,i.Fr(this.Gn))),i.Dr(this.Gn,this.Oi.cross_subdomain_cookie))}return this.Zn}Un(){return!!this.Oi.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,g.doNotTrack].some(e=>U(ef,e))}}function rW(e,t){var i,r=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!Y(r))return t;try{var s=r(t);return et(s)&&s?s:t}catch(e){return t3.error("Error in get_current_url, falling back to window.location.href",e),t}}var rJ="__POSTHOG_TOOLBAR__";function rK(e){return e instanceof Element&&(e.id===rJ||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rZ(e){return!!e&&1===e.nodeType}function rY(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
1function rQ(e){return!!e&&3===e.nodeType}function rX(e){return!!e&&11===e.nodeType&&rZ(e.host)}function r0(e){return e?z(e).split(/\s+/):[]}function r1(e,t){var i,r,n=ee(r=null==s||null==(i=s.location)?void 0:i.href)?void 0:rW(t,r);return!!(n&&e&&e.some(e=>n.match(e)))}function r2(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return r0(t)}function r3(e){return es(e)?null:z(e).split(/(\s+)/).filter(e=>sg(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function r5(e){var t="";return sl(e)&&!su(e)&&e.childNodes&&e.childNodes.length&&rl(e.childNodes,function(e){var i;rQ(e)&&e.textContent&&(t+=null!=(i=r3(e.textContent))?i:"")}),z(t)}function r6(e){var t;return ee(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var r8=["a","button","form","input","select","textarea","label"];function r4(e,t){if(ee(t))return!0;var i,r=function(e){if(t.some(t=>(function(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function r7(e){var t=e.parentNode;return!(!t||!rZ(t))&&t}var r9=[".ph-no-autocapture","[data-ph-no-autocapture]"],se=["next","previous","prev",">","<"],st=[...se,"+","-","â","â"],si=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sr=[".ph-no-rageclick",".ph-no-capture"],ss=["","text","search","email","password","url","tel","number"];function sn(e,t){if(!s||so(e)||(ea(t)?(r=!!t&&sr,n=void 0,o=!1):(r=null!=(a=null==t?void 0:t.css_selector_ignorelist)?a:sr,n=null==t?void 0:t.content_ignorelist,o=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===r)||o&&!(!(i=e)||!rZ(i))&&(rY(i,"textarea")||(rY(i,"input")?U(ss,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,r,n,o,a,l,u=sa(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||ee(e))return!1;if(!0===e)i=se;else{if(!Z(e))return!1;if(e.length>10)return t3.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,r=e.ariaLabel;return i.some(e=>si(t,e)||si(r,e))})}(n,u.map(e=>{var t;return{safeText:r5(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!r4(u,r)}var so=e=>!e||rY(e,"html")||!rZ(e),sa=(e,t)=>{if(!s||so(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!rY(n,"body");)if(rX(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=r7(n);if(!o)break;if(t||r8.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function sl(e){for(var t=new Set,i=0,r=e;r.parentNode&&!rY(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);var s=r2(r);if(U(s,"ph-sensitive")||U(s,"ph-no-capture"))return!1}if(U(r2(e),"ph-include"))return!0;var n=e.type||"";if(et(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!et(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 su(e){return!!(rY(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rY(e,"select")||rY(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var sh=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),sc=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,sd=[16,15,14,13],sp=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),sv=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),sf=/[0-9A-Za-z_]/;function sg(e,t){return void 0===t&&(t=!0),!(es(e)||et(e)&&(e=z(e),(t?sh.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(sc.lastIndex=0;t=sc.exec(e);){var i=t[2];if(i)for(var r=i.replace(/[- ]/g,""),s=0;r.length>s;s++)for(var n of sd){var o=s+n;if(r.length>=o){var a=r.slice(s,o);if(sh.test(a)&&function(e){for(var t=0,i=!1,r=e.length-1;r>=0;r--){var s=e.charCodeAt(r)-48;i&&(s*=2)>9&&(s-=9),t+=s,i=!i}return t%10==0}(a))return!0}}}return!1}(e))||(t?sp.test(e):function(e){var t;for(sv.lastIndex=0;t=sv.exec(e);){var i=t[1],r=t[3];if(!(i&&r&&sf.test(i)&&sf.test(r)))return!0}return!1}(e))))&&!0}function s_(e){var t=r5(e);return sg(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&rl(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=r5(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t3.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function sm(e){return e.replace(/"|\\"/g,'\\"')}var sy=t5("[Dead Clicks]"),sb=()=>!0,sw=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(ip)),r=e.instance.config.capture_dead_clicks;return ea(r)?r:!!Q(r)||i};class sx{get lazyLoadedDeadClicksAutocapture(){return this.Qn}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[ip]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Jn(()=>{this.Kn()}):this.stop()}Jn(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?sy.error("failed to load script",t):e()})}Kn(){var e;if(a){if(!this.Qn&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Q(this.instance.config.capture_dead_clicks)?b({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Qn=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Qn.start(a),sy.info("starting...")}}else sy.error("`document` not found. Cannot start.")}stop(){this.Qn&&(this.Qn.stop(),this.Qn=void 0,sy.info("stopping..."))}}var sE=t5("[SegmentIntegration]"),sk="posthog-js";function sS(e,t){var i=void 0===t?{}:t,r=i.organization,s=i.projectId,n=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
1on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var o,l,h,c,d,p,v=(null==(o=t.exception)?void 0:o.values)||[],f=v.map(e=>b({},e,{stacktrace:e.stacktrace?b({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>b({},e,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(l=v[0])?void 0:l.value)||t.message,$exception_type:null==(h=v[0])?void 0:h.type,$exception_level:t.level,$exception_list:f,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=v[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return r&&s&&(g.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(g)),t}}class sP{constructor(e,t,i,r,s,n){this.name=sk,this.setupOnce=function(o){o(sS(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class sO{constructor(e){this.Yn=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t3.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Xn=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ts()}ts(){var e;this.es=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Yn)}destroy(){var e;null==(e=this.es)||e.call(this),this.es=void 0}doPageView(e,t){var i,r=this.rs(e,t);return this.Xn={pathname:null!=(i=null==s?void 0:s.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.rs(e,null==(t=this.Xn)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Xn)?void 0:e.pageViewId}}rs(e,t){var i=this.Xn;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,l=s.maxContentHeight,u=s.lastContentY,h=s.maxContentY;if(!(ee(n)||ee(o)||ee(a)||ee(l)||ee(u)||ee(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?e_(o/n,0,1,t3):1,d=n>1?e_(a/n,0,1,t3):1,p=l>1?e_(u/l,0,1,t3):1,v=l>1?e_(h/l,0,1,t3):1;r=ru(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var sI=["flags","surveys"],sF={[ie]:{exposure:"hidden"},[is]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[io]:{exposure:"hidden"},[ia]:{exposure:"event"},[il]:{exposure:"hidden"},[iu]:{exposure:"event"},[ih]:{exposure:"hidden"},[ic]:{exposure:"event"},[id]:{exposure:"event"},[ip]:{exposure:"event"},[iv]:{exposure:"hidden"},[ig]:{exposure:"event"},[i_]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iE]:{exposure:"hidden"},[ik]:{exposure:"event"},[im]:{exposure:"event",shouldSkipFromEventProperties:e=>er(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[iS]:{exposure:"hidden",storageGroup:"flags"},[iP]:{exposure:"hidden",storageGroup:"flags"},[iO]:{exposure:"hidden"},[iI]:{exposure:"hidden",storageGroup:"flags"}
1,[iF]:{exposure:"hidden",storageGroup:"flags"},[iR]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iC]:{exposure:"hidden",storageGroup:"flags"},[iT]:{exposure:"hidden"},[iM]:{exposure:"hidden"},[i$]:{exposure:"hidden"},[iA]:{exposure:"hidden"},[iD]:{exposure:"hidden",storageGroup:"surveys"},[ij]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iN]:{exposure:"event"},[iB]:{exposure:"hidden"},[iq]:{exposure:"hidden"},[iH]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iU]:{exposure:"hidden"},[iz]:{exposure:"hidden"},[iL]:{exposure:"event"},[iV]:{exposure:"hidden"},[iG]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iW]:{exposure:"hidden"},[iJ]:{exposure:"hidden"},[iK]:{exposure:"hidden"},[iZ]:{exposure:"hidden"},[iY]:{exposure:"hidden"},[iQ]:{exposure:"hidden"},[iX]:{exposure:"hidden"},[iy]:{exposure:"event"},[ib]:{exposure:"event"},[iw]:{exposure:"event"},[ix]:{exposure:"event"},[i2]:{exposure:"event"},[i3]:{exposure:"event"},[i5]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},sR=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],sC=e=>{var t=sF[e];if(t)return t;for(var i of sR){var r=i[1];if(0===e.indexOf(i[0]))return r}},sT=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return G(e)}},sM=e=>{var t=null==a?void 0:a.createElement("a");return ee(t)?null:(t.href=e,t)},s$=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!Z(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){t3.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},sA=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");Z(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=s&&(d+="#"+s),d},sL=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},sD=(e,t)=>e>=t&&v(),sj=(e,t,i,r)=>{if(0===e){if(v()){var s=t+1;return s===i&&r(),s}return t}return 0},sN="https?://(.*)",sB=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sq=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...sB],sH="<masked>",sU=["li_fat_id"];function sz(e,t,i){if(!a)return{};var r,s=t?[...sB,...i||[]]:[],n=sV(sA(a.URL,s,sH),e);return ru((r={},rl(sU,function(e){var t=r_(e);r[e]=t||null}),r),n)}function sV(e,t){var i=sq.concat(t||[]),r={};return rl(i,function(t){var i=s$(e,t);r[t]=i||null}),r}function sG(e){var t=e?0===e.search(sN+"google.([^/?]*)")?"google":0===e.search(sN+"bing.com")?"bing":0===e.search(sN+"yahoo.com")?"yahoo":0===e.search(sN+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!er(t)){i.$search_engine=t;var r=a?s$(a.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function sW(){return navigator.language||navigator.userLanguage}var sJ="$direct";function sK(){return(null==a?void 0:a.referrer)||sJ}function sZ(e,t,i){void 0===i&&(i=!1);var r=e?[...sB,...t||[]]:[],s=i?tv(null==l?void 0:l.href):null==l?void 0:l.href,n=null==s?void 0:s.substring(0,1e3);return{r:sK().substring(0,1e3),u:n?sA(n,r,sH):void 0}}function sY(e,t){void 0===t&&(t=!1);var i,r=e.r,s=e.u,n=t?tv(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==sJ?sJ:null==(i=sM(r))?void 0:i.host};
1if(n){o.$current_url=n;var a=sM(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,ru(o,sV(n))}return r&&ru(o,sG(r)),o}function sQ(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sX={flags:iG,surveys:ij},s0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],s1="main",s2=(e,t)=>{rl(e,(i,r)=>{var s=sC(r);s&&"event"!==s.exposure||({}).hasOwnProperty.call(t,r)||delete e[r]})};class s3{constructor(e,t,i){if(void 0===i&&(i=!0),this.ns={},this.ss=!1,this.os=!1,this.ls=!1,this.us=!1,this.Oi=e,this.hs=i,this.props={},this.ds=void 0,this.vs=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Vn=this.cs(e),this.os=this.fs(e),this.load(),e.debug&&t3.info("Persistence loaded",e.persistence,b({},this.props)),this.update_config(e,e,t),this.save(),s){var r=()=>this.flush();rf(s,"beforeunload",r,{capture:!1}),rf(s,"pagehide",r,{capture:!1})}}ps(){var e,t=null==(e=this.Oi)?void 0:e.persistence_save_debounce_ms;return en(t)&&t>0?t:0}gs(e){if(this.Oi.cookieWinsOnConflict&&"localstorage+cookie"===this.Oi.persistence.toLowerCase())if(e)try{var t=rD(e,this.Oi.cookie_persisted_properties||[]),i=rN(t,this.Oi.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(i),s=rR.Fr(this.vs)||void 0;s&&rq(this.vs,s)===r&&(this.ys=r,this.bs=s)}catch(e){}else try{var n=rR.Fr(this.vs)||void 0;this.ys=n?rq(this.vs,n):void 0,this.bs=n}catch(e){}}syncCookieProperties(){return this._s(this.Oi)}_s(e,t){if(void 0===t&&(t=!1),this.ws&&!t||this.us||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=rR.Fr(this.vs)||void 0}catch(e){}if(!i||i===this.bs)return!1;var i,r,s=rq(this.vs,i);try{r=rL(JSON.parse(i))}catch(e){return!1}if((rR.Fr(this.vs)||void 0)!==i)return!1;this.ys=s,this.bs=i;var n=rB(this.vs,i),o=[...r$,...n.properties],a={};if(Object.keys(r).forEach(e=>{var t=r[e];(ee(t)||er(t)||""===t||e===iW&&t!==i7&&t!==i9)&&(a[e]=!0,delete r[e])}),X(r))return!1;var l=it in r||r[iW]===i7||r[iW]===i9,u=this.props[it],h=this.props[iW],c=ru({},this.props);[...r$,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in r)&&!a[e]&&(l||e!==it&&e!==iW)){var t=c[e];(n.isValid||-1===r$.indexOf(e)||!1!==t&&0!==t)&&delete c[e]}}),this.props=ru(c,r),!l||iW in r||iW in this.props||this.ks(iW,i7);var d=this.props[it],p=this.props[iW];return l&&(d!==u||p!==h)&&(this.ls=!0,rV.Or(this.vs+"_cookie_identity_change_pending",!0),this.xs(i$),this.xs(iP),this.xs(iS),this.xs(iI),this.xs(iF),this.xs(iR),this.xs(iG),this.xs(iV),this.xs(iU),p!==i7||h!==i9&&r[iW]!==i7&&(ee(u)||d===u)||(s2(this.props,r),this.xs(iA)),p===i9?this.props.$user_id=d:delete this.props.$user_id,this.xs(is)),!0}
1consumeCookieIdentityChange(){var e=this.vs+"_cookie_identity_change_pending",t=this.ls||!!rV.Fr(e);return this.ls=!1,t&&rV.Dr(e),t}Ss(e){return void 0===e&&(e=!1),!(this.us||this.ws&&!e||!this.Oi.cookieWinsOnConflict||"localstorage+cookie"!==this.Oi.persistence.toLowerCase()||(this.us=!0,0))}Cs(){this.us&&(ee(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0),delete this.ns[s1],this.Ms(!0))}Es(e){if(void 0===e&&(e=!0),this.us)try{e?this.Cs():ee(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0)}finally{this.us=!1}}isDisabled(){return!!this.ws}cs(e){-1===s0.indexOf(e.persistence.toLowerCase())&&(t3.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,r,n,o=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),r=[...r$,...t],b({},rT,{Pr(e){try{var t,s={};try{s=(t=rR.Fr(e)||void 0)?rL(JSON.parse(t)):{}}catch(e){}var n,o=JSON.parse(rT.Fr(e)||"{}");if(i){var a=rB(e,t),l=[...r$,...a.properties],u={};Object.keys(s).forEach(e=>{var t=s[e];er(t)||""===t||e===iW&&t!==i7&&t!==i9||(u[e]=t)});var h=it in u||u[iW]===i7||u[iW]===i9;if(Object.keys(u).length>0){var c,d=o[it],p=null!=(c=o[iW])?c:i7;r.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in s)&&(h||e!==it&&e!==iW)){var t=o[e];(a.isValid||-1===r$.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!h||iW in s||iW in o||(o[iW]=i7),h&&((it in u?u[it]:o[it])!==d||(iW in u?u[iW]:o[iW])!==p)&&(rM.forEach(e=>delete o[e]),u[iW]===i9&&it in u?o.$user_id=u[it]:delete o.$user_id,u[iW]!==i9&&(delete o[iL],delete o[iA]),delete o.__al
1ias)}n=ru(o,u)}else n=ru(s,o);return rT.Or(e,n),n}catch(e){}return null},Or(e,r,s,n,o,a){var l=rT.Or(e,r,void 0,void 0,a);try{var u=rD(r,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=rN(u,t);if(rR.Or(h,c,s,n,o,a),rR.Fr(h)!==JSON.stringify(c)){rR.Dr(h,n);var d=rD(r);return rR.Or(e,d,s,n,o,a),l}}rR.Or(e,u,s,n,o,a)}}catch(e){rT.Nr(e)}return l},Dr(e,t){try{null==s||s.localStorage.removeItem(e),rR.Dr(e,t),rR.Dr(e+"_cpm",t)}catch(e){rT.Nr(e)}}})),a=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&rT.Lr()?(n=rT,a=!0):"localstorage+cookie"===l&&o.Lr()?(n=o,a=!0):"sessionstorage"===l&&rV.Lr()?n=rV:"memory"===l?n=rU:"cookie"===l?n=rR:o.Lr()?(n=o,a=!0):n=rR,this.ss=a,n}Is(e){return this.vs+"__"+e}fs(e){return this.ss&&!!e.split_storage}properties(){var e={};return rl(this.props,(t,i)=>{var r=sC(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(){if(!this.ws){var e=this.Oi.cookieWinsOnConflict&&"localstorage+cookie"===this.Oi.persistence.toLowerCase(),t=e?rT.Pr(this.vs):null,i={};if(e)try{rl(i=rL(rR.Pr(this.vs)),(e,t)=>{(ee(e)||er(e)||""===e)&&delete i[t]})}catch(e){}var r=this.Vn.Pr(this.vs);if(r&&(this.props=ru({},r)),this.os&&this.Rs(),e&&r){var s,n,o=null==t?void 0:t[it],a=null!=(s=null==t?void 0:t[iW])?s:i7,l=r[it],u=null!=(n=r[iW])?n:i7;if(l!==o||u!==a){this.ls=!0,rV.Or(this.vs+"_cookie_identity_change_pending",!0);var h=ru({},this.props);rM.forEach(e=>delete h[e]),u!==i7||a!==i9&&i[iW]!==i7&&(ee(o)||l===o)||(s2(h,i),delete h[iA]),this.props=h;var c=new Set;rM.forEach(e=>{var t,i=null==(t=sC(e))?void 0:t.storageGroup;i&&c.add(i)}),c.forEach(e=>{var t={};rl(this.props,(i,r)=>{var s;(null==(s=sC(r))?void 0:s.storageGroup)===e&&(t[r]=i)}),X(t)?(rT.Dr(this.Is(e)),this.ns[e]={}):rT.Or(this.Is(e),t)&&(this.ns[e]={persisted:!0,fingerprint:this.Ps(t,e)})})}}rV.Fr(this.vs+"_cookie_identity_change_pending")&&(this.ls=!0)}}Rs(){for(var e of sI){var t=rT.Pr(this.Is(e));if(t&&!X(t)){var i=this.As(e);i.persisted=!0,this.Fs(e)||(i.fingerprint=this.Ps(t,e)),this.Os(e,t)||ru(this.props,t)}}}Fs(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=sC(t))?void 0:i.storageGroup)===e})}Os(e,t){var i=sX[e];if(!i)return!1;var r=t[i],s=this.props[i];return en(r)&&en(s)&&s>r}refreshKey(e){var t;if(!this.ws){var i=this.os?null==(t=sC(e))?void 0:t.storageGroup:void 0,r=i?rT.Pr(this.Is(i)):this.Vn.Pr(this.vs);if(r&&e in r)this.ks(e,r[e]);else{if(i){var s=this.Vn.Pr(this.vs);if(s&&e in s)return void this.ks(e,s[e])}this.xs(e)}}}save(){if(!this.ws){var e=this.ps();e>0?ee(this.Ts)&&(this.Ts=setTimeout(()=>{this.Ts=void 0,this.Ms()},e)):this.Ms()}}flush(){ee(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0,this.Ms())}Ms(e){void 0===e&&(e=!1),this.ws||this.us&&!e||(e||this.syncCookieProperties(),this.os?this.Ls():this.$s(this.Vn,this.vs,this.props,s1)&&this.gs(this.props))}Ls(){var e=this.Ds(),t=e.main,i=e.groups;for(var r of(this.$s(this.Vn,this.vs,t,s1)&&this.gs(t),sI)){var s,n=i[r];(!X(n)||null!=(s=this.ns[r])&&s.persisted)&&this.$s(rT,this.Is(r),n,r)}}Ds(){var e={},t={flags:{},surveys:{}};return rl(this.props,(i,r)=>{var s,n=null==(s=sC(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}Ps(e,t){if(t===s1)return JSON.stringify(e)+"|"+this.Ns+"|"+this.qs+"|"+this.js;var i={};return rl(e,(e,t)=>{var r;i[t]=null!=(r=sC(t))&&r.volatile?"__volatile__":e}),JSON.stringify(i)}$s(e,t,i,r){var s,n=this.As(r);if(r!==s1&&!n.dirty&&!ee(n.fingerprint))return!1;try{if((s=this.Ps(i,r))===n.fingerprint)return n.dirty=!1,!1}catch(e){s=void 0}return e.Or(t,i,this.Ns,this.qs,this.js,this.Oi.debug)?(n.dirty=!1,r!==s1&&(n.persisted=!0),ee(s)||(n.fingerprint=s),!0):(this.Oi.debug&&t3.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(ee(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0),this.Vn.Dr(this.vs,!1),this.Vn.Dr(this.vs,!0),!i&&this.hs)for(var r of sI)rT.Dr(this.Is(r));i?delete this.ns[s1]:this.ns={},this.ys=void 0,this.bs=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(Q(e)){this.syncCookieProperties(),ee(t)&&(t="None"),this.Ns=ee(i)?this.Bs:i;var r=!1;if(rl(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.ks(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(Q(e)){this.syncCookieProperties(),this.Ns=ee(t)?this.Bs:t;var i=!1;if(rl(e,(t,r)=>{e.hasOwnProperty(r)&&(this.props[r]!==t||Q(t)||Z(t))&&(this.ks(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.xs(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==a?void 0:a.URL;if(e!==this.ds){var t=sz(this.Oi.custom_campaign_params,this.Oi.mask_personal_data_properties,this.Oi.custom_personal_data_properties);X(rp(t))||this.register(t),this.ds=e}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?sG(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sK(),$referring_domain:null!=a&&a.referrer&&(null==(e=sM(a.referrer))?void 0:e.host)||sJ},void 0)}set_initial_person_info(){this.props[iZ]||this.props[iY]||this.register_once({[iQ]:sZ(this.Oi.mask_personal_data_properties,this.Oi.custom_personal_data_properties,this.Oi.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,r={};rl([iY,iZ],e=>{var t=this.props[e];t&&rl(t,function(e,t){r["$initial_"+V(t)]=e})});var s=this.props[iQ];return s&&ru(r,(void 0===(e=this.Oi.disable_capture_url_hashes)&&(e=!1),t=sY(s,e),i={},rl(t,function(e,t){i["$initial_"+V(t)]=e}),i)),r}safe_merge(e){return rl(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var r=e.persistence!==t.persistence,s=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=r||s,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.ws&&!a;a||this._s(t,l),this.Oi=e,!a&&(r||s||o)&&(this.ys=void 0,this.bs=void 0,this._s(b({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||o?this.cs(e):this.Vn,h=this.fs(e),c=n||h!==this.os,d=!a&&(c||e.cross_subdomain_cookie!==this.qs||e.secure_cookie!==this.js)&&this.Ss(l);try{if(this.Bs=this.Ns=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this.Vn=u,this.os=h,this.props=p,this.save()}else o&&(this.Vn=u,a||(delete this.ns[s1],this.Ms()))}finally{d&&this.Es()}}set_disabled(e){this.ws=e,this.ws?this.remove():this.save()}set_cross_subdomain(e){e!==this.qs&&(this.qs=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.js&&(this.js=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[io]||{};i[e]=t,this.ks(io,i),this.save()}remove_event_timer(e){var t=this.props[io]||{},i=t[e];return ee(i)||(delete t[e],this.ks(io,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.ks(e,t),this.save()}ks(e,t){var i;this.props[e]=t,null!=(i=sC(e))&&i.volatile||this.Hs(e)}xs(e){delete this.props[e],this.Hs(e)}Hs(e){var t,i=null==(t=sC(e))?void 0:t.storageGroup;i&&(this.As(i).dirty=!0)}As(e){return this.ns[e]||(this.ns[e]={})}}function s5(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&Y(i.then)&&i.then(void 0,()=>{})}}}}var s6="gzip-js",s8="base64",s4="events",s7="cancelEvents",s9="survey shown",ne="survey dismissed",nt="survey sent",ni="popover",nr=t5("[RateLimiter]");class ns{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{nr.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nr.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,s=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(iK))?t:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var u=(en(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.zs(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(iK,a),{isRateLimited:l,remainingTokens:a.tokens}}Us(e){var t=this.instance.config.property_denylist;return!Z(t)||!t.includes(e)}Ws(){var e;if(this.Us("$current_url")&&this.Us("$pathname")&&null!=l&&l.pathname)return""+(null!=(e=l.origin)?e:"")+l.pathname}zs(e){var t,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,n=this.Ws(),o=this.Us("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(
vendor: 4,549 bytes, line 1
1Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var nn=t5("[RemoteConfig]");class no{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Vs(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Gs(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return nn.info("Using preloaded remote config",this.remoteConfig),this.Zs(this.remoteConfig),void this.Qs();if(this._instance.Js())return void nn.warn("Remote config is disabled. Falling back to local config.");this.Vs(e=>{e?(this.Zs(e),this.Qs()):(nn.info("No config found after loading remote JS config. Falling back to JSON."),this.Gs(e=>{this.Zs(e.json,e),this.Qs()}))})}catch(e){nn.error("Error loading remote config",e),this.Zs()}}stop(){this.Ks&&(clearInterval(this.Ks),this.Ks=void 0)}refresh(){!this._instance.Js()&&a&&"hidden"!==a.visibilityState&&this._instance.reloadFeatureFlags()}Qs(){var e;if(!this.Ks){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Ks=setInterval(()=>{this.refresh()},t))}}Zs(e,t){!e&&t&&(0===t.statusCode?t.error||nn.warn("Failed to fetch remote config from PostHog."):nn.error("Failed to fetch remote config from PostHog."));try{this._instance.Zs(e?{ok:!0,config:e}:{ok:!1})}catch(e){nn.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){nn.error("Error loading feature flags",e)}}}var na=Uint8Array,nl=Uint16Array,nu=Uint32Array,nh=new na([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]),nc=new na([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]),nd=new na([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),np=function(e,t){for(var i=new nl(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new nu(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},nv=np(nh,2),nf=nv[1];nv[0][28]=258,nf[258]=28;for(var ng=np(nc,0)[1],n_=new nl(32768),nm=0;32768>nm;++nm){var ny=(43690&nm)>>>1|(21845&nm)<<1;n_[nm]=((65280&(ny=(61680&(ny=(52428&ny)>>>2|(13107&ny)<<2))>>>4|(3855&ny)<<4))>>>8|(255&ny)<<8)>>>1}var nb=function(e,t,i){for(var r=e.length,s=0,n=new nl(t);r>s;++s)++n[e[s]-1];var o,a=new nl(t);for(s=0;t>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new nl(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],h=t-e[s],c=a[e[s]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[n_[c]>>>l]=u}else for(o=new nl(r),s=0;r>s;++s)o[s]=n_[a[e[s]-1]++]>>>15-e[s];return o},nw=new na(288);for(nm=0;144>nm;++nm)nw[nm]=8;for(nm=144;256>nm;++nm)nw[nm]=9;for(nm=256;280>nm;++nm)nw[nm]=7;for(nm=280;288>nm;++nm)nw[nm]=8;var nx=new na(32);for(nm=0;32>nm;++nm)nx[nm]=5;var nE=nb(nw,9,0),nk=nb(nx,5,0),nS=function(e){return(e/8|0)+(7&e&&1)},nP=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof nl?nl:e instanceof nu?nu:na)(i-t);return r.set(e.subarray(t,i)),r},nO=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},nI=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},nF=function(e,t){for(var i=[],r=0;e.length>r;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new na(0),0];if(1==s){var o=new na(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=s-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new nl(d+1),v=nR(i[h-1],p,0);if(v>t){r=0;var f=0,g=v-t,_=1<<g;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>r;++r){var m=n[r].s;if(t>=p[m])break;f+=_-(1<<v-p[m]),p[m]=t}for(f>>>=g;f>0;){var y=n[r].s;t>p[y]?f-=1<<t-p[y]++-1:++r}for(;r>=0&&f;--r){var b=n[r].s;p[b]==t&&(--p[b],++f)}v=t}
1return[new na(p),v]},nR=function(e,t,i){return -1==e.s?Math.max(nR(e.l,t,i+1),nR(e.r,t,i+1)):t[e.s]=i},nC=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nl(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;t>=a;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[i.subarray(0,r),t]},nT=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},nM=function(e,t,i){var r=i.length,s=nS(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;r>n;++n)e[s+n+4]=i[n];return 8*(s+4+r)},n$=function(e,t,i,r,s,n,o,a,l,u,h){nO(t,h++,i),++s[256];for(var c=nF(s,15),d=c[0],p=c[1],v=nF(n,15),f=v[0],g=v[1],_=nC(d),m=_[0],y=_[1],b=nC(f),w=b[0],x=b[1],E=new nl(19),k=0;m.length>k;++k)E[31&m[k]]++;for(k=0;w.length>k;++k)E[31&w[k]]++;for(var S=nF(E,7),P=S[0],O=S[1],I=19;I>4&&!P[nd[I-1]];--I);var F,R,C,T,M=u+5<<3,$=nT(s,nw)+nT(n,nx)+o,A=nT(s,d)+nT(n,f)+o+14+3*I+nT(E,P)+(2*E[16]+3*E[17]+7*E[18]);if($>=M&&A>=M)return nM(t,h,e.subarray(l,l+u));if(nO(t,h,1+($>A)),h+=2,$>A){F=nb(d,p,0),R=d,C=nb(f,g,0),T=f;var L=nb(P,O,0);for(nO(t,h,y-257),nO(t,h+5,x-1),nO(t,h+10,I-4),h+=14,k=0;I>k;++k)nO(t,h+3*k,P[nd[k]]);h+=3*I;for(var D=[m,w],j=0;2>j;++j){var N=D[j];for(k=0;N.length>k;++k)nO(t,h,L[B=31&N[k]]),h+=P[B],B>15&&(nO(t,h,N[k]>>>5&127),h+=N[k]>>>12)}}else F=nE,R=nw,C=nk,T=nx;for(k=0;a>k;++k)if(r[k]>255){nI(t,h,F[257+(B=r[k]>>>18&31)]),h+=R[B+257],B>7&&(nO(t,h,r[k]>>>23&31),h+=nh[B]);var B,q=31&r[k];nI(t,h,C[q]),h+=T[q],q>3&&(nI(t,h,r[k]>>>5&8191),h+=nc[q])}else nI(t,h,F[r[k]]),h+=R[r[k]];return nI(t,h,F[256]),h+R[256]},nA=new nu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nL=function(){for(var e=new nu(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nD=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nj=!!h||!!u,nN="text/plain",nB=!1,nq=(e,t)=>{var i=e.split("#"),r=i[1],s=i[0].split("?"),n=s[0],o=s[1];if(!o)return e;var a=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(a?"?"+a:"")+(r?"#"+r:"")},nH=function(e,t,i){void 0===i&&(i=!0);var r,s,n,o,a,l=e.split("?"),u=l[0],h=l[1],c=b({},t),d=null!=(a=null==h?void 0:h.split("&").map(e=>{var t,r=e.split("="),s=r[0],n=i&&null!=(t=c[s])?t:r[1];return delete c[s],s+"="+n}))?a:[],p=(void 0===r&&(r="&"),o=[],rl(c,function(e,t){ee(e)||ee(t)||"undefined"===t||(s=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+s)}),o.join(r));return p&&d.push(p),d.length>0?u+"?"+d.join("&"):u},nU=e=>{if(e.Ys)return e.Ys;var t=e.data,i=e.compression;if(t){if(i===s6){var r,s,n,o,a,l,u,h,c=(r=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new na(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},n=0;t>n;++n){if(r+5>i.length){var o=new na(r+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?s(a):(2048>a?s(192|a>>>6):(a>55295&&57344>a?(s(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),s(128|a>>>12&63)):s(224|a>>>12),s(128|a>>>6&63)),s(128|63&a))}return nP(i,0,r)}(sT(t)),s={mtime:0},n=0xffffffff,o={p(e){for(var t=n,i=0;e.length>i;++i)t=nL[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},a=r.length,o.p(r),h=(l=10+(s.filename&&s.filename.length+1||0),u=function(e,t,i,r){var s=e.length,n=new na(r+s+5*(1+Math.floor(s/7e3))+8),o=n.subarray(r,n.length-8),a=0;if(!t||8>s)for(var l=0;s>=l;l+=65535){var u=l+65535;s>u?a=nM(o,a,e.subarray(l,u)):(o[l]=!0,a=nM(o,a,e.subarray(l,s)))}else{for(var h=nA[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new nl(32768),f=new nl(p+1),g=Math.ceil(i/3),_=2*g,m=function(t){return(e[t]^e[t+1]<<g^e[t+2]<<_)&p},y=new nu(25e3),b=new nl(288),w=new nl(32),x=0,E=0,k=(l=0,0),S=0,P=0;s>l;++l){var O=m(l),I=32767&l,F=f[O];if(v[I]=F,f[O]=I,l>=S){var R=s-l;if((x>7e3||k>24576)&&R>423){a=n$(e,o,0,y,b,w,E,k,P,l-P,a),k=x=E=0,P=l;for(var C=0;286>C;++C)b[C]=0;for(C=0;30>C;++C)w[C]=0}var T=2,M=0,$=d,A=I-F&32767;if(R>2&&O==m(l-A))for(var L=Math.min(c,R)-1,D=Math.min(32767,l),j=Math.min(258,R);D>=A&&--$&&I!=F;){if(e[l+T]==e[l+T-A]){for(var N=0;j>N&&e[l+N]==e[l+N-A];++N);if(N>T){if(T=N,M=A,N>L)break;var B=Math.min(A,N-2),q=0;for(C=0;B>C;++C){var H=l-A+C+32768&32767,U=H-v[H]+32768&32767;U>q&&(q=U,F=H)}}}A+=(I=F)-(F=v[I])+32768&32767}if(M){y[k++]=0x10000000|nf[T]<<18|ng[M];var z=31&nf[T],V=31&ng[M];E+=nh[z]+nc[V],++b[257+z],++w[V],S=l+T,++x}else y[k++]=e[l],++b[e[l]]}}a=n$(e,o,!0,y,b,w,E,k,P,l-P,a)}return nP(n,0,r+nS(a)+8)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,l)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&nD(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;i.length>=r;++r)e[r+10]=i.charCodeAt(r)}}(u,s),nD(u,h-8,o.d()),nD(u,h-4,a),u);return{contentType:nN,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===s8){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=sT(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>
1String.fromCharCode(parseInt(t,16)))):d)?e:sT(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=sT(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},nz=e=>{var t,i,r=()=>"sendBeacon"===e.transport?{url:nH(e.url,{compression:s8}),encodedBody:nU(b({},e,{compression:s8,Ys:void 0}))}:{url:nq(e.url,"compression"),encodedBody:nU(b({},e,{compression:void 0,Ys:void 0}))};try{t=nU(e)}catch(t){if(L(e.compression,s$(e.url,"compression")))return t3.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return!(t&&L(e.compression,s$(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?A(new Uint8Array(i)):ArrayBuffer.isView(i)&&A(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nB=!0,r())},nV=e=>{try{return nz(e)}catch(t){return t3.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nG=(t=y(function*(e){var t=sT(e.data),i=yield function(e,t,i){return B.apply(this,arguments)}(t,_.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return b({},e,{Ys:{contentType:nN,body:r,estimatedSize:r.byteLength}})}),function(e){return t.apply(this,arguments)}),nW=/Failed to fetch|NetworkError|Load failed/i,nJ=e=>"TypeError"===(null==e?void 0:e.name)&&nW.test((null==e?void 0:e.message)||""),nK=e=>{var t=nV(e);if(t){var i,r=t.url,s=t.encodedBody,n=null!=s?s:{},o=n.contentType,a=n.body,l=n.estimatedSize,h=new Headers;rl(e.headers,function(e,t){h.append(t,e)}),o&&h.append("Content-Type",o);var d=null,p=!1;if(c){var v=new c;d={signal:v.signal,timeout:setTimeout(()=>{var t,i;p=!0,v.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var f=t=>{p&&"AbortError"===(null==t?void 0:t.name)||nJ(t)?t3.warn(t):t3.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{u(r,b({method:(null==e?void 0:e.method)||"GET",headers:h,keepalive:"POST"===e.method&&!e.Xs&&52428.8>(l||0),body:a,signal:null==(i=d)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){t3.error(e)}null==e.callback||e.callback(r)})).catch(f).finally(()=>d?clearTimeout(d.timeout):null)}catch(e){d&&clearTimeout(d.timeout),f(e)}}},nZ=e=>{try{var t,i=nz(e),r=i.url,s=i.encodedBody,n=null!=s?s:{},a=n.body,l=n.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(o.sendBeacon(r,u))return;var h=Z(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Z(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>Z(e.data)?t:b({},e.data,{batch:t});return nZ(b({},e,{data:d(h.slice(0,c))})),void nZ(b({},e,{data:d(h.slice(c))}))}t3.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),nK(b({},e,{Xs:!0}))}catch(e){t3.warn("Beacon send failed",e)}},nY=(e,t,i,r)=>{var s="query"===r?"POST"===t?"sent_at":"_":void 0;return nH(i===s6?nq(e,"compression"):e,b({},s?{[s]:Date.now().toString()}:{},i===s6?{}:{compression:i}))},nQ=[];u&&nQ.push({transport:"fetch",method:nK}),h&&nQ.push({transport:"XHR",method(e){var t=nV(e);if(t){var i=new h,r=t.encodedBody;i.open(e.method||"GET",t.url,!0);var s=null!=r?r:{},n=s.contentType,o=s.body;rl(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}}}),null!=o&&o.sendBeacon&&nQ.push({transport:"sendBeacon",method:nZ});
1class nX{constructor(e,t){this.ta=!0,this.ea=[],this.ia=e_((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t3.createLogger("flush interval"),3e3),this.ra=e}enqueue(e){this.ea.push(e),this.na||this.sa()}unload(){this.aa();var e=Object.values(this.ea.length>0?this.oa():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.la(b({},e,{transport:"sendBeacon"}))})}enable(){this.ta=!1,this.sa()}sa(){var e=this;this.ta||(this.na=setTimeout(()=>{if(this.aa(),this.ea.length>0){var t=this.oa();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&Z(r.data)&&rl(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.la(r)}()}},this.ia))}la(e){try{this.ra(e)}catch(e){t3.error(e)}}aa(){clearTimeout(this.na),this.na=void 0}oa(){var e={};return rl(this.ea,t=>{var i,r=(t?t.batchKey:null)||t.url;ee(e[r])&&(e[r]=b({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.ea=[],e}}var n0=["retriesPerformedSoFar"];class n1{constructor(e){this.ua=!1,this.ha=3e3,this.ea=[],this._instance=e,this.ea=[],this.da=!0,!ee(s)&&"onLine"in s.navigator&&(this.da=s.navigator.onLine,this.va=()=>{this.da=!0,this.ca()},this.fa=()=>{this.da=!1},rf(s,"online",this.va),rf(s,"offline",this.fa))}get length(){return this.ea.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=w(e,n0);eo(t)&&(i.url=nH(i.url,{retry_count:t})),this._instance._send_request(b({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.bn(b({retriesPerformedSoFar:t},i));0===e.statusCode&&t3.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}bn(e){var t,i,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,r)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+s;this.ea.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+s;navigator.onLine||(o+=" (Browser is offline)"),t3.warn(o),this.ua||(this.ua=!0,this.pa())}pa(){(this.ga&&clearTimeout(this.ga),0===this.ea.length)?(this.ua=!1,this.ga=void 0):this.ga=setTimeout(()=>{this.da&&this.ea.length>0&&this.ca(),this.pa()},this.ha)}ca(){var e=Date.now(),t=[],i=this.ea.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.ea=t,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.ga&&(clearTimeout(this.ga),this.ga=void 0),this.ua=!1,ee(s)||(this.va&&(s.removeEventListener("online",this.va),this.va=void 0),this.fa&&(s.removeEventListener("offline",this.fa),this.fa=void 0)),this.ea)){var t=e.requestOptions;try{this._instance._send_request(b({},t,{transport:"sendBeacon"}))}catch(e){t3.error(e)}}this.ea=[]}}class n2{constructor(e){this.ma=()=>{this.ya||(this.ya={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.ya.lastScrollY=Math.ceil(n),this.ya.maxScrollY=Math.max(n,null!=(e=this.ya.maxScrollY)?e:0),this.ya.maxScrollHeight=Math.max(o,null!=(t=this.ya.maxScrollHeight)?t:0),this.ya.lastContentY=a,this.ya.maxContentY=Math.max(a,null!=(i=this.ya.maxContentY)?i:0),this.ya.maxContentHeight=Math.max(l,null!=(r=this.ya.maxContentHeight)?r:0)},this._instance=e}get ba(){return this._instance.config.scroll_root_selector}getContext(){return this.ya}resetContext(){var e=this.ya;return setTimeout(this.ma,0),e}startMeasuringScrollPosition(){rf(s,"scroll",this.ma,{capture:!0}),rf(s,"scrollend",this.ma,{capture:!0}),rf(s,"resize",this.ma)}scrollElement(){if(!this.ba)return null==s?void 0:s.document.documentElement;for(var e of Z(this.ba)?this.ba:[this.ba]){var t=null==s?void 0:s.document.querySelector(e);if(t)return t}}_a(e){if(this.ba){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return s?"y"===e?s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop||0:s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft||0:0}scrollY(){return this._a("y")}scrollX(){return this._a("x")}}var n3=e=>sZ(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes
1);class n5{constructor(e,t,i,r){this.ot=e=>{var t=this.wa();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ka(this._instance)};this.xa.register({[iJ]:i})}},this._instance=e,this.Sa=t,this.xa=i,this.ka=r||n3,this.Sa.onSessionId(this.ot)}wa(){return this.xa.props[iJ]}getSetOnceProps(){var e,t=null==(e=this.wa())?void 0:e.props;return t?"r"in t?sY(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return rl(rp(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+V(i)]=t}),e}}class n6{on(e,t){return this.Ca[e]||(this.Ca[e]=[]),this.Ca[e].push(t),()=>{this.Ca[e]=this.Ca[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ca[e]||[])i(t);for(var r of this.Ca["*"]||[])r(e,t)}constructor(){this.Ca={}}}var n8=t5("[SessionId]");class n4{on(e,t){return this.Ta.on(e,t)}constructor(e,t,i){if(this.Ma=null,this.Ea=null,this.Ia=[],this.Ra=void 0,this.Pa=!1,this.Ta=new n6,this.Aa=(e,t)=>!(!eo(e)||!eo(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===i4)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Oi=e.config,this.xa=e.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.Fa=void 0,this._sessionActivityTimestamp=null,this.Oa=t||rP,this.La=i||rP;var r,s=this.Oi.persistence_name||this.Oi.token;if(this._sessionTimeoutMs=1e3*e_(this.Oi.session_idle_timeout_seconds||1800,60,36e3,n8.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.$a(),this.Da="ph_"+s+"_window_id",this.Na="ph_"+s+"_primary_window_exists",this.qa()){var n=rV.Pr(this.Da),o=rV.Pr(this.Na);n&&!o?this.st=n:rV.Dr(this.Da),rV.Or(this.Na,!0)}null!=(r=this.Oi.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Oi.bootstrap.sessionID),this.ja()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ee(this.Ia)&&(this.Ia=[]),this.Ia.push(e),this._e&&e(this._e,this.st),()=>{this.Ia=this.Ia.filter(t=>t!==e)}}qa(){return"memory"!==this.Oi.persistence&&!this.xa.ws&&rV.Lr()}Ba(e){e!==this.st&&(this.st=e,this.qa()&&rV.Or(this.Da,e))}Ha(){return this.st?this.st:this.qa()?rV.Pr(this.Da):null}za(e){var t=this.Ma;return!er(t)&&!er(e)&&5e3>Math.abs(e-t)}Ua(e,t,i){var r=t!==this._sessionActivityTimestamp,s=e===this._e&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._e=e,s&&!r||s&&this.za(t)||(this.Ma=t,this.xa.register({[iE]:[t,e,i]}))}Wa(){var e,t=null==(e=this.Oi)?void 0:e.persistence_save_debounce_ms;return eo(t)&&t>0}Va(){this.Wa()?this.xa.refreshKey(iE):(this.xa.flush(),this.xa.load())}Ga(){var e;if(!er(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ma){this.Va();var t=this.Za();t[1]===this._e&&t[2]===this._sessionStartTimestamp&&(this.Ma=this._sessionActivityTimestamp,this.xa.register({[iE]:[this._sessionActivityTimestamp,null!=(e=this._e)?e:null,this._sessionStartTimestamp]}),this.xa.flush())}}Qa(){var e=this.Za()[0];return Math.max(eo(e)?e:0,eo(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Ja(e){return this.Va(),this.Aa(e,this.Qa())}Za(){var e=this.xa.props[iE];return Z(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ma=null,this.Fa=void 0,clearTimeout(this.Ka),this.Ka=void 0,this.Ua(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void n8.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void n8.error("Invalid sessionID in bootstrap",e)}}(e);return!ee(i)&&(t?this.Fa={sessionId:e,sessionStartTimestamp:i}
1:this.Ua(e,(new Date).getTime(),i),!0)}destroy(){this.Pa=!0,this.Ga(),clearTimeout(this.Ka),this.Ka=void 0,this.Ra&&s&&(s.removeEventListener(ri,this.Ra,{capture:!1}),this.Ra=void 0),this.Ia=[]}ja(){this.Ra=()=>{this.Ga(),this.qa()&&rV.Dr(this.Na)},rf(s,ri,this.Ra,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.Oi.cookieless_mode===i4)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r,s,n=t||(new Date).getTime(),o=this._e;i?this.Ea=n:(er(this.Ea)||this.Ea>n||n-this.Ea>=1e3)&&(null==(r=(s=this.xa).syncCookieProperties)||r.call(s),this.Ea=n);var a=this.Za(),l=a[1],u=a[2],h=!ee(o)&&l!==o,c=this.Qa(),d=this.Ha(),p=this.Fa,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),f=p?v:eo(u)&&Math.abs(n-u)>864e5,g=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.Aa(n,c);if(b){(b=this.Ja(n))||n8.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Za();l=w[1],u=w[2]}if(m||b||f){_=!1;var x=p&&!v;l=x?p.sessionId:this.Oa(),d=this.La(),n8.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f}}),u=x?p.sessionStartTimestamp:n,this.Fa=void 0,g=!0}else d||(d=this.La(),g=!0),(_=_||l!==y)&&(n8.info("adopted cross-tab session id",{sessionId:l,windowId:d}),g=!0);var E=eo(c)&&e&&!f?c:n,k=eo(u)?u:(new Date).getTime();this.Ba(d),this.Ua(l,E,k),e||this.$a();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f,crossTabAdoption:_};return g&&this.Ia.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:k,changeReason:g?S:void 0,lastActivityTimestamp:c}}$a(){this.Pa||(clearTimeout(this.Ka),this.Ka=setTimeout(()=>{if(!this.Pa)if(this.Ja((new Date).getTime())){var e=this._e;this.resetSessionId(),this.Ta.emit("forcedIdleReset",{idleSessionId:e})}else this.$a()},1.1*this.sessionTimeoutMs))}}var n7=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&H(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>H(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function n9(){return(n9=y(function*(){var e=null==o?void 0:o.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return et(i)&&i.length>0?i:void 0}catch(e){return void t3.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var oe=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function ot(e,t,i){return sT({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var oi={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>oe(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!oe(t,e))),icontains:(e,t)=>t.map(or).some(t=>e.map(or).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(or).every(t=>e.map(or).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},or=e=>e.toLowerCase();function os(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],r=null==t?void 0:t[e[0]];if(ee(r)||er(r))return!1;var s=[String(r)],n=oi[i.operator];return!!n&&n(i.values,s)})}var on="custom",oo="i.posthog.com",oa=/^\/static\//,ol=["/s/","/e/","/i/"];class ou{constructor(e){this.Ya={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+oo,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ya[this.apiHost]||(this.Ya[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":
1on),this.Ya[this.apiHost]}Xa(e){if(oa.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}eo(e){var t=sM(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}io(e,t,i){if("ui"===e)return i;var r=i,s=this.instance.config.rewriteRequestPath;if(s&&(r=s(new URL((null==(o=sM(i))?void 0:o.href)||i)).toString()),s&&"api"===e&&ol.some(e=>0===t.indexOf(e))){var n=this.eo(r);if(n){var o,a,l=this.apiHost,u=this.ro;(null==(a=u)?void 0:a.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.ro=u),u.urls.add(n)}}return r}isIngestionEndpoint(e){var t=this.ro,i=this.eo(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.io(e,t,this.uiHost+t);if("flags"===e)return this.io(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.Xa(t);if(i)return this.io(e,t,""+i+t)}if(this.region===on)return this.io(e,t,this.apiHost+t);var r=oo+t;switch(e){case"assets":return this.io(e,t,"https://"+this.region+"-assets."+r);case"api":return this.io(e,t,"https://"+this.region+"."+r)}}}function oh(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var oc=t5("[Surveys]"),od="seenSurvey_",op=e=>{try{var t=""+od+(e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){oc.error("Failed to persist survey seen state",e)}},ov=["popover","widget","api"],of={ignoreConditions:!1,ignoreDelay:!1,displayType:ni},og=t5("[PostHog ExternalIntegrations]"),o_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class om{constructor(e){this._instance=e}Jn(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return og.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,r,s,n=i[0],o=i[1];!o||null!=(e=g.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Jn(o_[n],()=>{var e;null==(e=g.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(r=g.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=g.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())}()}}class oy{constructor(e,t){this.I=e,this.no=t,this.so=new Map,this.ao=!1}add(e){var t=this;return y(function*(){if(t.ao)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.so.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.so.set(e.name,e);try{var i=e.setup(t.no);i&&(yield i)}catch(i){var r=t.so.get(e.name)===e;r&&t.so.delete(e.name),t.I.error('Failed to set up browser extension "'+e.name+'"',i),r&&t.oo(e)}})()}dispose(){if(!this.ao){this.ao=!0;var e=Array.from(this.so.values()).reverse();for(var t of(this.so.clear(),e))this.oo(t)}}oo(e){try{var t=null==e.dispose?void 0:e.dispose();t&&Y(t.then)&&t.then(void 0,t=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.I.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class ob{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var r of e){var s=null==t?void 0:t.get_property(r);ee(s)||(i[r]=s)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var ow="extensionsRemoteConfig";class ox{constructor(e){this.ao=!1,this.instance=e,this.I=t3,this.lo=e.uo,this.kv=new ob(e),this.onEvent=e=>s5(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.I.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.ao)return s5(()=>{});var t=t=>{try{e(t)}catch(e){this.I.error("Browser extension remote config listener failed",e)}},i=this.instance.ho.on(ow,t);return this.lo&&t(this.lo),s5(i)},this.do=new oy(t3.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property(ii))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(ii);return"string"==typeof e?e:void 0}get library(){return{name:_.LIB_NAME,version:_.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,r,s=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==s?void 0:s.sessionId)?t:"",windowId:null!=(i=null==s?void 0:s.windowId)?i:"",sessionStartTimestamp:null!=(r=null==s?void 0:s.sessionStartTimestamp)?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.do.add(e)}capture(e,t,i){var r=this;return y(function*(){i?r.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(e,t)})()}registerDynamicEventProperties(e){return s5(this.instance.vo(e))}handleRemoteConfig(e){this.ao||(this.lo=e,this.instance.ho.emit(ow,e))}sendRequest(e,t){var i=this;return y(function*(){void 0===t&&(t={});var r,s=i.instance.requestRouter.endpointFor(null!=(r=t.target)?r:"api",e),n={method:t.method,url:t.query?nH(s,t.query):s,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.ao||(this.ao=!0,this.do.dispose())}}var oE={},ok=0,oS=()=>{}
1,oP='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',oO="Surveys module not available",oI="sanitize_properties is deprecated. Use before_send instead",oF="Invalid value for property_denylist config: ",oR=["token","distinct_id",i1],oC="posthog",oT=!nj&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),oM=e=>{var t;return b({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!et(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of rv)if(i===r)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:oS,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:l&&et(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){t3.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:re,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:oS},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:st,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},o$=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],oA=e=>{var t={};for(var i of o$){var r=i[0],s=i[1];ee(e[r])||(t[s]=e[r])}var n=ru({},t,e),o=e.__preview_external_dependency_versioned_paths;return ee(o)||(ee(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),et(o)&&ee(e.asset_host)&&(n.asset_host=o)),Z(e.property_blacklist)&&(ee(e.property_denylist)?n.property_denylist=e.property_blacklist:Z(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:t3.error(oF+e.property_denylist)),n};class oL{constructor(){this.__forceAllowLocalhost=!1}get co(){return this.__forceAllowLocalhost}set co(e){t3.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class oD{fo(e,t){if(e){var i=this.so.indexOf(e);-1!==i&&this.so.splice(i,1)}return this.so.push(t),null==t.initialize||t.initialize(),t}po(){return this.config.cookieless_mode===i4||this.config.cookieless_mode===i8&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new oL,this.mo=!1,this.version=_.LIB_VERSION,this.yo=new Set,this.bo="",this.ho=new n6,this.so=[],this._o=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=oM(),this.SentryIntegration=sP,this.sentryIntegration=e=>{var t;return t=sS(this,e),{name:sk,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.wo=!1,this.ko=null,this.xo=null,this.So=null,this.scrollManager=new n2(this),this.pageViewManager=new sO(this),this.rateLimiter=new ns(this),this.requestRouter=new ou(this),this.consent=new rG(this),this.externalIntegrations=new om(this);var e,t=null!=(e=oD.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var r=et(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=et(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>t3.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==oC){var r,s=null!=(r=oE[i])?r:new oD;return s._init(e,t,i),oE[i]=s,oE[oC][i]=s,s}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var r,n,o,a=et(e)?e.trim():"";if(!a)return t3.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=oM(t.defaults),t.debug=this.Co(t.debug),this.To=t,this.Mo=[],t.person_profiles?this.xo=t.person_profiles:t.process_person&&(this.xo=t.process_person);var l=oM(t.defaults),u=oA(t),h=ru({},l,u,{name:i,token:a});Q(l.rageclick)&&Q(u.rageclick)&&(h.rageclick=ru({},l.rageclick,u.rageclick)),Q(l.session_recording)&&Q(u.session_recording)&&(h.session_recording=ru({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&t3.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:s6;var c=this.Eo();if(this.persistence=new s3(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new s3(b({},this.config,{persistence:"sessionStorage"}),c,!1),this.bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&rV.Lr()){var d=rV.Pr(this.bo);
1Z(d)&&d.forEach(e=>{et(e)&&this.yo.add(e)})}else rV.Dr(this.bo);var p=b({},this.persistence.props),v=b({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Io=new nX(e=>this.Ro(e),this.config.request_queue_config),this.Po=new n1(this),this.__request_queue=[];var f=this.po();if(f||(this.sessionManager=new n4(this),this.sessionPropsManager=new n5(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Ao()})),this.Fo(),this.config.__preview_deferred_init_extensions?(t3.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Oo(f)},0)):(t3.info("Initializing extensions synchronously"),this.Oo(f)),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&t3.info("Starting in debug mode",{this:this,config:t,thisC:b({},this.config),p:p,s:v}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=b({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var g=t.bootstrap.distinctID,m=this.get_distinct_id(),y=this.persistence.get_property(iW);if(t.bootstrap.isIdentifiedID&&null!=m&&m!==g&&y===i7)this.identify(g);else if(t.bootstrap.isIdentifiedID&&null!=m&&m!==g&&y===i9)t3.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var w=this.config.get_device_id(rP()),x=t.bootstrap.isIdentifiedID?w:g;this.persistence.set_property(iW,t.bootstrap.isIdentifiedID?i9:i7),this.register({distinct_id:g,$device_id:x})}}if(f)this.register_once({distinct_id:i0,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(rP());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(iW,i7)}return rf(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||rP();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(iW,i9)),t()},s=i.user();"then"in s&&Y(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register(("u">typeof Promise&&Promise.resolve||sE.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(sE.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sE.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,rr),identify:e=>r(e,rn),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Lo()):this.Lo(),Y(this.config._onCapture)&&this.config._onCapture!==oS&&(t3.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t3.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return n9.apply(this,arguments)})().then(e=>{e&&this.register({[ir]:e})}).catch(oS),this}Fo(){var e,t,i,r,s,n,o=null!=(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)?e:null==(i=oD.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(r=this.$o)||r.call(this),this.$o=void 0,this.featureFlags=new o(this)),Y(this.featureFlags.onReloading)&&Y(this.featureFlags.setup)?this.$o||(this.$o=this.featureFlags.onReloading(()=>{this.ho.emit("featureFlagsReloading",!0)}),this.Do().add(this.featureFlags)):null==(s=(n=this.featureFlags).initialize)||s.call(n))}Oo(e){var t,i,r,s,n,o,a,l=performance.now(),u=b({},oD.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.so.push(this.exceptions=null!=(t=this.exceptions)?t:new u.exceptions(this)),u.historyAutocapture&&this.so.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.so.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.so.push(this.siteApps=new u.
1siteApps(this)),u.sessionRecording&&!e&&this.so.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.so.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.so.push(this.surveys=null!=(i=this.surveys)?i:new u.surveys(this)),u.logs&&this.so.push(this.logs=null!=(r=this.logs)?r:new u.logs(this)),u.metrics&&this.so.push(this.metrics=null!=(s=this.metrics)?s:new u.metrics(this)),u.conversations&&this.so.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.so.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.so.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.so.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.so.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.so.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,sw)),u.toolbar&&this.so.push(this.toolbar=null!=(o=this.toolbar)?o:new u.toolbar(this)),u.experiments&&this.so.push(this.experiments=null!=(a=this.experiments)?a:new u.experiments(this)),this.so.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.No){var e=this.No;this.No=void 0,this.so.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.qo(h,l)}qo(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.qo(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t3.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[i2]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[i3]:r}),this.config.__preview_deferred_init_extensions&&t3.info("PostHog extensions initialized ("+r+"ms)")}Zs(e){var t;if(!a||!a.body)return t3.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Zs(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.No=e),this.uo=e,this.compression=void 0,e.ok){var i,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=U(r.supportedCompression,s6)?s6:U(r.supportedCompression,s8)?s8:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.xo?this.xo:re}),null==(t=this.jo)||t.handleRemoteConfig(e),this.so.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Lo(){try{this.config.loaded(this)}catch(e){t3.critical("`loaded` function failed",e)}if(this.Bo(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var e=l.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.po())&&this.Ho()},1),this.zo=new no(this),this.zo.load()}Bo(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Io)||e.enable())}_dom_loaded(){this.is_capturing()&&ra(this.__request_queue,e=>this.Ro(e)),this.__request_queue=[],this.Bo()}_handle_unload(){var e,t,i,r,s;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.Uo()&&this.capture(rs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.Io)||r.unload(),null==(s=this.Po)||s.unload()):this.Uo()&&this.capture(rs,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?oT?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=b({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(ee(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,r,s,n,o=b({},e);o.timeout=o.timeout||6e4;var a,l,u,h,c,p=null!=(r=o.transport)?r:"fetch";"sendBeacon"===p&&ee(o.compression)&&o.data&&(o.compression=s8),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!=(l=null==(c=(h=(Z(a=o.data)?a:[a]).map(e=>b({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(u=c.properties)?void 0:u.token)?l:null==c?void 0:c.token,batch:h,sent_at:(new Date).toISOString()}:"body"===o.timestampMode&&(t=o.data,void 0===i&&(i=(new Date).toISOString()),o.data=Z(t)?t.map(e=>b({},e,{sent_at:i})):b({},t,{sent_at:i}))),o.url=nY(o.url,o.method,o.compression,o.timestampMode);var v=nQ.filter(e=>!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport)),f=null!=(s=null==(n=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===p)return e[t]}(v))?void 0:n.method)?s:v[0].method;if(!f)throw Error("No available transport method");var g=e=>{try{f(e)}catch(e){nJ(e)?t3.warn(e):t3.error(e),null==o.callback||o.callback({statusCode:0,error:e})}};"sendBeacon"!==p&&o.data&&o.compression===s6&&d&&"u">typeof Promise&&!nB?nG(o).then(e=>{g(e)}).catch(t=>{D(t)?(nB=!0,g(b({},o,{compression:void 0,url:nY(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return D(e)||t===$})(t)&&(nB=!0),g(o))}):f(o)})(b({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Ro(e){this.Po?this.Po.retriableRequest(e):this._send_request(e)}_execute_array(e){ok++;try{var t,i=[],r=[],s=[];ra(e,e=>{if(e)if(Z(t=e[0]))s.push(e);else if(Y(e))try{e.call(this)}catch(t){t3.error("Error executing queued PostHog call",e,t)}else Z(e)&&"alias"===t?i.push(e):Z(e)&&-1!==t.indexOf("capture")&&Y(this[t])?s.push(e):r.push(e)});var n=function(e,t){ra(e,function(e){try{if(Z(e[0])){var i=t;rl(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t3.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{ok--}}push(e){if(ok>0&&Z(e)&&et(e[0])){var t=oD.prototype[e[0]];Y(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Io){if(this.is_capturing())if(!ee(e)&&et(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!et(null==t?void 0:t.$current_url)&&(t3.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.Wo||t3.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h,c,d,p,v=new Date,f=(null==i?void 0:i.timestamp)||v,g=tp(null==i?void 0:i.uuid,rP),_={uuid:g,event:e,properties:this.calculateEventProperties(e,t||{},f,g)};e===rr&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var m="$feature_flag_called"===e&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(iC);(null==i?void 0:i.$set)&&!m&&(_.$set=null==i?void 0:i.$set);var y=null==i?void 0:i.$unset;y&&(_.$unset=y);var w,x,E,k=m?void 0:this.Vo(null==i?void 0:i.$set_once,e!==ro,e===rn);if(k&&(_.$set_once=k),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=_,o=e=>et(e)?e.slice(0,s):e,a=new Set,_=function e(t,i){if(t!==Object(t))return o?o(t):t;if(!a.has(t)){var r;if(a.add(t),Z(t))r=[],ra(t,t=>{r.push(e(t))});else{var s={};
1rl(t,(t,i)=>{a.has(t)||(s[i]=e(t,i))}),r=s}return r}}(n)),_.timestamp=f,ee(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=v),m&&(_.properties=(h=_.properties,void 0===(c=oR)&&(c=[]),d={},p=e=>{void 0!==h[e]&&(d[e]=h[e])},F.forEach(p),c.forEach(p),d)),e===ne||e===nt){var S=null==t?void 0:t.$survey_id,P=null==t?void 0:t.$survey_iteration;op({id:S,current_iteration:P}),_.$set=b({},_.$set,{[(w={id:S,current_iteration:P},E="$survey_"+(x=e===nt?"responded":"dismissed")+"/"+w.id,w.current_iteration&&w.current_iteration>0&&(E="$survey_"+x+"/"+w.id+"/"+w.current_iteration),E)]:!0})}else e===s9&&(_.$set=b({},_.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var O=null==t?void 0:t.$product_tour_type;O&&(_.$set=b({},_.$set,{["$product_tour_last_seen_date/"+O]:(new Date).toISOString()}))}var I=b({},_.properties.$set,_.$set);if(X(I)||this.setPersonPropertiesForFlags(I),!es(this.config.before_send)){var R=this.mn(_);if(!R)return;(_=R).uuid=tp(_.uuid,rP)}this.ho.emit("eventCaptured",_);var C=null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),T={method:"POST",url:C,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(C)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Ro(T):this.Io.enqueue(T),_}t3.critical("This capture call is ignored due to client rate limiting.")}}else t3.error("No event name provided to posthog.capture")}else t3.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}Do(){var e;return null!=(e=this.jo)?e:this.jo=new ox(this)}vo(e){this._o.push(e);var t=!0;return()=>{if(t){t=!1;var i=this._o.indexOf(e);-1!==i&&this._o.splice(i,1)}}}Go(e){var t,i,r;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.So=null,this.persistence.get_property(iW)===i7&&(null==(r=this.sessionPersistence)||r.clear(),this.yo.clear(),this.Zo()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.Go();var o,u=n?void 0:this.persistence.remove_event_timer(e),h=b({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.po()&&(h[i1]=!0),"$snapshot"===e){var c=b({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!et(h.distinct_id)&&!en(h.distinct_id)||ei(h.distinct_id))&&t3.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var d,v=function(e,t,i,r){if(void 0===r&&(r=!1),!p)return{};var n,o,a,u,h,c=e?[...sB,...t||[]]:[],d=function(e){for(var t=0;th.length>t;t++){var i=th[t],r=i[1],s=i[0].exec(e),n=s&&(Y(r)?r(s,e):r);if(n)return n}return["",""]}(p),v=d[0],f=d[1],g=null!=(h="u">typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},m={};ee(i)||(m.detectGoogleSearchApp=i);var y={},b=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,w=null==(o=navigator)?void 0:o.maxTouchPoints,x=null==s||null==(a=s.screen)?void 0:a.width,E=null==s||null==(u=s.screen)?void 0:u.height,k=null==s?void 0:s.devicePixelRatio;ee(b)||(y.userAgentDataPlatform=b),ee(w)||(y.maxTouchPoints=w),ee(x)||(y.screenWidth=x),ee(E)||(y.screenHeight=E),ee(k)||(y.devicePixelRatio=k);var S,P,O,I,F,R,C=ru(rp({$os:v,$os_version:f,$browser:ta(p,navigator.vendor,g,m),$device:tc(p),$device_type:(R=tc(p))===eE||R===ex||"
1Kobo"===R||"Kindle Fire"===R||R===eX?ew:R===eH||R===ez||R===eU||R===eZ?"Console":R===eS?"Wearable":R?ey:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!=(P=null==y?void 0:y.maxTouchPoints)?P:0)>0?600>Math.min(null!=(O=null==y?void 0:y.screenWidth)?O:0,null!=(I=null==y?void 0:y.screenHeight)?I:0)/(null!=(F=null==y?void 0:y.devicePixelRatio)?F:1)?ey:ew:"Desktop",$timezone:sQ(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:sA(r?tv(null==l?void 0:l.href):null==l?void 0:l.href,c,sH),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:tu(p,navigator.vendor,g,m),$browser_language:sW(),$browser_language_prefix:"string"==typeof(S=sW())?S.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return _.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=_.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&ru(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&ru(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(o=this.Po)?void 0:o.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===on&&(h.$lib_custom_api_host=this.config.api_host),d=e!==rr||n?e!==rs||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),h=ru(h,d),e===rr&&a&&(h.title=a.title),!ee(u)){var m=i.getTime()-u;h.$duration=parseFloat((m/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),w=this.sessionPersistence.properties();rl(["$referrer","$referring_domain"],e=>{e in y&&delete w[e]});var x={};if(this._o.length>0)for(var E of this._o.slice())try{ru(x,E())}catch(e){t3.error("Failed to produce browser extension event properties",e)}(h=ru({},v,y,w,b({},x,h))).$is_identified=this._isIdentified(),Z(this.config.property_denylist)?rl(this.config.property_denylist,function(e){delete h[e]}):t3.error(oF+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(t3.error(oI),h=k(h,e));var S=this.Qo();return h.$process_person_profile=S,S&&!n&&this.Jo("_calculate_event_properties"),h}Vo(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Qo()||this.mo&&!i)return e;var r,s=ru({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t3.error(oI),s=n(s,"$set_once")),t&&(this.mo=!0),X(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.Go(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.yo.add(e)),this.Zo()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.yo.delete(e),this.Zo()}Ko(e,t){this.register({[e]:t})}Ao(){this.yo.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.yo.clear(),this.Zo()}Zo(){var e;if(this.bo)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.ws||!rV.Lr())rV.Dr(this.bo);else{var t=[];this.yo.forEach(e=>t.push(e)),t.length>0?rV.Or(this.bo,t):rV.Dr(this.bo)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,r;return null!=(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.ho.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:oO}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:oO})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:oO})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=of),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:oO}}canRenderSurveyAsync(e,t){var i,r;return void 0===t&&(t=!1),null!=(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:oO})}Yo(e){return!e||ei(e)?(t3.critical("Unique user id has not been set in posthog.identify"),!1):e===i0?(t3.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(t3.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return t3.uninitializedWarning("posthog.identify");if(en(e)&&(e=e.toString(),t3.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Yo(e)&&this.Jo("posthog.identify")){var r=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,n=this.Go(!1),o=this.persistence.Ss(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(ii)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(is)&&(this.unregister(is),this.register({distinct_id:e}));var u,h=(this.persistence.get_property(iW)||i7)===i7,c=e!==l,d=!c&&h;if(c&&h)this.persistence.set_property(iW,i9),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Cs(),this.capture(rn,{distinct_id:e,$anon_distinct_id:l},{$set:t||{},$set_once:i||{}}),this.So=ot(e,t,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(d){this.persistence.set_property(iW,i9);var p=t||{},v=i||{};this.setPersonPropertiesForFlags({$set:p,$set_once:v},!1),this.config.cookieWinsOnConflict&&this.persistence.Cs(),this.capture("$set",{$set:p,$set_once:v}),this.So=ot(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||s||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(iU)):d&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Es(a)}}}setPersonProperties(e,t){if((e||t)&&this.Jo("posthog.setPersonProperties")){var i=ot(this.get_distinct_id(),e,t);this.So!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.So=i):t3.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(Z(e)?e:[e]).filter(e=>et(e)&&e.length>0);0!==i.length&&this.Jo("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.So=null)}group(e,t,i){var r;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this.Go();var s=this.getGroups(),n=s[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:b({},s,{[e]:t})}),n||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(ro,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else t3.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.Jo("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=ea(e)?e:null==e?void 0:e.resetDeviceID,i=ea(e)||null==e?void 0:e.bootstrap;this.Xo(t,!1,i)}Xo(e,t,i){if(void 0===t&&(t=!1),t3.info("reset"),!this.__loaded)return t3.uninitializedWarning("posthog.reset");var r,s,n,o,a,l,u,h,c,d,p,v,f,g,_,m,y,w,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.To)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Js());var E=this.get_property(ii),k=this.get_property(ir),S=this.get_property(i_),P=this.is_capturing();this.consent.reset(),t||!P||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var O=null==(n=this.persistence)||null==n.Ss?void 0:n.Ss(),I=!1;try{if(null==(o=this.persistence)||o.clear(),null==(a=this.sessionPersistence)||a.clear(),this.yo.clear(),this.Zo(),ee(S)||null==(g=this.persistence)||g.register({[i_]:S}),null==(l=this.surveys)||l.reset(),null==(u=this.zo)||u.stop(),null==(h=this.featureFlags)||h.reset(),null==(c=this.conversations)||c.reset(),null==(d=this.logs)||d.reset(),null==(p=this.metrics)||p.reset(),null==(v=this.persistence)||v.set_property(iW,i7),null==(f=this.sessionManager)||f.resetSessionId(),this.So=null,this.config.cookieless_mode===i4)this.register_once({distinct_id:i0,$device_id:null},"");else{var F=this.config.get_device_id(rP());this.register_once({distinct_id:F,$device_id:e?F:E},""),e||ee(k)||this.register({[ir]:k})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.po()||(null==(y=this.persistence)||y.set_property(iW,i.isIdentifiedID?i9:i7),this.register({distinct_id:i.distinctID})),null==(_=this.featureFlags)||_.initialize(),!(ee(x)||null!=(m=this.sessionManager)&&m.setBootstrapSessionId(x,!0)))){var R=b({},i);delete R.sessionID,this.config.bootstrap=R}delete this.config.identity_distinct_id,delete this.config.identity_hash,I=!0}
1finally{O&&(null==(w=this.persistence)||null==w.Es||w.Es(I))}this.reloadFeatureFlags()}shutdown(e){var t=this;return y(function*(){var e,i,r,s,n,o,a,l;if(t.__loaded){null==(e=t.zo)||e.stop(),null==(i=t.jo)||i.dispose(),null==(r=t.sessionRecording)||r.dispose(),null==(s=t.logs)||s.flushLogs("sendBeacon"),null==(n=t.metrics)||n.flush("sendBeacon"),null==(o=t.Io)||o.unload(),null==(a=t.Po)||a.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){t3.error("Error while destroying feature flags",e)}}else t3.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.tl()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.el()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(ie)?(t3.critical("Attempting to create alias for existing People user - aborting."),-2):this.Jo("posthog.alias")?(ee(t)&&(t=this.get_distinct_id()),e!==t?(this.Ko(is,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t3.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=b({},this.config);if(Q(e)){ru(this.config,oA(e));var i,r,s,n,o,a,l,u,h,c,d,p,v=this.Eo();null==(i=this.persistence)||i.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new s3(b({},this.config,{persistence:"sessionStorage"}),v,!1);var f=this.Co(this.config.debug);ea(f)&&(this.config.debug=f),ea(this.config.debug)&&(this.config.debug?(_.DEBUG=!0,rT.Lr()&&rT.Or("ph_debug",!0),t3.info("set_config",{config:e,oldConfig:t,newConfig:b({},this.config)})):(_.DEBUG=!1,rT.Lr()&&rT.Dr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Js()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.il(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){_.LIB_NAME=e,_.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(b({},r,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:oD.rl}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:oC;return t!==oC&&(t=oC+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iW))===i9||(null==(t=this.sessionPersistence)?void 0:t.get_property(iW))===i9}Qo(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===re&&!this._isIdentified()&&X(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[is])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iX]))}Uo(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Qo()||this.Jo("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Jo("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Jo(e){return"never"===this.config.person_profiles?(t3.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ko(iX,!0),!0)}Eo(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==i8)}il(){var e,t,i,r,s=this.Eo();return(null==(e=this.persistence)?void 0:e.ws)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.ws)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s&&(this.yo.clear(),this.Zo()),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==i4){if(this.po()){this.Xo(!0,!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewM
1anager)||n.destroy(),this.sessionManager=new n4(this),this.pageViewManager=new sO(this),this.persistence&&(this.sessionPropsManager=new n5(this,this.sessionManager,this.persistence));var i,r,s,n,o,a,l,u,h=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=oD.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.fo(this.sessionRecording,new h(this)),this.uo&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.uo)))}this.consent.optInOut(!0),this.il(),this.Bo(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==i8&&(null==(i=this.surveys)||i.loadIfEnabled()),(ee(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(r=null==e?void 0:e.captureEventName)?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ho()}else t3.warn(oP)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==i4?(this.config.cookieless_mode===i8&&this.consent.isOptedIn()&&this.Xo(!0,!0),this.consent.optInOut(!1),this.il(),this.config.cookieless_mode===i8&&(this.register({distinct_id:i0,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Ho(),this.Bo())):t3.warn(oP)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===i4||(this.config.cookieless_mode===i8?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.il()}_is_bot(){return o?n7(o,this.config.custom_blocked_useragents):void 0}Ho(){a&&("visible"===a.visibilityState?this.wo||(this.wo=!0,this.capture(rr,{title:a.title},{send_instantly:!0}),this.ko&&(a.removeEventListener(rt,this.ko),this.ko=null)):this.ko||(this.ko=this.Ho.bind(this),rf(a,rt,this.ko)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Js(){var e,t,i,r,s=this.To||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(t3.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!es(s[e]),r=t in s&&!es(s[t]),i?s[e]:!!r&&(t3&&t3.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}mn(e){if(es(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(eu),r=Z(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of r){if(es(s=n(s))){var o="Event '"+e.event+"' was rejected in beforeSend function";return el(e.event)?t3.warn(o+". This can cause unexpected behavior."):t3.info(o),null}s.properties&&!X(s.properties)||t3.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&es(s.properties[a]))return t3.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager.Xn)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Co(e){var t=ea(e)&&!e,i=rT.Lr()&&"true"===rT.Fr("ph_debug");return!t&&(!!i||e)}}oD.__defaultExtensionClasses={},oD.rl={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=rd(e.prototype[t[i]])}(oD,["identify"]);class oj{constructor(e){this.disabled=!1===e;var t=Q(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var oN="$copy_autocapture",oB=t5("[AutoCapture]");function oq(e,t){return t.length>e?t.slice(0,e)+"...":t}var oH=t5("[ExceptionAutocapture]"),oU=()=>{},oz=t5("[TracingHeaders]"),oV=t5("[Web Vitals]"),oG="disabled",oW="lazy_loading",oJ="awaiting_config",oK="missing_config";t5("[SessionRecording]"),t5("[SessionRecording]");var oZ="[SessionRecording]",oY=t5(oZ),oQ=t5("[Heatmaps]");function oX(e){return Q(e)&&"clientX"in e&&"clientY"in e&&en(e.clientX)&&en(e.clientY)}var o0=t5("[Product Tours]"),o1=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(iv))},o2=["$set_once","$set"],o3=t5("[SiteApps]"),o5="Error while initializing PostHog app with config id ";function o6(e,t,i){if(es(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class o8{constructor(e){this.nl=new n6,this.sl=(e,t)=>this.al(e,t)&&this.ol(e,t)&&this.ll(e,t)&&this.ul(e,t),this.al=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.hl=new Set,this.dl=new Set}init(){var e,t;ee(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!ee(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
1=>{var t,i;null==(t=this.dl)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.hl)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.hl.has(e)||this.hl.has(t.event))&&this.dl&&(null==(i=this.dl)?void 0:i.size)>0&&this.dl.forEach(e=>{this.vl(t,e)&&this.nl.emit("actionCaptured",e.name)})}cl(e){this.onAction("actionCaptured",t=>e(t))}vl(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.sl(e,i))return!0;return!1}onAction(e,t){return this.nl.on(e,t)}ol(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!o6(r,t.url,t.url_matching||"contains"))return!1}return!0}ll(e,t){return!!this.fl(e,t)&&!!this.pl(e,t)&&!!this.gl(e,t)}fl(e,t){if(null==t||!t.href)return!0;var i=this.ml(e);if(i.length>0)return i.some(e=>o6(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&o6((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}pl(e,t){if(null==t||!t.text)return!0;var i=this.ml(e);if(i.length>0)return i.some(e=>o6(e.text,t.text,t.text_matching||"exact")||o6(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!es(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",s.some(e=>o6(e,n,o)))}gl(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}ml(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}ul(e,t){return null==t||!t.properties||0===t.properties.length||os(t.properties.reduce((e,t)=>{var i=Z(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class o4{constructor(e){var t;this.yl=[],this._instance=e,this.bl=new Map,this._l=new Map,this.wl=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.kl(e))}xl(e){return!1}Sl(){return null}Cl(e){}Tl(){}Ml(e,t){return!!e&&os(e.propertyFilters,null==t?void 0:t.properties)}El(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}Il(e,t,i){var r=(i===s4?this.bl:this._l).get(e),s=[];return this.Rl(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s,n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.Ml(n,t)})}register(e){var t;ee(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Pl(e),this.Al(e))}Al(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.Fl&&(this.Fl=new o8(this._instance),this.Fl.init(),this.Fl.cl(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.Fl)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.wl.get(t.name);i&&i.push(e.id),this.wl.set(t.name,i||[e.id])}}))}))}Pl(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});0===i.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.bl=this.El(e,s4),this._l=this.El(e,s7))}onEvent(e,t){var i,r,s=this.Ol(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var o=this.Ll(e,n);if("consume"===o)return s.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.$l([n]);if("persist"===o)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Dl(n),void this.Nl([n])}if(this._l.has(e)){var a=this.Il(e,t,s7);a.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this.$l(a.map(e=>e.id)),a.forEach(e=>this.ql(e.id)))}if(this.bl.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.bl.get(e)});var l=this.Il(e,t,s4);this.jl(l.map(e=>e.id))}}onAction(e){this.wl.has(e)&&this.jl(this.wl.get(e)||[])}jl(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),r=[];for(var s of e)i&&this.xl(s)?this.Dl(s)&&this.Bl(s):r.push(s);r.length>0&&(this.yl=[...new Set([...this.yl,...r])]),this.Ol().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Dl(e){this.yl=this.yl.filter(t=>t!==e);var t=this.Hl();return!t.includes(e)&&(this.zl([...t,e]),this.Ul(),!0)}$l(e){var t=new Set(e);this.yl=this.yl.filter(e=>!t.has(e));var i=this.Wl(),r=i.filter(e=>!t.has(e));r.length!==i.length&&(this.zl(r),0===r.length&&this.Vl()),this.Nl(e)}Gl(){var e,t=this.Sl();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Bl(e){if(this.Sl()){var t=this.Gl();this.Cl(b({},t,{[e]:Date.now()}))}}Nl(e){if(this.Sl()){var t=this.Gl(),i={},r=!1;for(var s of Object.entries(t)){var n=s[0],o=s[1];e.includes(n)?r=!0:i[n]=o}r&&(X(i)?this.Tl():this.Cl(i))}}Zl(){this.Sl()&&this.Tl()}getActivationTimestamp(e){if(this.Hl().includes(e)){var t=this.Gl()[e];return en(t)?t:void 0}}Wl(){var e,t=this.Ql();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Hl(){var e,t,i=this.Wl();if(0===i.length)return[];var r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Jl()],s=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return s&&r===s?i:[]}Ul(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.Kl(t)}Vl(){this.Yl()}kl(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Jl()];if(i&&i!==e){var r=this.Wl(),s=this.Gl();r.length>0&&(this.zl([]),r.filter(e=>en(s[e])).forEach(e=>this.ql(e))),this.Vl(),this.Zl()}}getActivatedIds(){return[...new Set([...this.Hl(),...this.yl])].filter(e=>!this.Xl(e))}reset(){this.yl=[],this.Wl().length>0&&this.zl([]),this.Vl(),this.Zl()}getEventToItemsMap(){return this.bl}tu(){return this.Fl}}class o7 extends o4{constructor(e){super(e)}Ql(){return iN}Jl(){return iB}Sl(){return iq}Cl(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iq]:e})}Tl(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iq)}xl(e){this.Rl(t=>{i=t.find(t=>t.id===e)});var t,i,r=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return en(r)&&r>0}eu(){return s9}Rl(e){var t;null==(t=this._instance)||t.getSurveys(e)}ql(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Ol(){return oc}zl(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iN]:e})}Kl(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iB]:e})}Yl(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iB)}Xl(){return!1}Ll(e,t){var i,r,s;return this.Rl(e=>{s=e.find(e=>e.id===t)}),!s||oh(i=s)&&!(null==(r=i.conditions)||null==(r=r.events)||!r.repeatedActivation)||"always"===i.schedule?e===s9?"consume":"ignore":e===s9?"persist":e===ne||e===nt?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var o9="SDK is not enabled or survey functionality is not yet loaded",ae="Disabled. Not loading surveys.",at=null!=s&&s.location?sL(s.location.hash,"__posthog")||sL(location.hash,"state"):null,ai="_postHogToolbarParams",ar=t5("[Toolbar]"),as=t5("[FeatureFlags]");class an{constructor(e,t){void 0===t&&(t=!1),this.iu=!1,this.update(e,t)}update(e,t){var i,r,s,n;this.ru={bootstrap:{featureFlags:null==(i=e.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=e.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?"none":"base64",evaluationContexts:null!=(s=null!=(n=e.evaluation_contexts)?n:e.evaluation_environments)?s:[],flagKeys:Z(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.iu||(as.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.iu=!0),ee(e.flag_keys)||Z(e.flag_keys)||as.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ru}}var ao=t5("[FeatureFlags]"),aa=t5("[FeatureFlags]",{debugEnabled:!0}),al="\" failed. Feature flags didn't load in time.",au="connection_error",ah=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},ac=e=>{var t={};for(var i of rh(e||{})){var r=i[1];r&&(t[i[0]]=r)}return t},ad=t5("[Error tracking]"),ap=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],av="Refusing to render web experiment since the viewer is a likely bot",af={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>oe(t,e),not_regex:(e,t)=>!oe(t,e),exact:(e,t)=>
1t===e,is_not:(e,t)=>t!==e};class ag{get Oi(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{ag.nu("retrieved web experiments from the server"),t.su=new Map,e.forEach(e=>{if(e.feature_flag_key){t.su&&(ag.nu("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.su)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);et(r)&&e.variants[r]&&t.au(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];ag.ou(n,t._instance)&&t.au(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ag.nu(av);else if(!this.Oi.disable_web_experiments){if(es(this.su))return this.su=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ag.nu("applying feature flags",e),e.forEach(e=>{var t;if(this.su&&null!=(t=this.su)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.su)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.au(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=ag.getWindowLocation();if(null!=e&&e.search){var t=s$(null==e?void 0:e.search,"__experiment_id"),i=s$(null==e?void 0:e.search,"__experiment_variant");t&&i&&(ag.nu("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.lu(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Oi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Oi.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Oi.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}lu(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(ag.nu("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.au(r[0].name,t,r[0].variants[t].transforms))}static ou(e,t){return!es(e.conditions)&&ag.uu(e,t)&&ag.hu(e)}static uu(e,t){if(es(e.conditions)||es(null==(r=e.conditions)?void 0:r.url))return!0;var i=ag.getWindowLocation();if(i){var r,s,n,o,a=rW(t,i.href);return null==(s=e.conditions)||!s.url||af[null!=(n=null==(o=e.conditions)?void 0:o.urlMatchType)?n:"icontains"](e.conditions.url,a)}return!1}
1static getWindowLocation(){return null==s?void 0:s.location}static hu(e){if(es(e.conditions)||es(null==(i=e.conditions)?void 0:i.utm))return!0;var t=sz();if(t.utm_source){var i,r,s,n,o,a,l,u,h,c=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==t.utm_term;return c&&p&&v&&d}return!1}static nu(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];t3.info("[WebExperiments] "+e,i)}au(e,t,i){this._is_bot()?ag.nu(av):"control"!==t?i.forEach(i=>{if(i.selector){ag.nu("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):ag.nu("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?n7(o,this.Oi.custom_blocked_useragents):void 0}}var a_=t5("[Conversations]"),am="Conversations not available yet.",ay="console",ab="__posthogHandledLogsRequestError",aw=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[ab]=!0,i},ax=e=>!!e&&"object"==typeof e&&!0===e[ab],aE={featureFlags:class{constructor(e){this.name="featureFlags",this.du=!1,this.featureFlagEventHandlers=[],this.I=ao,this.vu={},this.cu={},this.fu=[],this.pu=!1,this.gu=!1,this.mu=0,this.yu=!1,this.bu=!1,this._u=!1,this.wu=!1,this.ku=0,this.Tt=()=>{var e=this.xu();this.ku=0,e&&this.reloadFeatureFlags()},"get"in e?this.Su=e:(this.Cu=new an(e.config,e.Js()),this.Su=this.Cu)}updateConfig(e,t){var i;null==(i=this.Cu)||i.update(e,t)}setup(e){var t,i;return this.Tu=e,this.I=e.logger.createLogger("[FeatureFlags]"),i=()=>{this.Tu===e&&(this.Tu=void 0,this.no=e,this.Mu(e))},null!=(t=e.kv.initialize())&&t.then?t.then(i):i()}Mu(e){if(this.no===e)return s&&rf(s,"online",this.Tt),this.Eu=e.registerDynamicEventProperties(()=>this.Iu()?this.vu:this.cu),this.Ru(),this.initialize()}destroy(){null==s||s.removeEventListener("online",this.Tt)}dispose(){var e;this.mu++,this.bu=!1,this.Tu=void 0,this.no&&(this.Pu(),null==(e=this.Eu)||e.dispose(),this.Eu=void 0,this.fu=[],null==s||s.removeEventListener("online",this.Tt),this.no=void 0)}get Oi(){return this.Su.get()}Au(e){var t;return null==(t=this.no)?void 0:t.kv.get(e)}Or(e){this.Fu(()=>{var t;return null==(t=this.no)?void 0:t.kv.set(e)})}Dr(e){this.Fu(()=>{var t;return null==(t=this.no)?void 0:t.kv.remove(e)})}Fu(e){try{e()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}Ru(){var e={};for(var t of[iP,iF,iR,iT]){var i=this.Au(t);ee(i)||(e[t]=i)}this.vu=e;var r=b({},e),s=this.Au(iS);if(s)for(var n of Object.entries(s))r["$feature/"+n[0]]=n[1];this.cu=r}Iu(){var e=this.Oi.cacheTtlMs;if(!e||0>=e)return!1;var t=this.Au(iG);return"number"!=typeof t||Date.now()-t>e}Ou(){return!!this.Iu()&&(this.wu||this.gu||(this.wu=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Lu(){var e=this.Oi.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}$u(){var e=this.Oi.flagKeys;if(!ee(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.Oi,r=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(r).length){var s,n,o=null!=(s=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?s:{},a=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>(e[t]=o[t],e),{});return this.Du({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var r,s,n=null!=i&&i.merge&&null!=(r=this.Au(iS))?r:{},o=null!=i&&i.merge&&null!=(s=this.Au(iF))?s:{},a=b({},n,e),l=b({},o,t),u={};for(var h of Object.entries(a)){var c=h[0],d=h[1];u[c]={key:c,enabled:E(d),variant:k(d),reason:void 0,metadata:ee(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.Du({flags:u})}get hasLoadedFlags(){return this.pu}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Au(iI),t=this.Au(iT),i=this.Au(iM);if(!i&&!t)return e||{};var r=ru({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=r[s],l=null==t?void 0:t[s],u=ee(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,h=ee(l)?null==a?void 0:a.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[s],d=b({},a,{enabled:u,variant:u?null!=h?h:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),h!==(null==a?void 0:a.variant)&&(
1d.original_variant=null==a?void 0:a.variant),c&&(d.metadata=b({},null==a?void 0:a.metadata,{payload:c,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),r[s]=d}return this.du||(this.I.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.du=!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var r=e[i];return{key:i,enabled:E(r),variant:k(r),payload:x(t[i])}})}getFlagVariants(){var e=this.Au(iS),t=this.Au(iT);if(!t)return e||{};for(var i=ru({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.du||(this.I.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.du=!0),i}getFlagPayloads(){var e=this.Au(iF),t=this.Au(iM);if(!t)return e||{};for(var i=ru({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.du||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.du=!0),i}reloadFeatureFlags(){this.yu||this.Oi.featureFlagsDisabled||this.xu()||this.Nu||(this.fu.slice().forEach(e=>{try{e()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}}),this.Nu=setTimeout(()=>{this.qu()},5))}Pu(){clearTimeout(this.Nu),this.Nu=void 0}onReloading(e){return this.fu.push(e),()=>{this.fu=this.fu.filter(t=>t!==e)}}ensureFlagsLoaded(){this.pu||this.gu||this.Nu||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.yu=e}resetFlagCallReported(){this.Dr(iU)}qu(e){this.Pu();var t=this.no;if(t&&!this.Oi.remoteRequestsDisabled&&!this.xu())if(this.gu)this.bu=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:b({},t.initialPersonProperties,this.Au(i$)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Au(iA),timezone:sQ()};ee(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.Oi.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Lu();r.length&&(i.evaluation_contexts=r);var s=this.$u();ee(s)||(i.flag_keys=s);var n=this.Oi.onlyEvaluateSurveyFeatureFlags,o=this.mu;this.gu=!0;var a=()=>{this.bu&&(this.bu=!1,this.qu())},l=e=>{this.gu=!1,o===this.mu&&(this.Or({[iV]:[au]}),this.I.error("Feature flag request failed",e)),a()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:"base64"===this.Oi.compression?s8:void 0,sentAt:"body",timeoutMs:this.Oi.requestTimeoutMs}).then(e=>{var t,r,s=null!=(t=e.json)?t:{},l=200!==e.statusCode;if(this.gu=!1,o===this.mu){if(this.ju(e.statusCode),l||this.bu||(this.$anon_distinct_id=void 0),!i.disable_flags||this.bu){this._u=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?au:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),s.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=s.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.Or({[iV]:u}),h?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.Du(s,l,{partialResponse:n}),a()}}else a()}).catch(l)}catch(e){l(e)}}}xu(){return sD(this.ku,3)}ju(e){this.ku=sj(e,this.ku,3,()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this._u)if(this.pu||this.getFlags()&&this.getFlags().length>0){if(!this.Ou()){var r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+e+al)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this._u)if(this.pu||this.getFlags()&&this.getFlags().length>0){if(!this.Ou()){var i,r=this.getFlagVariants(),s=e in r,n=r[e],o=this.getFlagPayloads()[e],a=String(n),l=this.Au(iR)||void 0,u=this.Au(iG)||void 0,h=this.Au(iU)||{};if(this.Oi.deduplicateCallsPerSession){var c,d=null==(c=this.no)?void 0:c.session.sessionId,p=this.Au(iz);d&&d!==p&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.Or({[iU]:h,[iz]:i});else if(e in h&&h[e].includes(a))i&&this.Or({[iU]:h,[iz]:i});
1else{Z(h[e])?h[e].push(a):h[e]=[a],this.Or(b({[iU]:h},i?{[iz]:i}:{}));var v=this.getFeatureFlagDetails(e),f=[...null!=(_=this.Au(iV))?_:[]];ee(n)&&f.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=o?o:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!=(m=null==(y=this.Oi.bootstrap)||null==(y=y.featureFlags)?void 0:y[e])?m:null,$feature_flag_bootstrapped_payload:null!=(w=null==(E=this.Oi.bootstrap)||null==(E=E.featureFlagPayloads)?void 0:E[e])?w:null,$used_bootstrap_value:!this._u};ee(null==v||null==(k=v.metadata)?void 0:k.has_experiment)||(g.$feature_flag_has_experiment=v.metadata.has_experiment),ee(null==v||null==(S=v.metadata)?void 0:S.version)||(g.$feature_flag_version=v.metadata.version);var _,m,y,w,E,k,S,P,O,I,F,R,C,T=null!=(P=null==v||null==(O=v.reason)?void 0:O.description)?P:null==v||null==(I=v.reason)?void 0:I.code;T&&(g.$feature_flag_reason=T),null!=v&&null!=(F=v.metadata)&&F.id&&(g.$feature_flag_id=v.metadata.id),ee(null==v?void 0:v.original_variant)&&ee(null==v?void 0:v.original_enabled)||(g.$feature_flag_original_response=ee(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(R=v.metadata)&&R.original_payload&&(g.$feature_flag_original_payload=null==v||null==(C=v.metadata)?void 0:C.original_payload),f.length&&(g.$feature_flag_error=f.join(",")),this.Bu(g)}if(s)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:x(o)}}}else this.I.warn('getFeatureFlagResult for key "'+e+al)}Bu(e){try{var t;null==(t=this.no)||t.capture("$feature_flag_called",e).catch(e=>{this.I.error("Failed to capture feature flag call",e)})}catch(e){this.I.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.Hu(e,t)}Hu(e,t){var i=this;return y(function*(){var r=i.no;if(r){var s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},n=i.Lu();n.length&&(s.evaluation_contexts=n);var o,a=i.$u();ee(a)||(s.flag_keys=a);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:"base64"===i.Oi.compression?s8:void 0,sentAt:"body",timeoutMs:i.Oi.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;o=(null==u?void 0:u[e])||void 0}catch(e){return void i.I.error("Remote config feature flag request failed",e)}try{t(o)}catch(e){i.I.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this._u)return t.defaultValue;if(!(this.pu||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+e+al),t.defaultValue;var i=this.getFeatureFlag(e,t);return ee(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.Du(e,t,i)}Du(e,t,i){if(this.no){this.pu=!0;var r=function(e,t,i,r,s,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===n&&(n=ao);var o,a,l=(o=n,(a=e.flags)?b({},e,{featureFlags:Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!=(t=a[e].variant)?t:a[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&o.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,p=e.evaluatedAt;if(Z(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var f=0;h.length>f;f++)v[h[f]]=!0;return{[iP]:h,[iS]:v,[iC]:!1}}var g=h,_=c,m=u;if(null!=s&&s.partialResponse)g=b({},t,g),_=b({},i,_),m=b({},r,m);else if(e.errorsWhileComputingFlags)if(u){var y=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));g=b({},t,Object.fromEntries(Object.entries(g).filter(e=>y.has(e[0])))),_=b({},i,Object.fromEntries(Object.entries(_||{}).filter(e=>y.has(e[0])))),m=b({},r,Object.fromEntries(Object.entries(m||{}).filter(e=>y.has(e[0]))))}else g=b({},t,g),_=b({},i,_),m=b({},r,m);return b({[iP]:Object.keys(ac(g)),[iS]:g||{},[iF]:_||{},[iI]:m||{},[iC]:!0===e.minimalFlagCalledEvents},d?{[iR]:d}:{},p?{[iG]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.Or(r),t||(this.wu=!1),this.zu(t)}}override(e,t){void 0===t&&(t=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Uu(e)}Uu(e){if(this.no){if(!1===e)return this.Dr([iT,iM]),this.zu(),void aa.info("All overrides cleared");if(Z(e))return this.Or({[iT]:ah(e)}),this.zu(),void aa.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.du=!!(null!=(t=e.suppressWarning)&&t);var t,i={},r=e.flags,s=e.payloads;
1return r&&(i[iT]=Z(r)?ah(r):r),s&&(i[iM]=s),Object.keys(i).length&&this.Or(i),!1===r&&!1===s?this.Dr([iT,iM]):!1===r?this.Dr(iT):!1===s&&this.Dr(iM),this.zu(),!1===r?aa.info("Flag overrides cleared"):r&&aa.info("Flag overrides set",{flags:r}),void(!1===s?aa.info("Payload overrides cleared"):s&&aa.info("Payload overrides set",{payloads:s}))}if(e&&"object"==typeof e)return this.Or({[iT]:e}),this.zu(),void aa.info("Flag overrides set",{flags:e});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.pu){var t=this.Wu(),i=t.flags,r=t.flagVariants;try{e(i,r)}catch(e){this.I.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.Au(iO)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(o.$early_access_feature_name=s.name),i&&(o.$feature_enrollment_stage=i);var a=b({},this.getFlagVariants(),{[e]:t});this.Or({[iP]:Object.keys(ac(a)),[iS]:a,[i$]:b({},this.Au(i$)||{},n)}),this.zu();try{null==(r=this.no)||r.capture("$feature_enrollment_update",o).catch(e=>{this.I.error("Failed to capture early access feature enrollment",e)})}catch(e){this.I.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.Au(iO);!r||t?this.Vu(e,i):e(r)}Vu(e,t){var i=this;return y(function*(){var r=i.no;if(r){var s,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i.Or({[iO]:s=o.json.earlyAccessFeatures})}catch(e){return void i.I.error("Early access feature request failed",e)}try{e(s)}catch(e){i.I.error("Early access feature callback failed",e)}}})()}Wu(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}zu(e){this.Ru();var t=this.Wu(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>{try{t(i,r,{errorsLoading:e})}catch(e){this.I.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Gu(e,t)}Gu(e,t){void 0===t&&(t=!0);var i=this.Au(i$)||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in i||(n[o]=s[o]));this.Or({[i$]:b({},i,n,r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=b({},this.Au(i$)||{});e.forEach(e=>{delete i[e]}),this.Or({[i$]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.Dr(i$),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.Au(iA)||{},r=b({},i);for(var s of Object.keys(e))r[s]=b({},i[s],e[s]);this.Or({[iA]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Au(iA)||{};this.Or({[iA]:b({},t,{[e]:{}})})}else this.Dr(iA)}reset(){this.mu++,this.bu=!1,this.vu={},this.cu={},this.pu=!1,this.yu=!1,this._u=!1,this.$anon_distinct_id=void 0,this.Pu(),this.du=!1,this.ku=0}}},ak=b({productTours:class{get xa(){return this._instance.persistence}constructor(e){this.ld=null,this.ud=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,r=e.config;if("productTours"in r){if(this.xa&&this.xa.register({[iv]:!!r.productTours}),!o1(this._instance))return!this.ld&&es(null==(t=this.xa)?void 0:t.props[iH])||o0.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.ld)||i.stop(),this.ld=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.ld&&o1(this._instance)&&this.Jn(()=>this.hd())}Jn(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?o0.error("Could not load product tours script",t):e()})}hd(){var e;!this.ld&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.ld=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Z(this.ud)||t){var i=this.xa;if(i){var r=i.props[iH];if(Z(r)&&!t)return this.ud=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(o1(this._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return 0===r?t.error||o0.warn(s):o0.error(s),void e([],{isLoaded:!1,error:s})}var n=Z(t.json.product_tours)?t.json.product_tours:[];this.ud=n,i&&i.register({[iH]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.ud,{isLoaded:!0})}getActiveProductTours(e){es(this.ld)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.ld.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.ld)||t.showTourById(e)}previewTour(e){this.ld?this.ld.previewTour(e):this.Jn(()=>{var t;this.hd(),null==(t=this.ld)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.ld)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.ld)||e.nextStep()}previousStep(){var e;null==(e=this.ld)||e.previousStep()}clearCache(){var e;this.ud=null,null==(e=this.xa)||e.unregister(iH)}resetTour(e){var t;null==(t=this.ld)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.ld)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.ld)||t.cancelPendingTour(e)}}},aE),aS=b({surveys:class{get Oi(){return this._instance.config}constructor(e){this.Ed=void 0,this._surveyManager=null,this.Id=!1,this.Rd=[],this.Pd=null,this.Ad=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Oi.disable_surveys){if(!e.ok)return oc.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(es(t))return oc.warn("Flags not loaded yet. Not loading surveys.");var i=Z(t);this.Ed=i?t.length>0:t,oc.info("flags response received, isSurveysEnabled: "+this.Ed),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(od)||null!=r&&r.startsWith("inProgressSurvey_"))&&t.push(r)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Id)oc.info("Already initializing surveys, skipping...");else if(this.Oi.disable_surveys)oc.info(ae);else if(this.Oi.cookieless_mode&&this._instance.consent.isOptedOut())oc.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!ee(this.Ed)||this.Oi.advanced_enable_surveys){var t=this.Ed||this.Oi.advanced_enable_surveys;this.Id=!0;try{var i=e.generateSurveys;if(i)return void this.Fd(i,t);var r=e.loadExternalDependency;if(!r)return void this.Od(i6);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.Od("Could not load surveys script",i):this.Fd(e.generateSurveys,t)})}catch(e){throw this.Od("Error initializing surveys",e),e}finally{this.Id=!1}}}else oc.error("PostHog Extensions not found.")}}Fd(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new o7(this._instance),oc.info("Surveys loaded successfully"),this.Ld({isLoaded:!0})}Od(e,t){oc.error(e,t),this.Ld({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Rd.push(e),this._surveyManager&&this.Ld({isLoaded:!0}),()=>{this.Rd=this.Rd.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Oi.disable_surveys)return oc.info(ae),e([]);var i,r=this._instance.get_property(iD);r&&!t?(e(r,{isLoaded:!0}),this.$d()&&this.getSurveys(()=>{},!0)):"u">typeof Promise&&this.Pd?this.Pd.then(t=>e(t.surveys,t.context)):("u">typeof Promise&&(this.Pd=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Oi.token),method:"GET",timestampMode:"query",timeout:this.Oi.surveys_request_timeout_ms,callback:t=>{this.Pd=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;0!==r?oc.error(s):t.error||oc.warn(s),this.Ad=Date.now();var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}this.Ad=null;var o,a,l=t.json.surveys||[],u=l.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(oh(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[iD]:l,[ij]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}$d(){return this.Dd()&&!this.Pd&&!this.Nd()}Dd(){var e=this._instance.get_property(ij);return en(e)&&Date.now()-e>3e5}Nd(){return en(this.Ad)&&3e5>Date.now()-this.Ad}markSurveyAsSeen(e,t){var i;op({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}Ld(e){for(var t of this.Rd)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){oc.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!es(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);oc.warn("init was not called")}qd(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}jd(e){if(es(this._surveyManager))return{eligible:!1,reason:o9};var t="string"==typeof e?this.qd(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Bd(e){if(es(this._surveyManager))return{eligible:!1,reason:o9};var t="string"==typeof e?this.qd(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(es(this._surveyManager))return oc.warn("init was not called"),{visible:!1,disabledReason:o9};var t=this.Bd(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return es(this._surveyManager)?(oc.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:o9})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.Bd(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(es(this._surveyManager))oc.warn("init was not called");else{var s="string"==typeof e?this.qd(e):e;if(null!=s&&s.id)if(ov.includes(s.type)){var n=null==a?void 0:a.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(oc.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;oc.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,n,i),oc.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);oc.warn("Survey element not found")}else oc.warn("Surveys of type "+s.type+" cannot be rendered in the app");else oc.warn("Survey not found")}}displaySurvey(e,t){var i;if(es(this._surveyManager))oc.warn("init was not called");else{var r=this.qd(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=b({},r,{appearance:b({},r.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==ni&&t.initialResponses&&oc.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.jd(r);if(!n.eligible)return void oc.warn("Survey is not eligible to be displayed: ",n.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else oc.warn("Survey not found")}}cancelPendingSurvey(e){es(this._surveyManager)?oc.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},aE),aP=b({experiments:ag},aE),aO=b({},aE,{sessionRecording:class{get Oi(){return this._instance.config}get xa(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Zu)||!e.isStarted)}get status(){var e,t;return this.Qu===oJ||this.Qu===oK?this.Qu:null!=(e=null==(t=this.Zu)?void 0:t.status)?e:this.Qu}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Qu=oG,this.Ju=void 0,this.Ku=!1,this.kt=(()=>{if(null==a||!a.visibilityState||"visible"===a.visibilityState)return!0;var e,t=null==s||null==(e=s.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.It=()=>{var e;"visible"===(null==a?void 0:a.visibilityState)&&(this.kt=!0,null==(e=this.Zu)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw oY.error("started without valid sessionManager"),Error(oZ+" started without valid sessionManager. This is a bug.");if(this.Oi.cookieless_mode===i4)throw Error(oZ+' cannot be used with cookieless_mode="always"');null!=a&&a.addEventListener&&rf(a,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Ku=!0,null==a||null==a.removeEventListener||a.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Yu(){var e,t=!(null==(e=this._instance.get_property(i_))||!e.enabled),i=!this.Oi.disable_session_recording,r=this.Oi.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!(this.Ku||this.Yu&&null!=(t=this.Zu)&&t.isStarted)){var i=!ee(Object.assign)&&!ee(Array.from);this.Yu&&i?(this.Xu(e),oY.info("starting")):(this.Qu=oG,this.stopRecording())}}Xu(e){var t,i,r;this.Yu&&(this.Qu!==oJ&&this.Qu!==oK&&(this.Qu=oW),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.th(e):null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.eh,t=>{if(t)return this._instance.register_for_session({[i5]:!0}),oY.error("could not load recorder",t);this.th(e)}))}stopRecording(){var e,t;null==(e=this.Ju)||e.call(this),this.Ju=void 0,null==(t=this.Zu)||t.stop()}ih(){var e,t;null==(e=this.Ju)||e.call(this),this.Ju=void 0,null==(t=this.Zu)||t.discard()}rh(){var e,t;null==(e=this.xa)||e.unregister(ik),null==(t=this.xa)||t.unregister(im)}nh(e,t){if(es(e))return null;var i=en(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(oY.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}sh(e){if(this.xa){var t,i,r=this.xa,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.nh(null==(t=this.Oi.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.nh(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=s?s:n;es(o)&&this.rh();var a=null==i?void 0:i.minimumDurationMilliseconds;r.register({[i_]:b({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:b({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:o,minimumDurationMilliseconds:ee(a)?null:a,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.Ju)||t.call(this),this.Ju=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.sh(t),void this.ih()):(this.sh(t),void this.startIfEnabledOrStop()):(this.Qu===oJ&&(this.Qu=oK,oY.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.Zu)&&i.log?this.Zu.log(e,t):oY.warn("log called before recorder was ready")}get eh(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(i_);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}ah(){var e,t=this._instance.get_property(i_);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return oY.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!es(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}th(e){var t,i,r,s;if(!this.Ku){if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return oY.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[i5]:!0});if(this.Zu||(this.Zu=null==(s=g.__PosthogExtensions__)?void 0:s.initSessionRecording(this._instance,this.kt),this.Zu._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ah()){if(this.Qu===oK||this.Qu===oJ)return;return this.Qu=oJ,oY.info("persisted remote config is stale, requesting fresh config before starting"),void new no(this._instance).load()}this.Qu=oW,null==(i=(r=this.Zu).setDocumentWasEverVisible)||i.call(r,this.kt),this.Zu.start(e)}}onRRwebEmit(e){var t;null==(t=this.Zu)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Zu||null==(t=this.xa)||t.register({[ib]:!0}),null==(e=this.Zu)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Zu||null==(t=this.xa)||t.register({[iy]:!0}),null==(e=this.Zu)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Zu||null==(i=this.xa)||i.register({["url"===e?iw:ix]:!0}),null==(t=this.Zu)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Zu)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Zu)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.oh=!1,this.lh=null,this.uh=!1,this.hh=!1,this.instance=e,this.rageclicks=new oj(e.config.rageclick),this.dh=null}initialize(){this.startIfEnabled()}get Oi(){var e,t,i=Q(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}fh(){if(this.isBrowserSupported()){if(s&&a){var e=e=>{e=e||(null==s?void 0:s.event);try{this.ph(e)}catch(e){oB.error("Failed to capture event",e)}};if(rf(a,"submit",e,{capture:!0}),rf(a,"change",e,{capture:!0}),rf(a,"click",e,{capture:!0}),this.Oi.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event);try{this.ph(e,oN)}catch(e){oB.error("Failed to capture copy/cut event",e)}};rf(a,"copy",t,{capture:!0}),rf(a,"cut",t,{capture:!0})}}}else oB.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.oh&&(this.fh(),this.oh=!0)}onRemoteConfig(e){if(this.uh=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.hh=t.elementsChainAsString);var i=t.autocapture_opt_out;ea(i)&&(this.instance.persistence&&this.instance.persistence.register({[ia]:i}),this.lh=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.dh=e}getElementSelectors(e){var t,i=[];return null==(t=this.dh)||t.forEach(t=>{var r=null==a?void 0:a.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[ia],r=this.lh,s=this.instance.Js()&&!this.uh;if(er(r)&&!ea(i)&&!s)return!1;var n=null!=(t=this.lh)?t:!!i;return!!this.instance.config.autocapture&&!n}ph(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=r6(e);rQ(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&sn(r,this.instance.config.rageclick)&&this.ph(e,"$rageclick");var n=t===oN;if(r&&function(e,t,i,r,n,o){if(!s||so(e)||null!=i&&i.url_allowlist&&!r1(i.url_allowlist,o)||null!=i&&i.url_ignorelist&&r1(i.url_ignorelist,o))return!1;if(null!=i&&i.dom_event_allowlist){var a,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=sa(e,r),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(ee(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(c,i)||!r4(c,null==i?void 0:i.css_selector_allowlist)||r4(c,null!=(a=null==i?void 0:i.css_selector_ignorelist)?a:r9))return!1;try{var d=s.getComputedStyle(e);
1if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(r8.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Oi,n,n?["copy","cut"]:void 0,this.instance)){var o=function(e,t){var i,r,n=t.e,o=t.maskAllElementAttributes,a=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!rZ(e))return{props:{}};for(var c=[e],d=new Set([e]),p=e;p.parentNode&&!rY(p,"body")&&1e3>c.length;)if(rX(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),c.push(v),p=v}else{if(!rZ(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}var f,g=[],_={},m=!1,y=!1;if(rl(c,e=>{var t=sl(e);if(rY(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&sg(i))&&(h?tv(i):i)}U(r2(e),"ph-no-capture")&&(y=!0),g.push(function(e,t,i,r,s){void 0===s&&(s=!1);var n=e.tagName.toLowerCase(),o={tag_name:n};r8.indexOf(n)>-1&&!i&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?oq(1024,s_(e)):oq(1024,r5(e)));var a=r2(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),rl(e.attributes,function(i){var n;if((!su(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&sg(i.value)&&(!et(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var a=i.value;"class"===i.name&&(a=r0(a).join(" ")),o["attr__"+i.name]=oq(1024,"href"===i.name&&s?tv(a):a)}});for(var l=1,u=1,h=e;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rZ(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h)),ru(_,function(e){if(!sl(e))return{};var t={};return rl(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&sg(r)&&(t[i]=r)}}),t}(e))}),y)return{props:{},explicitNoCapture:y};if(a||(g[0].$el_text=rY(e,"a")||rY(e,"button")?s_(e):r5(e)),m){g[0].attr__href=m;var w,x,E=null==(w=sM(m))?void 0:w.host,k=null==s||null==(x=s.location)?void 0:x.host;E&&k&&E!==k&&(f=m)}return{props:ru({$event_type:n.type,$ce_version:1},u?{}:{$elements:g},{$elements_chain:g.map(e=>{var t,i,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return Z(t)?t:r0(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return rh(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>r.attributes[e[0]]=e[1]),r}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=b({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return rh(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return o[sm(e[0].toString())]=sm(t.toString())}),(r+=":")+rh(o).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(i=g[0])&&i.$el_text?{$el_text:null==(r=g[0])?void 0:r.$el_text}:{},f&&"click"===n.type?{$external_click_url:f}:{},_)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oi.element_attribute_ignorelist,elementsChainAsString:this.hh,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=o.props;if(o.explicitNoCapture)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===oN){var u,h=r3(null==s||null==(u=s.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!h)return!1;a.$selected_content=h,a.$copy_type=c}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Y(null==a?void 0:a.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.gh=(null==s||null==(t=s.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(t3.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.mh&&this.mh(),this.mh=void 0,t3.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.yh("pushState"),this.yh("replaceState"),this.bh())}yh(e){var t;if(s&&(null==(t=s.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return oU;
1var r={next:e[t]},s=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return r.next.apply(this,t)});Y(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=s}catch(e){return oU}}(s.history,e,t=>function(r,s,n){t.call(this,r,s,n),i._h(e)})}}_h(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.gh&&this.isEnabled&&this._instance.capture(rr,{navigation_type:e}),this.gh=i}catch(t){t3.error("Error capturing "+e+" pageview",t)}}bh(){if(!this.mh){var e=()=>{this._h("popstate")};rf(s,"popstate",e),this.mh=()=>{s&&s.removeEventListener("popstate",e)}}}},heatmaps:class{get Oi(){return this.instance.config}constructor(e){var t;this.wh=!1,this.oh=!1,this.kh=null,this.instance=e,this.wh=!(null==(t=this.instance.persistence)||!t.props[il]),this.rageclicks=new oj(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Q(this.Oi.capture_heatmaps)&&this.Oi.capture_heatmaps.flush_interval_milliseconds&&(e=this.Oi.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return es(this.Oi.capture_heatmaps)?es(this.Oi.enable_heatmaps)?this.wh:this.Oi.enable_heatmaps:!1!==this.Oi.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.oh||(oQ.info("starting..."),this.xh(),this.It());else{var e;clearInterval(null!=(e=this.kh)?e:void 0),this.Sh(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[il]:i}),this.wh=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.ft;return this.ft=void 0,e}Ch(e){oX(e.originalEvent)&&this.mi(e.originalEvent,"deadclick")}It(){this.kh&&clearInterval(this.kh),this.kh="visible"===(null==a?void 0:a.visibilityState)?setInterval(this.ca.bind(this),this.flushIntervalMilliseconds):null}xh(){s&&a&&(this.Th=this.ca.bind(this),rf(s,ri,this.Th),this.Mh=e=>this.mi(e||(null==s?void 0:s.event)),rf(a,"click",this.Mh,{capture:!0}),this.Eh=e=>this.Ih(e||(null==s?void 0:s.event)),rf(a,"mousemove",this.Eh,{capture:!0}),this.Rh=new sx(this.instance,sb,this.Ch.bind(this)),this.Rh.startIfEnabledOrStop(),this.Ph=this.It.bind(this),rf(a,rt,this.Ph),this.oh=!0)}Sh(){var e;s&&a&&(this.Th&&s.removeEventListener(ri,this.Th),this.Mh&&a.removeEventListener("click",this.Mh,{capture:!0}),this.Eh&&a.removeEventListener("mousemove",this.Eh,{capture:!0}),this.Ph&&a.removeEventListener(rt,this.Ph),clearTimeout(this.Ah),null==(e=this.Rh)||e.stop(),this.oh=!1)}Fh(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&rZ(r)&&!rY(r,"body")&&r!==i;){var n,o,a,l=void 0;try{l=null==(n=null!=(o=null==(a=r.ownerDocument)?void 0:a.defaultView)?o:s)?void 0:n.getComputedStyle(r).position}catch(e){break}if(U(t,l))return!0;r=r7(r)}return!1}(r6(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}mi(e,t){var i;if(void 0===t&&(t="click"),!rK(e.target)&&oX(e)){var r=this.Fh(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sn(r6(e),this.instance.config.rageclick)&&this.Fn(b({},r,{type:"rageclick"})),this.Fn(r)}}Ih(e){!rK(e.target)&&oX(e)&&(clearTimeout(this.Ah),this.Ah=setTimeout(()=>{this.Fn(this.Fh(e,"mousemove"))},500))}Fn(e){if(s){var t=this.Oi.disable_capture_url_hashes?tv(s.location.href):s.location.href,i=this.Oi.custom_personal_data_properties,r=sA(t,this.Oi.mask_personal_data_properties?[...sB,...i||[]]:[],sH);this.ft=this.ft||{},this.ft[r]||(this.ft[r]=[]),this.ft[r].push(e)}}ca(){this.ft&&!X(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:sx,webVitalsAutocapture:class{constructor(e){var t;this.wh=!1,this.oh=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Oh=()=>{clearTimeout(this.Lh),this.Lh=void 0,0!==this.ft.metrics.length&&(this._instance.capture("$web_vitals",b({$current_url:this.ft.url},this.ft.metrics.reduce((e,t)=>
1b({},e,{["$web_vitals_"+t.name+"_event"]:b({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.$h=e=>{var t;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},es(null==e?void 0:e.name)||es(null==e?void 0:e.value))oV.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,r=this.Dh(i);if(!ee(r)){var s=en(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+r;if(!this.Nh||this.Nh>e.value){this.ft.navigationKey!==s&&(this.Oh(),this.Lh=setTimeout(this.Oh,this.flushToCaptureTimeoutMs)),ee(this.ft.navigationKey)&&(this.ft.navigationKey=s,this.ft.url=r),this.ft.firstMetricTimestamp=ee(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=b({},e,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});ee(n)||(o.$session_id=n.sessionId,o.$window_id=n.windowId),this.ft.metrics.push(o),this.ft.metrics.length===this.allowedMetrics.length&&this.Oh()}else oV.error("Ignoring metric with value >= "+this.Nh,e)}}},this.qh=()=>{if(!this.oh){var e,t,i,r,s=g.__PosthogExtensions__,n=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==n?void 0:n[this.jh])||("web-vitals"===this.jh&&ee(n)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(ee(o)||(e=o.onLCP,t=o.onCLS,i=o.onFCP,r=o.onINP),e&&t&&i&&r){var a={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&e(this.$h.bind(this),a),this.allowedMetrics.indexOf("CLS")>-1&&t(this.$h.bind(this),a),this.allowedMetrics.indexOf("FCP")>-1&&i(this.$h.bind(this),a),this.allowedMetrics.indexOf("INP")>-1&&r(this.$h.bind(this),a),this.oh=!0}else oV.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.wh=!(null==(t=this._instance.persistence)||!t.props[id]),this.startIfEnabled()}get Bh(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=Q(this.Bh)?null==(e=this.Bh)?void 0:e.web_vitals_allowed_metrics:void 0;return es(i)?(null==(t=this._instance.persistence)?void 0:t.props[ig])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Q(this.Bh)?this.Bh.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Q(this.Bh)?this.Bh.web_vitals_attribution:void 0;return null!=e&&e}get useSoftNavs(){var e=Q(this.Bh)?this.Bh.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Nh(){var e=Q(this.Bh)&&en(this.Bh.__web_vitals_max_value)?this.Bh.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return oV.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Q(this.Bh)?this.Bh.web_vitals:ea(this.Bh)?this.Bh:void 0;return ea(t)?t:this.wh}startIfEnabled(){this.isEnabled&&!this.oh&&(oV.info("enabled, starting..."),this.Jn(this.qh))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=Q(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Q(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[id]:i}),this._instance.persistence.register({[ig]:r})),this.wh=i,this.startIfEnabled()}}}get jh(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Jn(e){var t=g.__PosthogExtensions__,i=this.jh,r=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&ee(r)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?oV.error("failed to load script",t):e()})}Dh(e){var t=e||(null==s?void 0:s.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tv(t):t,r=this._instance.config.custom_personal_data_properties;return sA(i,this._instance.config.mask_personal_data_properties?[...sB,...r||[]]:[],sH)}oV.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.qh=()=>{var e;if(s&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Hh&&this.Oi.capture_unhandled_errors&&(this.Hh=t(this.captureException.bind(this))),!this.zh&&this.Oi.capture_unhandled_rejections&&(this.zh=i(this.captureException.bind(this))),!this.Uh&&this.Oi.capture_console_errors&&(this.Uh=r(this.captureException.bind(this)))}catch(e){oH.error("failed to start",e),this.Wh()}}},this._instance=e,this.Vh=!(null==(t=this._instance.persistence)||!t.props[iu]),this.oe=new em(b({},function(e){var t,i,r,s;return void 0===e&&(e={}),{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(r=null!=(s=e.exceptionRateLimiterBucketSize)?s:e.__exceptionRateLimiterBucketSize)?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:oH})),this.Oi=this.Gh(),this.startIfEnabledOrStop()}Gh(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Q(e)?t=b({},t,e):(ee(e)?this.Vh:e)&&(t=b({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}
1get isEnabled(){return this.Oi.capture_console_errors||this.Oi.capture_unhandled_errors||this.Oi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(oH.info("enabled"),this.Wh(),this.Jn(this.qh)):this.Wh()}Jn(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return oH.error("failed to load script",t);e()})}Wh(){var e,t,i;null==(e=this.Hh)||e.call(this),this.Hh=void 0,null==(t=this.zh)||t.call(this),this.zh=void 0,null==(i=this.Uh)||i.call(this),this.Uh=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Vh=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[iu]:this.Vh}),this.Oi=this.Gh(),this.startIfEnabledOrStop())}}onConfigChange(){this.Oi=this.Gh()}captureException(e){var t,i,r,s=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.oe.consumeRateLimit(s)?oH.info("Skipping exception capture because of client rate limiting.",{exception:s}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.Zh=[],this.Qh=new tI([new tN,new tK,new tq,new tB,new tW,new tG,new tU,new tJ],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),o=r;n.length>o;o++){var a=n[o];if(1024>=a.length){var l=tj.test(a)?a.replace(tj,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){s.push(h);break}}if(s.length>=50)break}}}if(!s.length)return[];var c=Array.from(s);return c.reverse(),c.slice(0,50).map(e=>b({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",t$,tD)),this._instance=e,this.Zh=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(ih))?t:[],this.Jh=t0(this.Kh()),this.Yh=new t1(this.Jh)}onConfigChange(){this.Jh=t0(this.Kh()),this.Yh.setConfig(this.Jh)}onRemoteConfig(e){var t,i,r;if(e.ok){var s=e.config;if("errorTracking"in s){var n=null!=(t=null==(i=s.errorTracking)?void 0:i.suppressionRules)?t:[],o=null==(r=s.errorTracking)?void 0:r.captureExtensionExceptions;this.Zh=n,this._instance.persistence&&this._instance.persistence.register({[ih]:this.Zh,[ic]:o})}}}get Xh(){var e,t=!!this._instance.get_property(ic),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Qh.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Jh.enabled)try{if(!et(e)||0===e.trim().length)return void ad.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(tQ.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(this.td(t)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&ad.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Yh.add(b({[tZ]:e,[tY]:(new Date).toISOString()},r))}catch(e){ad.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.ed(i)){if(this.rd(i))return this.nd("Exception dropped: matched a suppression rule"),void ad.info("Skipping exception capture because a suppression rule matched");if(!this.Xh&&this.sd(i))return this.nd("Exception dropped: thrown by a browser extension"),void ad.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ad(i))return this.nd("Exception dropped: thrown by the PostHog SDK"),void ad.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Jh.enabled&&es(e.$exception_steps)?this.od(e):e,s="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;s&&(r.$release_id=s);try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Wo:!0});return n&&this.Yh.clear(),n}catch(e){return ad.error("Failed to capture exception event. Dropping this exception.",e),void this.Yh.clear()}}catch(e){return void ad.error("Failed to process exception event. Ignoring this exception.",e)}}od(e){try{var t=this.Yh.getAttachable();return 0===t.length?e:b({},e,{$exception_steps:t})}catch(t){return ad.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}nd(e){this.Jh.enabled&&this.Yh.add({[tZ]:e,[tY]:(new Date).toISOString()})}td(e){return Q(e)?b({},e):{}}Kh(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}rd(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>
1{var i=t.type,r=t.value;return et(i)&&i.length>0&&e.$exception_types.push(i),et(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Zh.some(e=>{var i=e.values.map(e=>{var i=oi[e.operator],r=t[e.key];if(!i||!r)return!1;var s=Z(e.value)?e.value:[e.value];return s.length>0&&i(s,r)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return ad.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}sd(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>{var t=e.filename;return!!t&&ap.some(e=>t.startsWith(e))})}ad(e){if(e.length>0){var t,i,r,s,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}ed(e){return!es(e)&&Z(e)}}},ak,{siteApps:class{constructor(e){this.dd=0,this._instance=e,this.vd=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}fd(e,t){if(t){var i=this.globalsForEvent(t);this.vd.push(i),this.vd.length>1e3&&(this.vd=this.vd.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.fd.bind(this));this.pd=()=>{e(),this.vd=[],this.pd=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,o,a,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var c=h[0];l[c]={id:u[c],type:c,properties:h[1]}}var d=e.$set_once,p=e.$set;return{event:b({},w(e,o2),{properties:b({},e.properties,p?{$set:b({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:b({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}gd(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(o3.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(o3.error("prepare_external_dependency_script returned null"),null):e}md(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,r,s,n,o,l,u=null==a?void 0:a.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.dd++,this.yd)return this.bd();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var r=e[t];e[t]=i(r),c.push(()=>{e[t]=r})}},f=e=>{if(p.has(e))return e;var t=d.gd(e);return t&&p.add(t),t},g=e=>e.map(e=>"string"==typeof e?e:f(e)).filter(e=>!er(e));return v(h,"appendChild",e=>function(t){var i=f(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var r=f(t);return r?e.call(this,r,i):t}),v(h,"replaceChild",e=>function(t,i){var r=f(t);return r?e.call(this,r,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(r=u.DocumentFragment)?void 0:r.prototype].forEach(e=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,g(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,g(i))})}),[null==(s=u.Element)?void 0:s.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,g(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,g(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];var s=g(i);return i.length&&!s.length?void 0:e.apply(this,s)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var r=f(i);return r?e.call(this,t,r):null}),this.yd=()=>
1{c.forEach(e=>e()),this.yd=void 0},this.bd()}bd(){var e=!1;return()=>{var t;e||(e=!0,this.dd--,0===this.dd&&(null==(t=this.yd)||t.call(this)))}}_d(e,t){void 0===t&&(t=!0);var i=this.md();try{var r=e(i);return t&&i(),r}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.vd.length&&(o3.info("Processing "+this.vd.length+" events for site app with id "+e.id),this.vd.forEach(e=>this._d(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.pd)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,o3.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var n=this._d(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1).processEvent;n&&(t.processEvent=n),r=!0}catch(t){o3.error(o5+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){o3.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}wd(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}kd(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),r=function(r){try{t._d(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(t){o3.error("Error while processing event "+e.event+" for site app "+r.id,t)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.wd(),void this._instance.on("eventCaptured",e=>this.kd(e))):void o3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.pd)||i.call(this),e.ok){var n=e.config;if(null!=(r=n.siteApps)&&r.length)if(this.isEnabled)for(var o of n.siteApps)!function(){var e,t=o.id,i=o.url;g["__$$ph_site_app_"+t]=s._instance,null==(e=g.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(s._instance,i,e=>{if(e)return o3.error(o5+t,e)})}();else o3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},aS,{tracingHeaders:class{constructor(e){this.xd=void 0,this.Sd=void 0,this.Cd=void 0,this.qh=()=>{var e,t,i=this.Td();i?(ee(this.xd)&&(this.xd=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ee(this.Sd)&&(this.Sd=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Wh()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Jn(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return oz.error("failed to load script",t);e()})}Md(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Td(){var e=this.Md();return Z(e)?(Z(this.Cd)?this.Cd.splice(0,this.Cd.length,...e):this.Cd=[...e],e.length>0?this.Cd:void 0):(Z(this.Cd)&&this.Cd.splice(0),this.Cd=e||void 0,this.Cd)}Wh(){var e,t;null==(e=this.xd)||e.call(this),null==(t=this.Sd)||t.call(this),this.xd=void 0,this.Sd=void 0}startIfEnabledOrStop(){this.Td()?this.Jn(this.qh):this.Wh()}}},{toolbar:class{constructor(e){this.instance=e}Hd(e){g.ph_toolbar_state=e}zd(){var e;return null!=(e=g.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),rg(this.instance.config)||!s||!a)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=at||sL(e.hash,"__posthog")||sL(e.hash,"state"),o=n?rc(()=>JSON.parse(atob(decodeURIComponent(n))))||rc(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ai)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}Ud(e){var t=g.ph_load_toolbar||g.ph_load_editor;!es(t)&&Y(t)?t(e,this.instance):ar.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==a||!a.getElementById(rJ));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=b({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(ai,JSON.stringify(b({},n,{source:void 0}))),2===this.zd())?this.Ud(n):0===this.zd()&&(this.Hd(1),null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(ar.error("[Toolbar] Failed to load",e),this.Hd(0)):(this.Hd(2),this.Ud(n))}),rf(s,"turbolinks:load",()=>{this.Hd(0),this.loadToolbar(n)})),!0}Wd(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}},aP,{conversations:class{constructor(e){this.Vd=void 0,this._conversationsManager=null,this.Gd=!1,this.Me=null,this.Zd=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Qd=e.ok,e.ok)){var t=e.config.conversations;es(t)||(ea(t)?this.Vd=t:(this.Vd=t.enabled,this.Me=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Vd=void 0,this.Me=null,this.Qd=void 0,this.Zd=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Gd||this._instance.config.disable_conversations||rg(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!ee(this.Vd)&&this.Vd)if(this.Me&&this.Me.token){this.Gd=!0;try{var t=e.initConversations;if(t)return this.Jd(t),void(this.Gd=!1);var i=e.loadExternalDependency;if(!i)return void this.Kd(i6);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Kd("Could not load conversations script",t):this.Jd(e.initConversations),this.Gd=!1})}catch(e){this.Kd("Error initializing conversations",e),this.Gd=!1}}else a_.error("Conversations enabled but missing token in remote config.")}}Jd(e){if(this.Me)try{this._conversationsManager=e(this.Me,this._instance),this.Zd=!1,a_.info("Conversations loaded successfully")}catch(e){this.Kd("Error completing conversations initialization",e)}else a_.error("Cannot complete initialization: remote config is null")}Kd(e,t){a_.error(e,t),this._conversationsManager=null,this.Gd=!1,this.Zd=!0}show(){this._conversationsManager?this._conversationsManager.show():a_.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Vd&&!er(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":rg(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Qd?"remote_config_failed":ee(this.Vd)?this.Qd?"disabled_in_project":"remote_config_pending":this.Vd?es(this.Me)||!this.Me.token?"missing_token":null!=g&&g.__PosthogExtensions__?this.Gd?"initializing":this.Zd?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return y(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(a_.warn(am),null)})()}getMessages(e,t){var i=this;return y(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(a_.warn(am),null)})()}markAsRead(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(a_.warn(am),null)})()}getTickets(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(a_.warn(am),null)})()}requestRestoreLink(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(a_.warn(am),null)})()}restoreFromToken(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(a_.warn(am),null)})()}restoreFromUrlToken(){var e=this;return y(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(a_.warn(am),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}tl(){var e;null==(e=this._conversationsManager)||e.setIdentity()}el(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.Yd=!1,this.Xd=!1,this.I=t5("[logs]"),this.tv=b({},this.I,{error(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];t.some(ax)||i.I.error(...t)}}),this.ea=[],this.ev=[],this.ku=0,this.iv=()=>{var e,t;this.ku=0,null==(e=this.rv)||e.onReconnect(),null==(t=this.nv)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Yd=!0),s&&rf(s,"online",this.iv)}sv(e,t,i,r){var s,n,o,a,l,u,h,c,d,p,v,f,g,_,m=(s=null==(_=this._instance)||null==(_=_.config)?void 0:_.logs,d=null!=(n=null==s?void 0:s.flushIntervalMs)?n:3e3,p=null!=(o=null==s?void 0:s.maxBufferSize)?o:100,f=ee(v=null!=i&&i.consoleCapture?void 0:null!=(a=null==s?void 0:s.maxLogsPerInterval)?a:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!=(l=null!=(u=null==(g=null==s?void 0:s.resourceAttributes)?void 0:g["service.name"])?u:null==s?void 0:s.serviceName)?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!=(h=null==g?void 0:g["service.version"])?h:null==s?void 0:s.serviceVersion,environment:null!=(c=null==g?void 0:g["deployment.environment"])?c:null==s?void 0:s.environment,resourceAttributes:g,beforeSend:null==s?void 0:s.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tE(this.av(e,t),m,this.tv,()=>this.ov(),e=>e(),void 0,r),m]}lv(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.rv||this.uv!==t){null==(i=this.rv)||i.reset(),this.uv=t;var i,r=this.sv(()=>this.ea,e=>{this.ea=e});this.rv=r[0],this.hv=r[1]}return this.rv}dv(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.nv||this.vv!==t){null==(i=this.nv)||i.reset(),this.vv=t;var i,r=this.sv(()=>this.ev,e=>{this.ev=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ay);this.nv=r[0],this.fv=r[1]}return this.nv}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!es(i)&&i&&(this.Yd=!0,this.loadIfEnabled())}}reset(){var e,t;this.ea=[],null==(e=this.rv)||e.reset(),this.ev=[],null==(t=this.nv)||t.reset(),this.ku=0}captureLog(e){this.lv().captureLog(e)}ui(e){this.dv().captureLog(e)}get logger(){return this.pv||(this.pv={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.pv}flushLogs(e){e?this.gv(e):(this.rv&&this.rv.flush().catch(e=>this.mv(e)),this.nv&&this.nv.flush().catch(e=>this.mv(e)))}mv(e){ax(e)||this.I.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Yd&&!this.Xd){var e=null==g?void 0:g.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.I.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.Xd=!0)}):this.I.error(i6)}else this.I.error("PostHog Extensions not found.")}}av(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===R.LogsQueue?e():void 0,setPersistedProperty(e,i){e===R.LogsQueue&&t(null!=i?i:[])},kn:e=>this.kn(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}kn(e){return new Promise(t=>{if(sD(this.ku,3))t({kind:"fatal",error:aw(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=e=>{i||(i=!0,clearTimeout(s),t(e))},s=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:aw(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.yv(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.bv(i),i>=200&&300>i)?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:aw(e.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}bv(e){(0!==e||this._instance.__loaded)&&(this.ku=sj(e,this.ku,3,()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}gv(e){this.ea.length>0&&this._v(e,this.ea,this.hv,_.LIB_NAME,e=>{this.ea=e}),this.ev.length>0&&this._v(e,this.ev,this.fv,ay,e=>{this.ev=e})}_v(e,t,i,r,s){if(0!==t.length){var n=t.map(e=>e.record);s([]);var o=tx(n,tw(i,_.LIB_NAME,_.LIB_VERSION),r,_.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yv(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}yv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ov(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,s=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=r,es(s)||(t.sessionStartTimestamp=s),es(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tv(g.location.href):g.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},{metrics:class{constructor(e){this.I=t5("[metrics]"),this._instance=e}initialize(){}lv(){var e,t,i,r,s,n,o,a,l=null==(o=this._instance)||null==(o=o.config)?void 0:o.metrics;return this.rv&&this.uv===l||(null==(a=this.rv)||a.reset(),this.uv=l,this.rv=new tO(this.av(),{serviceName:null!=(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])?e:null==l?void 0:l.serviceName,serviceVersion:null!=(t=null==n?void 0:n["service.version"])?t:null==l?void 0:l.serviceVersion,environment:null!=(i=null==n?void 0:n["deployment.environment"])?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(r=null==l?void 0:l.flushIntervalMs)?r:1e4,maxSeriesPerFlush:null!=(s=null==l?void 0:l.maxSeriesPerFlush)?s:1e3},this.I)),this.rv}count(e,t,i){void 0===t&&(t=1),this.lv().count(e,t,i)}
1gauge(e,t,i){this.lv().gauge(e,t,i)}histogram(e,t,i){this.lv().histogram(e,t,i)}flush(e){if(!this.rv)return Promise.resolve();if(e){var t=this.rv.drainWindow();return t&&this.Nn(t,e),Promise.resolve()}return this.rv.flush().catch(e=>this.I.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.rv)||e.reset()}av(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Nn:e=>t.Nn(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}Nn(e,t){return new Promise(i=>{var r=!1,s=e=>{r||(r=!0,clearTimeout(n),i(e))},n=setTimeout(()=>s({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(b({method:"POST",url:this.wv(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("metrics request failed with status "+i)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}wv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});oD.__defaultExtensionClasses=b({},aO),(_.SDK_DIST_CHANNEL="npm",r=oE[oC]=new oD,function(){function e(){e.done||(e.done=!0,oT=!1,rl(oE,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():rf(a,"DOMContentLoaded",e,{capture:!1}):s&&t3.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),r).init("phc_A6DSfbcbGRzBSu3EWYAmB4Ck9VFmuEFcMEkSdVLyx7C6",{api_host:"https://analytics.getasinguard.com",ui_host:"https://us.posthog.com",defaults:"2026-01-30",person_profiles:"identified_only"}),e.s([],71217)},83793,(e,t,i)=>{t.exports=[e.r(62826),e.f({"private-next-instrumentation-client-user":{id:()=>71217,module:()=>e.r(71217)}})("private-next-instrumentation-client-user")]},5526,(e,t,i)=>{"use strict";e.i(47167);{let i=e.r(83793);t.exports=Array.isArray(i)?i:[i]}},23755,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});let r=(0,e.r(43369).getDeploymentId)();globalThis.NEXT_DEPLOYMENT_ID=r,("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.