1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,291967,e=>{"use strict";"u">typeof window&&window.document&&window.document.createElement,e.s(["composeEventHandlers",0,function(e,t,{checkForDefaultPrevented:i=!0}={}){return function(r){if(e?.(r),!1===i||!r.defaultPrevented)return t?.(r)}}])},994629,e=>{"use strict";var t=e.i(63940),i=e.i(387716),r=e.i(512119),s=e.i(194832),n=e.i(889448);e.s(["createCollection",0,function(e){let o=e+"CollectionProvider",[a,l]=(0,i.createContextScope)(o),[u,c]=a(o,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:i,children:r}=e,s=t.default.useRef(null),o=t.default.useRef(new Map).current;return(0,n.jsx)(u,{scope:i,itemMap:o,collectionRef:s,children:r})};d.displayName=o;let h=e+"CollectionSlot",p=(0,s.createSlot)(h),f=t.default.forwardRef((e,t)=>{let{scope:i,children:s}=e,o=c(h,i),a=(0,r.useComposedRefs)(t,o.collectionRef);return(0,n.jsx)(p,{ref:a,children:s})});f.displayName=h;let g=e+"CollectionItemSlot",v="data-radix-collection-item",_=(0,s.createSlot)(g),m=t.default.forwardRef((e,i)=>{let{scope:s,children:o,...a}=e,l=t.default.useRef(null),u=(0,r.useComposedRefs)(i,l),d=c(g,s);return t.default.useEffect(()=>(d.itemMap.set(l,{ref:l,...a}),()=>void d.itemMap.delete(l))),(0,n.jsx)(_,{...{[v]:""},ref:u,children:o})});return m.displayName=g,[{Provider:d,Slot:f,ItemSlot:m},function(i){let r=c(e+"CollectionConsumer",i);return t.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(r.itemMap.values()).sort((e,i)=>t.indexOf(e.ref.current)-t.indexOf(i.ref.current))},[r.collectionRef,r.itemMap])},l]}])},387716,e=>{"use strict";var t=e.i(63940),i=e.i(889448);e.s(["createContext",0,function(e,r){let s=t.createContext(r),n=e=>{let{children:r,...n}=e,o=t.useMemo(()=>n,Object.values(n));return(0,i.jsx)(s.Provider,{value:o,children:r})};return n.displayName=e+"Provider",[n,function(i){let n=t.useContext(s);if(n)return n;if(void 0!==r)return r;throw Error(`\`${i}\` must be used within \`${e}\``)}]},"createContextScope",0,function(e,r=[]){let s=[],n=()=>{let i=s.map(e=>t.createContext(e));return function(r){let s=r?.[e]||i;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:s}}),[r,s])}};return n.scopeName=e,[function(r,n){let o=t.createContext(n),a=s.length;s=[...s,n];let l=r=>{let{scope:s,children:n,...l}=r,u=s?.[e]?.[a]||o,c=t.useMemo(()=>l,Object.values(l));return(0,i.jsx)(u.Provider,{value:c,children:n})};return l.displayName=r+"Provider",[l,function(i,s){let l=s?.[e]?.[a]||o,u=t.useContext(l);if(u)return u;if(void 0!==n)return n;throw Error(`\`${i}\` must be used within \`${r}\``)}]},function(...e){let i=e[0];if(1===e.length)return i;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=r.reduce((t,{useScope:i,scopeName:r})=>{let s=i(e)[`__scope${r}`];return{...t,...s}},{});return t.useMemo(()=>({[`__scope${i.scopeName}`]:s}),[s])}};return r.scopeName=i.scopeName,r}(n,...r)]}])},974389,e=>{"use strict";var t=e.i(63940);e.i(889448);var i=t.createContext(void 0);e.s(["useDirection",0,function(e){let r=t.useContext(i);return e||r||"ltr"}])},681497,e=>{"use strict";var t,i=e.i(63940),r=e.i(291967),s=e.i(431657),n=e.i(512119),o=e.i(847797),a=e.i(889448),l="dismissableLayer.update",u=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),c=i.forwardRef((e,c)=>{let{disableOutsidePointerEvents:p=!1,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:_,onDismiss:m,...y}=e,b=i.useContext(u),[x,w]=i.useState(null),E=x?.ownerDocument??globalThis?.document,[,S]=i.useState({}),k=(0,n.useComposedRefs)(c,e=>w(e)),P=Array.from(b.layers),[C]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),O=P.indexOf(C),R=x?P.indexOf(x):-1,$=b.layersWithOutsidePointerEventsDisabled.size>0,I=R>=O,M=function(e,t=globalThis?.document){let r=(0,o.useCallbackRef)(e),s=i.useRef(!1),n=i.useRef(()=>{});return i.useEffect(()=>{let e=e=>{if(e.target&&!s.current){let i=function(){h("dismissableLayer.pointerDownOutside",r,s,{discrete:!0})},s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",n.current),n.current=i,t.addEventListener("click",n.current,{once:!0})):i()}else t.removeEventListener("click",n.current);s.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>s.current=!0}}(e=>{let t=e.target,i=[...b.branches].some(e=>e.contains(t));I&&!i&&(g?.(e),_?.(e),e.defaultPrevented||m?.())},E),T=function(e,t=globalThis?.document){let r=(0,o.useCallbackRef)(e),s=i.useRef(!1);return i.useEffect(()=>{let e=e=>{e.target&&!s.current&&h("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}(e=>{let t=e.target;![...b.branches].some(e=>e.contains(t))&&(v?.(e),_?.(e),e.defaultPrevented||m?.())},E);return!function(e,t=globalThis?.document){let r=(0,o.useCallbackRef)(e);i.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{R===b.layers.size-1&&(f?.(e),!e.defaultPrevented&&m&&(e.preventDefault(),m()))},E),i.useEffect(()=>{if(x)return p&&(0===b.layersWithOutsidePointerEventsDisabled.size&&(t=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(x)),b.layers.add(x),d(),()=>{p&&1===b.layersWithOutsidePointerEventsDisabled.size&&(E.body.style.pointerEvents=t)}},[x,E,p,b]),i.useEffect(()=>()=>{x&&(b.layers.delete(x),b.layersWithOutsidePointerEventsDisabled.delete(x),d())},[x,b]),i.useEffect(()=>{let e=()=>S({});return document.addEventListener(l,e),()=>document.removeEventListener(l,e)},[]),(0,a.jsx)(s.Primitive.div,{...y,ref:k,style:{pointerEvents:$?I?"auto":"none":void 0,...e.style},onFocusCapture:(0,r.composeEventHandlers)(e.onFocusCapture,T.onFocusCapture),onBlurCapture:(0,r.composeEventHandlers)(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:(0,r.composeEventHandlers)(e.onPointerDownCapture,M.onPointerDownCapture)})});function d(){let e=new CustomEvent(l);document.dispatchEvent(e)}function h(e,t,i,{discrete:r}){let n=i.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});t&&n.addEventListener(e,t,{once:!0}),r?(0,s.dispatchDiscreteCustomEvent)(n,o):n.dispatchEvent(o)}c.displayName="DismissableLayer",i.forwardRef((e,t)=>
1{let r=i.useContext(u),o=i.useRef(null),l=(0,n.useComposedRefs)(t,o);return i.useEffect(()=>{let e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,a.jsx)(s.Primitive.div,{...e,ref:l})}).displayName="DismissableLayerBranch",e.s(["DismissableLayer",0,c],681497)},815772,e=>{"use strict";var t=e.i(63940),i=e.i(974573),r=t[" useId ".trim().toString()]||(()=>void 0),s=0;e.s(["useId",0,function(e){let[n,o]=t.useState(r());return(0,i.useLayoutEffect)(()=>{e||o(e=>e??String(s++))},[e]),e||(n?`radix-${n}`:"")}])},341095,e=>{"use strict";var t=e.i(63940),i=e.i(961143),r=e.i(278928),s=e.i(431657),n=e.i(889448),o=t.forwardRef((e,t)=>{let{children:i,width:r=10,height:o=5,...a}=e;return(0,n.jsx)(s.Primitive.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:(0,n.jsx)("polygon",{points:"0,0 30,0 15,10"})})});o.displayName="Arrow";var a=e.i(512119),l=e.i(387716),u=e.i(847797),c=e.i(974573),d=e.i(160787),h="Popper",[p,f]=(0,l.createContextScope)(h),[g,v]=p(h),_=e=>{let{__scopePopper:i,children:r}=e,[s,o]=t.useState(null);return(0,n.jsx)(g,{scope:i,anchor:s,onAnchorChange:o,children:r})};_.displayName=h;var m="PopperAnchor",y=t.forwardRef((e,i)=>{let{__scopePopper:r,virtualRef:o,...l}=e,u=v(m,r),c=t.useRef(null),d=(0,a.useComposedRefs)(i,c),h=t.useRef(null);return t.useEffect(()=>{let e=h.current;h.current=o?.current||c.current,e!==h.current&&u.onAnchorChange(h.current)}),o?null:(0,n.jsx)(s.Primitive.div,{...l,ref:d})});y.displayName=m;var b="PopperContent",[x,w]=p(b),E=t.forwardRef((e,o)=>{let{__scopePopper:l,side:h="bottom",sideOffset:p=0,align:f="center",alignOffset:g=0,arrowPadding:_=0,avoidCollisions:m=!0,collisionBoundary:y=[],collisionPadding:w=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:k="optimized",onPlaced:P,...$}=e,I=v(b,l),[M,T]=t.useState(null),F=(0,a.useComposedRefs)(o,e=>T(e)),[j,A]=t.useState(null),L=(0,d.useSize)(j),D=L?.width??0,q=L?.height??0,N="number"==typeof w?w:{top:0,right:0,bottom:0,left:0,...w},z=Array.isArray(y)?y:[y],H=z.length>0,U={padding:N,boundary:z.filter(C),altBoundary:H},{refs:B,floatingStyles:W,placement:V,isPositioned:G,middlewareData:Y}=(0,i.useFloating)({strategy:"fixed",placement:h+("center"!==f?"-"+f:""),whileElementsMounted:(...e)=>(0,r.autoUpdate)(...e,{animationFrame:"always"===k}),elements:{reference:I.anchor},middleware:[(0,i.offset)({mainAxis:p+q,alignmentAxis:g}),m&&(0,i.shift)({mainAxis:!0,crossAxis:!1,limiter:"partial"===E?(0,i.limitShift)():void 0,...U}),m&&(0,i.flip)({...U}),(0,i.size)({...U,apply:({elements:e,rects:t,availableWidth:i,availableHeight:r})=>{let{width:s,height:n}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${i}px`),o.setProperty("--radix-popper-available-height",`${r}px`),o.setProperty("--radix-popper-anchor-width",`${s}px`),o.setProperty("--radix-popper-anchor-height",`${n}px`)}}),j&&(0,i.arrow)({element:j,padding:_}),O({arrowWidth:D,arrowHeight:q}),S&&(0,i.hide)({strategy:"referenceHidden",...U})]}),[K,J]=R(V),X=(0,u.useCallbackRef)(P);(0,c.useLayoutEffect)(()=>{G&&X?.()},[G,X]);let Z=Y.arrow?.x,Q=Y.arrow?.y,ee=Y.arrow?.centerOffset!==0,[et,ei]=t.useState();return(0,c.useLayoutEffect)(()=>{M&&ei(window.getComputedStyle(M).zIndex)},[M]),(0,n.jsx)("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:G?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:et,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,n.jsx)(x,{scope:l,placedSide:K,onArrowChange:A,arrowX:Z,arrowY:Q,shouldHideArrow:ee,children:(0,n.jsx)(s.Primitive.div,{"data-side":K,"data-align":J,...$,ref:F,style:{...$.style,animation:G?void 0:"none"}})})})});E.displayName=b;var S="PopperArrow",k={top:"bottom",right:"left",bottom:"top",left:"right"},P=t.forwardRef(function(e,t){let{__scopePopper:i,...r}=e,s=w(S,i),a=k[s.placedSide];return(0,n.jsx)("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:(0,n.jsx)(o,{...r,ref:t,style:{...r.style,display:"block"}})})});function C(e){return null!==e}P.displayName=S;var O=e=>({name:"transformOrigin",options:e,fn(t){let{placement:i,rects:r,middlewareData:s}=t,n=s.arrow?.centerOffset!==0,o=n?0:e.arrowWidth,a=n?0:e.arrowHeight,[l,u]=R(i),c={start:"0%",center:"50%",end:"100%"}[u],d=(s.arrow?.x??0)+o/2,h=(s.arrow?.y??0)+a/2,p="",f="";return"bottom"===l?(p=n?c:`${d}px`,f=`${-a}px`):"top"===l?(p=n?c:`${d}px`,f=`${r.floating.height+a}px`):"right"===l?(p=`${-a}px`,f=n?c:`${h}px`):"left"===l&&(p=`${r.floating.width+a}px`,f=n?c:`${h}px`),{data:{x:p,y:f}}}});function R(e){let[t,i="center"]=e.split("-");return[t,i]}e.s(["Anchor",0,y,"Arrow",0,P,"Content",0,E,"Root",0,_,"createPopperScope",0,f],341095)},780281,e=>{"use strict";var t=e.i(63940),i=e.i(157793),r=e.i(431657),s=e.i(974573),n=e.i(889448),o=t.forwardRef((e,o)=>{let{container:a,...l}=e,[u,c]=t.useState(!1);(0,s.useLayoutEffect)(()=>c(!0),[]);let d=a||u&&globalThis?.document?.body;return d?i.default.createPortal((0,n.jsx)(r.Primitive.div,{...l,ref:o}),d):null});o.displayName="Portal",e.s(["Portal",0,o])},279761,e=>{"use strict";var t=e.i(63940),i=e.i(512119),r=e.i(974573),s=e=>{var s;let o,a,{present:l,children:u}=e,c=function(e){var i,s;let[o,a]=t.useState(),l=t.useRef(null),u=t.useRef(e),c=t.useRef("none"),[d,h]=(i=e?"mounted":"unmounted",s={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>
1s[e][t]??e,i));return t.useEffect(()=>{let e=n(l.current);c.current="mounted"===d?e:"none"},[d]),(0,r.useLayoutEffect)(()=>{let t=l.current,i=u.current;if(i!==e){let r=c.current,s=n(t);e?h("MOUNT"):"none"===s||t?.display==="none"?h("UNMOUNT"):i&&r!==s?h("ANIMATION_OUT"):h("UNMOUNT"),u.current=e}},[e,h]),(0,r.useLayoutEffect)(()=>{if(o){let e,t=o.ownerDocument.defaultView??window,i=i=>{let r=n(l.current).includes(CSS.escape(i.animationName));if(i.target===o&&r&&(h("ANIMATION_END"),!u.current)){let i=o.style.animationFillMode;o.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=i)})}},r=e=>{e.target===o&&(c.current=n(l.current))};return o.addEventListener("animationstart",r),o.addEventListener("animationcancel",i),o.addEventListener("animationend",i),()=>{t.clearTimeout(e),o.removeEventListener("animationstart",r),o.removeEventListener("animationcancel",i),o.removeEventListener("animationend",i)}}h("ANIMATION_END")},[o,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{l.current=e?getComputedStyle(e):null,a(e)},[])}}(l),d="function"==typeof u?u({present:c.isPresent}):t.Children.only(u),h=(0,i.useComposedRefs)(c.ref,(s=d,(a=(o=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in o&&o.isReactWarning)?s.ref:(a=(o=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in o&&o.isReactWarning)?s.props.ref:s.props.ref||s.ref));return"function"==typeof u||c.isPresent?t.cloneElement(d,{ref:h}):null};function n(e){return e?.animationName||"none"}s.displayName="Presence",e.s(["Presence",0,s])},431657,e=>{"use strict";var t=e.i(63940),i=e.i(157793),r=e.i(194832),s=e.i(889448),n=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{let n=(0,r.createSlot)(`Primitive.${i}`),o=t.forwardRef((e,t)=>{let{asChild:r,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(r?n:i,{...o,ref:t})});return o.displayName=`Primitive.${i}`,{...e,[i]:o}},{});e.s(["Primitive",0,n,"dispatchDiscreteCustomEvent",0,function(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}])},194832,512119,e=>{"use strict";var t=e.i(63940);function i(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function r(...e){return t=>{let r=!1,s=e.map(e=>{let s=i(e,t);return r||"function"!=typeof s||(r=!0),s});if(r)return()=>{for(let t=0;t<s.length;t++){let r=s[t];"function"==typeof r?r():i(e[t],null)}}}}e.s(["composeRefs",0,r,"useComposedRefs",0,function(...e){return t.useCallback(r(...e),e)}],512119);var s=e.i(889448);function n(e){var i;let n,o=(i=e,(n=t.forwardRef((e,i)=>{let{children:s,...n}=e;if(t.isValidElement(s)){var o;let e,a,l=(o=s,(a=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(a=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),u=function(e,t){let i={...t};for(let r in t){let s=e[r],n=t[r];/^on[A-Z]/.test(r)?s&&n?i[r]=(...e)=>{let t=n(...e);return s(...e),t}:s&&(i[r]=s):"style"===r?i[r]={...s,...n}:"className"===r&&(i[r]=[s,n].filter(Boolean).join(" "))}return{...e,...i}}(n,s.props);return s.type!==t.Fragment&&(u.ref=i?r(i,l):l),t.cloneElement(s,u)}return t.Children.count(s)>1?t.Children.only(null):null})).displayName=`${i}.SlotClone`,n),a=t.forwardRef((e,i)=>{let{children:r,...n}=e,a=t.Children.toArray(r),l=a.find(c);if(l){let e=l.props.children,r=a.map(i=>i!==l?i:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,s.jsx)(o,{...n,ref:i,children:t.isValidElement(e)?t.cloneElement(e,void 0,r):null})}return(0,s.jsx)(o,{...n,ref:i,children:r})});return a.displayName=`${e}.Slot`,a}var o=n("Slot"),a=Symbol("radix.slottable");function l(e){let t=({children:e})=>(0,s.jsx)(s.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=a,t}var u=l("Slottable");function c(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a}e.s(["Root",0,o,"Slot",0,o,"Slottable",0,u,"createSlot",0,n,"createSlottable",0,l],194832)},847797,e=>{"use strict";var t=e.i(63940);e.s(["useCallbackRef",0,function(e){let i=t.useRef(e);return t.useEffect(()=>{i.current=e}),t.useMemo(()=>(...e)=>i.current?.(...e),[])}])},171089,e=>{"use strict";var t=e.i(63940),i=e.i(974573);t[" useEffectEvent ".trim().toString()],t[" useInsertionEffect ".trim().toString()];var r=t[" useInsertionEffect ".trim().toString()]||i.useLayoutEffect;Symbol("RADIX:SYNC_STATE"),e.s(["useControllableState",0,function({prop:e,defaultProp:i,onChange:s=()=>{},caller:n}){let[o,a,l]=function({defaultProp:e,onChange:i}){let[s,n]=t.useState(e),o=t.useRef(s),a=t.useRef(i);return r(()=>{a.current=i},[i]),t.useEffect(()=>{o.current!==s&&(a.current?.(s),o.current=s)},[s,o]),[s,n,a]}({defaultProp:i,onChange:s}),u=void 0!==e,c=u?e:o;{let i=t.useRef(void 0!==e);t.useEffect(()=>{let e=i.current;if(e!==u){let t=u?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}i.current=u},[u,n])}return[c,t.useCallback(t=>{if(u){let i="function"==typeof t?t(e):t;i!==e&&l.current?.(i)}else a(t)},[u,e,a,l])]}],171089)},974573,e=>{"use strict";var t=e.i(63940),i=globalThis?.document?t.useLayoutEffect:()=>{};
1e.s(["useLayoutEffect",0,i])},610720,e=>{"use strict";var t=e.i(63940);e.s(["usePrevious",0,function(e){let i=t.useRef({value:e,previous:e});return t.useMemo(()=>(i.current.value!==e&&(i.current.previous=i.current.value,i.current.value=e),i.current.previous),[e])}])},160787,e=>{"use strict";var t=e.i(63940),i=e.i(974573);e.s(["useSize",0,function(e){let[r,s]=t.useState(void 0);return(0,i.useLayoutEffect)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let i,r;if(!Array.isArray(t)||!t.length)return;let n=t[0];if("borderBoxSize"in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,r=t.blockSize}else i=e.offsetWidth,r=e.offsetHeight;s({width:i,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),r}])},342041,e=>{"use strict";var t=e.i(63940),i=e.i(431657),r=e.i(889448),s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),n=t.forwardRef((e,t)=>(0,r.jsx)(i.Primitive.span,{...e,ref:t,style:{...s,...e.style}}));n.displayName="VisuallyHidden",e.s(["Root",0,n,"VISUALLY_HIDDEN_STYLES",0,s])},779135,e=>{"use strict";var t=e.i(476774);e.s(["ChevronDownIcon",()=>t.default])},408568,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"Image",{enumerable:!0,get:function(){return x}});let r=e.r(481258),s=e.r(744066),n=e.r(889448),o=s._(e.r(63940)),a=r._(e.r(157793)),l=r._(e.r(591779)),u=e.r(209160),c=e.r(488473),d=e.r(984914),h=e.r(538680),p=r._(e.r(398451)),f=e.r(866560),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[100,75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function v(e,t,i,r,s,n,o){let a=e?.src;e&&e["data-loaded-src"]!==a&&(e["data-loaded-src"]=a,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&s(!0),i?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,s=!1;i.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>s,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{s=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function _(e){return o.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let m="u"<typeof window?o.useEffect:o.useLayoutEffect,y=(0,o.forwardRef)(({src:e,srcSet:t,sizes:i,height:r,width:s,decoding:a,className:l,style:u,fetchPriority:c,placeholder:d,loading:h,unoptimized:p,fill:g,onLoadRef:y,onLoadingCompleteRef:b,setBlurComplete:x,setShowAltText:w,sizesInput:E,onLoad:S,onError:k,...P},C)=>{let O=(0,o.useRef)(!1),R=(0,o.useRef)(null);m(()=>{let{current:e}=O,{current:t}=R;e||null===t||(k&&(t.src=t.src),t.complete&&v(t,d,y,b,x,p,E),O.current=!0)},[e,d,y,b,k,p,E]);let $=(0,f.useMergedRef)(C,R);return(0,n.jsx)("img",{...P,..._(c),loading:h,width:s,height:r,decoding:a,"data-nimg":g?"fill":"1",className:l,style:u,sizes:i,srcSet:t,src:e,ref:$,onLoad:e=>{v(e.currentTarget,d,y,b,x,p,E)},onError:e=>{w(!0),"empty"!==d&&x(!0),k&&k(e)}})});function b({isAppRouter:e,imgAttributes:t}){let i={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,..._(t.fetchPriority)};return e&&a.default.preload?(a.default.preload(t.src,i),null):(0,n.jsx)(l.default,{children:(0,n.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...i},"__nimg-"+t.src+t.srcSet+t.sizes)})}let x=(0,o.forwardRef)((e,t)=>{let i=(0,o.useContext)(h.RouterContext),r=(0,o.useContext)(d.ImageConfigContext),s=(0,o.useMemo)(()=>{let e=g||r||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),i=e.deviceSizes.sort((e,t)=>e-t),s=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:i,qualities:s,localPatterns:"u"<typeof window?r?.localPatterns:e.localPatterns}},[r]),{onLoad:a,onLoadingComplete:l}=e,f=(0,o.useRef)(a);(0,o.useEffect)(()=>{f.current=a},[a]);let v=(0,o.useRef)(l);(0,o.useEffect)(()=>{v.current=l},[l]);let[_,m]=(0,o.useState)(!1),[x,w]=(0,o.useState)(!1),{props:E,meta:S}=(0,u.getImgProps)(e,{defaultLoader:p.default,imgConf:s,blurComplete:_,showAltText:x});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{...E,unoptimized:S.unoptimized,placeholder:S.placeholder,fill:S.fill,onLoadRef:f,onLoadingCompleteRef:v,setBlurComplete:m,setShowAltText:w,sizesInput:e.sizes,ref:t}),S.preload?(0,n.jsx)(b,{isAppRouter:!i,imgAttributes:E}):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)},733241,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={cancelIdleCallback:function(){return o},requestIdleCallback:function(){return n}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},o="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(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)},200289,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={ESCAPE_REGEX:function(){return o},htmlEscapeAttributeString:function(){return c},htmlEscapeJsonString:function(){return u}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},o=/[&><\u2028\u2029]/g,a={"&":"&",'"':""","'":"'","<":"<",">":">"},l=/[&"'<>]/g;function u(e){return e.replace(o,e=>n[e])}function c(e){return e.replace(l,e=>a[e])}},62353,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={default:function(){return b},handleClientScriptLoad:function(){return _},initScriptLoader:function(){return m}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=e.r(481258),o=e.r(744066),a=e.r(889448),l=n._(e.r(157793)),u=o._(e.r(63940)),c=e.r(126730),d=e.r(665754),h=e.r(733241),p=e.r(200289),f=new Map,g=new Set,v=e=>{let{src:t,id:i,onLoad:r=()=>{},onReady:s=null,dangerouslySetInnerHTML:n,children:o="",strategy:a="afterInteractive",onError:u,stylesheets:c}=e,h=i||t;if(h&&g.has(h))return;if(f.has(t)){g.add(h),f.get(t).then(r,u);return}let p=()=>{s&&s(),g.add(h)},v=document.createElement("script"),_=new Promise((e,t)=>{v.addEventListener("load",function(t){e(),r&&r.call(this,t),p()}),v.addEventListener("error",function(e){t(e)})}).catch(function(e){u&&u(e)});n?(v.innerHTML=n.__html||"",p()):o?(v.textContent="string"==typeof o?o:Array.isArray(o)?o.join(""):"",p()):t&&(v.src=t,f.set(t,_)),(0,d.setAttributesFromProps)(v,e),"worker"===a&&v.setAttribute("type","text/partytown"),v.setAttribute("data-nscript",a),c&&(e=>{if(l.default.preinit)return e.forEach(e=>{l.default.preinit(e,{as:"style"})});if("u">typeof window){let t=document.head;e.forEach(e=>{let i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=e,t.appendChild(i)})}})(c),document.body.appendChild(v)};function _(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>v(e))}):v(e)}function m(e){e.forEach(_),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");g.add(t)})}function y(e){let{id:t,src:i="",onLoad:r=()=>{},onReady:s=null,strategy:n="afterInteractive",onError:o,stylesheets:d,...f}=e,{updateScripts:_,scripts:m,getIsSsr:y,appDir:b,nonce:x}=(0,u.useContext)(c.HeadManagerContext);x=f.nonce||x;let w=(0,u.useRef)(!1);(0,u.useEffect)(()=>{let e=t||i;w.current||(s&&e&&g.has(e)&&s(),w.current=!0)},[s,t,i]);let E=(0,u.useRef)(!1);if((0,u.useEffect)(()=>{if(!E.current){if("afterInteractive"===n)v(e);else"lazyOnload"===n&&("complete"===document.readyState?(0,h.requestIdleCallback)(()=>v(e)):window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>v(e))}));E.current=!0}},[e,n]),("beforeInteractive"===n||"worker"===n)&&(_?(m[n]=(m[n]||[]).concat([{id:t,src:i,onLoad:r,onReady:s,onError:o,...f,nonce:x}]),_(m)):y&&y()?g.add(t||i):y&&!y()&&v({...e,nonce:x})),b){if(d&&d.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===n)if(!i)return f.dangerouslySetInnerHTML&&(f.children=f.dangerouslySetInnerHTML.__html,delete f.dangerouslySetInnerHTML),(0,a.jsx)("script",{nonce:x,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([0,{...f,id:t}]))})`}});else return l.default.preload(i,f.integrity?{as:"script",integrity:f.integrity,nonce:x,crossOrigin:f.crossOrigin}:{as:"script",nonce:x,crossOrigin:f.crossOrigin}),(0,a.jsx)("script",{nonce:x,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([i,{...f,id:t}]))})`}});"afterInteractive"===n&&i&&l.default.preload(i,f.integrity?{as:"script",integrity:f.integrity,nonce:x,crossOrigin:f.crossOrigin}:{as:"script",nonce:x,crossOrigin:f.crossOrigin})}return null}Object.defineProperty(y,"__nextScript",{value:!0});let b=y;("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)},915619,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={bindSnapshot:function(){return u},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return c}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class o{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let a="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return a?new a:new o}function u(e){return a?a.bind(e):o.bind(e)}function c(){return a?a.snapshot():function(e,...t){return e(...t)}}},329904,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,e.r(915619).createAsyncLocalStorage)()},907501,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=e.r(329904)},871210,(e,t,i)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"encodeURIPath",{enumerable:!0,get:function(){return r}})},558721,(e,t,i)=>{"use strict";function r(e,t){let i=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-i)<Math.abs(e-i)?t:e,t.qualities[0]):i}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"findClosestQuality",{enumerable:!0,get:function(){return r}})},398451,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return o}});let r=e.r(558721),s=e.r(672341);function n({config:e,src:t,width:i,quality:o}){let a=(0,s.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,s.getAssetToken)())a=void 0;else{let e=t.indexOf("?");if(-1!==e){let i=new URLSearchParams(t.slice(e+1)),r=i.get("dpl");if(r){a=r,i.delete("dpl");let s=i.toString();t=t.slice(0,e)+(s?"?"+s:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns. 2Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let l=(0,r.findClosestQuality)(o,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${i}&q=${l}${t.startsWith("/")&&a?`&dpl=${a}`:""}`}n.__next_img_default=!0;let o=n},591779,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0});var r={default:function(){return g},defaultHead:function(){return d}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=e.r(481258),o=e.r(744066),a=e.r(889448),l=o._(e.r(63940)),u=n._(e.r(171391)),c=e.r(126730);function d(){return[(0,a.jsx)("meta",{charSet:"utf-8"},"charset"),(0,a.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let p=["name","httpEquiv","charSet","itemProp"];function f(e){let t,i,r,s;return e.reduce(h,[]).reverse().concat(d().reverse()).filter((t=new Set,i=new Set,r=new Set,s={},e=>{let n=!0,o=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){o=!0;let i=e.key.slice(e.key.indexOf("$")+1);t.has(i)?n=!1:t.add(i)}switch(e.type){case"title":case"base":i.has(e.type)?n=!1:i.add(e.type);break;case"meta":for(let t=0,i=p.length;t<i;t++){let i=p[t];if(e.props.hasOwnProperty(i))if("charSet"===i)r.has(i)?n=!1:r.add(i);else{let t=e.props[i],r=s[i]||new Set;("name"!==i||!o)&&r.has(t)?n=!1:(r.add(t),s[i]=r)}}}return n})).reverse().map((e,t)=>{let i=e.key||t;return l.default.cloneElement(e,{key:i})})}let g=function({children:e}){let t=(0,l.useContext)(c.HeadManagerContext);return(0,a.jsx)(u.default,{reduceComponentsToState:f,headManager:t,children:e})};("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esMo
2dule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},153095,(e,t,i)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:i,blurHeight:s,blurDataURL:n,objectFit:o}){let a=i?40*i:e,l=s?40*s:t,u=a&&l?`viewBox='0 0 ${a} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===o?"xMidYMid":"cover"===o?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${n}'/%3E%3C/svg%3E`}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},488473,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return n},imageConfigDefault:function(){return o}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=["default","imgix","cloudinary","akamai","custom"],o={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},209160,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getImgProps",{enumerable:!0,get:function(){return u}});let r=e.r(672341),s=e.r(153095),n=e.r(488473),o=["-moz-initial","fill","none","scale-down",void 0];function a(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:i=!1,priority:c=!1,preload:d=!1,loading:h,className:p,quality:f,width:g,height:v,fill:_=!1,style:m,overrideSrc:y,onLoad:b,onLoadingComplete:x,placeholder:w="empty",blurDataURL:E,fetchPriority:S,decoding:k="async",layout:P,objectFit:C,objectPosition:O,lazyBoundary:R,lazyRoot:$,...I},M){var T;let F,j,A,{imgConf:L,showAltText:D,blurComplete:q,defaultLoader:N}=M,z=L||n.imageConfigDefault;if("allSizes"in z)F=z;else{let e=[...z.deviceSizes,...z.imageSizes].sort((e,t)=>e-t),t=z.deviceSizes.sort((e,t)=>e-t),i=z.qualities?.sort((e,t)=>e-t);F={...z,allSizes:e,deviceSizes:t,qualities:i}}if(void 0===N)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let H=I.loader||N;delete I.loader,delete I.srcSet;let U="__next_img_default"in H;if(U){if("custom"===F.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop. 3Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=H;H=t=>{let{config:i,...r}=t;return e(r)}}if(P){"fill"===P&&(_=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[P];e&&(m={...m,...e});let i={responsive:"100vw",fill:"100vw"}[P];i&&!t&&(t=i)}let B="",W=l(g),V=l(v);if((T=e)&&"object"==typeof T&&(a(T)||void 0!==T.src)){let t=a(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}
3`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(j=t.blurWidth,A=t.blurHeight,E=E||t.blurDataURL,B=t.src,!_)if(W||V){if(W&&!V){let e=W/t.width;V=Math.round(t.height*e)}else if(!W&&V){let e=V/t.height;W=Math.round(t.width*e)}}else W=t.width,V=t.height}let G=!c&&!d&&("lazy"===h||void 0===h);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(i=!0,G=!1),F.unoptimized&&(i=!0),U&&!F.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(i=!0);let Y=l(f),K=Object.assign(_?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:O}:{},D?{}:{color:"transparent"},m),J=q||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,s.getImageBlurSvg)({widthInt:W,heightInt:V,blurWidth:j,blurHeight:A,blurDataURL:E||"",objectFit:K.objectFit})}")`:`url("${w}")`,X=o.includes(K.objectFit)?"fill"===K.objectFit?"100% 100%":"cover":K.objectFit,Z=J?{backgroundSize:X,backgroundPosition:K.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},Q=function({config:e,src:t,unoptimized:i,width:s,quality:n,sizes:o,loader:a}){if(i){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,r.getAssetToken)())e=void 0;else if(e){let i=t.indexOf("?");if(-1!==i){let r=new URLSearchParams(t.slice(i+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,i)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:u}=function({deviceSizes:e,allSizes:t},i,r){if(r){let i=/(^|\s)(1?\d?\d)vw/g,s=[];for(let e;e=i.exec(r);)s.push(parseInt(e[2]));if(s.length){let i=.01*Math.min(...s);return{widths:t.filter(t=>t>=e[0]*i),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof i?{widths:e,kind:"w"}:{widths:[...new Set([i,2*i].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,s,o),c=l.length-1;return{sizes:o||"w"!==u?o:"100vw",srcSet:l.map((i,r)=>`${a({config:e,src:t,quality:n,width:i})} ${"w"===u?i:r+1}${u}`).join(", "),src:a({config:e,src:t,quality:n,width:l[c]})}}({config:F,src:e,unoptimized:i,width:W,quality:Y,sizes:t,loader:H}),ee=G?"lazy":h;return{props:{...I,loading:ee,fetchPriority:S,width:W,height:V,decoding:k,className:p,style:{...K,...Z},sizes:Q.sizes,srcSet:Q.srcSet,src:y||Q.src},meta:{unoptimized:i,preload:d||c,placeholder:w,fill:_}}}},984914,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ImageConfigContext",{enumerable:!0,get:function(){return n}});let r=e.r(481258)._(e.r(63940)),s=e.r(488473),n=r.default.createContext(s.imageConfigDefault)},538680,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(481258)._(e.r(63940)).default.createContext(null)},610863,(e,t,i)=>{"use strict";e.i(916011),Object.defineProperty(i,"__esModule",{value:!0});var r={default:function(){return c},getImageProps:function(){return u}};for(var s in r)Object.defineProperty(i,s,{enumerable:!0,get:r[s]});let n=e.r(481258),o=e.r(209160),a=e.r(408568),l=n._(e.r(398451));function u(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[100,75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,i]of Object.entries(t))void 0===i&&delete t[e];return{props:t}}let c=a.Image},834497,(e,t,i)=>{t.exports=e.r(610863)},739864,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"BailoutToCSR",{enumerable:!0,get:function(){return s}});let r=e.r(906990);function s({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},451677,(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(889448),s=e.r(63940),n=e.r(739864),o=e.r(926068);function a(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},u=function(e){let t={...l,...e},i=(0,s.lazy)(()=>t.loader().then(a)),u=t.loading;function c(e){let a=u?(0,r.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,c=l?s.Suspense:s.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(o.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(i,{...e})]}):(0,r.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(i,{...e})});return(0,r.jsx)(c,{...l?{fallback:a}:{},children:d})}return c.displayName="LoadableComponent",c}},421357,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});let r=e.r(481258)._(e.r(451677));function s(e,t){let i={};"function"==typeof e&&(i.loader=e);let s={...i,...t};return(0,r.default)({...s,modules:s.loadableGenerated?.modules})}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esMo
3dule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},926068,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"PreloadChunks",{enumerable:!0,get:function(){return l}});let r=e.r(889448),s=e.r(157793),n=e.r(907501),o=e.r(871210),a=e.r(672341);function l({moduleIds:e}){if("u">typeof window)return null;let t=n.workAsyncStorage.getStore();if(void 0===t)return null;let i=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;i.push(...e)}}if(0===i.length)return null;let u=(0,a.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:i.map(e=>{let i=`${t.assetPrefix}/_next/${(0,o.encodeURIPath)(e)}${u}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:i,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,s.preload)(i,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},171391,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return a}});let r=e.r(63940),s="u"<typeof window,n=s?()=>{}:r.useLayoutEffect,o=s?()=>{}:r.useEffect;function a(e){let{headManager:t,reduceComponentsToState:i}=e;function a(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(i(e))}}return s&&(t?.mountedInstances?.add(e.children),a()),n(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),n(()=>(t&&(t._pendingUpdate=a),()=>{t&&(t._pendingUpdate=a)})),o(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},982876,390221,e=>{"use strict";var t,i,r="u">typeof window?window:void 0,s="u">typeof globalThis?globalThis:r;"u"<typeof self&&(s.self=s),"u"<typeof File&&(s.File=function(){});var n=null==s?void 0:s.navigator,o=null==s?void 0:s.document,a=null==s?void 0:s.location,l=null==s?void 0:s.fetch,u=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,c=null==s?void 0:s.AbortController,d=null==s?void 0:s.CompressionStream,h=null==n?void 0:n.userAgent,p=null!=r?r:{},f="1.379.1",g={DEBUG:!1,LIB_VERSION:f,LIB_NAME:"web",JS_SDK_VERSION:f};function v(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 _(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){v(n,r,s,o,a,"next",e)}function a(e){v(n,r,s,o,a,"throw",e)}o(void 0)})}}function m(){return(m=Object.assign.bind()).apply(null,arguments)}function y(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 b,x,w,E=((b={}).GZipJS="gzip-js",b.Base64="base64",b),S=["$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"],k="NativeGzipValidationError",P=e=>e.length>=2&&31===e[0]&&139===e[1],C=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),O=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=k,t},R=(x=_(function*(e,t){18>e.size&&O("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));P(i)&&8===i[2]||O("invalid-header");var r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(w)return w;w=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;w[e]=t>>>0}return w})(),i=0xffffffff,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&O("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&O("invalid-size")}),function(e,t){return x.apply(this,arguments)});function $(){return($=_(function*(e,t,i){void 0===t&&(t=!0);try{var r,s=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(s).then(()=>o.close()).catch((r=_(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]);return yield R(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 I=["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","hub
3spot","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"],M=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return I.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function T(e,t){return -1!==e.indexOf(t)}var F=function(e){return e.trim()},j=function(e){return e.replace(/^\$/,"")},A=Object.prototype,L=A.hasOwnProperty,D=A.toString,q=Array.isArray||function(e){return"[object Array]"===D.call(e)},N=e=>"function"==typeof e,z=e=>e===Object(e)&&!q(e),H=e=>{if(z(e)){for(var t in e)if(L.call(e,t))return!1;return!0}return!1},U=e=>void 0===e,B=e=>"[object String]"==D.call(e),W=e=>B(e)&&0===e.trim().length,V=e=>null===e,G=e=>U(e)||V(e),Y=e=>"[object Number]"==D.call(e)&&e==e,K=e=>Y(e)&&e>0,J=e=>"[object Boolean]"===D.call(e),X=e=>T(S,e);function Z(e){return null===e||"object"!=typeof e}function Q(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ee(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var et=[!0,"true",1,"1","yes"],ei=[!1,"false",0,"0","no"];function er(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),Y(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),er(s||i,t,i,r))}class es{constructor(e){this.$t={},this.zt=e.zt,this.Zt=er(e.bucketSize,0,100,e.Gt),this.Qt=er(e.refillRate,0,this.Zt,e.Gt),this.Jt=er(e.refillInterval,0,864e5,e.Gt)}Kt(e,t){var i=Math.floor((t-e.lastAccess)/this.Jt);i>0&&(e.tokens=Math.min(e.tokens+i*this.Qt,this.Zt),e.lastAccess=e.lastAccess+i*this.Jt)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.$t[r];return s?this.Kt(s,i):this.$t[r]=s={tokens:this.Zt,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.zt)||t.call(this,e)),0===s.tokens)}stop(){this.$t={}}}var en,eo,ea,el="Mobile",eu="Android",ec="Tablet",ed=eu+" "+ec,eh="iPad",ep="Apple",ef=ep+" Watch",eg="Safari",ev="BlackBerry",e_="Samsung",em=e_+"Browser",ey=e_+" Internet",eb="Chrome",ex=eb+" OS",ew=eb+" iOS",eE="Internet Explorer",eS=eE+" "+el,ek="Opera",eP=ek+" Mini",eC="Edge",eO="Microsoft "+eC,eR="Firefox",e$=eR+" iOS",eI="Nintendo",eM="PlayStation",eT="Xbox",eF=eu+" "+el,ej=el+" "+eg,eA="Windows",eL=eA+" Phone",eD="Nokia",eq="Ouya",eN="Generic",ez=eN+" "+el.toLowerCase(),eH=eN+" "+ec.toLowerCase(),eU="Konqueror",eB="Oculus Browser",eW="Vivaldi",eV="Yandex",eG="Whale",eY="DuckDuckGo",eK="Pale Moon",eJ="Waterfox",eX="Brave",eZ="(\\d+(\\.\\d+)?)",eQ=RegExp("Version/"+eZ),e0=RegExp(eT,"i"),e1=RegExp(eM+" \\w+","i"),e3=RegExp(eI+" \\w+","i"),e2=RegExp(ev+"|PlayBook|BB10","i"),e4={"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"},e8=function(e,t,i){var r;return t=t||"",(null!=i&&i.brave?eX:null)||(T(e," OPR/")&&T(e,"Mini")?eP:T(e," OPR/")?ek:e2.test(e)?ev:T(e,"IE"+el)||T(e,"WPDesktop")?eS:T(e,"OculusBrowser")?eB:T(e,em)?ey:T(e,eC)||T(e,"Edg/")?eO:T(e,eW+"/")?eW:T(e,"YaBrowser/")?eV:T(e,eG+"/")?eG:T(e,eY+"/")||T(e,"Ddg/")?eY:T(e,"FBIOS")?"Facebook "+el:T(e,"UCWEB")||T(e,"UCBrowser")?"UC Browser":T(e,"CriOS")?ew:T(e,"CrMo")||T(e,eb)?eb:T(e,eu)&&T(e,eg)?eF:T(e,"FxiOS")?e$:T(e.toLowerCase(),eU.toLowerCase())?eU:T(e,eX+"/")?eX:(r=t)&&T(r,ep)||T(e,eg)&&!T(e,eb)&&!T(e,eu)?T(e,el)?ej:eg:T(e,"PaleMoon/")?eK:T(e,eJ+"/")?eJ:T(e,eR)?eR:T(e,"MSIE")||T(e,"Trident/")?eE:T(e,"Gecko")?eR:"")},e5={[eS]:[RegExp("rv:"+eZ)],[eO]:[RegExp(eC+"?\\/"+eZ)],[eb]:[RegExp("("+eb+"|CrMo)\\/"+eZ)],[ew]:[RegExp("CriOS\\/"+eZ)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eZ)],[eg]:[eQ],[ej]:[eQ],[ek]:[RegExp("(Opera|OPR)\\/"+eZ)],[eR]:[RegExp(eR+"\\/"+eZ)],[e$]:[RegExp("FxiOS\\/"+eZ)],[eU]:[RegExp("Konqueror[:/]?"+eZ,"i")],[ev]:[RegExp(ev+" "+eZ),eQ],[eF]:[RegExp("android\\s"+eZ,"i")],[ey]:[RegExp(em+"\\/"+eZ)],[eB]:[RegExp("OculusBrowser\\/"+eZ)],[eW]:[RegExp(eW+"\\/"+eZ)],[eV]:[RegExp("YaBrowser\\/"+eZ)],[eG]:[RegExp(eG+"\\/"+eZ)],[eX]:[RegExp(eX+"\\/"+eZ)],[eY]:[RegExp("(DuckDuckGo|Ddg)\\/"+eZ)],[eK]:[RegExp("PaleMoon\\/"+eZ)],[eJ]:[RegExp(eJ+"\\/"+eZ)],[eE]:[RegExp("(rv:|MSIE )"+eZ)],Mozilla:[RegExp("rv:"+eZ)]},e6=function(e,t,i){var r=e5[e8(e,t,i)];if(U(r))return null;for(var s=0;r.length>s;s++){var n=e.match(r[s]);if(n)return parseFloat(n[n.length-2])}return null},e9=[[RegExp(eT+"; "+eT+" (.*?)[);]","i"),e=>[eT,e&&e[1]||""]],[RegExp(eI,"i"),[eI,""]],[RegExp(eM,"i"),[eM,""]],[e2,[ev,""]],[RegExp(eA,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eL,""];if(new RegExp(el).test(t)&&!/IEMobile\b/.test(t))return[eA+" "+el,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=e4[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[eA,r]}return[eA,""]}],[/((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=U(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+eu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+eu+")","i"),e=>e&&e[2]?[eu,[e[2],e[3],e[4]||"0"].join(".")]:[eu,""]],[/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/,[ex,""]],[/Linux|debian/i,["Linux",""]]],e7=function(e){return e3.test(e)?eI:e1.test(e)?eM:e0.test(e)?eT:RegExp(eq,"i").test(e)?eq:RegExp("("+eL+"|WPDesktop)","i").test(e)?eL:/iPad/.test(e)?eh:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ef:e2.test(e)?ev:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eD,"i").test(e)?eD:/(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(el).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)?eu:ed:RegExp("(pda|"+el+")","i").test(e)?ez:RegExp(ec,"i").test(e)&&!RegExp(ec+" pc","i").test(e)?eH:""},te=e=>e instanceof Error,tt={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}},ti=tt.info;function tr(e){var t=[];for(var i in e){var r=e[i];V(r)||U(r)||t.push({key:i,value:function e(t){if(J(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(q(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}class ts{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 _(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&q(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
3pFirstLines:0),t.chunkIdMap)),m({},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 _(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,m({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return ea&&i.length===eo||(eo=i.length,ea=i.reduce((i,r)=>{en||(en={});var s=en[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,en[r]=[l,u];break}}return i},{})),ea}}(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 m({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function tn(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return U(r)||(n.lineno=r),U(s)||(n.colno=s),n}var to=(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]},ta=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tl=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tu=/\((\S*)(?::(\d+))(?::(\d+))\)/,tc=(e,t)=>{var i=ta.exec(e);if(i){var[,r,s,n]=i;return tn(t,r,"?",+s,+n)}var o=tl.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=tu.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=to(o[1]||"?",o[2]);return tn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},td=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,th=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tp=(e,t)=>{var i=td.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=th.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]||"?";return[n,s]=to(n,s),tn(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tf=/\(error: (.*)\)/;class tg{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=B(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 Q(e,"DOMException")}isDOMError(e){return Q(e,"DOMError")}}class tv{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}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 t_{match(e){return Q(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var tm=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ty{match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(tm);return r&&(t=r[1],i=r[2]),[t,i]}}var tb=["fatal","error","warning","log","info","debug"];function tx(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(", ");
3if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class tw{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ee(e)?e.constructor.name:"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: "+tx(e)}isSeverityLevel(e){return B(e)&&!W(e)&&tb.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(te(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tE{match(e){return ee(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tx(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tS{match(e){return Z(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 Q(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ee(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 Z(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 tP="$message",tC="$timestamp",tO=new Set([tP,tC]),tR={enabled:!0,max_bytes:32768};function t$(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tR.enabled,max_bytes:function(e,t){if(!Y(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tR.max_bytes)}:m({},tR)}class tI{constructor(e){this.Yt=[],this.Xt=0,this.qt=t$(e)}setConfig(e){this.qt=t$(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,(e,i)=>{if("bigint"==typeof i)return i.toString();if("function"!=typeof i&&"symbol"!=typeof i){if(i instanceof Date)return i.toISOString();if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&"object"==typeof i){if(t.has(i))return"[Circular]";t.add(i)}return i}})}catch(e){return}}(e);if(t)try{var i=JSON.parse(t);if(!z(i))return;var r=i[tP],s=i[tC];if(!B(r)||0===r.trim().length||!B(s)&&!Y(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.qt.max_bytes||(this.Yt.push({step:t.step,bytes:i}),this.Xt+=i,this.er())}}getAttachable(){return this.Yt.map(e=>e.step)}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}}var tM=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,s={k(t){if(r&&(g.DEBUG||p.POSTHOG_DEBUG||i)&&!U(r.console)&&r.console){for(var s=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("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){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tM(e+" "+t,i)};return s},tT=tM("[PostHog.js]"),tF=tT.createLogger,tj=tF("[ExternalScriptsLoader]"),tA=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tj.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==o?void 0:o.querySelectorAll("script");
3if(r){for(var s,n=0;r.length>n;n++)if(s=function(){if(r[n].src===t){var e=r[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var a=()=>{if(!o)return i("document not found");var r=o.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=>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)o.head.appendChild(r);else{var s,n=o.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):o.body.appendChild(r)}};null!=o&&o.body?a():null==o||o.addEventListener("DOMContentLoaded",a)};p.__PosthogExtensions__=p.__PosthogExtensions__||{},p.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var s="/static/"+t+".js?v="+e.version;"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5)),r=e.requestRouter.endpointFor("assets",s)}tA(e,r,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tA(e,n,i)}},p.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);tA(e,r,i)};var tL="$people_distinct_id",tD="$device_id",tq="__alias",tN="__timers",tz="$autocapture_disabled_server_side",tH="$heatmaps_enabled_server_side",tU="$exception_capture_enabled_server_side",tB="$error_tracking_suppression_rules",tW="$error_tracking_capture_extension_exceptions",tV="$web_vitals_enabled_server_side",tG="$dead_clicks_enabled_server_side",tY="$product_tours_enabled_server_side",tK="$web_vitals_allowed_metrics",tJ="$session_recording_remote_config",tX="$replay_override_sampling",tZ="$replay_override_linked_flag",tQ="$replay_override_url_trigger",t0="$replay_override_event_trigger",t1="$sesid",t3="$session_is_sampled",t2="$enabled_feature_flags",t4="$active_feature_flags",t8="$early_access_features",t5="$feature_flag_details",t6="$feature_flag_payloads",t9="$feature_flag_request_id",t7="$override_feature_flags",ie="$override_feature_flag_payloads",it="$stored_person_properties",ii="$stored_group_properties",ir="$surveys",is="$surveys_activated",io="ph_product_tours",ia="$flag_call_reported",il="$flag_call_reported_session_id",iu="$feature_flag_errors",ic="$feature_flag_evaluated_at",id="$user_state",ih="$client_session_props",ip="$capture_rate_limit",ig="$initial_campaign_params",iv="$initial_referrer_info",i_="$initial_person_info",im="$epp",iy="__POSTHOG_TOOLBAR__",ib="$posthog_cookieless",ix="$sdk_debug_extensions_init_method",iw="$sdk_debug_extensions_init_time_ms",iE="$sdk_debug_recording_script_not_loaded",iS="PostHog loadExternalDependency extension not found.",ik="on_reject",iP="always",iC="anonymous",iO="identified",iR="identified_only",i$="visibilitychange",iI="beforeunload",iM="$pageview",iT="$pageleave",iF="$identify",ij="$groupidentify";function iA(e,t){q(e)&&e.forEach(t)}function iL(e,t){if(!G(e))if(q(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)L.call(e,i)&&t(e[i],i)}var iD=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 iq(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var iN=function(e){try{return e()}catch(e){return}},iz=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){tT.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tT.critical(e)}}},iH=function(e){var t={};return iL(e,function(e,i){(B(e)&&e.length>0||Y(e))&&(t[i]=e)}),t},iU=["herokuapp.com","vercel.app","netlify.app"];function iB(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}function iW(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Y(e)&&isFinite(e)&&Math.floor(e)===e});class iV{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 iV(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 iV(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 iG{constructor(){this.S=0,this.C=0,this.I=new iJ}generate(){var e=this.generateOrAbort();if(U(e)){this.S=0;var t=this.generateOrAbort();if(U(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.T())}return iV.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var iY,iK=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};
3r&&!U(r.crypto)&&crypto.getRandomValues&&(iK=e=>crypto.getRandomValues(e));class iJ{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(iK(this.M),this.R=0),this.M[this.R++]}}var iX=()=>iZ().toString(),iZ=()=>(iY||(iY=new iG)).generate(),iQ="",i0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,i1={O:()=>!!o,D(e){tT.error("cookieStore error: "+e)},A(e){if(o){try{for(var t=e+"=",i=o.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}},F(e){var t;try{t=JSON.parse(i1.A(e))||{}}catch(e){}return t},N(e,t,i,r,s){if(o)try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),iQ)return iQ;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+iX();!iQ&&r--;){var n=i.slice(r).join("."),a=s+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(s)&&(t.cookie=a+";max-age=0",iQ=n)}return iQ}(e);if(!i){var r,s=(r=e.match(i0))?r[0]:"";s!==i&&tT.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(o.location.hostname,r);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}s&&(a="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+a;return c.length>3686.4&&tT.warn("cookieStore warning: large cookie, len="+c.length),o.cookie=c,c}catch(e){return}},q(e,t){if(null!=o&&o.cookie)try{i1.N(e,"",-1,t)}catch(e){return}}},i3=null,i2={O(){if(!V(i3))return i3;var e=!0;if(U(r))e=!1;else try{var t="__mplssupport__";i2.N(t,"xyz"),'"xyz"'!==i2.A(t)&&(e=!1),i2.q(t)}catch(t){e=!1}return e||tT.error("localStorage unsupported; falling back to cookie store"),i3=e,e},D(e){tT.error("localStorage error: "+e)},A(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){i2.D(e)}return null},F(e){try{return JSON.parse(i2.A(e))||{}}catch(e){}return null},N(e,t){try{null==r||r.localStorage.setItem(e,JSON.stringify(t))}catch(e){i2.D(e)}},q(e){try{null==r||r.localStorage.removeItem(e)}catch(e){i2.D(e)}}},i4=[tD,"distinct_id",t1,t3,im,i_,id],i8={},i5={O:()=>!0,D(e){tT.error("memoryStorage error: "+e)},A:e=>i8[e]||null,F:e=>i8[e]||null,N(e,t){i8[e]=t},q(e){delete i8[e]}},i6=null,i9={O(){if(!V(i6))return i6;if(i6=!0,U(r))i6=!1;else try{var e="__support__";i9.N(e,"xyz"),'"xyz"'!==i9.A(e)&&(i6=!1),i9.q(e)}catch(e){i6=!1}return i6},D(e){tT.error("sessionStorage error: ",e)},A(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){i9.D(e)}return null},F(e){try{return JSON.parse(i9.A(e))||null}catch(e){}return null},N(e,t){try{null==r||r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){i9.D(e)}},q(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){i9.D(e)}}};class i7{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===iP||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===ik}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qt.opt_out_capturing_by_default}optInOut(e){this.nr.N(this.sr,+!!e,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.A(this.sr);return T(et,e)?1:T(ei,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t="localStorage"===e?i2:i1;if(!this.ar||this.ar!==t){this.ar=t;var i="localStorage"===e?i1:i2;i.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(T(et,i.A(this.sr))),i.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,p.doNotTrack].some(e=>T(et,e))}}var re=tF("[Dead Clicks]"),rt=()=>!0,ri=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tG)),r=e.instance.config.capture_dead_clicks;return J(r)?r:!!z(r)||i};class rr{get lazyLoadedDeadClicksAutocapture(){return this.ur}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[tG]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr(()=>{this.hr()}):this.stop()}lr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?re.error("failed to load script",t):e()})}hr(){var e;if(o){if(!this.ur&&null!=(e=p.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=z(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ur=p.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ur.start(o),re.info("starting...")}}else re.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,re.info("stopping..."))}}var rs=tF("[SegmentIntegration]"),rn="posthog-js";function ro(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var a=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
3on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=a,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,d,h,p,f=(null==(l=t.exception)?void 0:l.values)||[],g=f.map(e=>m({},e,{stacktrace:e.stacktrace?m({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>m({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(u=f[0])?void 0:u.value)||t.message,$exception_type:null==(c=f[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=f[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=f[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(v.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),o&&(null==(p=e.exceptions)||p.sendExceptionEvent(v)),t}}class ra{constructor(e,t,i,r,s,n){this.name=rn,this.setupOnce=function(o){o(ro(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class rl{constructor(e){this.cr=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(tT.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){var e;this.pr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.cr)}destroy(){var e;null==(e=this.pr)||e.call(this),this.pr=void 0}doPageView(e,t){var i,s=this.gr(e,t);return this.dr={pathname:null!=(i=null==r?void 0:r.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.gr(e,null==(t=this.dr)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.dr)?void 0:e.pageViewId}}gr(e,t){var i=this.dr;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{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=s;if(!(U(n)||U(o)||U(a)||U(l)||U(u)||U(c))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=n>1?er(o/n,0,1,tT):1,h=n>1?er(a/n,0,1,tT):1,p=l>1?er(u/l,0,1,tT):1,f=l>1?er(c/l,0,1,tT):1;r=iD(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var ru={[tL]:{exposure:"hidden"},[tq]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tN]:{exposure:"hidden"},[tz]:{exposure:"event"},[tH]:{exposure:"hidden"},[tU]:{exposure:"event"},[tB]:{exposure:"hidden"},[tW]:{exposure:"event"},[tV]:{exposure:"event"},[tG]:{exposure:"event"},[tY]:{exposure:"hidden"},[tK]:{exposure:"event"},[tJ]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[t1]:{exposure:"hidden"},[t3]:{exposure:"event"},$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"},[t2]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!z(e))return{};for(var t={},i=Object.keys(e),r=0;i.length>r;r++)t["$feature/"+i[r]]=e[i[r]];return t}},[t4]:{exposure:"event"},[t8]:{exposure:"hidden"},[t5]:{exposure:"hidden"},[t6]:{exposure:"event"},[t9]:{exposure:"event"},[t7]:{exposure:"event"},[ie]:{exposure:"hidden"},[it]:{exposure:"hidden"},[ii]:{exposure:"hidden"},[ir]:{exposure:"hidden"},[is]:{exposure:"event"},[io]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"}
3,$conversations_user_traits:{exposure:"event"},[ia]:{exposure:"hidden"},[il]:{exposure:"hidden"},[iu]:{exposure:"hidden"},[ic]:{exposure:"hidden"},[id]:{exposure:"hidden"},[ih]:{exposure:"hidden"},[ip]:{exposure:"hidden"},[ig]:{exposure:"hidden"},[iv]:{exposure:"hidden"},[i_]:{exposure:"hidden"},[im]:{exposure:"hidden"},[tX]:{exposure:"event"},[tZ]:{exposure:"event"},[tQ]:{exposure:"event"},[t0]:{exposure:"event"},[ix]:{exposure:"event"},[iw]:{exposure:"event"},[iE]:{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"}},rc=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rd=e=>{var t=null==o?void 0:o.createElement("a");return U(t)?null:(t.href=e,t)},rh=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(!q(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){tT.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},rp=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=[],c=0;l.length>c;c++){var d=l[c].split("=");q(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(l[c]))}var h=a;return null!=o&&(h+="?"+u.join("&")),null!=s&&(h+="#"+s),h},rf=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rg="https?://(.*)",rv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],r_=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rv],rm="<masked>",ry=["li_fat_id"];function rb(e,t,i){if(!o)return{};var r,s=t?[...rv,...i||[]]:[],n=rx(rp(o.URL,s,rm),e);return iD((r={},iL(ry,function(e){var t=i1.A(e);r[e]=t||null}),r),n)}function rx(e,t){var i=r_.concat(t||[]),r={};return iL(i,function(t){var i=rh(e,t);r[t]=i||null}),r}function rw(e){var t=e?0===e.search(rg+"google.([^/?]*)")?"google":0===e.search(rg+"bing.com")?"bing":0===e.search(rg+"yahoo.com")?"yahoo":0===e.search(rg+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!V(t)){i.$search_engine=t;var r=o?rh(o.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function rE(){return navigator.language||navigator.userLanguage}var rS="$direct";function rk(){return(null==o?void 0:o.referrer)||rS}function rP(e,t){var i=e?[...rv,...t||[]]:[],r=null==a?void 0:a.href.substring(0,1e3);return{r:rk().substring(0,1e3),u:r?rp(r,i,rm):void 0}}function rC(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:i==rS?rS:null==(t=rd(i))?void 0:t.host};if(r){s.$current_url=r;var n=rd(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname,iD(s,rx(r))}return i&&iD(s,rw(i)),s}function rO(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rR=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class r${constructor(e,t){if(this.qt=e,this.props={},this.mr=!1,this.yr=(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.nr=this.br(e),this.load(),e.debug&&tT.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e,t),this.save(),r){var i=()=>this.flush();iB(r,"beforeunload",i,{capture:!1}),iB(r,"pagehide",i,{capture:!1})}}_r(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return Y(t)&&t>0?t:0}isDisabled(){return!!this.wr}br(e){-1===rR.indexOf(e.persistence.toLowerCase())&&(tT.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");
3var t,i,s=(void 0===(t=e.cookie_persisted_properties||[])&&(t=[]),i=[...i4,...t],m({},i2,{F(e){try{var t={};try{t=i1.F(e)||{}}catch(e){}var i=iD(t,JSON.parse(i2.A(e)||"{}"));return i2.N(e,i),i}catch(e){}return null},N(e,t,r,s,n,o){try{i2.N(e,t,void 0,void 0,o);var a={};i.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&i1.N(e,a,r,s,n,o)}catch(e){i2.D(e)}},q(e,t){try{null==r||r.localStorage.removeItem(e),i1.q(e,t)}catch(e){i2.D(e)}}})),n=e.persistence.toLowerCase();return"localstorage"===n&&i2.O()?i2:"localstorage+cookie"===n&&s.O()?s:"sessionstorage"===n&&i9.O()?i9:"memory"===n?i5:"cookie"===n?i1:s.O()?s:i1}Sr(e){var t=null!=e?e:this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[ic];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return iL(this.props,(t,i)=>{var r=(e=>{var t=ru[e];if(t)return t;for(var[i,r]of rc)if(0===e.indexOf(i))return r})(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,i===t2?()=>this.Sr():()=>!1))return;r.transformToEventProperties&&iD(e,r.transformToEventProperties(t))}else r&&"event"!==r.exposure||(e[i]=t)}),e}load(){if(!this.wr){var e=this.nr.F(this.yr);e&&(this.props=iD({},e))}}refreshKey(e){if(!this.wr){var t=this.nr.F(this.yr);t&&e in t?this.kr(e,t[e]):this.Cr(e)}}save(){if(!this.wr){var e=this._r();e>0?U(this.Ir)&&(this.Ir=setTimeout(()=>{this.Ir=void 0,this.Tr()},e)):this.Tr()}}flush(){U(this.Ir)||(clearTimeout(this.Ir),this.Ir=void 0,this.Tr())}Tr(){if(!this.wr){try{var e=JSON.stringify(this.props)+"|"+this.Er+"|"+this.Mr+"|"+this.Rr;if(e===this.Pr)return;this.Pr=e}catch(e){}this.nr.N(this.yr,this.props,this.Er,this.Mr,this.Rr,this.qt.debug)}}remove(){U(this.Ir)||(clearTimeout(this.Ir),this.Ir=void 0),this.nr.q(this.yr,!1),this.nr.q(this.yr,!0),this.Pr=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(z(e)){U(t)&&(t="None"),this.Er=U(i)?this.Or:i;var r=!1;if(iL(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.kr(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(z(e)){this.Er=U(t)?this.Or:t;var i=!1;if(iL(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.kr(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Cr(e),this.save())}update_campaign_params(){if(!this.mr){var e=rb(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);H(iH(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?rw(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rk(),$referring_domain:null!=o&&o.referrer&&(null==(e=rd(o.referrer))?void 0:e.host)||rS},void 0)}set_initial_person_info(){this.props[ig]||this.props[iv]||this.register_once({[i_]:rP(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};iL([iv,ig],t=>{var i=this.props[t];i&&iL(i,function(t,i){e["$initial_"+j(i)]=t})});var t,i,r=this.props[i_];return r&&iD(e,(t=rC(r),i={},iL(t,function(e,t){i["$initial_"+j(t)]=e}),i)),e}safe_merge(e){return iL(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Or=this.Er=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((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||[])){var r=this.br(e),s=this.props;this.clear(),this.nr=r,this.props=s,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Mr&&(this.Mr=e,this.remove(),this.save())}set_secure(e){e!==this.Rr&&(this.Rr=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[tN]||{};i[e]=t,this.kr(tN,i),this.save()}remove_event_timer(e){var t=this.props[tN]||{},i=t[e];return U(i)||(delete t[e],this.kr(tN,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.kr(e,t),this.save()}kr(e,t){this.props[e]=t}Cr(e){delete this.props[e]}}
3var rI="events",rM="cancelEvents",rT="survey shown",rF="survey sent",rj="popover",rA=tF("[RateLimiter]");class rL{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=>{rA.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rA.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,{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(ip))?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;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(ip,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rD=tF("[RemoteConfig]");class rq{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Lr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Fr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return rD.info("Using preloaded remote config",this.remoteConfig),this.Ar(this.remoteConfig),void this.Nr();if(this._instance.Dr())return void rD.warn("Remote config is disabled. Falling back to local config.");this.Lr(e=>{e?(this.Ar(e),this.Nr()):(rD.info("No config found after loading remote JS config. Falling back to JSON."),this.Fr(e=>{this.Ar(e),this.Nr()}))})}catch(e){rD.error("Error loading remote config",e)}}stop(){this.$r&&(clearInterval(this.$r),this.$r=void 0)}refresh(){!this._instance.Dr()&&o&&"hidden"!==o.visibilityState&&this._instance.reloadFeatureFlags()}Nr(){var e;if(!this.$r){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.$r=setInterval(()=>{this.refresh()},t))}}Ar(e){var t;e||rD.error("Failed to fetch remote config from PostHog."),this._instance.Ar(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var rN="gzip-js",rz="base64",rH=Uint8Array,rU=Uint16Array,rB=Uint32Array,rW=new rH([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]),rV=new rH([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]),rG=new rH([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rY=function(e,t){for(var i=new rU(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new rB(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]},rK=rY(rW,2),rJ=rK[1];rK[0][28]=258,rJ[258]=28;for(var rX=rY(rV,0)[1],rZ=new rU(32768),rQ=0;32768>rQ;++rQ){var r0=(43690&rQ)>>>1|(21845&rQ)<<1;rZ[rQ]=((65280&(r0=(61680&(r0=(52428&r0)>>>2|(13107&r0)<<2))>>>4|(3855&r0)<<4))>>>8|(255&r0)<<8)>>>1}var r1=function(e,t,i){for(var r=e.length,s=0,n=new rU(t);r>s;++s)++n[e[s]-1];var o,a=new rU(t);for(s=0;t>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new rU(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],c=t-e[s],d=a[e[s]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)o[rZ[d]>>>l]=u}else for(o=new rU(r),s=0;r>s;++s)o[s]=rZ[a[e[s]-1]++]>>>15-e[s];return o},r3=new rH(288);for(rQ=0;144>rQ;++rQ)r3[rQ]=8;for(rQ=144;256>rQ;++rQ)r3[rQ]=9;for(rQ=256;280>rQ;++rQ)r3[rQ]=7;for(rQ=280;288>rQ;++rQ)r3[rQ]=8;var r2=new rH(32);for(rQ=0;32>rQ;++rQ)r2[rQ]=5;var r4=r1(r3,9,0),r8=r1(r2,5,0),r5=function(e){return(e/8|0)+(7&e&&1)},r6=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof rU?rU:e instanceof rB?rB:rH)(i-t);return r.set(e.subarray(t,i)),r},r9=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},r7=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},se=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 rH(0),0];if(1==s){var o=new rH(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,c=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=i[i[d].f>i[u].f?u++:d++],l=i[u!=c&&i[d].f>i[u].f?u++:d++],i[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=n[0].s;for(r=1;s>r;++r)n[r].s>h&&(h=n[r].s);var p=new rU(h+1),f=st(i[c-1],p,0);if(f>t){r=0;var g=0,v=f-t,_=1<<v;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;g+=_-(1<<f-p[m]),p[m]=t}for(g>>>=v;g>0;){var y=n[r].s;t>p[y]?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}f=t}return[new rH(p),f]},st=function(e,t,i){return -1==e.s?Math.max(st(e.l,t,i+1),st(e.r,t,i+1)):t[e.s]=i},si=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new rU(++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]},sr=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},ss=function(e,t,i){var r=i.length,s=r5(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)},sn=function(e,t,i,r,s,n,o,a,l,u,c){r9(t,c++,i),++s[256];for(var d=se(s,15),h=d[0],p=d[1],f=se(n,15),g=f[0],v=f[1],_=si(h),m=_[0],y=_[1],b=si(g),x=b[0],w=b[1],E=new rU(19),S=0;m.length>S;
3++S)E[31&m[S]]++;for(S=0;x.length>S;++S)E[31&x[S]]++;for(var k=se(E,7),P=k[0],C=k[1],O=19;O>4&&!P[rG[O-1]];--O);var R,$,I,M,T=u+5<<3,F=sr(s,r3)+sr(n,r2)+o,j=sr(s,h)+sr(n,g)+o+14+3*O+sr(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(F>=T&&j>=T)return ss(t,c,e.subarray(l,l+u));if(r9(t,c,1+(F>j)),c+=2,F>j){R=r1(h,p,0),$=h,I=r1(g,v,0),M=g;var A=r1(P,C,0);for(r9(t,c,y-257),r9(t,c+5,w-1),r9(t,c+10,O-4),c+=14,S=0;O>S;++S)r9(t,c+3*S,P[rG[S]]);c+=3*O;for(var L=[m,x],D=0;2>D;++D){var q=L[D];for(S=0;q.length>S;++S)r9(t,c,A[N=31&q[S]]),c+=P[N],N>15&&(r9(t,c,q[S]>>>5&127),c+=q[S]>>>12)}}else R=r4,$=r3,I=r8,M=r2;for(S=0;a>S;++S)if(r[S]>255){r7(t,c,R[257+(N=r[S]>>>18&31)]),c+=$[N+257],N>7&&(r9(t,c,r[S]>>>23&31),c+=rW[N]);var N,z=31&r[S];r7(t,c,I[z]),c+=M[z],z>3&&(r7(t,c,r[S]>>>5&8191),c+=rV[z])}else r7(t,c,R[r[S]]),c+=$[r[S]];return r7(t,c,R[256]),c+$[256]},so=new rB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sa=function(){for(var e=new rB(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),sl=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},su=!!u||!!l,sc="text/plain",sd=!1,sh=function(e,t,i){void 0===i&&(i=!0);var r,s,n,o,a,[l,u]=e.split("?"),c=m({},t),d=null!=(a=null==u?void 0:u.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!=(t=c[r])?t:s;return delete c[r],r+"="+n}))?a:[],h=(void 0===r&&(r="&"),o=[],iL(c,function(e,t){U(e)||U(t)||"undefined"===t||(s=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+s)}),o.join(r));return h&&d.push(h),l+"?"+d.join("&")},sp=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),sf=e=>{if(e.tr)return e.tr;var{data:t,compression:i}=e;if(t){if(i===rN){var r,s,n,o,a,l,u,c,d=(r=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new rH(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 rH(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 r6(i,0,r)}(sp(t)),s={mtime:0},n=0xffffffff,o={p(e){for(var t=n,i=0;e.length>i;++i)t=sa[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},a=r.length,o.p(r),c=(l=10+(s.filename&&s.filename.length+1||0),u=function(e,t,i,r){var s=e.length,n=new rH(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=ss(o,a,e.subarray(l,u)):(o[l]=!0,a=ss(o,a,e.subarray(l,s)))}else{for(var c=so[t-1],d=c>>>13,h=8191&c,p=(1<<i)-1,f=new rU(32768),g=new rU(p+1),v=Math.ceil(i/3),_=2*v,m=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<_)&p},y=new rB(25e3),b=new rU(288),x=new rU(32),w=0,E=0,S=(l=0,0),k=0,P=0;s>l;++l){var C=m(l),O=32767&l,R=g[C];if(f[O]=R,g[C]=O,l>=k){var $=s-l;if((w>7e3||S>24576)&&$>423){a=sn(e,o,0,y,b,x,E,S,P,l-P,a),S=w=E=0,P=l;for(var I=0;286>I;++I)b[I]=0;for(I=0;30>I;++I)x[I]=0}var M=2,T=0,F=h,j=O-R&32767;if($>2&&C==m(l-j))for(var A=Math.min(d,$)-1,L=Math.min(32767,l),D=Math.min(258,$);L>=j&&--F&&O!=R;){if(e[l+M]==e[l+M-j]){for(var q=0;D>q&&e[l+q]==e[l+q-j];++q);if(q>M){if(M=q,T=j,q>A)break;var N=Math.min(j,q-2),z=0;for(I=0;N>I;++I){var H=l-j+I+32768&32767,U=H-f[H]+32768&32767;U>z&&(z=U,R=H)}}}j+=(O=R)-(R=f[O])+32768&32767}if(T){y[S++]=0x10000000|rJ[M]<<18|rX[T];var B=31&rJ[M],W=31&rX[T];E+=rW[B]+rV[W],++b[257+B],++x[W],k=l+M,++w}else y[S++]=e[l],++b[e[l]]}}a=sn(e,o,!0,y,b,x,E,S,P,l-P,a)}return r6(n,0,r+r5(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&&sl(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),sl(u,c-8,o.d()),sl(u,c-4,a),u);return{contentType:sc,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(i===rz){let e;var h,p="data="+encodeURIComponent("string"==typeof(e=(h=sp(t))?btoa(encodeURIComponent(h).replace(/%([0-9A-F]{2})/g,(e,t)=>
3String.fromCharCode(parseInt(t,16)))):h)?e:sp(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var f=sp(t);return{contentType:"application/json",body:f,estimatedSize:new Blob([f]).size}}},sg=e=>{var t,i,r,s=sf(e);return!s||(i=e.compression,r=rh(e.url,"compression"),i!==E.GZipJS&&r!==E.GZipJS&&"gzip"!==r)||((t=s.body)instanceof ArrayBuffer?P(new Uint8Array(t)):ArrayBuffer.isView(t)&&P(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:s}:(sd=!0,{url:((e,t)=>{var[i,r]=e.split("#"),[s,n]=i.split("?");if(!n)return e;var o=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")})(e.url,"compression"),encodedBody:sf(m({},e,{compression:void 0,tr:void 0}))})},sv=(sW=_(function*(e){var t=sp(e.data),i=yield function(e,t,i){return $.apply(this,arguments)}(t,g.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return m({},e,{tr:{contentType:sc,body:r,estimatedSize:r.byteLength}})}),function(e){return sW.apply(this,arguments)}),s_=(e,t)=>sh(e,{_:(new Date).getTime().toString(),ver:g.JS_SDK_VERSION,compression:t}),sm=[];l&&sm.push({transport:"fetch",method(e){var t,{url:i,encodedBody:r}=sg(e),{contentType:s,body:n,estimatedSize:o}=null!=r?r:{},a=new Headers;iL(e.headers,function(e,t){a.append(t,e)}),s&&a.append("Content-Type",s);var u=null;if(c){var d=new c;u={signal:d.signal,timeout:setTimeout(()=>d.abort(),e.timeout)}}l(i,m({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(o||0),body:n,signal:null==(t=u)?void 0:t.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){tT.error(e)}null==e.callback||e.callback(r)})).catch(t=>{tT.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>u?clearTimeout(u.timeout):null)}}),u&&sm.push({transport:"XHR",method(e){var t=new u,{url:i,encodedBody:r}=sg(e);t.open(e.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};iL(e.headers,function(e,i){t.setRequestHeader(i,e)}),s&&t.setRequestHeader("Content-Type",s),e.timeout&&(t.timeout=e.timeout),e.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(4===t.readyState){var i={statusCode:t.status,text:t.responseText};if(200===t.status)try{i.json=JSON.parse(t.responseText)}catch(e){}null==e.callback||e.callback(i)}},t.send(n)}}),null!=n&&n.sendBeacon&&sm.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=sg(e),r=sh(t,{beacon:"1"}),{contentType:s,body:o}=null!=i?i:{};if(!o)return;var a=o instanceof Blob?o:new Blob([o],{type:s});n.sendBeacon(r,a)}catch(e){}}});class sy{constructor(e,t){this.qr=!0,this.jr=[],this.Hr=er((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tT.createLogger("flush interval"),3e3),this.Ur=e}enqueue(e){this.jr.push(e),this.Br||this.zr()}unload(){this.Vr();var e=Object.values(this.jr.length>0?this.Wr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Ur(m({},e,{transport:"sendBeacon"}))})}enable(){this.qr=!1,this.zr()}zr(){var e=this;this.qr||(this.Br=setTimeout(()=>{if(this.Vr(),this.jr.length>0){var t=this.Wr();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&q(r.data)&&iL(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.Ur(r)}()}},this.Hr))}Vr(){clearTimeout(this.Br),this.Br=void 0}Wr(){var e={};return iL(this.jr,t=>{var i,r=(t?t.batchKey:null)||t.url;U(e[r])&&(e[r]=m({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.jr=[],e}}var sb=["retriesPerformedSoFar"];class sx{constructor(e){this.Zr=!1,this.Gr=3e3,this.jr=[],this._instance=e,this.jr=[],this.Qr=!0,!U(r)&&"onLine"in r.navigator&&(this.Qr=r.navigator.onLine,this.Jr=()=>{this.Qr=!0,this.Kr()},this.Yr=()=>{this.Qr=!1},iB(r,"online",this.Jr),iB(r,"offline",this.Yr))}get length(){return this.jr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=y(e,sb);K(t)&&(i.url=sh(i.url,{retry_count:t})),this._instance._send_request(m({},i,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==i.callback||i.callback(e):this.Xr(m({retriesPerformedSoFar:t},i))}}))}Xr(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.jr.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+s;
3navigator.onLine||(o+=" (Browser is offline)"),tT.warn(o),this.Zr||(this.Zr=!0,this.ei())}ei(){(this.ti&&clearTimeout(this.ti),0===this.jr.length)?(this.Zr=!1,this.ti=void 0):this.ti=setTimeout(()=>{this.Qr&&this.jr.length>0&&this.Kr(),this.ei()},this.Gr)}Kr(){var e=Date.now(),t=[],i=this.jr.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.jr=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.ti&&(clearTimeout(this.ti),this.ti=void 0),this.Zr=!1,U(r)||(this.Jr&&(r.removeEventListener("online",this.Jr),this.Jr=void 0),this.Yr&&(r.removeEventListener("offline",this.Yr),this.Yr=void 0)),this.jr))try{this._instance._send_request(m({},e,{transport:"sendBeacon"}))}catch(e){tT.error(e)}this.jr=[]}}class sw{constructor(e){this.ri=()=>{this.ii||(this.ii={});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.ii.lastScrollY=Math.ceil(n),this.ii.maxScrollY=Math.max(n,null!=(e=this.ii.maxScrollY)?e:0),this.ii.maxScrollHeight=Math.max(o,null!=(t=this.ii.maxScrollHeight)?t:0),this.ii.lastContentY=a,this.ii.maxContentY=Math.max(a,null!=(i=this.ii.maxContentY)?i:0),this.ii.maxContentHeight=Math.max(l,null!=(r=this.ii.maxContentHeight)?r:0)},this._instance=e}get ni(){return this._instance.config.scroll_root_selector}getContext(){return this.ii}resetContext(){var e=this.ii;return setTimeout(this.ri,0),e}startMeasuringScrollPosition(){iB(r,"scroll",this.ri,{capture:!0}),iB(r,"scrollend",this.ri,{capture:!0}),iB(r,"resize",this.ri)}scrollElement(){if(!this.ni)return null==r?void 0:r.document.documentElement;for(var e of q(this.ni)?this.ni:[this.ni]){var t=null==r?void 0:r.document.querySelector(e);if(t)return t}}scrollY(){if(this.ni){var e=this.scrollElement();return e&&e.scrollTop||0}return r&&(r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop)||0}scrollX(){if(this.ni){var e=this.scrollElement();return e&&e.scrollLeft||0}return r&&(r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft)||0}}var sE=e=>rP(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class sS{constructor(e,t,i,r){this.si=e=>{var t=this.oi();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ai(this._instance)};this.ui.register({[ih]:i})}},this._instance=e,this.li=t,this.ui=i,this.ai=r||sE,this.li.onSessionId(this.si)}oi(){return this.ui.props[ih]}getSetOnceProps(){var e,t=null==(e=this.oi())?void 0:e.props;return t?"r"in t?rC(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return iL(iH(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+j(i)]=t}),e}}class sk{constructor(){this.hi={}}on(e,t){return this.hi[e]||(this.hi[e]=[]),this.hi[e].push(t),()=>{this.hi[e]=this.hi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.hi[e]||[])i(t);for(var r of this.hi["*"]||[])r(e,t)}}var sP=tF("[SessionId]");class sC{on(e,t){return this.ci.on(e,t)}constructor(e,t,i){if(this.di=null,this.vi=[],this.fi=void 0,this.ci=new sk,this.pi=(e,t)=>!(!K(e)||!K(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iP)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=e.config,this.ui=e.persistence,this.gi=void 0,this.mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.yi=t||iX,this.bi=i||iX;var r,s=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*er(this.qt.session_idle_timeout_seconds||1800,60,36e3,sP.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.wi(),this.xi="ph_"+s+"_window_id",this.Si="ph_"+s+"_primary_window_exists",this.ki()){var n=i9.F(this.xi),o=i9.F(this.Si);n&&!o?this.gi=n:i9.q(this.xi),i9.N(this.Si,!0)}if(null!=(r=this.qt.bootstrap)&&r.sessionID)try{var a=(()=>{var e=this.qt.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw Error("Not a valid UUID");if("7"!==e[12])throw Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.Ci(this.qt.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){sP.error("Invalid sessionID in bootstrap",e)}this.Ii()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.vi)&&(this.vi=[]),this.vi.push(e),this.mi&&e(this.mi,this.gi),()=>{this.vi=this.vi.filter(t=>t!==e)}}ki(){return"memory"!==this.qt.persistence&&!this.ui.wr&&i9.O()}Ti(e){e!==this.gi&&(this.gi=e,this.ki()&&i9.N(this.xi,e))}Ei(){return this.gi?this.gi:this.ki()?i9.F(this.xi):null}Mi(e){var t=this.di;return!V(t)&&!V(e)&&5e3>Math.abs(e-t)}Ci(e,t,i){var r=t!==this._sessionActivityTimestamp,s=e===this.mi&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.mi=e,s&&!r||s&&this.Mi(t)||(this.di=t,this.ui.register({[t1]:[t,e,i]}))}Ri(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return K(t)&&t>0}Pi(){var e;if(!V(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.di){this.Ri()?this.ui.refreshKey(t1):(this.ui.flush(),this.ui.load());var[,t,i]=this.Oi();
3t===this.mi&&i===this._sessionStartTimestamp&&(this.di=this._sessionActivityTimestamp,this.ui.register({[t1]:[this._sessionActivityTimestamp,null!=(e=this.mi)?e:null,this._sessionStartTimestamp]}),this.ui.flush())}}Li(){var[e]=this.Oi();return Math.max(K(e)?e:0,K(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Oi(){var e=this.ui.props[t1];return q(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.di=null,clearTimeout(this.Fi),this.Fi=void 0,this.Ci(null,null,null)}destroy(){this.Pi(),clearTimeout(this.Fi),this.Fi=void 0,this.fi&&r&&(r.removeEventListener(iI,this.fi,{capture:!1}),this.fi=void 0),this.vi=[]}Ii(){this.fi=()=>{this.Pi(),this.ki()&&i9.q(this.Si)},iB(r,iI,this.fi,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.qt.cookieless_mode===iP)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,r,s]=this.Oi(),n=this.Li(),o=this.Ei(),a=K(s)&&Math.abs(i-s)>864e5,l=!1,u=!r,c=!u&&!e&&this.pi(i,n);u||c||a?(r=this.yi(),o=this.bi(),sP.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),s=i,l=!0):o||(o=this.bi(),l=!0);var d=K(n)&&e&&!a?n:i,h=K(s)?s:(new Date).getTime();return this.Ti(o),this.Ci(r,d,h),e||this.wi(),l&&this.vi.forEach(e=>e(r,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0)),{sessionId:r,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:n}}wi(){clearTimeout(this.Fi),this.Fi=setTimeout(()=>{var e=this.Li();if(this.pi((new Date).getTime(),e)){var t=this.mi;this.resetSessionId(),this.ci.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var sO=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&M(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>M(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},sR=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 s$(e,t,i){return sp({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sI={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=>sR(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!sR(t,e))),icontains:(e,t)=>t.map(sM).some(t=>e.map(sM).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(sM).every(t=>e.map(sM).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))})},sM=e=>e.toLowerCase();function sT(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,s=null==t?void 0:t[i];if(U(s)||V(s))return!1;var n=[String(s)],o=sI[r.operator];return!!o&&o(r.values,n)})}var sF="custom",sj="i.posthog.com",sA=/^\/static\//;class sL{constructor(e){this.Ai={},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("."+sj,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ai[this.apiHost]||(this.Ai[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":sF),this.Ai[this.apiHost]}Ni(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof t&&sA.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.Ni(t);if(i)return""+i+t}if(this.region===sF)return this.apiHost+t;var r=sj+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var sD=tF("[Surveys]"),sq="seenSurvey_",sN=["popover","widget","a
3pi"],sz={ignoreConditions:!1,ignoreDelay:!1,displayType:rj},sH=tF("[PostHog ExternalIntegrations]"),sU={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class sB{constructor(e){this._instance=e}lr(e,t){var i;null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return sH.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=p.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.lr(sU[e],()=>{var i;null==(i=p.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=p.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=p.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(r)}}var sW,sV,sG={},sY=0,sK=()=>{},sJ='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',sX="Surveys module not available",sZ="sanitize_properties is deprecated. Use before_send instead",sQ="Invalid value for property_denylist config: ",s0="posthog",s1=!su&&-1===(null==h?void 0:h.indexOf("MSIE"))&&-1===(null==h?void 0:h.indexOf("Mozilla")),s3=e=>{var t;return m({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!B(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of iU)if(i===r)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:sK,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,debug:a&&B(null==a?void 0:a.search)&&-1!==a.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,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.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){tT.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:iR,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:sK,__preview_eager_load_replay:!1},{rageclick:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording: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})},s2=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],s4=e=>{var t={};for(var[i,r]of s2)U(e[i])||(t[r]=e[i]);var s=iD({},t,e);return q(e.property_blacklist)&&(U(e.property_denylist)?s.property_denylist=e.property_blacklist:q(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:tT.error(sQ+e.property_denylist)),s};class s8{constructor(){this.__forceAllowLocalhost=!1}get Di(){return this.__forceAllowLocalhost}set Di(e){tT.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class s5{$i(e,t){if(e){var i=this.qi.indexOf(e);-1!==i&&this.qi.splice(i,1)}return this.qi.push(t),null==t.initialize||t.initialize(),t}ji(){return this.config.cookieless_mode===iP||this.config.cookieless_mode===ik&&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 s8,this.Hi=!1,this.version=g.LIB_VERSION,this.Ui=new sk,this.qi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=s3(),this.SentryIntegration=ra,this.sentryIntegration=e=>{var t;return t=ro(this,e),{name:rn,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Bi=!1,this.zi=null,this.Vi=null,this.Wi=null,this.scrollManager=new sw(this),this.pageViewM
3anager=new rl(this),this.rateLimiter=new rL(this),this.requestRouter=new sL(this),this.consent=new i7(this),this.externalIntegrations=new sB(this);var e,t=null!=(e=s5.__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.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var r=B(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=B(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>tT.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==s0){var r,s=null!=(r=sG[i])?r:new s5;return s._init(e,t,i),sG[i]=s,sG[s0][i]=s,s}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,n,o=B(e)?e.trim():"";if(!o)return tT.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Zi(t.debug),this.Gi=t,this.Qi=[],t.person_profiles?this.Vi=t.person_profiles:t.process_person&&(this.Vi=t.process_person),this.set_config(iD({},s3(t.defaults),s4(t),{name:i,token:o})),this.config.on_xhr_error&&tT.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rN;var a=this.Ji();this.persistence=new r$(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r$(m({},this.config,{persistence:"sessionStorage"}),a);var l=m({},this.persistence.props),u=m({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ki=new sy(e=>this.Yi(e),this.config.request_queue_config),this.Xi=new sx(this),this.__request_queue=[];var c=this.ji();if(c||(this.sessionManager=new sC(this),this.sessionPropsManager=new sS(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tT.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.en(c)},0)):(tT.info("Initializing extensions synchronously"),this.en(c)),g.DEBUG=g.DEBUG||this.config.debug,g.DEBUG&&tT.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:l,s:u}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=m({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var d=t.bootstrap.distinctID,h=this.get_distinct_id(),p=this.persistence.get_property(id);if(t.bootstrap.isIdentifiedID&&null!=h&&h!==d&&p===iC)this.identify(d);else if(t.bootstrap.isIdentifiedID&&null!=h&&h!==d&&p===iO)tT.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 f=this.config.get_device_id(iX()),v=t.bootstrap.isIdentifiedID?f:d;this.persistence.set_property(id,t.bootstrap.isIdentifiedID?iO:iC),this.register({distinct_id:d,$device_id:v})}}if(c)this.register_once({distinct_id:ib,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(iX());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(id,iC)}return iB(r,"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()||iX();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(id,iO)),t()},s=i.user();"then"in s&&N(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register((Promise&&Promise.resolve||rs.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()||(rs.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rs.info("UserId set, identifying with PostHog"),e.identify(t.event.userId)
3);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,iM),identify:e=>r(e,iF),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.tn()):this.tn(),N(this.config._onCapture)&&this.config._onCapture!==sK&&(tT.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tT.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}en(e){var t,i,r,s,n,o,a,l=performance.now(),u=m({},s5.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.qi.push(this.featureFlags=null!=(t=this.featureFlags)?t:new u.featureFlags(this)),u.exceptions&&this.qi.push(this.exceptions=null!=(i=this.exceptions)?i:new u.exceptions(this)),u.historyAutocapture&&this.qi.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.qi.push(new u.tracingHeaders(this)),u.siteApps&&this.qi.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.qi.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.qi.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.qi.push(this.surveys=null!=(r=this.surveys)?r:new u.surveys(this)),u.logs&&this.qi.push(this.logs=null!=(s=this.logs)?s:new u.logs(this)),u.conversations&&this.qi.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.qi.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.qi.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.qi.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.qi.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.qi.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,ri)),u.toolbar&&this.qi.push(this.toolbar=null!=(o=this.toolbar)?o:new u.toolbar(this)),u.experiments&&this.qi.push(this.experiments=null!=(a=this.experiments)?a:new u.experiments(this)),this.qi.forEach(e=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.rn){var e=this.rn;this.rn=void 0,this.Ar(e)}}),this.nn(c,l)}nn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.nn(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tT.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[ix]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iw]:r}),this.config.__preview_deferred_init_extensions&&tT.info("PostHog extensions initialized ("+r+"ms)")}Ar(e){var t;o&&o.body?(this.config.__preview_deferred_init_extensions&&(this.rn=e),this.sn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=T(e.supportedCompression,rN)?rN:T(e.supportedCompression,rz)?rz:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vi?this.Vi:iR}),this.qi.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(tT.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Ar(e)},500))}tn(){try{this.config.loaded(this)}catch(e){tT.critical("`loaded` function failed",e)}if(this.an(),this.config.internal_or_test_user_hostname&&null!=a&&a.hostname){var e=a.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.ji())&&this.un()},1),this.ln=new rq(this),this.ln.load()}an(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Ki)||e.enable())}_dom_loaded(){this.is_capturing()&&iA(this.__request_queue,e=>this.Yi(e)),this.__request_queue=[],this.an()}_handle_unload(){var e,t,i,r;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.hn()&&this.capture(iT),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.Ki)||i.unload(),null==(r=this.
3Xi)||r.unload()):this.hn()&&this.capture(iT,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(s1?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sh(e.url,{ip:+!!this.config.ip}),e.headers=m({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=m({},e);s.timeout=s.timeout||6e4,s.url=s_(s.url,s.compression);var n=null!=(t=s.transport)?t:"fetch",o=sm.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),a=null!=(i=null==(r=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===n)return e[t]}(o))?void 0:r.method)?i:o[0].method;if(!a)throw Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===rN&&d&&!sd?sv(s).then(e=>{a(e)}).catch(t=>{C(t)?(sd=!0,a(m({},s,{compression:void 0,url:s_(e.url,void 0)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return C(e)||t===k})(t)&&(sd=!0),a(s))}):a(s)})(m({},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)}}))))}Yi(e){this.Xi?this.Xi.retriableRequest(e):this._send_request(e)}_execute_array(e){sY++;try{var t,i=[],r=[],s=[];iA(e,e=>{if(e)if(q(t=e[0]))s.push(e);else if(N(e))try{e.call(this)}catch(t){tT.error("Error executing queued PostHog call",e,t)}else q(e)&&"alias"===t?i.push(e):q(e)&&-1!==t.indexOf("capture")&&N(this[t])?s.push(e):r.push(e)});var n=function(e,t){iA(e,function(e){try{if(q(e[0])){var i=t;iL(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tT.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{sY--}}push(e){if(sY>0&&q(e)&&B(e[0])){var t=s5.prototype[e[0]];N(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.Ki){if(this.is_capturing())if(!U(e)&&B(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&&!B(null==t?void 0:t.$current_url)&&(tT.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.cn||tT.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 c=new Date,d=(null==i?void 0:i.timestamp)||c,h=(null==i?void 0:i.uuid)||iX(),p={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},d,h)};e===iM&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var f,g,v,_=this.dn(null==i?void 0:i.$set_once,e!==ij,e===iF);if(_&&(p.$set_once=_),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=p,o=e=>B(e)?e.slice(0,s):e,a=new Set,p=function e(t,i){var r;return t!==Object(t)?o?o(t):t:a.has(t)?void 0:(a.add(t),q(t)?(r=[],iA(t,t=>{r.push(e(t))})):(r={},iL(t,(t,i)=>{a.has(t)||(r[i]=e(t,i))})),r)}(n)),p.timestamp=d,U(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=c),"survey dismissed"===e||e===rF){var y=null==t?void 0:t.$survey_id,b=null==t?void 0:t.$survey_iteration;(e=>{try{var t,i=(t=""+sq+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+sq+e.id+"_"+e.current_iteration),t);
3if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){sD.error("Failed to persist survey seen state",e)}})({id:y,current_iteration:b}),p.$set=m({},p.$set,{[(f={id:y,current_iteration:b},v="$survey_"+(g=e===rF?"responded":"dismissed")+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(v="$survey_"+g+"/"+f.id+"/"+f.current_iteration),v)]:!0})}else e===rT&&(p.$set=m({},p.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var x=null==t?void 0:t.$product_tour_type;x&&(p.$set=m({},p.$set,{["$product_tour_last_seen_date/"+x]:(new Date).toISOString()}))}var w=m({},p.properties.$set,p.$set);if(H(w)||this.setPersonPropertiesForFlags(w),!G(this.config.before_send)){var E=this.vn(p);if(!E)return;p=E}this.Ui.emit("eventCaptured",p);var S={method:"POST",url:null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",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.Yi(S):this.Ki.enqueue(S),p}tT.critical("This capture call is ignored due to client rate limiting.")}}else tT.error("No event name provided to posthog.capture")}else tT.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var l,u=n?void 0:this.persistence.remove_event_timer(e),c=m({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.ji()&&(c.$cookieless_mode=!0),"$snapshot"===e){var d=m({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=d.distinct_id,(!B(c.distinct_id)&&!Y(c.distinct_id)||W(c.distinct_id))&&tT.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var p,f=function(e,t){if(!h)return{};var i,s,n,o,l,u,c,d,p,f,v,_,m=e?[...rv,...t||[]]:[],[y,b]=function(e){for(var t=0;e9.length>t;t++){var[i,r]=e9[t],s=i.exec(e),n=s&&(N(r)?r(s,e):r);if(n)return n}return["",""]}(h),x=null!=(l="u">typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},w=iD(iH({$os:y,$os_version:b,$browser:e8(h,navigator.vendor,x),$device:e7(h),$device_type:(c={userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(s=navigator)?void 0:s.maxTouchPoints,screenWidth:null==r||null==(n=r.screen)?void 0:n.width,screenHeight:null==r||null==(o=r.screen)?void 0:o.height,devicePixelRatio:null==r?void 0:r.devicePixelRatio},(_=e7(h))===eh||_===ed||"Kobo"===_||"Kindle Fire"===_||_===eH?ec:_===eI||_===eT||_===eM||_===eq?"Console":_===ef?"Wearable":_?el:"Android"===(null==c?void 0:c.userAgentDataPlatform)&&(null!=(d=null==c?void 0:c.maxTouchPoints)?d:0)>0?600>Math.min(null!=(p=null==c?void 0:c.screenWidth)?p:0,null!=(f=null==c?void 0:c.screenHeight)?f:0)/(null!=(v=null==c?void 0:c.devicePixelRatio)?v:1)?el:ec:"Desktop"),$timezone:rO(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rp(null==a?void 0:a.href,m,rm),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:h.length>1e3?h.substring(0,997)+"...":h,$browser_version:e6(h,navigator.vendor,x),$browser_language:rE(),$browser_language_prefix:"string"==typeof(u=rE())?u.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:g.LIB_NAME,$lib_version:g.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return g.SDK_DIST_CHANNEL&&(w.$sdk_dist_channel=g.SDK_DIST_CHANNEL),w}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:v,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());c.$session_id=v,c.$window_id=_}this.sessionPropsManager&&iD(c,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&iD(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null==(l=this.Xi)?void 0:l.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===sF&&(c.$lib_custom_api_host=this.config.api_host),p=e!==iM||n?e!==iT||n?this.pageViewM
3anager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),c=iD(c,p),e===iM&&o&&(c.title=o.title),!U(u)){var y=i.getTime()-u;c.$duration=parseFloat((y/1e3).toFixed(3))}h&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=iD({},f,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),q(this.config.property_denylist)?iL(this.config.property_denylist,function(e){delete c[e]}):tT.error(sQ+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tT.error(sZ),c=b(c,e));var x=this.fn();return c.$process_person_profile=x,x&&!n&&this.pn("_calculate_event_properties"),c}dn(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.fn()||this.Hi&&!i)return e;var r,s=iD({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tT.error(sZ),s=n(s,"$set_once")),t&&(this.Hi=!0),H(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;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}gn(e,t){this.register({[e]:t})}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)}isFeatureEnabled(e,t){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}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.Ui.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:sX}),()=>{})}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:sX})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:sX})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=sz),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:sX}}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:sX})}mn(e){return!e||W(e)?(tT.critical("Unique user id has not been set in posthog.identify"),!1):e===ib?(tT.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())||(tT.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tT.uninitializedWarning("posthog.identify");if(Y(e)&&(e=e.toString(),tT.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.mn(e)&&this.pn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tD)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(tq)&&(this.unregister(tq),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(id)||iC)===iC;e!==r&&n?(this.persistence.set_property(id,iO),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(iF,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.Wi=s$(e,t,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(ia))}}setPersonProperties(e,t){if((e||t)&&this.pn("posthog.setPersonProperties")){var i=s$(this.get_distinct_id(),e,t);this.Wi!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Wi=i):tT.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var r=this.getGroups(),s=r[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},r,{[e]:t})}),s||i){var n={$group_type:e,$group_key:t};
3i&&(n.$group_set=i),this.capture(ij,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else tT.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(){var e;null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.pn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tT.info("reset"),!this.__loaded)return tT.uninitializedWarning("posthog.reset");var t,i,r,s,n,o,a,l,u,c=this.get_property(tD),d=this.get_property(tJ);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),U(d)||null==(u=this.persistence)||u.register({[tJ]:d}),null==(r=this.surveys)||r.reset(),null==(s=this.ln)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(id,iC),null==(l=this.sessionManager)||l.resetSessionId(),this.Wi=null,this.config.cookieless_mode===iP)this.register_once({distinct_id:ib,$device_id:null},"");else{var h=this.config.get_device_id(iX());this.register_once({distinct_id:h,$device_id:e?h:c},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.yn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.bn()}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{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);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(tL)?(tT.critical("Attempting to create alias for existing People user - aborting."),-2):this.pn("posthog.alias")?(U(t)&&(t=this.get_distinct_id()),e!==t?(this.gn(tq,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tT.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=m({},this.config);if(z(e)){iD(this.config,s4(e));var i,r,s,n,o,a,l,u,c,d,h=this.Ji();null==(i=this.persistence)||i.update_config(this.config,t,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r$(m({},this.config,{persistence:"sessionStorage"}),h);var p=this.Zi(this.config.debug);J(p)&&(this.config.debug=p),J(this.config.debug)&&(this.config.debug?(g.DEBUG=!0,i2.O()&&i2.N("ph_debug",!0),tT.info("set_config",{config:e,oldConfig:t,newConfig:m({},this.config)})):(g.DEBUG=!1,i2.O()&&i2.q("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this._n(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){g.LIB_NAME=e,g.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(m({},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:s5.wn}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:s0;return t!==s0&&(t=s0+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(id))===iO||(null==(t=this.sessionPersistence)?void 0:t.get_property(id))===iO}fn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iR&&!this._isIdentified()&&H(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tq])&&(null==(t=this.persistence)||null==(t=t.props)||!t[im]))}hn(){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.fn()||this.pn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}pn(e){return"never"===this.config.person_profiles?(tT.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gn(im,!0),!0)}Ji(){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!==ik)}_n(){var e,t,i,r,s=this.Ji();return(null==(e=this.persistence)?void 0:e.wr)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.wr)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iP){if(this.ji()){this.reset(!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewM
3anager)||n.destroy(),this.sessionManager=new sC(this),this.pageViewManager=new rl(this),this.persistence&&(this.sessionPropsManager=new sS(this,this.sessionManager,this.persistence));var i,r,s,n,o,a,l,u,c=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=s5.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.$i(this.sessionRecording,new c(this)),this.sn&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.sn)))}this.consent.optInOut(!0),this._n(),this.an(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==ik&&(null==(i=this.surveys)||i.loadIfEnabled()),(U(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.un()}else tT.warn(sJ)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iP?(this.config.cookieless_mode===ik&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._n(),this.config.cookieless_mode===ik&&(this.register({distinct_id:ib,$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.un(),this.an())):tT.warn(sJ)}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===iP||(this.config.cookieless_mode===ik?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._n()}_is_bot(){return n?sO(n,this.config.custom_blocked_useragents):void 0}un(){o&&("visible"===o.visibilityState?this.Bi||(this.Bi=!0,this.capture(iM,{title:o.title},{send_instantly:!0}),this.zi&&(o.removeEventListener(i$,this.zi),this.zi=null)):this.zi||(this.zi=this.un.bind(this),iB(o,i$,this.zi)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.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}))}Dr(){var e,t,i,r,s=this.Gi||{};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?(tT.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&&!G(s[e]),r=t in s&&!G(s[t]),i?s[e]:!!r&&(tT&&tT.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}vn(e){if(G(this.config.before_send))return e;var t=q(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(G(i=r(i))){var s="Event '"+e.event+"' was rejected in beforeSend function";return X(e.event)?tT.warn(s+". This can cause unexpected behavior."):tT.info(s),null}i.properties&&!H(i.properties)||tT.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.dr)?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)})}Zi(e){var t=J(e)&&!e,i=i2.O()&&"true"===i2.A("ph_debug");return!t&&(!!i||e)}}function s6(e){return e instanceof Element&&(e.id===iy||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function s9(e){return!!e&&1===e.nodeType}function s7(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
3function ne(e){return!!e&&3===e.nodeType}function nt(e){return!!e&&11===e.nodeType&&s9(e.host)}function ni(e){return e?F(e).split(/\s+/):[]}function nr(e){var t=null==r?void 0:r.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function ns(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 ni(t)}function nn(e){return G(e)?null:F(e).split(/(\s+)/).filter(e=>nE(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function no(e){var t="";return ng(e)&&!nv(e)&&e.childNodes&&e.childNodes.length&&iL(e.childNodes,function(e){var i;ne(e)&&e.textContent&&(t+=null!=(i=nn(e.textContent))?i:"")}),F(t)}function na(e){var t;return U(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}s5.__defaultExtensionClasses={},s5.wn={trace:sV=()=>{},debug:sV,info:sV,warn:sV,error:sV,fatal:sV},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=iz(e.prototype[t[i]])}(s5,["identify"]);var nl=["a","button","form","input","select","textarea","label"];function nu(e,t){if(U(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function nc(e){var t=e.parentNode;return!(!t||!s9(t))&&t}var nd=["next","previous","prev",">","<"],nh=[".ph-no-rageclick",".ph-no-capture"],np=e=>!e||s7(e,"html")||!s9(e),nf=(e,t)=>{if(!r||np(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!s7(n,"body");)if(nt(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=nc(n);if(!o)break;if(t||nl.indexOf(o.tagName.toLowerCase())>-1)i=!0;else{var a=r.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}s.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:s}};function ng(e){for(var t=e;t.parentNode&&!s7(t,"body");t=t.parentNode){var i=ns(t);if(T(i,"ph-sensitive")||T(i,"ph-no-capture"))return!1}if(T(ns(e),"ph-include"))return!0;var r=e.type||"";if(B(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!B(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function nv(e){return!!(s7(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||s7(e,"select")||s7(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var n_="(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})",nm=RegExp("^(?:"+n_+")$"),ny=new RegExp(n_),nb="\\d{3}-?\\d{2}-?\\d{4}",nx=RegExp("^("+nb+")$"),nw=RegExp("("+nb+")");function nE(e,t){return void 0===t&&(t=!0),!(G(e)||B(e)&&(e=F(e),(t?nm:ny).test((e||"").replace(/[- ]/g,""))||(t?nx:nw).test(e)))&&!0}function nS(e){var t=no(e);return nE(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&iL(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=no(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tT.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function nk(e){return e.replace(/"|\\"/g,'\\"')}class nP{constructor(e){this.disabled=!1===e;var t=z(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 nC="$copy_autocapture",nO=tF("[AutoCapture]");function nR(e,t){return t.length>e?t.slice(0,e)+"...":t}var n$=tF("[ExceptionAutocapture]");function nI(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);return N(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]===s&&(e[t]=r)}}catch(e){return()=>{}}}var nM=tF("[TracingHeaders]"),nT=tF("[Web Vitals]"),nF="disabled",nj="lazy_loading",nA="awaiting_config",nL="missing_config";tF("[SessionRecording]"),tF("[SessionRecording]");var nD="[SessionRecording]",nq=tF(nD),nN=tF("[Heatmaps]");function nz(e){return z(e)&&"clientX"in e&&"clientY"in e&&Y(e.clientX)&&Y(e.clientY)}var nH=tF("[Product Tours]"),nU=["$set_once","$set"],nB=tF("[SiteApps]"),nW="Error while initializing PostHog app with config id ";function nV(e,t,i){if(G(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 nG{constructor(e){this.xn=new sk,this.Sn=(e,t)=>this.kn(e,t)&&this.Cn(e,t)&&this.In(e,t)&&this.Tn(e,t),this.kn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.En=new Set,this.Mn=new Set}init(){var e,t;U(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(!U(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
3=>{var t,i;null==(t=this.Mn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.En)||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.En.has(e)||this.En.has(null==t?void 0:t.event))&&this.Mn&&(null==(i=this.Mn)?void 0:i.size)>0&&this.Mn.forEach(e=>{this.Rn(t,e)&&this.xn.emit("actionCaptured",e.name)})}Pn(e){this.onAction("actionCaptured",t=>e(t))}Rn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Sn(e,i))return!0;return!1}onAction(e,t){return this.xn.on(e,t)}Cn(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||!nV(r,t.url,t.url_matching||"contains"))return!1}return!0}In(e,t){return!!this.On(e,t)&&!!this.Ln(e,t)&&!!this.Fn(e,t)}On(e,t){if(null==t||!t.href)return!0;var i=this.An(e);if(i.length>0)return i.some(e=>nV(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&&nV((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}Ln(e,t){if(null==t||!t.text)return!0;var i=this.An(e);if(i.length>0)return i.some(e=>nV(e.text,t.text,t.text_matching||"exact")||nV(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;!G(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=>nV(e,n,o)))}Fn(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}An(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Tn(e,t){return null==t||!t.properties||0===t.properties.length||sT(t.properties.reduce((e,t)=>{var i=q(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 nY{constructor(e){this._instance=e,this.Nn=new Map,this.Dn=new Map,this.$n=new Map}qn(e,t){return!!e&&sT(e.propertyFilters,null==t?void 0:t.properties)}jn(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}Hn(e,t,i){var r=(i===rI?this.Nn:this.Dn).get(e),s=[];return this.Un(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.qn(n,t)})}register(e){var t;U(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Bn(e),this.zn(e))}zn(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.Vn&&(this.Vn=new nG(this._instance),this.Vn.init(),this.Vn.Pn(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.Vn)||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.$n.get(t.name);i&&i.push(e.id),this.$n.set(t.name,i||[e.id])}}))}))}Bn(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.Nn=this.jn(e,rI),this.Dn=this.jn(e,rM))}onEvent(e,t){var i,r=this.le(),s=this.Wn(),n=this.Zn(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[s])||[];if(n===e&&t&&o.length>0){r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var a,l,u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=o.indexOf(u);0>c||(o.splice(c,1),this.Gn(o))}}else{if(this.Dn.has(e)){var d=this.Hn(e,t,rM);d.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map(e=>e.id)}
3),d.forEach(e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.Qn(e.id)}),this.Gn(o))}if(this.Nn.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Nn.get(e)});var h=this.Hn(e,t,rI);this.Gn(o.concat(h.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.Wn(),r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.$n.has(e)&&this.Gn(r.concat(this.$n.get(e)||[]))}Gn(e){var t=this.le(),i=[...new Set(e)].filter(e=>!this.Jn(e));t.info("updating activated items",{activatedItems:i}),this.Kn(i)}getActivatedIds(){var e,t=this.Wn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Nn}Yn(){return this.Vn}}class nK extends nY{constructor(e){super(e)}Wn(){return is}Zn(){return rT}Un(e){var t;null==(t=this._instance)||t.getSurveys(e)}Qn(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}le(){return sD}Kn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[is]:e})}Jn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var nJ="SDK is not enabled or survey functionality is not yet loaded",nX="Disabled. Not loading surveys.",nZ=null!=r&&r.location?rf(r.location.hash,"__posthog")||rf(location.hash,"state"):null,nQ="_postHogToolbarParams",n0=tF("[Toolbar]"),n1=tF("[FeatureFlags]"),n3=tF("[FeatureFlags]",{debugEnabled:!0}),n2="\" failed. Feature flags didn't load in time.",n4=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},n8=e=>{var t={};for(var[i,r]of iq(e||{}))r&&(t[i]=r);return t},n5=tF("[Error tracking]"),n6="Refusing to render web experiment since the viewer is a likely bot",n9={icontains:(e,t)=>!!r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!r&&sR(t.href,e),not_regex:(e,t)=>!!r&&!sR(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class n7{get qt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{n7.Xn("retrieved web experiments from the server"),t.es=new Map,e.forEach(e=>{if(e.feature_flag_key){t.es&&(n7.Xn("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.es)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);B(r)&&e.variants[r]&&t.ts(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];n7.rs(n)&&t.ts(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())n7.Xn(n6);else if(!this.qt.disable_web_experiments){if(G(this.es))return this.es=new Map,this.loadIfEnabled(),void this.previewWebExperiment();n7.Xn("applying feature flags",e),e.forEach(e=>{var t;if(this.es&&null!=(t=this.es)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.es)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.ts(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=n7.getWindowLocation();if(null!=e&&e.search){var t=rh(null==e?void 0:e.search,"__experiment_id"),i=rh(null==e?void 0:e.search,"__experiment_variant");t&&i&&(n7.Xn("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ns(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.qt.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.qt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}ns(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(n7.Xn("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.ts(r[0].name,t,r[0].variants[t].transforms))}static rs(e){return!G(e.conditions)&&n7.ss(e)&&n7.os(e)}static ss(e){if(G(e.conditions)||G(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,r,s,n=n7.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||n9[null!=(r=null==(s=e.conditions)?void 0:s.urlMatchType)?r:"icontains"](e.conditions.url,n))}
3static getWindowLocation(){return null==r?void 0:r.location}static os(e){if(G(e.conditions)||G(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rb();if(t.utm_source){var i,r,s,n,o,a,l,u,c,d=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,h=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,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return d&&p&&f&&h}return!1}static Xn(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];tT.info("[WebExperiments] "+e,i)}ts(e,t,i){this._is_bot()?n7.Xn(n6):"control"!==t?i.forEach(i=>{if(i.selector){n7.Xn("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)})}}):n7.Xn("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?sO(n,this.qt.custom_blocked_useragents):void 0}}var oe=tF("[Conversations]"),ot="Conversations not available yet.",oi={featureFlags:class{constructor(e){this.us=!1,this.ls=!1,this.hs=!1,this.cs=!1,this.ds=!1,this.vs=!1,this.fs=!1,this.ps=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ui(){return this._instance.persistence}gs(e){return this._instance.get_property(e)}ys(){var e,t;return null!=(e=null==(t=this.ui)?void 0:t.Sr(this.qt.feature_flag_cache_ttl_ms))&&e}bs(){return!!this.ys()&&(this.ps||this.hs||(this.ps=!0,n1.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_s(){var e,t=null!=(e=this.qt.evaluation_contexts)?e:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.fs||(n1.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.fs=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||n1.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}ws(){return this._s().length>0}xs(){var e=this.qt.flag_keys;if(!U(e)){if(q(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||n1.error("Invalid flag key found:",e,"Expected non-empty string"),t});n1.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,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)=>(o[t]&&(e[t]=o[t]),e),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var r=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},n=m({},r,e),o=m({},s,t),a={};for(var[l,u]of Object.entries(n)){var c="string"==typeof u;a[l]={key:l,enabled:!!c||!!u,variant:c?u:void 0,reason:void 0,metadata:U(null==o?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.gs(t5),t=this.gs(t7),i=this.gs(ie);if(!i&&!t)return e||{};var r=iD({},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=U(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,c=U(l)?a.variant:"string"==typeof l?l:void 0,d=null==i?void 0:i[s],h=m({},a,{enabled:u,variant:u?null!=c?c:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(h.original_enabled=null==a?void 0:a.enabled),c!==(null==a?void 0:a.variant)&&(h.original_variant=null==a?void 0:a.variant),d&&(h.metadata=m({},null==a?void 0:a.metadata,{payload:d,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),r[s]=h}return this.us||(n1.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.us=!0),r}getFlagVariants(){var e=this.gs(t2),t=this.gs(t7);if(!t)return e||{};for(var i=iD({},e),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.us||(n1.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.us=!0),i}getFlagPayloads(){var e=this.gs(t6),t=this.gs(ie);if(!t)return e||{};for(var i=iD({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.us||(n1.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.us=!0),i}reloadFeatureFlags(){this.cs||this.qt.advanced_disable_feature_flags||this.Ss||(this._instance.Ui.emit("featureFlagsReloading",!0),this.Ss=setTimeout(()=>{this.ks()},5))}Cs(){clearTimeout(this.Ss),this.Ss=void 0}ensureFlagsLoaded(){this.ls||this.hs||this.Ss||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.cs=e}ks(e){var t;if(this.Cs(),!this._instance.Dr())if(this.hs)this.ds=!0;else{var i=this.qt.token,r=this.gs(tD),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:m({},(null==(t=this.ui)?void 0:t.get_initial_props())||{},this.gs(it)||{}),group_properties:this.gs(ii),timezone:rO()};V(r)||U(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.ws()&&(s.evaluation_contexts=this._s());var n=this.xs();U(n)||(s.flag_keys=n);var o=!!this.qt.advanced_only_evaluate_survey_feature_flags,a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.hs=!0,this._instance._send_request({method:"POST",url:a,data:s,compression:this.qt.disable_compression?void 0:rz,timeout:this.qt.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(200===e.statusCode&&(this.ds||(this.$anon_distinct_id=void 0),n=!1),this.hs=!1,!s.disable_flags||this.ds){this.vs=!n;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&a.push("quota_limited"),null==(r=this.ui)||r.register({[iu]:a}),u)?n1.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."):(s.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:o}),this.ds&&(this.ds=!1,this.ks()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.vs)if(this.ls||this.getFlags()&&this.getFlags().length>0){if(!this.bs()){var r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}}else n1.warn('getFeatureFlag for key "'+e+n2)}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.vs)if(this.ls||this.getFlags()&&this.getFlags().length>0){if(!this.bs()){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],o=String(s),a=this.gs(t9)||void 0,l=this.gs(ic)||void 0,u=this.gs(ia)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),h=this.gs(il);d&&d!==h&&(u={},null==(c=this.ui)||c.register({[ia]:u,[il]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){q(u[e])?u[e].push(o):u[e]=[o],null==(v=this.ui)||v.register({[ia]:u});var p=this.getFeatureFlagDetails(e),f=[...null!=(_=this.gs(iu))?_:[]];U(s)&&f.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.qt.bootstrap)||null==(m
3=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.qt.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.vs};U(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var v,_,m,y,b,x,w,E,S,k,P,C=null!=(x=null==p||null==(w=p.reason)?void 0:w.description)?x:null==p||null==(E=p.reason)?void 0:E.code;C&&(g.$feature_flag_reason=C),null!=p&&null!=(S=p.metadata)&&S.id&&(g.$feature_flag_id=p.metadata.id),U(null==p?void 0:p.original_variant)&&U(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=U(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(k=p.metadata)&&k.original_payload&&(g.$feature_flag_original_payload=null==p||null==(P=p.metadata)?void 0:P.original_payload),f.length&&(g.$feature_flag_error=f.join(",")),this._instance.capture("$feature_flag_called",g)}if(r){var O=n;if(!U(n))try{O=JSON.parse(n)}catch(e){}return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:O}}}}else n1.warn('getFeatureFlagResult for key "'+e+n2)}getRemoteConfigPayload(e,t){var i=this.qt.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ws()&&(r.evaluation_contexts=this._s());var s=this.xs();U(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.qt.disable_compression?void 0:rz,timeout:this.qt.feature_flag_request_timeout_ms,callback(i){var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.vs){if(this.ls||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return U(i)?void 0:!!i}n1.warn('isFeatureEnabled for key "'+e+n2)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.ui){this.ls=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,r,s,n){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var o,a=((o=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return null==(t=o[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))):n1.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=a.flags,u=a.featureFlags,c=a.featureFlagPayloads;if(u){var d=e.requestId,h=e.evaluatedAt;if(q(u)){n1.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var f=0;u.length>f;f++)p[u[f]]=!0;t&&t.register({[t4]:u,[t2]:p})}else{var g=u,v=c,_=l;if(null!=n&&n.partialResponse)g=m({},i,g),v=m({},r,v),_=m({},s,_);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=m({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return y.has(t)}))),v=m({},r,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return y.has(t)}))),_=m({},s,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return y.has(t)})))}else g=m({},i,g),v=m({},r,v),_=m({},s,_);t&&t.register(m({[t4]:Object.keys(n8(g)),[t2]:g||{},[t6]:v||{},[t5]:_||{}},d?{[t9]:d}:{},h?{[ic]:h}:{}))}}}(e,this.ui,r,s,n,i),t||(this.ps=!1),this.Is(t)}}override(e,t){void 0===t&&(t=!1),n1.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ui)return n1.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.ui.unregister(t7),this.ui.unregister(ie),this.Is(),n3.info("All overrides cleared");if(q(e)){var t,i=n4(e);return this.ui.register({[t7]:i}),this.Is(),n3.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.us=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.ui.unregister(t7),n3.info("Flag overrides cleared");else if(e.flags){if(q(e.flags)){var r=n4(e.flags);this.ui.register({[t7]:r})}else this.ui.register({[t7]:e.flags});n3.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.ui.unregister(ie),n3.info("Payload overrides cleared")):e.payloads&&(this.ui.register({[ie]:e.payloads}),n3.info("Payload overrides set",{payloads:e.payloads}))),void this.Is()}if(e&&"object"==typeof e)return this.ui.register({[t7]:e}),this.Is(),n3.info("Flag overrides set",{flags:e});n1.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ls){var{flags:t,flagVariants:i}=this.Ts();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.gs(t8)||[]).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),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=m({},this.getFlagVariants(),{[e]:t});null==(r=this.ui)||r.register({[t4]:Object.keys(n8(a)),[t2]:a}),this.Is()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.gs(t8),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.ui)||i.unregister(t8),null==(r=this.ui)||r.register({[t8]:s}),e(s)}}})}Ts(){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),{})}}Is(e){var{flags:t,flagVariants:i}=this.Ts();
3this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.gs(it)||{},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._instance.register({[it]:m({},i,n,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(it)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.gs(ii)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=m({},i[t],e[t]),delete e[t]}),this._instance.register({[ii]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.gs(ii)||{};this._instance.register({[ii]:m({},t,{[e]:{}})})}else this._instance.unregister(ii)}reset(){this.ls=!1,this.hs=!1,this.cs=!1,this.ds=!1,this.vs=!1,this.$anon_distinct_id=void 0,this.Cs(),this.us=!1}}},or=m({productTours:class{get ui(){return this._instance.persistence}constructor(e){this.$o=null,this.qo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ui&&this.ui.register({[tY]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.$o||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(tY)||this.lr(()=>this.jo())}lr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?nH.error("Could not load product tours script",t):e()})}jo(){var e;!this.$o&&null!=(e=p.__PosthogExtensions__)&&e.generateProductTours&&(this.$o=p.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!q(this.qo)||t){var i=this.ui;if(i){var r=i.props[io];if(q(r)&&!t)return this.qo=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",callback:t=>{var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return nH.error(s),void e([],{isLoaded:!1,error:s})}var n=q(t.json.product_tours)?t.json.product_tours:[];this.qo=n,i&&i.register({[io]:n}),e(n,{isLoaded:!0})}})}else e(this.qo,{isLoaded:!0})}getActiveProductTours(e){G(this.$o)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.$o.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.$o)||t.showTourById(e)}previewTour(e){this.$o?this.$o.previewTour(e):this.lr(()=>{var t;this.jo(),null==(t=this.$o)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.$o)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.$o)||e.nextStep()}previousStep(){var e;null==(e=this.$o)||e.previousStep()}clearCache(){var e;this.qo=null,null==(e=this.ui)||e.unregister(io)}resetTour(e){var t;null==(t=this.$o)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.$o)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.$o)||t.cancelPendingTour(e)}}},oi),os=m({surveys:class{get qt(){return this._instance.config}constructor(e){this.Qo=void 0,this._surveyManager=null,this.Jo=!1,this.Ko=[],this.Yo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(G(t))return sD.warn("Flags not loaded yet. Not loading surveys.");var i=q(t);this.Qo=i?t.length>0:t,sD.info("flags response received, isSurveysEnabled: "+this.Qo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(sq)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.Jo)sD.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)sD.info(nX);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())sD.info("Not loading surveys in cookieless mode without consent.");else{var e=null==p?void 0:p.__PosthogExtensions__;if(e){if(!U(this.Qo)||this.qt.advanced_enable_surveys){var t=this.Qo||this.qt.advanced_enable_surveys;this.Jo=!0;try{var i=e.generateSurveys;if(i)return void this.Xo(i,t);var r=e.loadExternalDependency;if(!r)return void this.ea(iS);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ea("Could not load surveys script",i):this.Xo(e.generateSurveys,t)})}catch(e){throw this.ea("Error initializing surveys",e),e}finally{this.Jo=!1}}}else sD.error("PostHog Extensions not found.")}}Xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new nK(this._instance),sD.info("Surveys loaded successfully"),this.ta({isLoaded:!0})}ea(e,t){sD.error(e,t),this.ta({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ko.push(e),this._surveyManager&&this.ta({isLoaded:!0}),()=>{this.Ko=this.Ko.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.qt.disable_surveys)return sD.info(nX),e([]);var i,r=this._instance.get_property(ir);if(r&&!t)return e(r,{isLoaded:!0});"u">typeof Promise&&this.Yo?this.Yo.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("u">typeof Promise&&(this.Yo=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:t=>{this.Yo=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;sD.error(s);var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}var o,a,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[ir]:l});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}
3ta(e){for(var t of this.Ko)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){sD.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!G(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);sD.warn("init was not called")}ra(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}ia(e){if(G(this._surveyManager))return{eligible:!1,reason:nJ};var t="string"==typeof e?this.ra(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(G(this._surveyManager))return sD.warn("init was not called"),{visible:!1,disabledReason:nJ};var t=this.ia(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return G(this._surveyManager)?(sD.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:nJ})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.ia(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(G(this._surveyManager))sD.warn("init was not called");else{var s="string"==typeof e?this.ra(e):e;if(null!=s&&s.id)if(sN.includes(s.type)){var n=null==o?void 0:o.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(sD.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;sD.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),sD.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);sD.warn("Survey element not found")}else sD.warn("Surveys of type "+s.type+" cannot be rendered in the app");else sD.warn("Survey not found")}}displaySurvey(e,t){var i;if(G(this._surveyManager))sD.warn("init was not called");else{var r=this.ra(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=m({},r,{appearance:m({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==rj&&t.initialResponses&&sD.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void sD.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else sD.warn("Survey not found")}}cancelPendingSurvey(e){G(this._surveyManager)?sD.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},oi),on=m({experiments:n7},oi),oo=m({},oi,{sessionRecording:class{get qt(){return this._instance.config}get ui(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Es)||!e.isStarted)}get status(){var e,t;return this.Ms===nA||this.Ms===nL?this.Ms:null!=(e=null==(t=this.Es)?void 0:t.status)?e:this.Ms}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ms=nF,this.Rs=void 0,this._instance=e,!this._instance.sessionManager)throw nq.error("started without valid sessionManager"),Error(nD+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===iP)throw Error(nD+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ps(){var e,t=!(null==(e=this._instance.get_property(tJ))||!e.enabled),i=!this.qt.disable_session_recording,s=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.Ps||null==(t=this.Es)||!t.isStarted){var i=!U(Object.assign)&&!U(Array.from);this.Ps&&i?(this.Os(e),nq.info("starting")):(this.Ms=nF,this.stopRecording())}}Os(e){var t,i,r;this.Ps&&(this.Ms!==nA&&this.Ms!==nL&&(this.Ms=nj),null!=p&&null!=(t=p.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=p.__PosthogExtensions__)&&i.initSessionRecording?this.Ls(e):null==(r=p.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Fs,t=>{if(t)return nq.error("could not load recorder",t);this.Ls(e)}))}stopRecording(){var e,t;null==(e=this.Rs)||e.call(this),this.Rs=void 0,null==(t=this.Es)||t.stop()}As(){var e,t;null==(e=this.Rs)||e.call(this),this.Rs=void 0,null==(t=this.Es)||t.discard()}Ns(){var e;null==(e=this.ui)||e.unregister(t3)}Ds(e,t){if(G(e))return null;var i=Y(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(nq.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}$s(e){if(this.ui){var t,i,r=this.ui,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Ds(null==(t=this.qt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Ds(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=s?s:n;G(o)&&this.Ns();var a=null==i?void 0:i.minimumDurationMilliseconds;r.register({[tJ]:m({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:m({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:U(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.Rs)||t.call(this),this.Rs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.$s(e),void this.As()):(this.$s(e),void this.startIfEnabledOrStop()):(this.Ms===nA&&(this.Ms=nL,nq.w
3arn("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.Es)&&i.log?this.Es.log(e,t):nq.warn("log called before recorder was ready")}get Fs(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tJ);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}qs(){var e,t,i=this._instance.get_property(tJ);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return nq.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var r=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-r}Ls(e){var t,i;if(null==(t=p.__PosthogExtensions__)||!t.initSessionRecording)return nq.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iE]:!0});if(this.Es||(this.Es=null==(i=p.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Es._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.qs()){if(this.Ms===nL||this.Ms===nA)return;return this.Ms=nA,nq.info("persisted remote config is stale, requesting fresh config before starting"),void new rq(this._instance).load()}this.Ms=nj,this.Es.start(e)}onRRwebEmit(e){var t;null==(t=this.Es)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Es||null==(t=this.ui)||t.register({[tZ]:!0}),null==(e=this.Es)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Es||null==(t=this.ui)||t.register({[tX]:!0}),null==(e=this.Es)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Es||null==(i=this.ui)||i.register({["url"===e?tQ:t0]:!0}),null==(t=this.Es)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Es)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Es)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.js=!1,this.Hs=null,this.Us=!1,this.instance=e,this.rageclicks=new nP(e.config.rageclick),this.Bs=null}initialize(){this.startIfEnabled()}get qt(){var e,t,i=z(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}zs(){if(this.isBrowserSupported()){if(r&&o){var e=e=>{e=e||(null==r?void 0:r.event);try{this.Vs(e)}catch(e){nO.error("Failed to capture event",e)}};if(iB(o,"submit",e,{capture:!0}),iB(o,"change",e,{capture:!0}),iB(o,"click",e,{capture:!0}),this.qt.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event);try{this.Vs(e,nC)}catch(e){nO.error("Failed to capture copy/cut event",e)}};iB(o,"copy",t,{capture:!0}),iB(o,"cut",t,{capture:!0})}}}else nO.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.js&&(this.zs(),this.js=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Us=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tz]:!!e.autocapture_opt_out}),this.Hs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Bs=e}getElementSelectors(e){var t,i=[];return null==(t=this.Bs)||t.forEach(t=>{var r=null==o?void 0:o.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[tz];if(V(this.Hs)&&!J(i)&&!this.instance.Dr())return!1;var r=null!=(t=this.Hs)?t:!!i;return!!this.instance.config.autocapture&&!r}Vs(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=na(e);ne(s)&&(s=s.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())&&function(e,t){if(!r||np(e)||(J(t)?(i=!!t&&nh,s=void 0):(i=null!=(n=null==t?void 0:t.css_selector_ignorelist)?n:nh,s=null==t?void 0:t.content_ignorelist),!1===i))return!1;var i,s,n,{targetElementList:o}=nf(e,!1);return!function(e,t){var i;if(!1===e||U(e))return!1;if(!0===e)i=nd;else{if(!q(e))return!1;if(e.length>10)return tT.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{safeText:t,ariaLabel:r}=e;return i.some(e=>t.includes(e)||r.includes(e))})}(s,o.map(e=>{var t;return{safeText:no(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!nu(o,i)}(s,this.instance.config.rageclick)&&this.Vs(e,"$rageclick");var n=t===nC;if(s&&function(e,t,i,s,n){if(void 0===i&&(i=void 0),!r||np(e)||null!=(o=i)&&o.url_allowlist&&!nr(i.url_allowlist)||null!=(a=i)&&a.url_ignorelist&&nr(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var o,a,l,u,c=i.dom_event_allowlist;if(c&&!c.some(e=>t.type===e))return!1}var{parentIsUsefulElement:d,targetElementList:h}=nf(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(U(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}(h,i)||!nu(h,null==(u=i)?void 0:u.css_selector_allowlist))return!1;var p=r.getComputedStyle(e);
3if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var f=e.tagName.toLowerCase();switch(f){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 d?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(nl.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.qt,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){var i,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t;if(!s9(e))return{props:{}};for(var c=[e],d=e;d.parentNode&&!s7(d,"body");)if(nt(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!s9(d.parentNode))break;c.push(d.parentNode),d=d.parentNode}var h,p=[],f={},g=!1,v=!1;if(iL(c,e=>{var t=ng(e);if(s7(e,"a")){var i=e.getAttribute("href");g=t&&!!i&&nE(i)&&i}T(ns(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};nl.indexOf(s)>-1&&!i&&(n.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?nR(1024,nS(e)):nR(1024,no(e)));var o=ns(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),iL(e.attributes,function(i){var s;if((!nv(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&nE(i.value)&&(!B(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=ni(o).join(" ")),n["attr__"+i.name]=nR(1024,o)}});for(var a=1,l=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!s9(t))return t}(u);)a++,u.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),iD(f,function(e){if(!ng(e))return{};var t={};return iL(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&&nE(r)&&(t[i]=r)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(a||(p[0].$el_text=s7(e,"a")||s7(e,"button")?nS(e):no(e)),g){p[0].attr__href=g;var _,y,b=null==(_=rd(g))?void 0:_.host,x=null==r||null==(y=r.location)?void 0:y.host;b&&x&&b!==x&&(h=g)}return{props:iD({$event_type:n.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?q(t)?t:ni(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return iq(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).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=m({},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 iq(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return o[nk(t.toString())]=nk(i.toString())}),(r+=":")+iq(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=p[0])&&i.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},h&&"click"===n.type?{$external_click_url:h}:{},f)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.Us});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===nC){var u,c=nn(null==r||null==(u=r.getSelection())?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=d}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return N(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ws=(null==r||null==(t=r.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tT.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Zs&&this.Zs(),this.Zs=void 0,tT.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(r&&r.history){var i=this;null!=(e=r.history.pushState)&&e.__posthog_wrapped__||nI(r.history,"pushState",e=>function(t,r,s){e.call(this,t,r,s),i.Gs("pushState")}),null!=(t=r.history.replaceState)&&t.__posthog_wrapped__||nI(r.history,"replaceState",e=>function(t,r,s){e.call(this,t,r,s),i.Gs("replaceState")}),this.Qs()}}Gs(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.Ws&&this.isEnabled&&this._instance.capture(iM,{navigation_type:e}),this.Ws=i}catch(t){tT.error("Error capturing "+e+" pageview",t)}}Qs(){if(!this.Zs){var e=()=>{this.Gs("popstate")};iB(r,"popstate",e),this.Zs=()=>{r&&r.removeEventListener("popstate",e)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.Js=!1,this.js=!1,this.Ks=null,this.instance=e,this.Js=!(null==(t=this.instance.persistence)||!t.props[tH]),this.rageclicks=new nP(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return z(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return G(this.qt.capture_heatmaps)?G(this.qt.enable_heatmaps)?this.Js:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.js||(nN.info("starting..."),this.Ys(),this.At());else{var e;clearInterval(null!=(e=this.Ks)?e:void 0),this.Xs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tH]:t}),this.Js=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}eo(e){this.Mt(e.originalEvent,"deadclick")}At(){this.Ks&&clearInterval(this.Ks),this.Ks="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.Kr.bind(this),this.flushIntervalMilliseconds):null}Ys(){r&&o&&(this.ro=this.Kr.bind(this),iB(r,iI,this.ro),this.io=e=>
3this.Mt(e||(null==r?void 0:r.event)),iB(o,"click",this.io,{capture:!0}),this.no=e=>this.so(e||(null==r?void 0:r.event)),iB(o,"mousemove",this.no,{capture:!0}),this.oo=new rr(this.instance,rt,this.eo.bind(this)),this.oo.startIfEnabledOrStop(),this.ao=this.At.bind(this),iB(o,i$,this.ao),this.js=!0)}Xs(){var e;r&&o&&(this.ro&&r.removeEventListener(iI,this.ro),this.io&&o.removeEventListener("click",this.io,{capture:!0}),this.no&&o.removeEventListener("mousemove",this.no,{capture:!0}),this.ao&&o.removeEventListener(i$,this.ao),clearTimeout(this.uo),null==(e=this.oo)||e.stop(),this.js=!1)}lo(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var s=e;s&&s9(s)&&!s7(s,"body")&&s!==i;){if(T(t,null==r?void 0:r.getComputedStyle(s).position))return!0;s=nc(s)}return!1}(na(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:i),target_fixed:o,type:t}}Mt(e,t){var i;if(void 0===t&&(t="click"),!s6(e.target)&&nz(e)){var r=this.lo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.ho(m({},r,{type:"rageclick"})),this.ho(r)}}so(e){!s6(e.target)&&nz(e)&&(clearTimeout(this.uo),this.uo=setTimeout(()=>{this.ho(this.lo(e,"mousemove"))},500))}ho(e){if(r){var t=r.location.href,i=this.qt.custom_personal_data_properties,s=rp(t,this.qt.mask_personal_data_properties?[...rv,...i||[]]:[],rm);this.M=this.M||{},this.M[s]||(this.M[s]=[]),this.M[s].push(e)}}Kr(){this.M&&!H(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rr,webVitalsAutocapture:class{constructor(e){var t;this.Js=!1,this.js=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.co=()=>{clearTimeout(this.do),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((e,t)=>m({},e,{["$web_vitals_"+t.name+"_event"]:m({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this.vo();if(!U(i))if(G(null==e?void 0:e.name)||G(null==e?void 0:e.value))nT.error("Invalid metric received",e);else if(!this.fo||this.fo>e.value){this.M.url!==i&&(this.co(),this.do=setTimeout(this.co,this.flushToCaptureTimeoutMs)),U(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=U(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var r=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=m({},e,{$current_url:i,timestamp:Date.now()});U(r)||(s.$session_id=r.sessionId,s.$window_id=r.windowId),this.M.metrics.push(s),this.M.metrics.length===this.allowedMetrics.length&&this.co()}else nT.error("Ignoring metric with value >= "+this.fo,e)},this.po=()=>
3{if(!this.js){var e,t,i,r,s=p.__PosthogExtensions__;U(s)||U(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.ht.bind(this)),this.js=!0):nT.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Js=!(null==(t=this._instance.persistence)||!t.props[tV]),this.startIfEnabled()}get mo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=z(this.mo)?null==(e=this.mo)?void 0:e.web_vitals_allowed_metrics:void 0;return G(i)?(null==(t=this._instance.persistence)?void 0:t.props[tK])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(z(this.mo)?this.mo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=z(this.mo)?this.mo.web_vitals_attribution:void 0;return null!=e&&e}get fo(){var e=z(this.mo)&&Y(this.mo.__web_vitals_max_value)?this.mo.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return nT.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=z(this.mo)?this.mo.web_vitals:J(this.mo)?this.mo:void 0;return J(t)?t:this.Js}startIfEnabled(){this.isEnabled&&!this.js&&(nT.info("enabled, starting..."),this.lr(this.po))}onRemoteConfig(e){if("capturePerformance"in e){var t=z(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=z(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tV]:t}),this._instance.persistence.register({[tK]:i})),this.Js=t,this.startIfEnabled()}}lr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?nT.error("failed to load script",t):e()})}vo(){var e=r?r.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return rp(e,this._instance.config.mask_personal_data_properties?[...rv,...t||[]]:[],rm)}nT.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,s;this.po=()=>{var e;if(r&&this.isEnabled&&null!=(e=p.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=p.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=p.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=p.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.yo&&this.qt.capture_unhandled_errors&&(this.yo=t(this.captureException.bind(this))),!this.bo&&this.qt.capture_unhandled_rejections&&(this.bo=i(this.captureException.bind(this))),!this._o&&this.qt.capture_console_errors&&(this._o=s(this.captureException.bind(this)))}catch(e){n$.error("failed to start",e),this.wo()}}},this._instance=e,this.xo=!(null==(t=this._instance.persistence)||!t.props[tU]),this.So=new es({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,Gt:n$}),this.qt=this.ko(),this.startIfEnabledOrStop()}ko(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return z(e)?t=m({},t,e):(U(e)?this.xo:e)&&(t=m({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(n$.info("enabled"),this.wo(),this.lr(this.po)):this.wo()}lr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return n$.error("failed to load script",t);e()})}wo(){var e,t,i;null==(e=this.yo)||e.call(this),this.yo=void 0,null==(t=this.bo)||t.call(this),this.bo=void 0,null==(i=this._o)||i.call(this),this._o=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.xo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[tU]:this.xo}),this.qt=this.ko(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.ko()}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.So.consumeRateLimit(s)?n$.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.Co=[],this.Io=new ts([new tg,new tk,new t_,new tv,new tE,new tw,new ty,new tS],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=tf.test(a)?a.replace(tf,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){s.push(c);break}}if(s.length>=50)break}}}if(!s.length)return[];var d=Array.from(s);return d.reverse(),d.slice(0,50).map(e=>m({},e,{filename:e.filename||(d[d.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tc,tp)),this._instance=e,this.Co=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(tB))?t:[],this.To=t$(this.Eo()),this.Mo=new tI(this.To)}onConfigChange(){this.To=t$(this.Eo()),this.Mo.setConfig(this.To)}onRemoteConfig(e){var t,i,r;if("errorTracking"in e){var s=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.Co=s,this._instance.persistence&&this._instance.persistence.register({[tB]:this.Co,[tW]:n})}}get Ro(){var e,t=!!this._instance.get_property(tW),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Io.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.To.enabled)try{if(!B(e)||0===e.trim().length)return void n5.warn("Ignoring exception step because message must be a non-empty string");var i=this.Po(t),{sanitizedProperties:r,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(tO.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(i);s.length>0&&n5.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Mo.add(m({[tP]:e,[tC]:(new Date).toISOString()},r))}catch(e){n5.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Oo(t)){if(this.Lo(t))return this.Fo("Exception dropped: matched a suppression rule"),void n5.info("Skipping exception capture because a suppression rule matched");if(!this.Ro&&this.Ao(t))return this.Fo("Exception dropped: thrown by a browser extension"),void n5.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.No(t))return this.Fo("Exception dropped: thrown by the PostHog SDK"),void n5.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.To.enabled&&G(e.$exception_steps)?this.Do(e):e;try{var r=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",cn:!0});return r&&this.Mo.clear(),r}catch(e){return n5.error("Failed to capture exception event. Dropping this exception.",e),void this.Mo.clear()}}catch(e){return void n5.error("Failed to process exception event. Ignoring this exception.",e)}}Do(e){try{var t=this.Mo.getAttachable();return 0===t.length?e:m({},e,{$exception_steps:t})}catch(t){return n5.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Fo(e){this.To.enabled&&this.Mo.add({[tP]:e,[tC]:(new Date).toISOString()})}Po(e){return z(e)?m({},e):{}}Eo(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}Lo(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
3{var{type:i,value:r}=t;return B(i)&&i.length>0&&e.$exception_types.push(i),B(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Co.some(e=>{var i=e.values.map(e=>{var i,r=sI[e.operator],s=q(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Ao(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}No(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}Oo(e){return!G(e)&&q(e)}}},or,{siteApps:class{constructor(e){this._instance=e,this.Ho=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Uo(e,t){if(t){var i=this.globalsForEvent(t);this.Ho.push(i),this.Ho.length>1e3&&(this.Ho=this.Ho.slice(10))}}get siteAppLoaders(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Uo.bind(this));this.Bo=()=>{e(),this.Ho=[],this.Bo=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[c,d]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:d};var{$set_once:h,$set:p}=e;return{event:m({},y(e,nU),{properties:m({},e.properties,p?{$set:m({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},h?{$set_once:m({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},h)}:{}),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}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Ho.length&&(nB.info("Processing "+this.Ho.length+" events for site app with id "+e.id),this.Ho.forEac
3h(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Bo)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,nB.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback(e){s(e)}});n&&(t.processEvent=n),r=!0}catch(t){nB.error(nW+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){nB.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}zo(){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)}Vo(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){nB.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.zo(),void this._instance.on("eventCaptured",e=>this.Vo(e))):void nB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Bo)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var n=function(e){var t;p["__$$ph_site_app_"+e]=s._instance,null==(t=p.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,a,t=>{if(t)return nB.error(nW+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else nB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},os,{tracingHeaders:class{constructor(e){this.Wo=void 0,this.Zo=void 0,this.po=()=>{var e,t,i=this.Go()||[];U(this.Wo)&&(this.Wo=null==(e=p.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,this._instance.get_distinct_id(),this._instance.sessionManager)),U(this.Zo)&&(this.Zo=null==(t=p.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}lr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return nM.error("failed to load script",t);e()})}Go(){var e;return null!=(e=this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Go()?this.lr(this.po):(null==(e=this.Wo)||e.call(this),null==(t=this.Zo)||t.call(this),this.Wo=void 0,this.Zo=void 0)}}},{toolbar:class{constructor(e){this.instance=e}na(e){p.ph_toolbar_state=e}sa(){var e;return null!=(e=p.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),iW(this.instance.config)||!r||!o)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=nZ||rf(e.hash,"__posthog")||rf(e.hash,"state"),a=n?iN(()=>JSON.parse(atob(decodeURIComponent(n))))||iN(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(nQ)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}oa(e){var t=p.ph_load_toolbar||p.ph_load_editor;!G(t)&&N(t)?t(e,this.instance):n0.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==o||!o.getElementById(iy));if(!r||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=m({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(r.localStorage.setItem(nQ,JSON.stringify(m({},n,{source:void 0}))),2===this.sa())?this.oa(n):0===this.sa()&&(this.na(1),null==(t=p.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(n0.error("[Toolbar] Failed to load",e),this.na(0)):(this.na(2),this.oa(n))}),iB(r,"turbolinks:load",()=>{this.na(0),this.loadToolbar(n)})),!0}aa(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)}}},on,{conversations:class{constructor(e){this.ua=void 0,this._conversationsManager=null,this.la=!1,this.ha=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;G(t)||(J(t)?this.ua=t:(this.ua=t.enabled,this.ha=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.ua=void 0,this.ha=null}loadIfEnabled(){if(!(this._conversationsManager||this.la||this._instance.config.disable_conversations||iW(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==p?void 0:p.__PosthogExtensions__;if(e&&!U(this.ua)&&this.ua)if(this.ha&&this.ha.token){this.la=!0;try{var t=e.initConversations;if(t)return this.ca(t),void(this.la=!1);var i=e.loadExternalDependency;if(!i)return void this.da(iS);i(this._instance,"conversations",t=>{t||!e.initConversations?this.da("Could not load conversations script",t):this.ca(e.initConversations),this.la=!1})}catch(e){this.da("Error initializing conversations",e),this.la=!1}}else oe.error("Conversations enabled but missing token in remote config.")}}ca(e){if(this.ha)try{this._conversationsManager=e(this.ha,this._instance),oe.info("Conversations loaded successfully")}catch(e){this.da("Error completing conversations initialization",e)}else oe.error("Cannot complete initialization: remote config is null")}da(e,t){oe.error(e,t),this._conversationsManager=null,this.la=!1}show(){this._conversationsManager?this._conversationsManager.show():oe.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ua&&!V(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return _(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(oe.warn(ot),null)})()}getMessages(e,t){var i=this;return _(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oe.warn(ot),null)})()}markAsRead(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oe.warn(ot),null)})()}getTickets(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oe.warn(ot),null)})()}requestRestoreLink(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oe.warn(ot),null)})()}restoreFromToken(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oe.warn(ot),null)})()}restoreFromUrlToken(){var e=this;return _(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oe.warn(ot),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}yn(){var e;null==(e=this._conversationsManager)||e.setIdentity()}bn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.va=!1,this.fa=!1,this.Gt=tF("[logs]"),this.pa=[],this.ga=0,this.ma=0,this.ya=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.va=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!G(i)&&i&&(this.va=!0,this.loadIfEnabled())}reset(){this.pa=[],this.Br&&(clearTimeout(this.Br),this.Br=void 0),this.ga=0,this.ma=0,this.ya=!1}loadIfEnabled(){if(this.va&&!this.fa){var e=null==p?void 0:p.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Gt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.fa=!0)}):this.Gt.error(iS)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,i,r,s,n,o;if(this._instance.is_capturing())if(e&&e.body){var a=null!=(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)?t:3e3,l=null!=(r=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)?r:1e3,u=Date.now();if(a>u-this.ma||(this.ma=u,this.ga=0,this.ya=!1),l>this.ga){this.ga++;var c=function(e,t){var{text:i,number:r}=tt[e.level||"info"]||ti,s=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var o=m({},n,e.attributes||{}),a={timeUnixNano:s,observedTimeUnixNano:s,severityNumber:r,severityText:i,body:{stringValue:e.body},attributes:tr(o)};return e.trace_id&&(a.traceId=e.trace_id),e.span_id&&(a.spanId=e.span_id),U(e.trace_flags)||(a.flags=e.trace_flags),a}(e,this.ba());this.pa.push({record:c}),(null!=(n=null==(o=this._instance.config.logs)?void 0:o.maxBufferSize)?n:100)>this.pa.length?this._a():this.flushLogs()}else this.ya||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+a+"ms"),this.ya=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.wa||(this.wa={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)=>
3this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.wa}flushLogs(e){if(this.Br&&(clearTimeout(this.Br),this.Br=void 0),0!==this.pa.length){var t,i,r,s=this.pa;this.pa=[];var n=this._instance.config.logs,o=m({"service.name":(null==n?void 0:n.serviceName)||"unknown_service"},(null==n?void 0:n.environment)&&{"deployment.environment":n.environment},(null==n?void 0:n.serviceVersion)&&{"service.version":n.serviceVersion},null==n?void 0:n.resourceAttributes),a=(t=s.map(e=>e.record),i=g.LIB_NAME,r=g.LIB_VERSION,{resourceLogs:[{resource:{attributes:tr(o)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}),l=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Yi({method:"POST",url:l,data:a,compression:"best-available",batchKey:"logs",transport:e})}}_a(){var e,t;this.Br||(this.Br=setTimeout(()=>{this.Br=void 0,this.flushLogs()},null!=(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)?e:3e3))}ba(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i}if(null!=p&&null!=(e=p.location)&&e.href&&(t.currentUrl=p.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});s5.__defaultExtensionClasses=m({},oo);var oa=(g.SDK_DIST_CHANNEL="npm",t=sG[s0]=new s5,function(){function e(){e.done||(e.done=!0,s1=!1,iL(sG,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():iB(o,"DOMContentLoaded",e,{capture:!1}):r&&tT.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t);e.s(["default",0,oa],390221);var ol=e.i(63940),ou=(0,ol.createContext)({get client(){return i},bootstrap:void 0}),oc=function(e){return"function"==typeof e},od=function(e,t){return(od=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var oh={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}function i(t){var i=e.call(this,t)||this;return i.state=oh,i}od(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.componentDidCatch=function(e,t){var i,r=this.props.additionalProperties;oc(r)?i=r(e):"object"==typeof r&&(i=r);var s=this.context.client.captureException(e,i),n=t.componentStack;this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:s})},i.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,r=this.state;if(null==r.componentStack)return oc(t)?t():t;var s=oc(i)?ol.default.createElement(i,{error:r.error,componentStack:r.componentStack,exceptionEvent:r.exceptionEvent}):i;return ol.default.isValidElement(s)?s:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),ol.default.createElement(ol.default.Fragment,null))},i.contextType=ou}(ol.default.Component),i=oa,e.s(["PostHogProvider",0,function(e){var t,r,s=e.children,n=e.client,o=e.apiKey,a=e.options,l=(0,ol.useRef)(null),u=(0,ol.useMemo)(function(){if(n)return o&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n;var e=i;return o||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[n,o,JSON.stringify(a)]);return(0,ol.useEffect)(function(){if(!n&&o){var e=i,t=l.current;t?(o!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!function e(t,i,r){if(void 0===r&&(r=new WeakMap),t===i)return!0;
3if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;if(r.has(t)&&r.get(t)===i)return!0;r.set(t,i);var s=Object.keys(t),n=Object.keys(i);if(s.length!==n.length)return!1;for(var o=0;o<s.length;o++){var a=s[o];if(!n.includes(a)||!e(t[a],i[a],r))return!1}return!0}(a,t.options)&&e.set_config(a)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(o,a)),l.current={apiKey:o,options:null!=a?a:{}}}},[n,o,JSON.stringify(a)]),ol.default.createElement(ou.Provider,{value:{client:u,bootstrap:null!=(t=null==a?void 0:a.bootstrap)?t:null==(r=null==n?void 0:n.config)?void 0:r.bootstrap}},s)},"usePostHog",0,function(){return(0,ol.useContext)(ou).client}],982876)},672894,e=>{"use strict";var t=e.i(889448),i=e.i(63940),r=e.i(421357);e.s(["DynamicIcon",0,({name:s,...n})=>{let o=(0,i.useMemo)(()=>(0,r.default)(()=>e.A(473738).then(e=>{let t=e[s];if(!t)throw Error(`Icon ${s} not found`);return t}),{loadableGenerated:{modules:[618679]},loading:()=>(0,t.jsx)("div",{className:"size-4"}),ssr:!1}),[s]);return(0,t.jsx)(o,{...n})}])},519455,779747,e=>{"use strict";var t=e.i(889448),i=e.i(194832);e.s(["Slot",0,i],779747);var i=i,r=e.i(294237),s=e.i(530941);let n=(0,r.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",brand:"bg-blue-700 text-white shadow-xs hover:bg-blue-700/90","brand-secondary":"bg-blue-50 text-blue-700 shadow-xs hover:bg-blue-50/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",tertiary:"bg-tertiary text-tertiary-foreground shadow-xs hover:bg-tertiary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 px-2 rounded-md text-xs",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xl:"h-12 rounded-md px-8 has-[>svg]:px-6",icon:"size-9","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:r,size:o,asChild:a=!1,...l}){let u=a?i.Root:"button";return(0,t.jsx)(u,{"data-slot":"button",className:(0,s.cn)(n({variant:r,size:o,className:e})),...l})}],519455)},542450,e=>{"use strict";var t=e.i(889448),i=e.i(63940),r=e.i(294237),s=e.i(530941),n=e.i(110204);e.i(772436);let o=(0,r.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:i="vertical",...r}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":i,className:(0,s.cn)(o({orientation:i}),e),...r})},"FieldError",0,function({className:e,children:r,errors:n,...o}){let a=(0,i.useMemo)(()=>
3{if(r)return r;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,t.jsx)("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:e.map((e,i)=>e?.message&&(0,t.jsx)("li",{children:e.message},i))})},[r,n]);return a?(0,t.jsx)("div",{role:"alert","data-slot":"field-error",className:(0,s.cn)("text-sm font-normal text-destructive",e),...o,children:a}):null},"FieldGroup",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"field-group",className:(0,s.cn)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),...i})},"FieldLabel",0,function({className:e,...i}){return(0,t.jsx)(n.Label,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",e),...i})},"FieldSet",0,function({className:e,...i}){return(0,t.jsx)("fieldset",{"data-slot":"field-set",className:(0,s.cn)("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",e),...i})}])},110204,e=>{"use strict";var t=e.i(889448),i=e.i(63940),r=e.i(431657),s=i.forwardRef((e,i)=>(0,t.jsx)(r.Primitive.label,{...e,ref:i,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));s.displayName="Label",e.s(["Label",0,s,"Root",0,s],761194);var n=e.i(761194),n=n,o=e.i(530941);e.s(["Label",0,function({className:e,...i}){return(0,t.jsx)(n.Root,{"data-slot":"label",className:(0,o.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...i})}],110204)},772436,e=>{"use strict";var t=e.i(889448),i=e.i(63940),r=e.i(431657),s="horizontal",n=["horizontal","vertical"],o=i.forwardRef((e,i)=>{var o;let{decorative:a,orientation:l=s,...u}=e,c=(o=l,n.includes(o))?l:s;return(0,t.jsx)(r.Primitive.div,{"data-orientation":c,...a?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...u,ref:i})});o.displayName="Separator",e.s(["Root",0,o,"Separator",0,o],945531);var a=e.i(945531),a=a,l=e.i(530941);e.s(["Separator",0,function({className:e,orientation:i="horizontal",decorative:r=!0,...s}){return(0,t.jsx)(a.Root,{"data-slot":"separator",decorative:r,orientation:i,className:(0,l.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...s})}],772436)},746798,e=>{"use strict";var t=e.i(889448),i=e.i(63940),r=e.i(291967),s=e.i(512119),n=e.i(387716),o=e.i(681497),a=e.i(815772),l=e.i(341095),u=e.i(780281),c=e.i(279761),d=e.i(431657),h=e.i(194832),p=e.i(171089),f=e.i(342041),[g,v]=(0,n.createContextScope)("Tooltip",[l.createPopperScope]),_=(0,l.createPopperScope)(),m="TooltipProvider",y="tooltip.open",[b,x]=g(m),w=e=>{let{__scopeTooltip:r,delayDuration:s=700,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,l=i.useRef(!0),u=i.useRef(!1),c=i.useRef(0);return i.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,t.jsx)(b,{scope:r,isOpenDelayedRef:l,delayDuration:s,onOpen:i.useCallback(()=>{window.clearTimeout(c.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(e=>{u.current=e},[]),disableHoverableContent:o,children:a})};w.displayName=m;var E="Tooltip",[S,k]=g(E),P=e=>{let{__scopeTooltip:r,children:s,open:n,defaultOpen:o,onOpenChange:u,disableHoverableContent:c,delayDuration:d}=e,h=x(E,e.__scopeTooltip),f=_(r),[g,v]=i.useState(null),m=(0,a.useId)(),b=i.useRef(0),w=c??h.disableHoverableContent,k=d??h.delayDuration,P=i.useRef(!1),[C,O]=(0,p.useControllableState)({prop:n,defaultProp:o??!1,onChange:e=>{e?(h.onOpen(),document.dispatchEvent(new CustomEvent(y))):h.onClose(),u?.(e)},caller:E}),R=i.useMemo(()=>C?P.current?"delayed-open":"instant-open":"closed",[C]),$=i.useCallback(()=>{window.clearTimeout(b.current),b.current=0,P.current=!1,O(!0)},[O]),I=i.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),M=i.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{P.current=!0,O(!0),b.current=0},k)},[k,O]);return i.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),(0,t.jsx)(l.Root,{...f,children:(0,t.jsx)(S,{scope:r,contentId:m,open:C,stateAttribute:R,trigger:g,onTriggerChange:v,onTriggerEnter:i.useCallback(()=>{h.isOpenDelayedRef.current?M():$()},[h.isOpenDelayedRef,M,$]),onTriggerLeave:i.useCallback(()=>{w?I():(window.clearTimeout(b.current),b.current=0)},[I,w]),onOpen:$,onClose:I,disableHoverableContent:w,children:s})})};P.displayName=E;
3var C="TooltipTrigger",O=i.forwardRef((e,n)=>{let{__scopeTooltip:o,...a}=e,u=k(C,o),c=x(C,o),h=_(o),p=i.useRef(null),f=(0,s.useComposedRefs)(n,p,u.onTriggerChange),g=i.useRef(!1),v=i.useRef(!1),m=i.useCallback(()=>g.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),(0,t.jsx)(l.Anchor,{asChild:!0,...h,children:(0,t.jsx)(d.Primitive.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...a,ref:f,onPointerMove:(0,r.composeEventHandlers)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(v.current||c.isPointerInTransitRef.current||(u.onTriggerEnter(),v.current=!0))}),onPointerLeave:(0,r.composeEventHandlers)(e.onPointerLeave,()=>{u.onTriggerLeave(),v.current=!1}),onPointerDown:(0,r.composeEventHandlers)(e.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>{g.current||u.onOpen()}),onBlur:(0,r.composeEventHandlers)(e.onBlur,u.onClose),onClick:(0,r.composeEventHandlers)(e.onClick,u.onClose)})})});O.displayName=C;var R="TooltipPortal",[$,I]=g(R,{forceMount:void 0}),M=e=>{let{__scopeTooltip:i,forceMount:r,children:s,container:n}=e,o=k(R,i);return(0,t.jsx)($,{scope:i,forceMount:r,children:(0,t.jsx)(c.Presence,{present:r||o.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:n,children:s})})})};M.displayName=R;var T="TooltipContent",F=i.forwardRef((e,i)=>{let r=I(T,e.__scopeTooltip),{forceMount:s=r.forceMount,side:n="top",...o}=e,a=k(T,e.__scopeTooltip);return(0,t.jsx)(c.Presence,{present:s||a.open,children:a.disableHoverableContent?(0,t.jsx)(q,{side:n,...o,ref:i}
3):(0,t.jsx)(j,{side:n,...o,ref:i})})}),j=i.forwardRef((e,r)=>{let n=k(T,e.__scopeTooltip),o=x(T,e.__scopeTooltip),a=i.useRef(null),l=(0,s.useComposedRefs)(r,a),[u,c]=i.useState(null),{trigger:d,onClose:h}=n,p=a.current,{onPointerInTransitChange:f}=o,g=i.useCallback(()=>{c(null),f(!1)},[f]),v=i.useCallback((e,t)=>{let i,r=e.currentTarget,s={x:e.clientX,y:e.clientY},n=function(e,t){let i=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),n=Math.abs(t.left-e.x);switch(Math.min(i,r,s,n)){case n:return"left";case s:return"right";case i:return"top";case r:return"bottom";default:throw Error("unreachable")}}(s,r.getBoundingClientRect());c(((i=[...function(e,t,i=5){let r=[];switch(t){case"top":r.push({x:e.x-i,y:e.y+i},{x:e.x+i,y:e.y+i});break;case"bottom":r.push({x:e.x-i,y:e.y-i},{x:e.x+i,y:e.y-i});break;case"left":r.push({x:e.x+i,y:e.y-i},{x:e.x+i,y:e.y+i});break;case"right":r.push({x:e.x-i,y:e.y-i},{x:e.x-i,y:e.y+i})}return r}(s,n),...function(e){let{top:t,right:i,bottom:r,left:s}=e;return[{x:s,y:t},{x:i,y:t},{x:i,y:r},{x:s,y:r}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let i=0;i<e.length;i++){let r=e[i];for(;t.length>=2;){let e=t[t.length-1],i=t[t.length-2];if((e.x-i.x)*(r.y-i.y)>=(e.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();let i=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;i.length>=2;){let e=i[i.length-1],t=i[i.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))i.pop();else break}i.push(r)}return(i.pop(),1===t.length&&1===i.length&&t[0].x===i[0].x&&t[0].y===i[0].y)?t:t.concat(i)}(i))),f(!0)},[f]);return i.useEffect(()=>()=>g(),[g]),i.useEffect(()=>{if(d&&p){let e=e=>v(e,p),t=e=>v(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,v,g]),i.useEffect(()=>{if(u){let e=e=>{let t=e.target,i={x:e.clientX,y:e.clientY},r=d?.contains(t)||p?.contains(t),s=!function(e,t){let{x:i,y:r}=e,s=!1;for(let e=0,n=t.length-1;e<t.length;n=e++){let o=t[e],a=t[n],l=o.x,u=o.y,c=a.x,d=a.y;u>r!=d>r&&i<(c-l)*(r-u)/(d-u)+l&&(s=!s)}return s}(i,u);r?g():s&&(g(),h())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,u,h,g]),(0,t.jsx)(q,{...e,ref:l})}),[A,L]=g(E,{isInside:!1}),D=(0,h.createSlottable)("TooltipContent"),q=i.forwardRef((e,r)=>{let{__scopeTooltip:s,children:n,"aria-label":a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,h=k(T,s),p=_(s),{onClose:g}=h;return i.useEffect(()=>(document.addEventListener(y,g),()=>document.removeEventListener(y,g)),[g]),i.useEffect(()=>{if(h.trigger){let e=e=>{let t=e.target;t?.contains(h.trigger)&&g()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[h.trigger,g]),(0,t.jsx)(o.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:g,children:(0,t.jsxs)(l.Content,{"data-state":h.stateAttribute,...p,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,t.jsx)(D,{children:n}),(0,t.jsx)(A,{scope:s,isInside:!0,children:(0,t.jsx)(f.Root,{id:h.contentId,role:"tooltip",children:a||n})})]})})});F.displayName=T;var N="TooltipArrow",z=i.forwardRef((e,i)=>{let{__scopeTooltip:r,...s}=e,n=_(r);return L(N,r).isInside?null:(0,t.jsx)(l.Arrow,{...n,...s,ref:i})});z.displayName=N,e.s(["Arrow",0,z,"Content",0,F,"Portal",0,M,"Provider",0,w,"Root",0,P,"Tooltip",0,P,"TooltipArrow",0,z,"TooltipContent",0,F,"TooltipPortal",0,M,"TooltipProvider",0,w,"TooltipTrigger",0,O,"Trigger",0,O,"createTooltipScope",0,v],646687);var H=e.i(646687),H=H,U=e.i(530941);function B({delayDuration:e=0,...i}){return(0,t.jsx)(H.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...i})}e.s(["Tooltip",0,function({...e}){return(0,t.jsx)(B,{children:(0,t.jsx)(H.Root,{"data-slot":"tooltip",...e})})}
3,"TooltipContent",0,function({className:e,sideOffset:i=0,children:r,...s}){return(0,t.jsx)(H.Portal,{children:(0,t.jsxs)(H.Content,{"data-slot":"tooltip-content",sideOffset:i,className:(0,U.cn)("z-50 w-fit max-w-[160px] origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-primary px-3 py-1.5 text-center text-xs text-balance text-primary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...s,children:[r,(0,t.jsx)(H.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary"})]})})},"TooltipProvider",0,B,"TooltipTrigger",0,function({...e}){return(0,t.jsx)(H.Trigger,{"data-slot":"tooltip-trigger",...e})}],746798)}]);
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.