1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79315,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s={cancelIdleCallback:function(){return a},requestIdleCallback:function(){return n}};for(var r in s)Object.defineProperty(i,r,{enumerable:!0,get:s[r]});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)},a="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)},47752,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s={default:function(){return y},handleClientScriptLoad:function(){return f},initScriptLoader:function(){return _}};for(var r in s)Object.defineProperty(i,r,{enumerable:!0,get:s[r]});let n=e.r(81258),a=e.r(44066),o=e.r(2452),l=n._(e.r(93997)),u=a._(e.r(3572)),c=e.r(96008),d=e.r(97030),h=e.r(79315),p=new Map,g=new Set,v=e=>{let{src:t,id:i,onLoad:s=()=>{},onReady:r=null,dangerouslySetInnerHTML:n,children:a="",strategy:o="afterInteractive",onError:u,stylesheets:c}=e,h=i||t;if(h&&g.has(h))return;if(p.has(t)){g.add(h),p.get(t).then(s,u);return}let v=()=>{r&&r(),g.add(h)},f=document.createElement("script"),_=new Promise((e,t)=>{f.addEventListener("load",function(t){e(),s&&s.call(this,t),v()}),f.addEventListener("error",function(e){t(e)})}).catch(function(e){u&&u(e)});n?(f.innerHTML=n.__html||"",v()):a?(f.textContent="string"==typeof a?a:Array.isArray(a)?a.join(""):"",v()):t&&(f.src=t,p.set(t,_)),(0,d.setAttributesFromProps)(f,e),"w
1orker"===o&&f.setAttribute("type","text/partytown"),f.setAttribute("data-nscript",o),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(f)};function f(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>v(e))}):v(e)}function _(e){e.forEach(f),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");g.add(t)})}function m(e){let{id:t,src:i="",onLoad:s=()=>{},onReady:r=null,strategy:n="afterInteractive",onError:a,stylesheets:d,...p}=e,{updateScripts:f,scripts:_,getIsSsr:m,appDir:y,nonce:b}=(0,u.useContext)(c.HeadManagerContext);b=p.nonce||b;let x=(0,u.useRef)(!1);(0,u.useEffect)(()=>{let e=t||i;x.current||(r&&e&&g.has(e)&&r(),x.current=!0)},[r,t,i]);let w=(0,u.useRef)(!1);if((0,u.useEffect)(()=>{if(!w.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))}));w.current=!0}},[e,n]),("beforeInteractive"===n||"worker"===n)&&(f?(_[n]=(_[n]||[]).concat([{id:t,src:i,onLoad:s,onReady:r,onError:a,...p,nonce:b}]),f(_)):m&&m()?g.add(t||i):m&&!m()&&v({...e,nonce:b})),y){if(d&&d.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===n)if(!i)return p.dangerouslySetInnerHTML&&(p.children=p.dangerouslySetInnerHTML.__html,delete p.dangerouslySetInnerHTML),(0,o.jsx)("script",{nonce:b,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...p,id:t}])})`}});else return l.default.preload(i,p.integrity?{as:"script",integrity:p.integrity,nonce:b,crossOrigin:p.crossOrigin}:{as:"script",nonce:b,crossOrigin:p.crossOrigin}),(0,o.jsx)("script",{nonce:b,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([i,{...p,id:t}])})`}});"afterInteractive"===n&&i&&l.default.preload(i,p.integrity?{as:"script",integrity:p.integrity,nonce:b,crossOrigin:p.crossOrigin}:{as:"script",nonce:b,crossOrigin:p.crossOrigin})}return null}Object.defineProperty(m,"__nextScript",{value:!0});let y=m;("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)},95403,e=>{"use strict";var t=e.i(3572),i=e.i(93997);let s=Array(12).fill(0),r=({visible:e,className:i})=>t.default.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":e},t.default.createElement("div",{className:"sonner-spinner"},s.map((e,i)=>t.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),n=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},t.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),a=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},t.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),o=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},t.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),l=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},t.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u=t.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},t.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),c=1,d=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>
vendor: 1,075 bytes, line 1
1{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:i,...s}=e,r="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:c++,n=this.toasts.find(e=>e.id===r),a=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),n?this.toasts=this.toasts.map(t=>t.id===r?(this.publish({...t,...e,id:r,title:i}),{...t,...e,id:r,dismissible:a,title:i}):t):this.addToast({title:i,...s,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
1this.create({...t,type:"loading",message:e}),this.promise=(e,i)=>{let s,r;if(!i)return;void 0!==i.loading&&(r=this.create({...i,promise:e,type:"loading",message:i.loading,description:"function"!=typeof i.description?i.description:void 0}));let n=Promise.resolve(e instanceof Function?e():e),a=void 0!==r,o=n.then(async e=>{if(s=["resolve",e],t.default.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(h(e)&&!e.ok){a=!1;let s="function"==typeof i.error?await i.error(`HTTP error! status: ${e.status}`):i.error,n="function"==typeof i.description?await i.description(`HTTP error! status: ${e.status}`):i.description,o="object"!=typeof s||t.default.isValidElement(s)?{message:s}:s;this.create({id:r,type:"error",description:n,...o})}else if(e instanceof Error){a=!1;let s="function"==typeof i.error?await i.error(e):i.error,n="function"==typeof i.description?await i.description(e):i.description,o="object"!=typeof s||t.default.isValidElement(s)?{message:s}:s;this.create({id:r,type:"error",description:n,...o})}else if(void 0!==i.success){a=!1;let s="function"==typeof i.success?await i.success(e):i.success,n="function"==typeof i.description?await i.description(e):i.description,o="object"!=typeof s||t.default.isValidElement(s)?{message:s}:s;this.create({id:r,type:"success",description:n,...o})}}).catch(async e=>{if(s=["reject",e],void 0!==i.error){a=!1;let s="function"==typeof i.error?await i.error(e):i.error,n="function"==typeof i.description?await i.description(e):i.description,o="object"!=typeof s||t.default.isValidElement(s)?{message:s}:s;this.create({id:r,type:"error",description:n,...o})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),null==i.finally||i.finally.call(i)}),l=()=>new Promise((e,t)=>o.then(()=>"reject"===s[0]?t(s[1]):e(s[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let i=(null==t?void 0:t.id)||c++;return this.create({jsx:e(i),id:i,...t}),i},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},h=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,p=Object.assign((e,t)=>{let i=(null==t?void 0:t.id)||c++;return d.addToast({title:e,...t,id:i}),i},{success:d.success,info:d.info,warning:d.warning,error:d.error,custom:d.custom,message:d.message,promise:d.promise,dismiss:d.dismiss,loading:d.loading},{getHistory:()=>d.toasts,getToasts:()=>d.getActiveToasts()});function g(e){return void 0!==e.label}function v(...e){return e.filter(Boolean).join(" ")}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}
vendor: 14,864 bytes, line 1
1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
1let f=e=>{var i,s,c,d,h,p,f,_,m,y,b,x,w;let{invert:E,toast:k,unstyled:S,interacting:P,setHeights:F,visibleToasts:$,heights:I,index:M,toasts:C,expanded:T,removeToast:R,defaultRichColors:O,closeButton:A,style:L,cancelButtonStyle:q,actionButtonStyle:N,className:D="",descriptionClassName:j="",duration:z,position:H,gap:B,expandByDefault:U,classNames:V,icons:W,closeButtonAriaLabel:G="Close toast"}=e,[Y,X]=t.default.useState(null),[K,J]=t.default.useState(null),[Z,Q]=t.default.useState(!1),[ee,et]=t.default.useState(!1),[ei,es]=t.default.useState(!1),[er,en]=t.default.useState(!1),[ea,eo]=t.default.useState(!1),[el,eu]=t.default.useState(0),[e
1c,ed]=t.default.useState(0),eh=t.default.useRef(k.duration||z||4e3),ep=t.default.useRef(null),eg=t.default.useRef(null),ev=0===M,ef=M+1<=$,e_=k.type,em=!1!==k.dismissible,ey=k.className||"",eb=k.descriptionClassName||"",ex=t.default.useMemo(()=>I.findIndex(e=>e.toastId===k.id)||0,[I,k.id]),ew=t.default.useMemo(()=>{var e;return null!=(e=k.closeButton)?e:A},[k.closeButton,A]),eE=t.default.useMemo(()=>k.duration||z||4e3,[k.duration,z]),ek=t.default.useRef(0),eS=t.default.useRef(0),eP=t.default.useRef(0),eF=t.default.useRef(null),[e$,eI]=H.split("-"),eM=t.default.useMemo(()=>I.reduce((e,t,i)=>i>=ex?e:e+t.height,0),[I,ex]),eC=(()=>{let[e,i]=t.default.useState(document.hidden);return t.default.useEffect(()=>{let e=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),eT=k.invert||E,eR="loading"===e_;eS.current=t.default.useMemo(()=>ex*B+eM,[ex,eM]),t.default.useEffect(()=>{eh.current=eE},[eE]),t.default.useEffect(()=>{Q(!0)},[]),t.default.useEffect(()=>{let e=eg.current;if(e){let t=e.getBoundingClientRect().height;return ed(t),F(e=>[{toastId:k.id,height:t,position:k.position},...e]),()=>F(e=>e.filter(e=>e.toastId!==k.id))}},[F,k.id]),t.default.useLayoutEffect(()=>{if(!Z)return;let e=eg.current,t=e.style.height;e.style.height="auto";let i=e.getBoundingClientRect().height;e.style.height=t,ed(i),F(e=>e.find(e=>e.toastId===k.id)?e.map(e=>e.toastId===k.id?{...e,height:i}:e):[{toastId:k.id,height:i,position:k.position},...e])},[Z,k.title,k.description,F,k.id,k.jsx,k.action,k.cancel]);let eO=t.default.useCallback(()=>{et(!0),eu(eS.current),F(e=>e.filter(e=>e.toastId!==k.id)),setTimeout(()=>{R(k)},200)},[k,R,F,eS]);t.default.useEffect(()=>{let e;if((!k.promise||"loading"!==e_)&&k.duration!==1/0&&"loading"!==k.type){if(T||P||eC){if(eP.current<ek.current){let e=new Date().getTime()-ek.current;eh.current=eh.current-e}eP.current=new Date().getTime()}else eh.current!==1/0&&(ek.current=new Date().getTime(),e=setTimeout(()=>{null==k.onAutoClose||k.onAutoClose.call(k,k),eO()},eh.current));return()=>clearTimeout(e)}},[T,P,k,e_,eC,eO]),t.default.useEffect(()=>{k.delete&&(eO(),null==k.onDismiss||k.onDismiss.call(k,k))},[eO,k.delete]);let eA=k.icon||(null==W?void 0:W[e_])||(e=>{switch(e){case"success":return n;case"info":return o;case"warning":return a;case"error":return l;default:return null}})(e_);return t.default.createElement("li",{tabIndex:0,ref:eg,className:v(D,ey,null==V?void 0:V.toast,null==k||null==(i=k.classNames)?void 0:i.toast,null==V?void 0:V.default,null==V?void 0:V[e_],null==k||null==(s=k.classNames)?void 0:s[e_]),"data-sonner-toast":"","data-rich-colors":null!=(y=k.richColors)?y:O,"data-styled":!(k.jsx||k.unstyled||S),"data-mounted":Z,"data-promise":!!k.promise,"data-swiped":ea,"data-removed":ee,"data-visible":ef,"data-y-position":e$,"data-x-position":eI,"data-index":M,"data-front":ev,"data-swiping":ei,"data-dismissible":em,"data-type":e_,"data-invert":eT,"data-swipe-out":er,"data-swipe-direction":K,"data-expanded":!!(T||U&&Z),"data-testid":k.testId,style:{"--index":M,"--toasts-before":M,"--z-index":C.length-M,"--offset":`${ee?el:eS.current}px`,"--initial-height":U?"auto":`${ec}px`,...L,...k.style},onDragEnd:()=>{es(!1),X(null),eF.current=null},onPointerDown:e=>{2===e.button||eR||!em||(ep.current=new Date,eu(eS.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(es(!0),eF.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,i,s,r;if(er||!em)return;eF.current=null;let n=Number((null==(e=eg.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=eg.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),o=new Date().getTime()-(null==(i=ep.current)?void 0:i.getTime()),l="x"===Y?n:a,u=Math.abs(l)/o;if(Math.abs(l)>=45||u>.11){eu(eS.current),null==k.onDismiss||k.onDismiss.call(k,k),"x"===Y?J(n>0?"right":"left"):J(a>0?"down":"up"),eO(),en(!0);return}null==(s=eg.current)||s.style.setProperty("--swipe-amount-x","0px"),null==(r=eg.current)||r.style.setProperty("--swipe-amount-y","0px"),eo(!1),es(!1),X(null)},onPointerMove:t=>{var i,s,r,n;if(!eF.current||!em||(null==(i=window.getSelection())?void 0:i.toString().length)>0)return;let a=t.clientY-eF.current.y,o=t.clientX-eF.current.x,l=null!=(n=e.swipeDirections)?n:function(e){let[t,i]=e.split("-"),s=[];return t&&s.push(t),i&&s.push(i),s}
1(H);!Y&&(Math.abs(o)>1||Math.abs(a)>1)&&X(Math.abs(o)>Math.abs(a)?"x":"y");let u={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if("y"===Y){if(l.includes("top")||l.includes("bottom"))if(l.includes("top")&&a<0||l.includes("bottom")&&a>0)u.y=a;else{let e=a*c(a);u.y=Math.abs(e)<Math.abs(a)?e:a}}else if("x"===Y&&(l.includes("left")||l.includes("right")))if(l.includes("left")&&o<0||l.includes("right")&&o>0)u.x=o;else{let e=o*c(o);u.x=Math.abs(e)<Math.abs(o)?e:o}(Math.abs(u.x)>0||Math.abs(u.y)>0)&&eo(!0),null==(s=eg.current)||s.style.setProperty("--swipe-amount-x",`${u.x}px`),null==(r=eg.current)||r.style.setProperty("--swipe-amount-y",`${u.y}px`)}},ew&&!k.jsx&&"loading"!==e_?t.default.createElement("button",{"aria-label":G,"data-disabled":eR,"data-close-button":!0,onClick:eR||!em?()=>{}:()=>{eO(),null==k.onDismiss||k.onDismiss.call(k,k)},className:v(null==V?void 0:V.closeButton,null==k||null==(c=k.classNames)?void 0:c.closeButton)},null!=(b=null==W?void 0:W.close)?b:u):null,(e_||k.icon||k.promise)&&null!==k.icon&&((null==W?void 0:W[e_])!==null||k.icon)?t.default.createElement("div",{"data-icon":"",className:v(null==V?void 0:V.icon,null==k||null==(d=k.classNames)?void 0:d.icon)},k.promise||"loading"===k.type&&!k.icon?k.icon||((null==W?void 0:W.loading)?t.default.createElement("div",{className:v(null==V?void 0:V.loader,null==k||null==(w=k.classNames)?void 0:w.loader,"sonner-loader"),"data-visible":"loading"===e_},W.loading):t.default.createElement(r,{className:v(null==V?void 0:V.loader,null==k||null==(x=k.classNames)?void 0:x.loader),visible:"loading"===e_})):null,"loading"!==k.type?eA:null):null,t.default.createElement("div",{"data-content":"",className:v(null==V?void 0:V.content,null==k||null==(h=k.classNames)?void 0:h.content)},t.default.createElement("div",{"data-title":"",className:v(null==V?void 0:V.title,null==k||null==(p=k.classNames)?void 0:p.title)},k.jsx?k.jsx:"function"==typeof k.title?k.title():k.title),k.description?t.default.createElement("div",{"data-description":"",className:v(j,eb,null==V?void 0:V.description,null==k||null==(f=k.classNames)?void 0:f.description)},"function"==typeof k.description?k.description():k.description):null),t.default.isValidElement(k.cancel)?k.cancel:k.cancel&&g(k.cancel)?t.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:k.cancelButtonStyle||q,onClick:e=>{!g(k.cancel)||em&&(null==k.cancel.onClick||k.cancel.onClick.call(k.cancel,e),eO())},className:v(null==V?void 0:V.cancelButton,null==k||null==(_=k.classNames)?void 0:_.cancelButton)},k.cancel.label):null,t.default.isValidElement(k.action)?k.action:k.action&&g(k.action)?t.default.createElement("button",{"data-button":!0,"data-action":!0,style:k.actionButtonStyle||N,onClick:e=>{!g(k.action)||(null==k.action.onClick||k.action.onClick.call(k.action,e),e.defaultPrevented||eO())},className:v(null==V?void 0:V.actionButton,null==k||null==(m=k.classNames)?void 0:m.actionButton)},k.action.label):null)};function _(){if("u"<typeof window||"u"<typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let m=t.default.forwardRef(function(e,s){let{id:r,invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:c,offset:h,mobileOffset:p,theme:g="light",richColors:v,duration:m,style:y,visibleToasts:b=3,toastOptions:x,dir:w=_(),gap:E=14,icons:k,containerAriaLabel:S="Notifications"}=e,[P,F]=t.default.useState([]),$=t.default.useMemo(()=>r?P.filter(e=>e.toasterId===r):P.filter(e=>!e.toasterId),[P,r]),I=t.default.useMemo(()=>Array.from(new Set([a].concat($.filter(e=>e.position).map(e=>e.position)))),[$,a]),[M,C]=t.default.useState([]),[T,R]=t.default.useState(!1),[O,A]=t.default.useState(!1),[L,q]=t.default.useState("system"!==g?g:"u">typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=t.default.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=t.default.useRef(null),z=t.default.useRef(!1),H=t.default.useCallback(e=>{F(t=>{var i;return(null==(i=t.find(t=>
1t.id===e.id))?void 0:i.delete)||d.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return t.default.useEffect(()=>d.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{F(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{i.default.flushSync(()=>{F(t=>{let i=t.findIndex(t=>t.id===e.id);return -1!==i?[...t.slice(0,i),{...t[i],...e},...t.slice(i+1)]:[e,...t]})})})}),[P]),t.default.useEffect(()=>{if("system"!==g)return void q(g);if("system"===g&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),"u"<typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{e?q("dark"):q("light")})}catch(t){e.addListener(({matches:e})=>{try{e?q("dark"):q("light")}catch(e){console.error(e)}})}},[g]),t.default.useEffect(()=>{P.length<=1&&R(!1)},[P]),t.default.useEffect(()=>{let e=e=>{var t,i;o.every(t=>e[t]||e.code===t)&&(R(!0),null==(i=N.current)||i.focus()),"Escape"===e.code&&(document.activeElement===N.current||(null==(t=N.current)?void 0:t.contains(document.activeElement)))&&R(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),t.default.useEffect(()=>{if(N.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,z.current=!1)}},[N.current]),t.default.createElement("section",{ref:s,"aria-label":`${S} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((i,s)=>{var r;let a,[o,d]=i.split("-");return $.length?t.default.createElement("ol",{key:i,dir:"auto"===w?_():w,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":o,"data-x-position":d,style:{"--front-toast-height":`${(null==(r=M[0])?void 0:r.height)||0}px`,"--width":"356px","--gap":`${E}px`,...y,...(a={},[h,p].forEach((e,t)=>{let i=1===t,s=i?"--mobile-offset":"--offset",r=i?"16px":"24px";function n(e){["top","right","bottom","left"].forEach(t=>{a[`${s}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?n(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?a[`${s}-${t}`]=r:a[`${s}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):n(r)}),a)},onBlur:e=>{z.current&&!e.currentTarget.contains(e.relatedTarget)&&(z.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:e=>{!(e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible)&&(z.current||(z.current=!0,j.current=e.relatedTarget))},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{O||R(!1)},onDragEnd:()=>R(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||A(!0)},onPointerUp:()=>A(!1)},$.filter(e=>!e.position&&0===s||e.position===i).map((s,r)=>{var a,o;return t.default.createElement(f,{key:s.id,icons:k,index:r,toast:s,defaultRichColors:v,duration:null!=(a=null==x?void 0:x.duration)?a:m,className:null==x?void 0:x.className,descriptionClassName:null==x?void 0:x.descriptionClassName,invert:n,visibleToasts:b,closeButton:null!=(o=null==x?void 0:x.closeButton)?o:u,interacting:O,position:i,style:null==x?void 0:x.style,unstyled:null==x?void 0:x.unstyled,classNames:null==x?void 0:x.classNames,cancelButtonStyle:null==x?void 0:x.cancelButtonStyle,actionButtonStyle:null==x?void 0:x.actionButtonStyle,closeButtonAriaLabel:null==x?void 0:x.closeButtonAriaLabel,removeToast:H,toasts:$.filter(e=>e.position==s.position),heights:M.filter(e=>e.position==s.position),setHeights:C,expandByDefault:l,gap:E,expanded:T,swipeDirections:e.swipeDirections})})):null}))});e.s(["Toaster",0,m,"toast",0,p,"useSonner",0,function(){let[e,s]=t.default.useState([]);return t.default.useEffect(()=>d.subscribe(e=>{e.dismiss?setTimeout(()=>{i.default.flushSync(()=>{s(t=>t.filter(t=>t.id!==e.id))})}):setTimeout(()=>{i.default.flushSync(()=>{s(t=>{let i=t.findIndex(t=>t.id===e.id);return -1!==i?[...t.slice(0,i),{...t[i],...e},...t.slice(i+1)]:[e,...t]})})})}),[]),{toasts:e}}])},44666,e=>{"use strict";var t="u">typeof window?window:void 0,i="u">typeof globalThis?globalThis:t;"u"<typeof self&&(i.self=i),"u"<typeof File&&(i.File=function(){});var s=null==i?void 0:i.navigator,r=null==i?void 0:i.document,n=null==i?void 0:i.location,a=null==i?void 0:i.fetch,o=null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:void 0,l=null==i?void 0:i.AbortController,u=null==i?void 0:i.CompressionStream,c=null==s?void 0:s.userAgent,d=null!=t?t:{}
1,h="1.372.9",p={DEBUG:!1,LIB_VERSION:h,LIB_NAME:"web",JS_SDK_VERSION:h};function g(e,t,i,s,r,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(s,r)}function v(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){g(n,s,r,a,o,"next",e)}function o(e){g(n,s,r,a,o,"throw",e)}a(void 0)})}}function f(){return(f=Object.assign.bind()).apply(null,arguments)}function _(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}function m(){return(m=v(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=new CompressionStream("gzip"),n=r.writable.getWriter(),a=n.write((new TextEncoder).encode(e)).then(()=>n.close()).catch((s=v(function*(e){try{yield n.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),o=new Response(r.readable).blob(),[l]=yield Promise.all([o,a]);return l}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var y=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],b=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return y.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},x=["$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"];function w(e,t){return -1!==e.indexOf(t)}var E=function(e){return e.trim()},k=function(e){return e.replace(/^\$/,"")},S=Object.prototype,P=S.hasOwnProperty,F=S.toString,$=Array.isArray||function(e){return"[object Array]"===F.call(e)},I=e=>"function"==typeof e,M=e=>e===Object(e)&&!$(e),C=e=>{if(M(e)){for(var t in e)if(P.call(e,t))return!1;return!0}return!1},T=e=>void 0===e,R=e=>"[object String]"==F.call(e),O=e=>R(e)&&0===e.trim().length,A=e=>null===e,L=e=>T(e)||A(e),q=e=>"[object Number]"==F.call(e)&&e==e,N=e=>q(e)&&e>0,D=e=>"[object Boolean]"===F.call(e),j=e=>w(x,e);function z(e){return null===e||"object"!=typeof e}function H(e,t){return({}).toString.call(e)==="[object "+t+"]"}function B(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var U=[!0,"true",1,"1","yes"],V=[!1,"false",0,"0","no"];function W(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),q(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),W(r||i,t,i,s))}class G{constructor(e){this.$t={},this.zt=e.zt,this.Zt=W(e.bucketSize,0,100,e.Gt),this.Qt=W(e.refillRate,0,this.Zt,e.Gt),this.Jt=W(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(),s=String(e),r=this.$t[s];return r?this.Kt(r,i):this.$t[s]=r={tokens:this.Zt,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.zt)||t.call(this,e)),0===r.tokens)}
1stop(){this.$t={}}}var Y,X,K,J="Mobile",Z="Android",Q="Tablet",ee=Z+" "+Q,et="iPad",ei="Apple",es=ei+" Watch",er="Safari",en="BlackBerry",ea="Samsung",eo=ea+"Browser",el=ea+" Internet",eu="Chrome",ec=eu+" OS",ed=eu+" iOS",eh="Internet Explorer",ep=eh+" "+J,eg="Opera",ev=eg+" Mini",ef="Edge",e_="Microsoft "+ef,em="Firefox",ey=em+" iOS",eb="Nintendo",ex="PlayStation",ew="Xbox",eE=Z+" "+J,ek=J+" "+er,eS="Windows",eP=eS+" Phone",eF="Nokia",e$="Ouya",eI="Generic",eM=eI+" "+J.toLowerCase(),eC=eI+" "+Q.toLowerCase(),eT="Konqueror",eR="(\\d+(\\.\\d+)?)",eO=RegExp("Version/"+eR),eA=RegExp(ew,"i"),eL=RegExp(ex+" \\w+","i"),eq=RegExp(eb+" \\w+","i"),eN=RegExp(en+"|PlayBook|BB10","i"),eD={"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"},ej=function(e,t){var i;return t=t||"",w(e," OPR/")&&w(e,"Mini")?ev:w(e," OPR/")?eg:eN.test(e)?en:w(e,"IE"+J)||w(e,"WPDesktop")?ep:w(e,eo)?el:w(e,ef)||w(e,"Edg/")?e_:w(e,"FBIOS")?"Facebook "+J:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?ed:w(e,"CrMo")||w(e,eu)?eu:w(e,Z)&&w(e,er)?eE:w(e,"FxiOS")?ey:w(e.toLowerCase(),eT.toLowerCase())?eT:(i=t)&&w(i,ei)||w(e,er)&&!w(e,eu)&&!w(e,Z)?w(e,J)?ek:er:w(e,em)?em:w(e,"MSIE")||w(e,"Trident/")?eh:w(e,"Gecko")?em:""},ez={[ep]:[RegExp("rv:"+eR)],[e_]:[RegExp(ef+"?\\/"+eR)],[eu]:[RegExp("("+eu+"|CrMo)\\/"+eR)],[ed]:[RegExp("CriOS\\/"+eR)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eR)],[er]:[eO],[ek]:[eO],[eg]:[RegExp("(Opera|OPR)\\/"+eR)],[em]:[RegExp(em+"\\/"+eR)],[ey]:[RegExp("FxiOS\\/"+eR)],[eT]:[RegExp("Konqueror[:/]?"+eR,"i")],[en]:[RegExp(en+" "+eR),eO],[eE]:[RegExp("android\\s"+eR,"i")],[el]:[RegExp(eo+"\\/"+eR)],[eh]:[RegExp("(rv:|MSIE )"+eR)],Mozilla:[RegExp("rv:"+eR)]},eH=function(e,t){var i=ez[ej(e,t)];if(T(i))return null;for(var s=0;i.length>s;s++){var r=e.match(i[s]);if(r)return parseFloat(r[r.length-2])}return null},eB=[[RegExp(ew+"; "+ew+" (.*?)[);]","i"),e=>[ew,e&&e[1]||""]],[RegExp(eb,"i"),[eb,""]],[RegExp(ex,"i"),[ex,""]],[eN,[en,""]],[RegExp(eS,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eP,""];if(new RegExp(J).test(t)&&!/IEMobile\b/.test(t))return[eS+" "+J,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=eD[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eS,s]}return[eS,""]}],[/((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=T(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+Z+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Z+")","i"),e=>e&&e[2]?[Z,[e[2],e[3],e[4]||"0"].join(".")]:[Z,""]],[/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/,[ec,""]],[/Linux|debian/i,["Linux",""]]],eU=function(e){return eq.test(e)?eb:eL.test(e)?ex:eA.test(e)?ew:RegExp(e$,"i").test(e)?e$:RegExp("("+eP+"|WPDesktop)","i").test(e)?eP:/iPad/.test(e)?et:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?es:eN.test(e)?en:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eF,"i").test(e)?eF:/(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(J).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)?Z:ee:RegExp("(pda|"+J+")","i").test(e)?eM:RegExp(Q,"i").test(e)&&!RegExp(Q+" pc","i").test(e)?eC:""},eV=e=>e instanceof Error,eW={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}},eG=eW.info;function eY(e){var t=[];for(var i in e){var s=e[i];A(s)||T(s)||t.push({key:i,value:function e(t){if(D(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($(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(s)})}return t}class eX{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"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return v(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&$(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,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),f({},e,{cause:i,stack:s})}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 v(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,f({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return K&&i.length===X||(X=i.length,K=i.reduce((i,s)=>{Y||(Y={});var r=Y[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,Y[s]=[l,u];break}}return i},{})),K}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return f({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function eK(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return T(s)||(n.lineno=s),T(r)||(n.colno=r),n}var eJ=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},eZ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,eQ=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,e0=/\((\S*)(?::(\d+))(?::(\d+))\)/,e1=(e,t)=>{var i=eZ.exec(e);if(i){var[,s,r,n]=i;return eK(t,s,"?",+r,+n)}var a=eQ.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=e0.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,u]=eJ(a[1]||"?",a[2]);return eK(t,u,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},e2=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,e5=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,e3=(e,t)=>
1{var i=e2.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=e5.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?";return[n,r]=eJ(n,r),eK(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},e4=/\(error: (.*)\)/;class e8{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=R(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 H(e,"DOMException")}isDOMError(e){return H(e,"DOMError")}}class e6{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 e7{match(e){return H(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 e9=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class te{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(e9);return s&&(t=s[1],i=s[2]),[t,i]}}var tt=["fatal","error","warning","log","info","debug"];function ti(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class ts{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{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 B(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: "+ti(e)}isSeverityLevel(e){return R(e)&&!O(e)&&tt.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(eV(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tr{match(e){return B(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+ti(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tn{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 ta{match(e){return H(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!B(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,s=this.getUnhandledRejectionReason(e);return z(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}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 to="$message",tl="$timestamp",tu=new Set([to,tl]),tc={enabled:!0,max_bytes:32768};function td(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tc.enabled,max_bytes:function(e,t){if(!q(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tc.max_bytes)}:f({},tc)}class th{constructor(e){this.Yt=[],this.Xt=0,this.qt=td(e)}setConfig(e){this.qt=td(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(!M(i))return;var s=i[to],r=i[tl];if(!R(s)||0===s.trim().length||!R(r)&&!q(r))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,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=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 tp=function(e,i){var{debugEnabled:s}=void 0===i?{}:i,r={k(i){if(t&&(p.DEBUG||d.POSTHOG_DEBUG||s)&&!T(t.console)&&t.console){for(var r=("__rrweb_original__"in t.console[i])?t.console[i].__rrweb_original__:t.console[i],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];r(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tp(e+" "+t,i)};return r},tg=tp("[PostHog.js]"),tv=tg.createLogger,tf=tv("[ExternalScriptsLoader]"),t_=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tf.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==r?void 0:r.querySelectorAll("script");
1if(s){for(var n,a=0;s.length>a;a++)if(n=function(){if(s[a].src===t){var e=s[a];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 n.v}var o=()=>{if(!r)return i("document not found");var s=r.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)r.head.appendChild(s);else{var n,a=r.querySelectorAll("body > script");a.length>0?null==(n=a[0].parentNode)||n.insertBefore(s,a[0]):r.body.appendChild(s)}};null!=r&&r.body?o():null==r||r.addEventListener("DOMContentLoaded",o)};d.__PosthogExtensions__=d.__PosthogExtensions__||{},d.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s;if(e.config.__preview_external_dependency_versioned_paths)s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var r="/static/"+t+".js?v="+e.version;"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5)),s=e.requestRouter.endpointFor("assets",r)}t_(e,s,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t_(e,n,i)}},d.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);t_(e,s,i)};var tm="$people_distinct_id",ty="$device_id",tb="__alias",tx="__timers",tw="$autocapture_disabled_server_side",tE="$heatmaps_enabled_server_side",tk="$exception_capture_enabled_server_side",tS="$error_tracking_suppression_rules",tP="$error_tracking_capture_extension_exceptions",tF="$web_vitals_enabled_server_side",t$="$dead_clicks_enabled_server_side",tI="$product_tours_enabled_server_side",tM="$web_vitals_allowed_metrics",tC="$session_recording_remote_config",tT="$replay_override_sampling",tR="$replay_override_linked_flag",tO="$replay_override_url_trigger",tA="$replay_override_event_trigger",tL="$sesid",tq="$session_is_sampled",tN="$enabled_feature_flags",tD="$active_feature_flags",tj="$early_access_features",tz="$feature_flag_details",tH="$feature_flag_payloads",tB="$feature_flag_request_id",tU="$override_feature_flags",tV="$override_feature_flag_payloads",tW="$stored_person_properties",tG="$stored_group_properties",tY="$surveys",tX="$surveys_activated",tK="ph_product_tours",tJ="$flag_call_reported",tZ="$flag_call_reported_session_id",tQ="$feature_flag_errors",t0="$feature_flag_evaluated_at",t1="$user_state",t2="$client_session_props",t5="$capture_rate_limit",t3="$initial_campaign_params",t4="$initial_referrer_info",t8="$initial_person_info",t6="$epp",t7="__POSTHOG_TOOLBAR__",t9="$posthog_cookieless",ie="$sdk_debug_extensions_init_method",it="$sdk_debug_extensions_init_time_ms",ii="$sdk_debug_recording_script_not_loaded",is="PostHog loadExternalDependency extension not found.",ir="on_reject",ia="always",io="anonymous",il="identified",iu="identified_only",ic="visibilitychange",id="beforeunload",ih="$pageview",ip="$pageleave",ig="$identify",iv="$groupidentify";function i_(e,t){$(e)&&e.forEach(t)}function im(e,t){if(!L(e))if($(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)P.call(e,i)&&t(e[i],i)}var iy=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e};function ib(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var ix=function(e){try{return e()}catch(e){return}},iw=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){tg.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tg.critical(e)}}},iE=function(e){var t={};return im(e,function(e,i){(R(e)&&e.length>0||q(e))&&(t[i]=e)}),t},ik=["herokuapp.com","vercel.app","netlify.app"];function iS(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}function iP(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 q(e)&&isFinite(e)&&Math.floor(e)===e});class iF{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");
1var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new iF(r)}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 iF(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 i${constructor(){this.S=0,this.C=0,this.I=new iC}generate(){var e=this.generateOrAbort();if(T(e)){this.S=0;var t=this.generateOrAbort();if(T(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 iF.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 iI,iM=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};t&&!T(t.crypto)&&crypto.getRandomValues&&(iM=e=>crypto.getRandomValues(e));class iC{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(iM(this.M),this.O=0),this.M[this.O++]}}var iT=()=>iR().toString(),iR=()=>(iI||(iI=new i$)).generate(),iO="",iA=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,iL={R:()=>!!r,D(e){tg.error("cookieStore error: "+e)},A(e){if(r){try{for(var t=e+"=",i=r.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var n=i[s];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(iL.A(e))||{}}catch(e){}return t},N(e,t,i,s,n){if(r)try{var a="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=r),iO)return iO;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),n="dmn_chk_"+iT();!iO&&s--;){var a=i.slice(s).join("."),o=n+"=1;domain=."+a+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",iO=a)}return iO}(e);if(!i){var s,n=(s=e.match(iA))?s[0]:"";n!==i&&tg.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),a="; expires="+u.toUTCString()}n&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&tg.warn("cookieStore warning: large cookie, len="+c.length),r.cookie=c,c}catch(e){return}},q(e,t){if(null!=r&&r.cookie)try{iL.N(e,"",-1,t)}catch(e){return}}},iq=null,iN={R(){if(!A(iq))return iq;var e=!0;if(T(t))e=!1;else try{var i="__mplssupport__";iN.N(i,"xyz"),'"xyz"'!==iN.A(i)&&(e=!1),iN.q(i)}catch(t){e=!1}return e||tg.error("localStorage unsupported; falling back to cookie store"),iq=e,e},D(e){tg.error("localStorage error: "+e)},A(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(e){iN.D(e)}return null},F(e){try{return JSON.parse(iN.A(e))||{}}catch(e){}return null},N(e,i){try{null==t||t.localStorage.setItem(e,JSON.stringify(i))}catch(e){iN.D(e)}},q(e){try{null==t||t.localStorage.removeItem(e)}catch(e){iN.D(e)}}},iD=[ty,"distinct_id",tL,tq,t6,t8,t1],ij={},iz={R:()=>!0,D(e){tg.error("memoryStorage error: "+e)},A:e=>ij[e]||null,F:e=>ij[e]||null,N(e,t){ij[e]=t},q(e){delete ij[e]}},iH=null,iB={R(){if(!A(iH))return iH;if(iH=!0,T(t))iH=!1;else try{var e="__support__";iB.N(e,"xyz"),'"xyz"'!==iB.A(e)&&(iH=!1),iB.q(e)}catch(e){iH=!1}return iH},D(e){tg.error("sessionStorage error: ",e)},A(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(e){iB.D(e)}return null},F(e){try{return JSON.parse(iB.A(e))||null}catch(e){}return null},N(e,i){try{null==t||t.sessionStorage.setItem(e,JSON.stringify(i))}catch(e){iB.D(e)}},q(e){try{null==t||t.sessionStorage.removeItem(e)}catch(e){iB.D(e)}}};class iU{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===ia||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===ir}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;
1return i||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.A(this.sr);return w(U,e)?1:w(V,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t="localStorage"===e?iN:iL;if(!this.ar||this.ar!==t){this.ar=t;var i="localStorage"===e?iL:iN;i.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(w(U,i.A(this.sr))),i.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==s?void 0:s.doNotTrack,null==s?void 0:s.msDoNotTrack,d.doNotTrack].some(e=>w(U,e))}}var iV=tv("[Dead Clicks]"),iW=()=>!0,iG=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(t$)),s=e.instance.config.capture_dead_clicks;return D(s)?s:!!M(s)||i};class iY{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({[t$]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr(()=>{this.hr()}):this.stop()}lr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?iV.error("failed to load script",t):e()})}hr(){var e;if(r){if(!this.ur&&null!=(e=d.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=M(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ur=d.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ur.start(r),iV.info("starting...")}}else iV.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,iV.info("stopping..."))}}var iX=tv("[SegmentIntegration]"),iK="posthog-js";function iJ(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var o=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=o,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,d,h,p,g=(null==(l=t.exception)?void 0:l.values)||[],v=g.map(e=>f({},e,{stacktrace:e.stacktrace?f({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>f({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(u=g[0])?void 0:u.value)||t.message,$exception_type:null==(c=g[0])?void 0:c.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=g[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=g[0])?void 0:h.type,$sentry_tags:t.tags};return i&&s&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),a&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class iZ{constructor(e,t,i,s,r,n){this.name=iK,this.setupOnce=function(a){a(iJ(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class iQ{constructor(e){this.cr=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(tg.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,i){var s,r=this.gr(e,i);return this.dr={pathname:null!=(s=null==t?void 0:t.location.pathname)?s:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),r}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 s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:u,maxContentY:c}=r;if(!(T(n)||T(a)||T(o)||T(l)||T(u)||T(c))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=n>1?W(a/n,0,1,tg):1,h=n>1?W(o/n,0,1,tg):1,p=l>1?W(u/l,0,1,tg):1,g=l>1?W(c/l,0,1,tg):1;s=iy(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$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:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var i0={[tm]:{exposure:"hidden"},[tb]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tx]:{exposure:"hidden"},[tw]:{exposure:"event"},[tE]:{exposure:"hidden"}
1,[tk]:{exposure:"event"},[tS]:{exposure:"hidden"},[tP]:{exposure:"event"},[tF]:{exposure:"event"},[t$]:{exposure:"event"},[tI]:{exposure:"hidden"},[tM]:{exposure:"event"},[tC]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[tL]:{exposure:"hidden"},[tq]:{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"},[tN]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!M(e))return{};for(var t={},i=Object.keys(e),s=0;i.length>s;s++)t["$feature/"+i[s]]=e[i[s]];return t}},[tD]:{exposure:"event"},[tj]:{exposure:"hidden"},[tz]:{exposure:"hidden"},[tH]:{exposure:"event"},[tB]:{exposure:"event"},[tU]:{exposure:"event"},[tV]:{exposure:"hidden"},[tW]:{exposure:"hidden"},[tG]:{exposure:"hidden"},[tY]:{exposure:"hidden"},[tX]:{exposure:"event"},[tK]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[tJ]:{exposure:"hidden"},[tZ]:{exposure:"hidden"},[tQ]:{exposure:"hidden"}
1,[t0]:{exposure:"hidden"},[t1]:{exposure:"hidden"},[t2]:{exposure:"hidden"},[t5]:{exposure:"hidden"},[t3]:{exposure:"hidden"},[t4]:{exposure:"hidden"},[t8]:{exposure:"hidden"},[t6]:{exposure:"hidden"},[tT]:{exposure:"event"},[tR]:{exposure:"event"},[tO]:{exposure:"event"},[tA]:{exposure:"event"},[ie]:{exposure:"event"},[it]:{exposure:"event"},[ii]:{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"}},i1=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],i2=e=>{var t=null==r?void 0:r.createElement("a");return T(t)?null:(t.href=e,t)},i5=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!$(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){tg.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},i3=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");$(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(l[c]))}var h=o;return null!=a&&(h+="?"+u.join("&")),null!=r&&(h+="#"+r),h},i4=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},i8="https?://(.*)",i6=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],i7=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...i6],i9="<masked>",se=["li_fat_id"];function st(e,t,i){if(!r)return{};var s,n=t?[...i6,...i||[]]:[],a=si(i3(r.URL,n,i9),e);return iy((s={},im(se,function(e){var t=iL.A(e);s[e]=t||null}),s),a)}function si(e,t){var i=i7.concat(t||[]),s={};return im(i,function(t){var i=i5(e,t);s[t]=i||null}),s}function ss(e){var t=e?0===e.search(i8+"google.([^/?]*)")?"google":0===e.search(i8+"bing.com")?"bing":0===e.search(i8+"yahoo.com")?"yahoo":0===e.search(i8+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!A(t)){i.$search_engine=t;var s=r?i5(r.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function sr(){return navigator.language||navigator.userLanguage}var sn="$direct";function sa(){return(null==r?void 0:r.referrer)||sn}function so(e,t){var i=e?[...i6,...t||[]]:[],s=null==n?void 0:n.href.substring(0,1e3);return{r:sa().substring(0,1e3),u:s?i3(s,i,i9):void 0}}function sl(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:i==sn?sn:null==(t=i2(i))?void 0:t.host};if(s){r.$current_url=s;var n=i2(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,iy(r,si(s))}return i&&iy(r,ss(i)),r}function su(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sc=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class sd{constructor(e,t){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&&tg.info("Persistence loaded",e.persistence,f({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._r}br(e){-1===sc.indexOf(e.persistence.toLowerCase())&&(tg.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,s,r=(void 0===(i=e.cookie_persisted_properties||[])&&(i=[]),s=[...iD,...i],f({},iN,{F(e){try{var t={};try{t=iL.F(e)||{}}catch(e){}var i=iy(t,JSON.parse(iN.A(e)||"{}"));return iN.N(e,i),i}catch(e){}return null},N(e,t,i,r,n,a){try{iN.N(e,t,void 0,void 0,a);var o={};
1s.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&iL.N(e,o,i,r,n,a)}catch(e){iN.D(e)}},q(e,i){try{null==t||t.localStorage.removeItem(e),iL.q(e,i)}catch(e){iN.D(e)}}})),n=e.persistence.toLowerCase();return"localstorage"===n&&iN.R()?iN:"localstorage+cookie"===n&&r.R()?r:"sessionstorage"===n&&iB.R()?iB:"memory"===n?iz:"cookie"===n?iL:r.R()?r:iL}wr(e){var t=null!=e?e:this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[t0];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return im(this.props,(t,i)=>{var s=(e=>{var t=i0[e];if(t)return t;for(var[i,s]of i1)if(0===e.indexOf(i))return s})(i);if("derived"===(null==s?void 0:s.exposure)){if(null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,i===tN?()=>this.wr():()=>!1))return;s.transformToEventProperties&&iy(e,s.transformToEventProperties(t))}else s&&"event"!==s.exposure||(e[i]=t)}),e}load(){if(!this._r){var e=this.nr.F(this.yr);e&&(this.props=iy({},e))}}save(){this._r||this.nr.N(this.yr,this.props,this.Sr,this.kr,this.Cr,this.qt.debug)}remove(){this.nr.q(this.yr,!1),this.nr.q(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(M(e)){T(t)&&(t="None"),this.Sr=T(i)?this.Ir:i;var s=!1;if(im(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Tr(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(M(e)){this.Sr=T(t)?this.Ir:t;var i=!1;if(im(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.Tr(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Er(e),this.save())}update_campaign_params(){if(!this.mr){var e=st(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);C(iE(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=null==r?void 0:r.referrer)?ss(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sa(),$referring_domain:null!=r&&r.referrer&&(null==(e=i2(r.referrer))?void 0:e.host)||sn},void 0)}set_initial_person_info(){this.props[t3]||this.props[t4]||this.register_once({[t8]:so(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};im([t4,t3],t=>{var i=this.props[t];i&&im(i,function(t,i){e["$initial_"+k(i)]=t})});var t,i,s=this.props[t8];return s&&iy(e,(t=sl(s),i={},im(t,function(e,t){i["$initial_"+k(t)]=e}),i)),e}safe_merge(e){return im(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ir=this.Sr=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(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var s=this.br(e),r=this.props;this.clear(),this.nr=s,this.props=r,this.save()}}set_disabled(e){this._r=e,this._r?this.remove():this.save()}set_cross_subdomain(e){e!==this.kr&&(this.kr=e,this.remove(),this.save())}set_secure(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[tx]||{};i[e]=t,this.Tr(tx,i),this.save()}remove_event_timer(e){var t=this.props[tx]||{},i=t[e];return T(i)||(delete t[e],this.Tr(tx,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Er(e){delete this.props[e]}}var sh="events",sp="cancelEvents",sg="survey shown",sv="survey sent",sf="popover",s_=tv("[RateLimiter]");class sm{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=>{s_.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void s_.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,s,{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(t5))?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=1>o.tokens;return l||e||(o.tokens=Math.max(0,o.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 "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(t5,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sy=tv("[RemoteConfig]");class sb{constructor(e){this._instance=e}get remoteConfig(){var e;
1return null==(e=d._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Mr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Pr(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 sy.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void sy.warn("Remote config is disabled. Falling back to local config.");this.Mr(e=>{e?(this.Rr(e),this.Or()):(sy.info("No config found after loading remote JS config. Falling back to JSON."),this.Pr(e=>{this.Rr(e),this.Or()}))})}catch(e){sy.error("Error loading remote config",e)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){this._instance.Lr()||"hidden"===(null==r?void 0:r.visibilityState)||this._instance.reloadFeatureFlags()}Or(){var e;if(!this.Fr){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Fr=setInterval(()=>{this.refresh()},t))}}Rr(e){var t;e||sy.error("Failed to fetch remote config from PostHog."),this._instance.Rr(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 sx="gzip-js",sw="base64",sE=Uint8Array,sk=Uint16Array,sS=Uint32Array,sP=new sE([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]),sF=new sE([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]),s$=new sE([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sI=function(e,t){for(var i=new sk(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new sS(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},sM=sI(sP,2),sC=sM[1];sM[0][28]=258,sC[258]=28;for(var sT=sI(sF,0)[1],sR=new sk(32768),sO=0;32768>sO;++sO){var sA=(43690&sO)>>>1|(21845&sO)<<1;sR[sO]=((65280&(sA=(61680&(sA=(52428&sA)>>>2|(13107&sA)<<2))>>>4|(3855&sA)<<4))>>>8|(255&sA)<<8)>>>1}var sL=function(e,t,i){for(var s=e.length,r=0,n=new sk(t);s>r;++r)++n[e[r]-1];var a,o=new sk(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new sk(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],c=t-e[r],d=o[e[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)a[sR[d]>>>l]=u}else for(a=new sk(s),r=0;s>r;++r)a[r]=sR[o[e[r]-1]++]>>>15-e[r];return a},sq=new sE(288);for(sO=0;144>sO;++sO)sq[sO]=8;for(sO=144;256>sO;++sO)sq[sO]=9;for(sO=256;280>sO;++sO)sq[sO]=7;for(sO=280;288>sO;++sO)sq[sO]=8;var sN=new sE(32);for(sO=0;32>sO;++sO)sN[sO]=5;var sD=sL(sq,9,0),sj=sL(sN,5,0),sz=function(e){return(e/8|0)+(7&e&&1)},sH=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof sk?sk:e instanceof sS?sS:sE)(i-t);return s.set(e.subarray(t,i)),s},sB=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},sU=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},sV=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new sE(0),0];if(1==r){var a=new sE(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,c=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=r-1;)o=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:o.f+l.f,l:o,r:l};var h=n[0].s;for(s=1;r>s;++s)n[s].s>h&&(h=n[s].s);var p=new sk(h+1),g=sW(i[c-1],p,0);if(g>t){s=0;var v=0,f=g-t,_=1<<f;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;v+=_-(1<<g-p[m]),p[m]=t}for(v>>>=f;v>0;){var y=n[s].s;t>p[y]?v-=1<<t-p[y]++-1:++s}for(;s>=0&&v;--s){var b=n[s].s;p[b]==t&&(--p[b],++v)}g=t}return[new sE(p),g]},sW=function(e,t,i){return -1==e.s?Math.max(sW(e.l,t,i+1),sW(e.r,t,i+1)):t[e.s]=i},sG=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sk(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;t>=o;++o)if(e[o]==r&&o!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[o]}return[i.subarray(0,s),t]},sY=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},sX=function(e,t,i){var s=i.length,r=sz(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},sK=function(e,t,i,s,r,n,a,o,l,u,c){sB(t,c++,i),++r[256];for(var d=sV(r,15),h=d[0],p=d[1],g=sV(n,15),v=g[0],f=g[1],_=sG(h),m=_[0],y=_[1],b=sG(v),x=b[0],w=b[1],E=new sk(19),k=0;m.length>k;++k)E[31&m[k]]++;for(k=0;x.length>k;++k)E[31&x[k]]++;for(var S=sV(E,7),P=S[0],F=S[1],$=19;$>4&&!P[s$[$-1]];--$);var I,M,C,T,R=u+5<<3,O=sY(r,sq)+sY(n,sN)+a,A=sY(r,h)+sY(n,v)+a+14+3*$+sY(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(O>=R&&A>=R)return sX(t,c,e.subarray(l,l+u));if(sB(t,c,1+(O>A)),c+=2,O>A){I=sL(h,p,0),M=h,C=sL(v,f,0),T=v;var L=sL(P,F,0);for(sB(t,c,y-257),sB(t,c+5,w-1),sB(t,c+10,$-4),c+=14,k=0;$>k;++k)sB(t,c+3*k,P[s$[k]]);c+=3*$;for(var q=[m,x],N=0;2>N;++N){var D=q[N];for(k=0;D.length>k;++k)sB(t,c,L[j=31&D[k]]),c+=P[j],j>15&&(sB(t,c,D[k]>>>5&127),c+=D[k]>>>12)}}else I=sD,M=sq,C=sj,T=sN;for(k=0;o>k;++k)if(s[k]>255){sU(t,c,I[257+(j=s[k]>>>18&31)]),c+=M[j+257],j>7&&(sB(t,c,s[k]>>>23&31),c+=sP[j]);var j,z=31&s[k];sU(t,c,C[z]),c+=T[z],z>3&&(sU(t,c,s[k]>>>5&8191),c+=sF[z])}else sU(t,c,I[s[k]]),c+=M[s[k]];return sU(t,c,I[256]),c+M[256]},sJ=new sS([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sZ=function(){for(var e=new sS(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),sQ=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},s0=!!o||!!a,s1="text/plain",s2=!1,s5=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,[l,u]=e.split("?"),c=f({},t),d=null!=(o=null==u?void 0:u.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!=(t=c[s])?t:r;return delete c[s],s+"="+n}))?o:[],h=(void 0===s&&(s="&"),a=[],im(c,function(e,t){T(e)||T(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return h&&d.push(h),l+"?"+d.join("&")},s3=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),s4=e=>{if(e.tr)return e.tr;var{data:t,compression:i}=e;if(t){if(i===sx){var s,r,n,a,o,l,u,c,d=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new sE(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var a=new sE(s+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?r(o):(2048>o?r(192|o>>>6):(o>55295&&57344>o?(r(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),r(128|o>>>12&63)):r(224|o>>>12),r(128|o>>>6&63)),r(128|63&o))}return sH(i,0,s)}(s3(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=sZ[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),c=(l=10+(r.filename&&r.filename.length+1||0),u=function(e,t,i,s){var r=e.length,n=new sE(s+r+5*(1+Math.floor(r/7e3))+8),a=n.subarray(s,n.length-8),o=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?o=sX(a,o,e.subarray(l,u)):(a[l]=!0,o=sX(a,o,e.subarray(l,r)))}else{for(var c=sJ[t-1],d=c>>>13,h=8191&c,p=(1<<i)-1,g=new sk(32768),v=new sk(p+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&p},y=new sS(25e3),b=new sk(288),x=new sk(32),w=0,E=0,k=(l=0,0),S=0,P=0;r>l;++l){var F=m(l),$=32767&l,I=v[F];if(g[$]=I,v[F]=$,l>=S){var M=r-l;if((w>7e3||k>24576)&&M>
1423){o=sK(e,a,0,y,b,x,E,k,P,l-P,o),k=w=E=0,P=l;for(var C=0;286>C;++C)b[C]=0;for(C=0;30>C;++C)x[C]=0}var T=2,R=0,O=h,A=$-I&32767;if(M>2&&F==m(l-A))for(var L=Math.min(d,M)-1,q=Math.min(32767,l),N=Math.min(258,M);q>=A&&--O&&$!=I;){if(e[l+T]==e[l+T-A]){for(var D=0;N>D&&e[l+D]==e[l+D-A];++D);if(D>T){if(T=D,R=A,D>L)break;var j=Math.min(A,D-2),z=0;for(C=0;j>C;++C){var H=l-A+C+32768&32767,B=H-g[H]+32768&32767;B>z&&(z=B,I=H)}}}A+=($=I)-(I=g[$])+32768&32767}if(R){y[k++]=0x10000000|sC[T]<<18|sT[R];var U=31&sC[T],V=31&sT[R];E+=sP[U]+sF[V],++b[257+U],++x[V],S=l+T,++w}else y[k++]=e[l],++b[e[l]]}}o=sK(e,a,!0,y,b,x,E,k,P,l-P,o)}return sH(n,0,s+sz(o)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.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&&sQ(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(u,r),sQ(u,c-8,a.d()),sQ(u,c-4,o),u);return{contentType:s1,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(i===sw){let e;var h,p="data="+encodeURIComponent("string"==typeof(e=(h=s3(t))?btoa(encodeURIComponent(h).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):h)?e:s3(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var g=s3(t);return{contentType:"application/json",body:g,estimatedSize:new Blob([g]).size}}},s8=(rS=v(function*(e){var t=s3(e.data),i=yield function(e,t,i){return m.apply(this,arguments)}(t,p.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return f({},e,{tr:{contentType:s1,body:s,estimatedSize:s.byteLength}})}),function(e){return rS.apply(this,arguments)}),s6=(e,t)=>s5(e,{_:(new Date).getTime().toString(),ver:p.JS_SDK_VERSION,compression:t}),s7=[];a&&s7.push({transport:"fetch",method(e){var t,i,{contentType:s,body:r,estimatedSize:n}=null!=(t=s4(e))?t:{},o=new Headers;im(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);var u=e.url,c=null;if(l){var d=new l;c={signal:d.signal,timeout:setTimeout(()=>d.abort(),e.timeout)}}a(u,f({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(n||0),body:r,signal:null==(i=c)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){tg.error(e)}null==e.callback||e.callback(s)})).catch(t=>{tg.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>c?clearTimeout(c.timeout):null)}}),o&&s7.push({transport:"XHR",method(e){var t,i=new o;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!=(t=s4(e))?t:{};im(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=s&&s.sendBeacon&&s7.push({transport:"sendBeacon",method(e){var t=s5(e.url,{beacon:"1"});try{var i,{contentType:r,body:n}=null!=(i=s4(e))?i:{};if(!n)return;var a=n instanceof Blob?n:new Blob([n],{type:r});s.sendBeacon(t,a)}catch(e){}}});class s9{constructor(e,t){this.Ar=!0,this.Nr=[],this.$r=W((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tg.createLogger("flush interval"),3e3),this.Dr=e}enqueue(e){this.Nr.push(e),this.qr||this.jr()}unload(){this.Hr();var e=Object.values(this.Nr.length>0?this.Ur():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Dr(f({},e,{transport:"sendBeacon"}))})}enable(){this.Ar=!1,this.jr()}jr(){var e=this;this.Ar||(this.qr=setTimeout(()=>{if(this.Hr(),this.Nr.length>0){var t=this.Ur();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&$(s.data)&&im(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Dr(s)}()}},this.$r))}Hr(){clearTimeout(this.qr),this.qr=void 0}Ur(){var e={};return im(this.Nr,t=>{var i,s=(t?t.batchKey:null)||t.url;T(e[s])&&(e[s]=f({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Nr=[],e}}var re=["retriesPerformedSoFar"];class rt{constructor(e){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=e,this.Nr=[],this.Vr=!0,!T(t)&&"onLine"in t.navigator&&(this.Vr=t.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},iS(t,"online",this.Wr),iS(t,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=_(e,re);N(t)&&(i.url=s5(i.url,{retry_count:t})),this._instance._send_request(f({},i,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==i.callback||i.callback(e):this.Qr(f({retriesPerformedSoFar:t},i))}}))}Qr(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.Nr.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),tg.warn(a),this.Br||(this.Br=!0,this.Jr())}Jr(){(this.Kr&&clearTimeout(this.Kr),0===this.Nr.length)?(this.Br=!1,this.Kr=void 0):this.Kr=setTimeout(()=>{this.Vr&&this.Nr.length>0&&this.Zr(),this.Jr()},this.zr)}Zr(){var e=Date.now(),t=[],i=this.Nr.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Nr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Kr&&(clearTimeout(this.Kr),this.Kr=void 0),this.Br=!1,T(t)||(this.Wr&&(t.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(t.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(f({},e,{transport:"sendBeacon"}))}catch(e){tg.error(e)}this.Nr=[]}}class ri{constructor(e){this.Yr=()=>{this.Xr||(this.Xr={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Xr.lastScrollY=Math.ceil(n),this.Xr.maxScrollY=Math.max(n,null!=(e=this.Xr.maxScrollY)?e:0),this.Xr.maxScrollHeight=Math.max(a,null!=(t=this.Xr.maxScrollHeight)?t:0),this.Xr.lastContentY=o,this.Xr.maxContentY=Math.max(o,null!=(i=this.Xr.maxContentY)?i:0),this.Xr.maxContentHeight=Math.max(l,null!=(s=this.Xr.maxContentHeight)?s:0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Xr}resetContext(){var e=this.Xr;return setTimeout(this.Yr,0),e}startMeasuringScrollPosition(){iS(t,"scroll",this.Yr,{capture:!0}),iS(t,"scrollend",this.Yr,{capture:!0}),iS(t,"resize",this.Yr)}scrollElement(){if(!this.ei)return null==t?void 0:t.document.documentElement;for(var e of $(this.ei)?this.ei:[this.ei]){var i=null==t?void 0:t.document.querySelector(e);
1if(i)return i}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return t&&(t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return t&&(t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft)||0}}var rs=e=>so(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class rr{constructor(e,t,i,s){this.ti=e=>{var t=this.ri();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ii(this._instance)};this.ni.register({[t2]:i})}},this._instance=e,this.si=t,this.ni=i,this.ii=s||rs,this.si.onSessionId(this.ti)}ri(){return this.ni.props[t2]}getSetOnceProps(){var e,t=null==(e=this.ri())?void 0:e.props;return t?"r"in t?sl(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 im(iE(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+k(i)]=t}),e}}class rn{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.oi[e]||[])i(t);for(var s of this.oi["*"]||[])s(e,t)}}var ra=tv("[SessionId]");class ro{on(e,t){return this.ai.on(e,t)}constructor(e,t,i){if(this.ui=[],this.li=void 0,this.ai=new rn,this.hi=(e,t)=>!(!N(e)||!N(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===ia)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||iT,this.fi=i||iT;var s,r=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*W(this.qt.session_idle_timeout_seconds||1800,60,36e3,ra.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+r+"_window_id",this.mi="ph_"+r+"_primary_window_exists",this.yi()){var n=iB.F(this.gi),a=iB.F(this.mi);n&&!a?this.ci=n:iB.q(this.gi),iB.N(this.mi,!0)}if(null!=(s=this.qt.bootstrap)&&s.sessionID)try{var o=(e=>{var t=this.qt.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.bi(this.qt.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){ra.error("Invalid sessionID in bootstrap",e)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return T(this.ui)&&(this.ui=[]),this.ui.push(e),this.di&&e(this.di,this.ci),()=>{this.ui=this.ui.filter(t=>t!==e)}}yi(){return"memory"!==this.qt.persistence&&!this.ni._r&&iB.R()}xi(e){e!==this.ci&&(this.ci=e,this.yi()&&iB.N(this.gi,e))}Si(){return this.ci?this.ci:this.yi()?iB.F(this.gi):null}bi(e,t,i){e===this.di&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[tL]:[t,e,i]}))}ki(){var e=this.ni.props[tL];return $(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.Ci),this.Ci=void 0,this.li&&t&&(t.removeEventListener(id,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&iB.q(this.mi)},iS(t,id,this.li,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.qt.cookieless_mode===ia)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[s,r,n]=this.ki(),a=this.Si(),o=N(n)&&Math.abs(i-n)>864e5,l=!1,u=!r,c=!u&&!e&&this.hi(i,s);u||c||o?(r=this.vi(),a=this.fi(),ra.info("new session ID generated",{sessionId:r,windowId:a,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:o}}),n=i,l=!0):a||(a=this.fi(),l=!0);var d=N(s)&&e&&!o?s:i,h=N(n)?n:(new Date).getTime();
1return this.xi(a),this.bi(r,d,h),e||this.pi(),l&&this.ui.forEach(e=>e(r,a,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:o}:void 0)),{sessionId:r,windowId:a,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:o}:void 0,lastActivityTimestamp:s}}pi(){clearTimeout(this.Ci),this.Ci=setTimeout(()=>{var[e]=this.ki();if(this.hi((new Date).getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var rl=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&b(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>b(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},ru=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 rc(e,t,i){return s3({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var rd={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=>ru(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ru(t,e))),icontains:(e,t)=>t.map(rh).some(t=>e.map(rh).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(rh).every(t=>e.map(rh).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))})},rh=e=>e.toLowerCase();function rp(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(T(r)||A(r))return!1;var n=[String(r)],a=rd[s.operator];return!!a&&a(s.values,n)})}var rg="custom",rv="i.posthog.com",rf=/^\/static\//;class r_{constructor(e){this.Ii={},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("."+rv,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ii[this.apiHost]||(this.Ii[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":rg),this.Ii[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof t&&rf.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.Ti(t);if(i)return""+i+t}if(this.region===rg)return this.apiHost+t;var s=rv+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var rm=tv("[Surveys]"),ry="seenSurvey_",rb=["popover","widget","api"],rx={ignoreConditions:!1,ignoreDelay:!1,displayType:sf},rw=tv("[PostHog ExternalIntegrations]"),rE={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class rk{constructor(e){this._instance=e}lr(e,t){var i;null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return rw.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=d.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.lr(rE[e],()=>{var i;null==(i=d.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=d.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=d.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var rS,rP,rF={},r$=0,rI=()=>{},rM='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',rC="Surveys module not available",rT="sanitize_properties is deprecated. Use before_send instead",rR="Invalid value for property_denylist config: ",rO="posthog",rA=!s0&&-1===(null==c?void 0:c.indexOf("MSIE"))&&-1===(null==c?void 0:c.indexOf("Mozilla")),rL=e=>{var i;return f({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(!R(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ik)if(i===s)return!1;return!0}(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:rI,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:n&&R(null==n?void 0:n.search)&&-1!==n.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==t||null==(i=t.location)?void 0:i.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){tg.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:iu,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:rI,__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})},rq=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],rN=e=>{var t={};
1for(var[i,s]of rq)T(e[i])||(t[s]=e[i]);var r=iy({},t,e);return $(e.property_blacklist)&&(T(e.property_denylist)?r.property_denylist=e.property_blacklist:$(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:tg.error(rR+e.property_denylist)),r};class rD{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(e){tg.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class rj{Mi(e,t){if(e){var i=this.Pi.indexOf(e);-1!==i&&this.Pi.splice(i,1)}return this.Pi.push(t),null==t.initialize||t.initialize(),t}Ri(){return this.config.cookieless_mode===ia||this.config.cookieless_mode===ir&&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 rD,this.Oi=!1,this.version=p.LIB_VERSION,this.Li=new rn,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rL(),this.SentryIntegration=iZ,this.sentryIntegration=e=>{var t;return t=iJ(this,e),{name:iK,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fi=!1,this.Ai=null,this.Ni=null,this.$i=null,this.scrollManager=new ri(this),this.pageViewManager=new iQ(this),this.rateLimiter=new sm(this),this.requestRouter=new r_(this),this.consent=new iU(this),this.externalIntegrations=new rk(this);var e,t=null!=(e=rj.__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 s=R(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=R(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>tg.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==rO){var s,r=null!=(s=rF[i])?s:new rj;return r._init(e,t,i),rF[i]=r,rF[rO][i]=r,r}return this._init(e,t,i)}_init(e,i,s){if(void 0===i&&(i={}),T(e)||O(e))return tg.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={},i.debug=this.Di(i.debug),this.qi=i,this.ji=[],i.person_profiles?this.Ni=i.person_profiles:i.process_person&&(this.Ni=i.process_person),this.set_config(iy({},rL(i.defaults),rN(i),{name:s,token:e})),this.config.on_xhr_error&&tg.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:sx;var r,n,a=this.Hi();this.persistence=new sd(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sd(f({},this.config,{persistence:"sessionStorage"}),a);var o=f({},this.persistence.props),l=f({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ui=new s9(e=>this.Bi(e),this.config.request_queue_config),this.zi=new rt(this),this.__request_queue=[];var u=this.Ri();if(u||(this.sessionManager=new ro(this),this.sessionPropsManager=new rr(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tg.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vi(u)},0)):(tg.info("Initializing extensions synchronously"),this.Vi(u)),p.DEBUG=p.DEBUG||this.config.debug,p.DEBUG&&tg.info("Starting in debug mode",{this:this,config:i,thisC:f({},this.config),p:o,s:l}),!this.config.identity_distinct_id||null!=(r=i.bootstrap)&&r.distinctID||(i.bootstrap=f({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(n=i.bootstrap)?void 0:n.distinctID)){var c=i.bootstrap.distinctID,d=this.get_distinct_id(),h=this.persistence.get_property(t1);if(i.bootstrap.isIdentifiedID&&null!=d&&d!==c&&h===io)this.identify(c);else if(i.bootstrap.isIdentifiedID&&null!=d&&d!==c&&h===il)tg.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 g=this.config.get_device_id(iT()),v=i.bootstrap.isIdentifiedID?g:c;this.persistence.set_property(t1,i.bootstrap.isIdentifiedID?il:io),this.register({distinct_id:c,$device_id:v})}}if(u)this.register_once({distinct_id:t9,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(iT());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(t1,io)}return iS(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.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 s=i=>{var s=()=>i.anonymousId()||iT();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(t1,il)),t()},r=i.user();"then"in r&&I(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||iX.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(iX.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(iX.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,ih),identify:e=>s(e,ig),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Wi()):this.Wi(),I(this.config._onCapture)&&this.config._onCapture!==rI&&(tg.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tg.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}Vi(e){var t,i,s,r,n,a,o,l=performance.now(),u=f({},rj.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.Pi.push(this.featureFlags=null!=(t=this.featureFlags)?t:new u.featureFlags(this)),u.exceptions&&this.Pi.push(this.exceptions=null!=(i=this.exceptions)?i:new u.exceptions(this)),u.historyAutocapture&&this.Pi.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Pi.push(new u.tracingHeaders(this)),u.siteApps&&this.Pi.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.Pi.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Pi.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Pi.push(this.surveys=null!=(s=this.surveys)?s:new u.surveys(this)),u.logs&&this.Pi.push(this.logs=null!=(r=this.logs)?r:new u.logs(this)),u.conversations&&this.Pi.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.Pi.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Pi.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Pi.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Pi.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Pi.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,iG)),u.toolbar&&this.Pi.push(this.toolbar=null!=(a=this.toolbar)?a:new u.toolbar(this)),u.experiments&&this.Pi.push(this.experiments=null!=(o=this.experiments)?o:new u.experiments(this)),this.Pi.forEac
1h(e=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.Zi){var e=this.Zi;this.Zi=void 0,this.Rr(e)}}),this.Gi(c,l)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Gi(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tg.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[ie]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[it]:s}),this.config.__preview_deferred_init_extensions&&tg.info("PostHog extensions initialized ("+s+"ms)")}Rr(e){var t;r&&r.body?(this.config.__preview_deferred_init_extensions&&(this.Zi=e),this.Qi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=w(e.supportedCompression,sx)?sx:w(e.supportedCompression,sw)?sw:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:iu}),this.Pi.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(tg.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Rr(e)},500))}Wi(){try{this.config.loaded(this)}catch(e){tg.critical("`loaded` function failed",e)}if(this.Ji(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var e=n.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.Ri())&&this.Ki()},1),this.Yi=new sb(this),this.Yi.load()}Ji(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Ui)||e.enable())}_dom_loaded(){this.is_capturing()&&i_(this.__request_queue,e=>this.Bi(e)),this.__request_queue=[],this.Ji()}_handle_unload(){var e,t,i,s;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.Xi()&&this.capture(ip),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.Ui)||i.unload(),null==(s=this.zi)||s.unload()):this.Xi()&&this.capture(ip,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(rA?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=s5(e.url,{ip:+!!this.config.ip}),e.headers=f({},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,s,r=f({},e);r.timeout=r.timeout||6e4,r.url=s6(r.url,r.compression);var n=null!=(t=r.transport)?t:"fetch",a=s7.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),o=null!=(i=null==(s=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===n)return e[t]}(a))?void 0:s.method)?i:a[0].method;if(!o)throw Error("No available transport method");"sendBeacon"!==n&&r.data&&r.compression===sx&&u&&!s2?s8(r).then(e=>{o(e)}).catch(t=>{t&&"object"==typeof t&&"NotReadableError"===("name"in t?String(t.name):"")?(s2=!0,o(f({},r,{compression:void 0,url:s6(e.url,void 0)}))):o(r)}):o(r)})(f({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))))}Bi(e){this.zi?this.zi.retriableRequest(e):this._send_request(e)}_execute_array(e){r$++;try{var t,i=[],s=[],r=[];i_(e,e=>{e&&($(t=e[0])?r.push(e):I(e)?e.call(this):$(e)&&"alias"===t?i.push(e):$(e)&&-1!==t.indexOf("capture")&&I(this[t])?r.push(e):s.push(e))});var n=function(e,t){i_(e,function(e){if($(e[0])){var i=t;im(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))})};n(i,this),n(s,this),n(r,this)}finally{r$--}}push(e){if(r$>0&&$(e)&&R(e[0])){var t=rj.prototype[e[0]];I(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ui){if(this.is_capturing())if(!T(e)&&R(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&&!R(null==t?void 0:t.$current_url)&&(tg.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.en||tg.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=iT(),p={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},d,h)};e===ih&&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 g,v,_,m=this.tn(null==i?void 0:i.$set_once,e!==iv,e===ig);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=p,a=e=>R(e)?e.slice(0,r):e,o=new Set,p=function e(t,i){var s;return t!==Object(t)?a?a(t):t:o.has(t)?void 0:(o.add(t),$(t)?(s=[],i_(t,t=>{s.push(e(t))})):(s={},im(t,(t,i)=>{o.has(t)||(s[i]=e(t,i))}
1)),s)}(n)),p.timestamp=d,T(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===sv){var y=null==t?void 0:t.$survey_id,b=null==t?void 0:t.$survey_iteration;(e=>{try{var t,i=(t=""+ry+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+ry+e.id+"_"+e.current_iteration),t);if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){rm.error("Failed to persist survey seen state",e)}})({id:y,current_iteration:b}),p.$set=f({},p.$set,{[(g={id:y,current_iteration:b},_="$survey_"+(v=e===sv?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(_="$survey_"+v+"/"+g.id+"/"+g.current_iteration),_)]:!0})}else e===sg&&(p.$set=f({},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=f({},p.$set,{["$product_tour_last_seen_date/"+x]:(new Date).toISOString()}))}var w=f({},p.properties.$set,p.$set);if(C(w)||this.setPersonPropertiesForFlags(w),!L(this.config.before_send)){var E=this.rn(p);if(!E)return;p=E}this.Li.emit("eventCaptured",p);var k={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Bi(k):this.Ui.enqueue(k),p}tg.critical("This capture call is ignored due to client rate limiting.")}}else tg.error("No event name provided to posthog.capture")}else tg.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;var l,u=o?void 0:this.persistence.remove_event_timer(e),d=f({},i);if(d.token=this.config.token,d.$config_defaults=this.config.defaults,this.Ri()&&(d.$cookieless_mode=!0),"$snapshot"===e){var h=f({},this.persistence.properties(),this.sessionPersistence.properties());return d.distinct_id=h.distinct_id,(!R(d.distinct_id)&&!q(d.distinct_id)||O(d.distinct_id))&&tg.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),d}var g,v=function(e,i){if(!c)return{};var s,r,a,o,l,u,d,h,g,v,f,_=e?[...i6,...i||[]]:[],[m,y]=function(e){for(var t=0;eB.length>t;t++){var[i,s]=eB[t],r=i.exec(e),n=r&&(I(s)?s(r,e):s);if(n)return n}return["",""]}(c);return iy(iE({$os:m,$os_version:y,$browser:ej(c,navigator.vendor),$device:eU(c),$device_type:(u={userAgentDataPlatform:null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,maxTouchPoints:null==(r=navigator)?void 0:r.maxTouchPoints,screenWidth:null==t||null==(a=t.screen)?void 0:a.width,screenHeight:null==t||null==(o=t.screen)?void 0:o.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},(f=eU(c))===et||f===ee||"Kobo"===f||"Kindle Fire"===f||f===eC?Q:f===eb||f===ew||f===ex||f===e$?"Console":f===es?"Wearable":f?J:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!=(d=null==u?void 0:u.maxTouchPoints)?d:0)>0?600>Math.min(null!=(h=null==u?void 0:u.screenWidth)?h:0,null!=(g=null==u?void 0:u.screenHeight)?g:0)/(null!=(v=null==u?void 0:u.devicePixelRatio)?v:1)?J:Q:"Desktop"),$timezone:su(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:i3(null==n?void 0:n.href,_,i9),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:c.length>1e3?c.substring(0,997)+"...":c,$browser_version:eH(c,navigator.vendor),$browser_language:sr(),$browser_language_prefix:"string"==typeof(l=sr())?l.split("-")[0]:void 0,$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:p.LIB_NAME,$lib_version:p.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:_,windowId:m}=this.sessionManager.checkAndGetSessionAndWindowId(o,s.getTime());d.$session_id=_,d.$window_id=m}this.sessionPropsManager&&iy(d,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&iy(d,this.sessionRecording.sdkDebugProperties),d.$sdk_debug_retry_queue_size=null==(l=this.zi)?void 0:l.length}catch(e){d.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===rg&&(d.$lib_custom_api_host=this.config.api_host),g=e!==ih||o?e!==ip||o?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),d=iy(d,g),e===ih&&r&&(d.title=r.title),!T(u)){var y=s.getTime()-u;d.$duration=parseFloat((y/1e3).toFixed(3))}c&&this.config.opt_out_useragent_filter&&(d.$browser_type=this._is_bot()?"bot":"browser"),(d=iy({},v,this.persistence.properties(),this.sessionPersistence.properties(),d)).$is_identified=this._isIdentified(),$(this.config.property_denylist)?im(this.config.property_denylist,function(e){delete d[e]}):tg.error(rR+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tg.error(rT),d=b(d,e));var x=this.nn();return d.$process_person_profile=x,x&&!o&&this.sn("_calculate_event_properties"),d}tn(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.nn()||this.Oi&&!i)return e;var s,r=iy({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tg.error(rT),r=n(r,"$set_once")),t&&(this.Oi=!0),C(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.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)}an(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 s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Li.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:rC}),()=>{})}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:rC})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:rC})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=rx),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:rC}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:rC})}un(e){return!e||O(e)?(tg.critical("Unique user id has not been set in posthog.identify"),!1):e===t9?(tg.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())||(tg.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 tg.uninitializedWarning("posthog.identify");if(q(e)&&(e=e.toString(),tg.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.un(e)&&this.sn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(ty)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(tb)&&(this.unregister(tb),this.register({distinct_id:e}));var r,n=(this.persistence.get_property(t1)||io)===io;e!==s&&n?(this.persistence.set_property(t1,il),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(ig,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.$i=rc(e,t,i),null==(r=this.featureFlags)||r.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(tJ))}}setPersonProperties(e,t){if((e||t)&&this.sn("posthog.setPersonProperties")){var i=rc(this.get_distinct_id(),e,t);this.$i!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.$i=i):tg.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var s=this.getGroups(),r=s[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:f({},s,{[e]:t})}),r||i){var n={$group_type:e,$group_key:t};
1i&&(n.$group_set=i),this.capture(iv,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),r&&!i&&this.reloadFeatureFlags()}else tg.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.sn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tg.info("reset"),!this.__loaded)return tg.uninitializedWarning("posthog.reset");var t,i,s,r,n,a,o,l,u=this.get_property(ty);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),null==(s=this.surveys)||s.reset(),null==(r=this.Yi)||r.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.persistence)||o.set_property(t1,io),null==(l=this.sessionManager)||l.resetSessionId(),this.$i=null,this.config.cookieless_mode===ia)this.register_once({distinct_id:t9,$device_id:null},"");else{var c=this.config.get_device_id(iT());this.register_once({distinct_id:c,$device_id:e?c:u},"")}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.ln()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.hn()}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),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(tm)?(tg.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(T(t)&&(t=this.get_distinct_id()),e!==t?(this.an(tb,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tg.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=f({},this.config);if(M(e)){iy(this.config,rN(e));var i,s,r,n,a,o,l,u,c,d,h=this.Hi();null==(i=this.persistence)||i.update_config(this.config,t,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sd(f({},this.config,{persistence:"sessionStorage"}),h);var g=this.Di(this.config.debug);D(g)&&(this.config.debug=g),D(this.config.debug)&&(this.config.debug?(p.DEBUG=!0,iN.R()&&iN.N("ph_debug",!0),tg.info("set_config",{config:e,oldConfig:t,newConfig:f({},this.config)})):(p.DEBUG=!1,iN.R()&&iN.q("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.exceptions)||r.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(o=this.heatmaps)||o.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.cn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){p.LIB_NAME=e,p.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),o.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"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(f({},s,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:rj.dn}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:rO;return t!==rO&&(t=rO+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(t1))===il||(null==(t=this.sessionPersistence)?void 0:t.get_property(t1))===il}nn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iu&&!this._isIdentified()&&C(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tb])&&(null==(t=this.persistence)||null==(t=t.props)||!t[t6]))}Xi(){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.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return"never"===this.config.person_profiles?(tg.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(t6,!0),!0)}Hi(){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!==ir)}cn(){var e,t,i,s,r=this.Hi();return(null==(e=this.persistence)?void 0:e._r)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t._r)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==ia){if(this.Ri()){this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewM
1anager)||n.destroy(),this.sessionManager=new ro(this),this.pageViewManager=new iQ(this),this.persistence&&(this.sessionPropsManager=new rr(this,this.sessionManager,this.persistence));var i,s,r,n,a,o,l,u,c=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=rj.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.Mi(this.sessionRecording,new c(this)),this.Qi&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Qi)))}this.consent.optInOut(!0),this.cn(),this.Ji(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==ir&&(null==(i=this.surveys)||i.loadIfEnabled()),(T(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ki()}else tg.warn(rM)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==ia?(this.config.cookieless_mode===ir&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===ir&&(this.register({distinct_id:t9,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.Ki())):tg.warn(rM)}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===ia||(this.config.cookieless_mode===ir?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return s?rl(s,this.config.custom_blocked_useragents):void 0}Ki(){r&&("visible"===r.visibilityState?this.Fi||(this.Fi=!0,this.capture(ih,{title:r.title},{send_instantly:!0}),this.Ai&&(r.removeEventListener(ic,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),iS(r,ic,this.Ai)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.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}))}Lr(){var e,t,i,s,r=this.qi||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tg.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 r&&!L(r[e]),s=t in r&&!L(r[t]),i?r[e]:!!s&&(tg&&tg.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}rn(e){if(L(this.config.before_send))return e;var t=$(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(L(i=s(i))){var r="Event '"+e.event+"' was rejected in beforeSend function";return j(e.event)?tg.warn(r+". This can cause unexpected behavior."):tg.info(r),null}i.properties&&!C(i.properties)||tg.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)})}Di(e){var t=D(e)&&!e,i=iN.R()&&"true"===iN.A("ph_debug");return!t&&(!!i||e)}}function rz(e){return e instanceof Element&&(e.id===t7||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rH(e){return!!e&&1===e.nodeType}function rB(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
1function rU(e){return!!e&&3===e.nodeType}function rV(e){return!!e&&11===e.nodeType&&rH(e.host)}function rW(e){return e?E(e).split(/\s+/):[]}function rG(e){var i=null==t?void 0:t.location.href;return!!(i&&e&&e.some(e=>i.match(e)))}function rY(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 rW(t)}function rX(e){return L(e)?null:E(e).split(/(\s+)/).filter(e=>ns(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rK(e){var t="";return r4(e)&&!r8(e)&&e.childNodes&&e.childNodes.length&&im(e.childNodes,function(e){var i;rU(e)&&e.textContent&&(t+=null!=(i=rX(e.textContent))?i:"")}),E(t)}function rJ(e){var t;return T(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}rj.__defaultExtensionClasses={},rj.dn={trace:rP=()=>{},debug:rP,info:rP,warn:rP,error:rP,fatal:rP},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=iw(e.prototype[t[i]])}(rj,["identify"]);var rZ=["a","button","form","input","select","textarea","label"];function rQ(e,t){if(T(t))return!0;var i,s=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function r0(e){var t=e.parentNode;return!(!t||!rH(t))&&t}var r1=["next","previous","prev",">","<"],r2=[".ph-no-rageclick",".ph-no-capture"],r5=e=>!e||rB(e,"html")||!rH(e),r3=(e,i)=>{if(!t||r5(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var s=!1,r=[e],n=e;n.parentNode&&!rB(n,"body");)if(rV(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var a=r0(n);if(!a)break;if(i||rZ.indexOf(a.tagName.toLowerCase())>-1)s=!0;else{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(s=!0)}r.push(a),n=a}return{parentIsUsefulElement:s,targetElementList:r}};function r4(e){for(var t=e;t.parentNode&&!rB(t,"body");t=t.parentNode){var i=rY(t);if(w(i,"ph-sensitive")||w(i,"ph-no-capture"))return!1}if(w(rY(e),"ph-include"))return!0;var s=e.type||"";if(R(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!R(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function r8(e){return!!(rB(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rB(e,"select")||rB(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var r6="(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})",r7=RegExp("^(?:"+r6+")$"),r9=new RegExp(r6),ne="\\d{3}-?\\d{2}-?\\d{4}",nt=RegExp("^("+ne+")$"),ni=RegExp("("+ne+")");function ns(e,t){return void 0===t&&(t=!0),!(L(e)||R(e)&&(e=E(e),(t?r7:r9).test((e||"").replace(/[- ]/g,""))||(t?nt:ni).test(e)))&&!0}function nr(e){var t=rK(e);return ns(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&im(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=rK(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tg.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function nn(e){return e.replace(/"|\\"/g,'\\"')}class na{constructor(e){this.disabled=!1===e;var t=M(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.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 no="$copy_autocapture",nl=tv("[AutoCapture]");function nu(e,t){return t.length>e?t.slice(0,e)+"...":t}var nc=tv("[ExceptionAutocapture]");function nd(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return I(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}var nh=tv("[TracingHeaders]"),np=tv("[Web Vitals]"),ng="disabled",nv="lazy_loading",nf="awaiting_config",n_="missing_config";tv("[SessionRecording]"),tv("[SessionRecording]");var nm="[SessionRecording]",ny=tv(nm),nb=tv("[Heatmaps]");function nx(e){return M(e)&&"clientX"in e&&"clientY"in e&&q(e.clientX)&&q(e.clientY)}var nw=tv("[Product Tours]"),nE=["$set_once","$set"],nk=tv("[SiteApps]"),nS="Error while initializing PostHog app with config id ";function nP(e,t,i){if(L(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 nF{constructor(e){this.vn=new rn,this.fn=(e,t)=>this.pn(e,t)&&this.gn(e,t)&&this.mn(e,t)&&this.yn(e,t),this.pn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.bn=new Set,this._n=new Set}init(){var e,t;T(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(!T(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
vendor: 4,480 bytes, line 1
1=>{var t,i;null==(t=this._n)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.bn)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.bn.has(e)||this.bn.has(null==t?void 0:t.event))&&this._n&&(null==(i=this._n)?void 0:i.size)>0&&this._n.forEach(e=>{this.wn(t,e)&&this.vn.emit("actionCaptured",e.name)})}xn(e){this.onAction("actionCaptured",t=>e(t))}wn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.fn(e,i))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!nP(s,t.url,t.url_matching||"contains"))return!1}return!0}mn(e,t){return!!this.Sn(e,t)&&!!this.kn(e,t)&&!!this.Cn(e,t)}Sn(e,t){if(null==t||!t.href)return!0;var i=this.In(e);if(i.length>0)return i.some(e=>nP(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&nP((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}kn(e,t){if(null==t||!t.text)return!0;var i=this.In(e);if(i.length>0)return i.some(e=>nP(e.text,t.text,t.text_matching||"exact")||nP(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!L(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",r.some(e=>nP(e,n,a)))}Cn(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}In(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}yn(e,t){return null==t||!t.properties||0===t.properties.length||rp(t.properties.reduce((e,t)=>{var i=$(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 n${constructor(e){this._instance=e,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(e,t){return!!e&&rp(e.propertyFilters,null==t?void 0:t.properties)}Rn(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}On(e,t,i){var s=(i===sh?this.Tn:this.En).get(e),r=[];return this.Ln(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.Pn(n,t)})}register(e){var t;T(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Fn(e),this.An(e))}An(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.Nn&&(this.Nn=new nF(this._instance),this.Nn.init(),this.Nn.xn(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.Nn)||r.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.Mn.get(t.name);i&&i.push(e.id),this.Mn.set(t.name,i||[e.id])}}))}))}Fn(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}),s=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===s.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Tn=this.Rn(e,sh),this.En=this.Rn(e,sp))}onEvent(e,t){var i,s=this.le(),r=this.$n(),n=this.Dn(),a=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[r])||[];
1if(n===e&&t&&a.length>0){s.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:a});var o,l,u=(null==t||null==(o=t.properties)?void 0:o.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=a.indexOf(u);0>c||(a.splice(c,1),this.qn(a))}}else{if(this.En.has(e)){var d=this.On(e,t,sp);d.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map(e=>e.id)}),d.forEach(e=>{var t=a.indexOf(e.id);0>t||a.splice(t,1),this.jn(e.id)}),this.qn(a))}if(this.Tn.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.Tn.get(e)});var h=this.On(e,t,sh);this.qn(a.concat(h.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.$n(),s=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.Mn.has(e)&&this.qn(s.concat(this.Mn.get(e)||[]))}qn(e){var t=this.le(),i=[...new Set(e)].filter(e=>!this.Hn(e));t.info("updating activated items",{activatedItems:i}),this.Un(i)}getActivatedIds(){var e,t=this.$n();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Bn(){return this.Nn}}class nI extends n${constructor(e){super(e)}$n(){return tX}Dn(){return sg}Ln(e){var t;null==(t=this._instance)||t.getSurveys(e)}jn(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}le(){return rm}Un(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[tX]:e})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var nM="SDK is not enabled or survey functionality is not yet loaded",nC="Disabled. Not loading surveys.",nT=null!=t&&t.location?i4(t.location.hash,"__posthog")||i4(location.hash,"state"):null,nR="_postHogToolbarParams",nO=tv("[Toolbar]"),nA=tv("[FeatureFlags]"),nL=tv("[FeatureFlags]",{debugEnabled:!0}),nq="\" failed. Feature flags didn't load in time.",nN=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},nD=e=>{var t={};for(var[i,s]of ib(e||{}))s&&(t[i]=s);return t},nj=tv("[Error tracking]"),nz="Refusing to render web experiment since the viewer is a likely bot",nH={icontains:(e,i)=>!!t&&i.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,i)=>!!t&&-1===i.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,i)=>!!t&&ru(i.href,e),not_regex:(e,i)=>!!t&&!ru(i.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nB{get qt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nB.zn("retrieved web experiments from the server"),t.Vn=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Vn&&(nB.zn("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Vn)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);R(s)&&e.variants[s]&&t.Wn(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];nB.Zn(n)&&t.Wn(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())nB.zn(nz);else if(!this.qt.disable_web_experiments){if(L(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nB.zn("applying feature flags",e),e.forEach(e=>{var t;if(this.Vn&&null!=(t=this.Vn)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Vn)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Wn(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=nB.getWindowLocation();if(null!=e&&e.search){var t=i5(null==e?void 0:e.search,"__experiment_id"),i=i5(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nB.zn("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Gn(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 s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);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||[])})}Gn(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(nB.zn("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Wn(s[0].name,t,s[0].variants[t].transforms))}static Zn(e){return!L(e.conditions)&&nB.Qn(e)&&nB.Jn(e)}static Qn(e){if(L(e.conditions)||L(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=nB.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||nH[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==t?void 0:t.location}static Jn(e){if(L(e.conditions)||L(null==(i=e.conditions)?void 0:i.utm))return!0;var t=st();if(t.utm_source){var i,s,r,n,a,o,l,u,c,d=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,h=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,g=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&&g&&h}return!1}static zn(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];tg.info("[WebExperiments] "+e,i)}Wn(e,t,i){this._is_bot()?nB.zn(nz):"control"!==t?i.forEach(i=>{if(i.selector){nB.zn("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):nB.zn("Control variants leave the page unmodified.")}_is_bot(){return s&&this._instance?rl(s,this.qt.custom_blocked_useragents):void 0}}var nU=tv("[Conversations]"),nV="Conversations not available yet.",nW={featureFlags:class{constructor(e){this.Kn=!1,this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}us(){var e,t;return null!=(e=null==(t=this.ni)?void 0:t.wr(this.qt.feature_flag_cache_ttl_ms))&&e}ls(){return!!this.us()&&(this.ss||this.Xn||(this.ss=!0,nA.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=null!=(e=this.qt.evaluation_contexts)?e:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.ns||(nA.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||nA.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:i}=this._instance,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,a=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},o=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var s=null!=i&&i.merge?this.getFlagVariants():{},r=null!=i&&i.merge?this.getFlagPayloads():{},n=f({},s,e),a=f({},r,t),o={};for(var[l,u]of Object.entries(n)){var c="string"==typeof u;o[l]={key:l,enabled:!!c||!!u,variant:c?u:void 0,reason:void 0,metadata:T(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(tz),t=this.os(tU),i=this.os(tV);if(!i&&!t)return e||{};var s=iy({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=T(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,c=T(l)?o.variant:"string"==typeof l?l:void 0,d=null==i?void 0:i[r],h=f({},o,{enabled:u,variant:u?null!=c?c:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(h.original_enabled=null==o?void 0:o.enabled),c!==(null==o?void 0:o.variant)&&(h.original_variant=null==o?void 0:o.variant),d&&(h.metadata=f({},null==o?void 0:o.metadata,{payload:d,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=h}return this.Kn||(nA.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.Kn=!0),s}getFlagVariants(){var e=this.os(tN),t=this.os(tU);if(!t)return e||{};for(var i=iy({},e),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Kn||(nA.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Kn=!0),i}getFlagPayloads(){var e=this.os(tH),t=this.os(tV);if(!t)return e||{};for(var i=iy({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Kn||(nA.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Kn=!0),i}reloadFeatureFlags(){this.es||this.qt.advanced_disable_feature_flags||this.ds||(this._instance.Li.emit("featureFlagsReloading",!0),this.ds=setTimeout(()=>{this.vs()},5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var i=this.qt.token,s=this.os(ty),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:f({},(null==(t=this.ni)?void 0:t.get_initial_props())||{},this.os(tW)||{}),group_properties:this.os(tG),timezone:su()};A(s)||T(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.cs()&&(r.evaluation_contexts=this.hs());var n=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Xn=!0,this._instance._send_request({method:"POST",url:n,data:r,compression:this.qt.disable_compression?void 0:sw,timeout:this.qt.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;if(200===e.statusCode&&(this.ts||(this.$anon_distinct_id=void 0),n=!1),this.Xn=!1,!r.disable_flags||this.ts){this.rs=!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 o,l=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(l&&a.push("quota_limited"),null==(s=this.ni)||s.register({[tQ]:a}),l)?nA.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(r.disable_flags||this.receivedFeatureFlags(null!=(o=e.json)?o:{},n,{partialResponse:!!this.qt.advanced_only_evaluate_survey_feature_flags}
1),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else nA.warn('getFeatureFlag for key "'+e+nq)}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.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var i=this.getFlagVariants(),s=e in i,r=i[e],n=this.getFlagPayloads()[e],a=String(r),o=this.os(tB)||void 0,l=this.os(t0)||void 0,u=this.os(tJ)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),h=this.os(tZ);d&&d!==h&&(u={},null==(c=this.ni)||c.register({[tJ]:u,[tZ]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){$(u[e])?u[e].push(a):u[e]=[a],null==(f=this.ni)||f.register({[tJ]:u});var p=this.getFeatureFlagDetails(e),g=[...null!=(_=this.os(tQ))?_:[]];T(r)&&g.push("flag_missing");var v={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.qt.bootstrap)||null==(m
1=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.rs};T(null==p||null==(b=p.metadata)?void 0:b.version)||(v.$feature_flag_version=p.metadata.version);var f,_,m,y,b,x,w,E,k,S,P,F=null!=(x=null==p||null==(w=p.reason)?void 0:w.description)?x:null==p||null==(E=p.reason)?void 0:E.code;F&&(v.$feature_flag_reason=F),null!=p&&null!=(k=p.metadata)&&k.id&&(v.$feature_flag_id=p.metadata.id),T(null==p?void 0:p.original_variant)&&T(null==p?void 0:p.original_enabled)||(v.$feature_flag_original_response=T(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(S=p.metadata)&&S.original_payload&&(v.$feature_flag_original_payload=null==p||null==(P=p.metadata)?void 0:P.original_payload),g.length&&(v.$feature_flag_error=g.join(",")),this._instance.capture("$feature_flag_called",v)}if(s){var I=n;if(!T(n))try{I=JSON.parse(n)}catch(e){}return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:I}}}}else nA.warn('getFeatureFlagResult for key "'+e+nq)}getRemoteConfigPayload(e,t){var i=this.qt.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.cs()&&(s.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.qt.disable_compression?void 0:sw,timeout:this.qt.feature_flag_request_timeout_ms,callback(i){var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.rs){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return T(i)?void 0:!!i}nA.warn('isFeatureEnabled for key "'+e+nq)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.ni){this.Yn=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,s,r,n){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var a,o=((a=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!=(t=a[e].variant)?t:a[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))):nA.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=o.flags,u=o.featureFlags,c=o.featureFlagPayloads;if(u){var d=e.requestId,h=e.evaluatedAt;if($(u)){nA.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var g=0;u.length>g;g++)p[u[g]]=!0;t&&t.register({[tD]:u,[tN]:p})}else{var v=u,_=c,m=l;if(null!=n&&n.partialResponse)v=f({},i,v),_=f({},s,_),m=f({},r,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));v=f({},i,Object.fromEntries(Object.entries(v).filter(e=>{var[t]=e;return y.has(t)}))),_=f({},s,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return y.has(t)}))),m=f({},r,Object.fromEntries(Object.entries(m||{}).filter(e=>{var[t]=e;return y.has(t)})))}else v=f({},i,v),_=f({},s,_),m=f({},r,m);t&&t.register(f({[tD]:Object.keys(nD(v)),[tN]:v||{},[tH]:_||{},[tz]:m||{}},d?{[tB]:d}:{},h?{[t0]:h}:{}))}}}(e,this.ni,s,r,n,i),t||(this.ss=!1),this.ps(t)}}override(e,t){void 0===t&&(t=!1),nA.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return nA.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.ni.unregister(tU),this.ni.unregister(tV),this.ps(),nL.info("All overrides cleared");if($(e)){var t,i=nN(e);return this.ni.register({[tU]:i}),this.ps(),nL.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.Kn=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.ni.unregister(tU),nL.info("Flag overrides cleared");else if(e.flags){if($(e.flags)){var s=nN(e.flags);this.ni.register({[tU]:s}
1)}else this.ni.register({[tU]:e.flags});nL.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.ni.unregister(tV),nL.info("Payload overrides cleared")):e.payloads&&(this.ni.register({[tV]:e.payloads}),nL.info("Payload overrides set",{payloads:e.payloads}))),void this.ps()}if(e&&"object"==typeof e)return this.ni.register({[tU]:e}),this.ps(),nL.info("Flag overrides set",{flags:e});nA.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:i}=this.gs();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.os(tj)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=f({},this.getFlagVariants(),{[e]:t});null==(s=this.ni)||s.register({[tD]:Object.keys(nD(o)),[tN]:o}),this.ps()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.os(tj),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this.ni)||i.unregister(tj),null==(s=this.ni)||s.register({[tj]:r}),e(r)}}})}gs(){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),{})}}ps(e){var{flags:t,flagVariants:i}=this.gs();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.os(tW)||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in i||(n[a]=r[a]));this._instance.register({[tW]:f({},i,n,s)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tW)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.os(tG)||{};
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=f({},i[t],e[t]),delete e[t]}),this._instance.register({[tG]:f({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(tG)||{};this._instance.register({[tG]:f({},t,{[e]:{}})})}else this._instance.unregister(tG)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Kn=!1}}},nG=f({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Eo=null,this.Mo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[tI]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Eo||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(tI)||this.lr(()=>this.Po())}lr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?nw.error("Could not load product tours script",t):e()})}Po(){var e;!this.Eo&&null!=(e=d.__PosthogExtensions__)&&e.generateProductTours&&(this.Eo=d.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!$(this.Mo)||t){var i=this.ni;if(i){var s=i.props[tK];if($(s)&&!t)return this.Mo=s,void e(s,{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 s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return nw.error(r),void e([],{isLoaded:!1,error:r})}var n=$(t.json.product_tours)?t.json.product_tours:[];this.Mo=n,i&&i.register({[tK]:n}),e(n,{isLoaded:!0})}})}else e(this.Mo,{isLoaded:!0})}getActiveProductTours(e){L(this.Eo)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Eo.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Eo)||t.showTourById(e)}previewTour(e){this.Eo?this.Eo.previewTour(e):this.lr(()=>{var t;this.Po(),null==(t=this.Eo)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Eo)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Eo)||e.nextStep()}previousStep(){var e;null==(e=this.Eo)||e.previousStep()}clearCache(){var e;this.Mo=null,null==(e=this.ni)||e.unregister(tK)}resetTour(e){var t;null==(t=this.Eo)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Eo)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Eo)||t.cancelPendingTour(e)}}},nW),nY=f({surveys:class{get qt(){return this._instance.config}constructor(e){this.qo=void 0,this._surveyManager=null,this.jo=!1,this.Ho=[],this.Uo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(L(t))return rm.warn("Flags not loaded yet. Not loading surveys.");var i=$(t);this.qo=i?t.length>0:t,rm.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(ry)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.jo)rm.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)rm.info(nC);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())rm.info("Not loading surveys in cookieless mode without consent.");else{var e=null==d?void 0:d.__PosthogExtensions__;if(e){if(!T(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.Bo(i,t);var s=e.loadExternalDependency;if(!s)return void this.zo(is);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.zo("Could not load surveys script",i):this.Bo(e.generateSurveys,t)})}catch(e){throw this.zo("Error initializing surveys",e),e}finally{this.jo=!1}}}else rm.error("PostHog Extensions not found.")}}Bo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new nI(this._instance),rm.info("Surveys loaded successfully"),this.Vo({isLoaded:!0})}zo(e,t){rm.error(e,t),this.Vo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ho.push(e),this._surveyManager&&this.Vo({isLoaded:!0}),()=>{this.Ho=this.Ho.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.qt.disable_surveys)return rm.info(nC),e([]);var i,s=this._instance.get_property(tY);if(s&&!t)return e(s,{isLoaded:!0});"u">typeof Promise&&this.Uo?this.Uo.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("u">typeof Promise&&(this.Uo=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.Uo=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;rm.error(r);var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}var a,o,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==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[tY]:l});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}
1Vo(e){for(var t of this.Ho)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){rm.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!L(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);rm.warn("init was not called")}Wo(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}Zo(e){if(L(this._surveyManager))return{eligible:!1,reason:nM};var t="string"==typeof e?this.Wo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(L(this._surveyManager))return rm.warn("init was not called"),{visible:!1,disabledReason:nM};var t=this.Zo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return L(this._surveyManager)?(rm.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:nM})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.Zo(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(L(this._surveyManager))rm.warn("init was not called");else{var n="string"==typeof e?this.Wo(e):e;if(null!=n&&n.id)if(rb.includes(n.type)){var a=null==r?void 0:r.querySelector(t);if(a)return null!=(s=n.appearance)&&s.surveyPopupDelaySeconds?(rm.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;rm.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,a,i),rm.info("Survey "+n.id+" rendered")},1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,a,i);rm.warn("Survey element not found")}else rm.warn("Surveys of type "+n.type+" cannot be rendered in the app");else rm.warn("Survey not found")}}displaySurvey(e,t){var i;if(L(this._surveyManager))rm.warn("init was not called");else{var s=this.Wo(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=f({},s,{appearance:f({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==sf&&t.initialResponses&&rm.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void rm.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else rm.warn("Survey not found")}}cancelPendingSurvey(e){L(this._surveyManager)?rm.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},nW),nX=f({experiments:nB},nW),nK=f({},nW,{sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e,t;return this.bs===nf||this.bs===n_?this.bs:null!=(e=null==(t=this.ys)?void 0:t.status)?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=ng,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw ny.error("started without valid sessionManager"),Error(nm+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===ia)throw Error(nm+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,i=!(null==(e=this._instance.get_property(tC))||!e.enabled),s=!this.qt.disable_session_recording,r=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&s&&!r}startIfEnabledOrStop(e){var t;if(!this.ws||null==(t=this.ys)||!t.isStarted){var i=!T(Object.assign)&&!T(Array.from);this.ws&&i?(this.xs(e),ny.info("starting")):(this.bs=ng,this.stopRecording())}}xs(e){var t,i,s;this.ws&&(this.bs!==nf&&this.bs!==n_&&(this.bs=nv),null!=d&&null!=(t=d.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=d.__PosthogExtensions__)&&i.initSessionRecording?this.Ss(e):null==(s=d.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.ks,t=>{if(t)return ny.error("could not load recorder",t);this.Ss(e)}))}stopRecording(){var e,t;null==(e=this._s)||e.call(this),this._s=void 0,null==(t=this.ys)||t.stop()}Cs(){var e,t;null==(e=this._s)||e.call(this),this._s=void 0,null==(t=this.ys)||t.discard()}Is(){var e;null==(e=this.ni)||e.unregister(tq)}Ts(e,t){if(L(e))return null;var i=q(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(ny.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Es(e){if(this.ni){var t,i,s=this.ni,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ts(null==(t=this.qt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;L(a)&&this.Is();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[tC]:f({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:f({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}
1,sampleRate:a,minimumDurationMilliseconds:T(o)?null:o,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})})};r(),null==(t=this._s)||t.call(this),this._s=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Es(e),void this.Cs()):(this.Es(e),void this.startIfEnabledOrStop()):(this.bs===nf&&(this.bs=n_,ny.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.ys)&&i.log?this.ys.log(e,t):ny.warn("log called before recorder was ready")}get ks(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tC);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ms(){var e,t=this._instance.get_property(tC);if(!t)return!1;var i=null!=(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)?e:Date.now();return 36e5>=Date.now()-i}Ss(e){var t,i;if(null==(t=d.__PosthogExtensions__)||!t.initSessionRecording)return ny.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[ii]:!0});if(this.ys||(this.ys=null==(i=d.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===n_||this.bs===nf)return;return this.bs=nf,ny.info("persisted remote config is stale, requesting fresh config before starting"),void new sb(this._instance).load()}this.bs=nv,this.ys.start(e)}onRRwebEmit(e){var t;null==(t=this.ys)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||null==(t=this.ni)||t.register({[tR]:!0}),null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||null==(t=this.ni)||t.register({[tT]:!0}),null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t,i;this.ys||null==(i=this.ni)||i.register({["url"===e?tO:tA]:!0}),null==(t=this.ys)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.ys)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.ys)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new na(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get qt(){var e,t,i=M(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}Fs(){if(this.isBrowserSupported()){if(t&&r){var e=e=>{e=e||(null==t?void 0:t.event);try{this.As(e)}catch(e){nl.error("Failed to capture event",e)}};if(iS(r,"submit",e,{capture:!0}),iS(r,"change",e,{capture:!0}),iS(r,"click",e,{capture:!0}),this.qt.capture_copied_text){var i=e=>{e=e||(null==t?void 0:t.event);try{this.As(e,no)}catch(e){nl.error("Failed to capture copy/cut event",e)}};iS(r,"copy",i,{capture:!0}),iS(r,"cut",i,{capture:!0})}}}else nl.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Os=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tw]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,i=[];return null==(t=this.Ls)||t.forEach(t=>{var s=null==r?void 0:r.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tw];if(A(this.Rs)&&!D(i)&&!this.instance.Lr())return!1;var s=null!=(t=this.Rs)?t:!!i;return!!this.instance.config.autocapture&&!s}As(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var s,r=rJ(e);rU(r)&&(r=r.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,i){if(!t||r5(e)||(D(i)?(s=!!i&&r2,r=void 0):(s=null!=(n=null==i?void 0:i.css_selector_ignorelist)?n:r2,r=null==i?void 0:i.content_ignorelist),!1===s))return!1;var s,r,n,{targetElementList:a}=r3(e,!1);return!function(e,t){var i;if(!1===e||T(e))return!1;if(!0===e)i=r1;else{if(!$(e))return!1;if(e.length>10)return tg.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:s}=e;return i.some(e=>t.includes(e)||s.includes(e))})}(r,a.map(e=>{var t;return{safeText:rK(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rQ(a,s)}(r,this.instance.config.rageclick)&&this.As(e,"$rageclick");var n=i===no;if(r&&function(e,i,s,r,n){if(void 0===s&&(s=void 0),!t||r5(e)||null!=(a=s)&&a.url_allowlist&&!rG(s.url_allowlist)||null!=(o=s)&&o.url_ignorelist&&rG(s.url_ignorelist))return!1;if(null!=(l=s)&&l.dom_event_allowlist){var a,o,l,u,c=s.dom_event_allowlist;if(c&&!c.some(e=>i.type===e))return!1}var{parentIsUsefulElement:d,targetElementList:h}=r3(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(T(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,s)||!rQ(h,null==(u=s)?void 0:u.css_selector_allowlist))return!1;var p=t.getComputedStyle(e);
1if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===i.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(i.type)>=0;default:return d?(n||["click"]).indexOf(i.type)>=0:(n||["click"]).indexOf(i.type)>=0&&(rZ.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.qt,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=function(e,i){var s,r,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:u}=i;if(!rH(e))return{props:{}};for(var c=[e],d=e;d.parentNode&&!rB(d,"body");)if(rV(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!rH(d.parentNode))break;c.push(d.parentNode),d=d.parentNode}var h,p=[],g={},v=!1,_=!1;if(im(c,e=>{var t=r4(e);if(rB(e,"a")){var i=e.getAttribute("href");v=t&&!!i&&ns(i)&&i}w(rY(e),"ph-no-capture")&&(_=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};rZ.indexOf(r)>-1&&!i&&(n.$el_text="a"===r.toLowerCase()||"button"===r.toLowerCase()?nu(1024,nr(e)):nu(1024,rK(e)));var a=rY(e);a.length>0&&(n.classes=a.filter(function(e){return""!==e})),im(e.attributes,function(i){var r;if((!r8(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&ns(i.value)&&(!R(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var a=i.value;"class"===i.name&&(a=rW(a).join(" ")),n["attr__"+i.name]=nu(1024,a)}});for(var o=1,l=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rH(t))return t}(u);)o++,u.tagName===e.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}(e,a,o,l)),iy(g,function(e){if(!r4(e))return{};var t={};return im(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&ns(s)&&(t[i]=s)}}),t}(e))}),_)return{props:{},explicitNoCapture:_};if(o||(p[0].$el_text=rB(e,"a")||rB(e,"button")?nr(e):rK(e)),v){p[0].attr__href=v;var m,y,b=null==(m=i2(v))?void 0:m.host,x=null==t||null==(y=t.location)?void 0:y.host;b&&x&&b!==x&&(h=v)}return{props:iy({$event_type:n.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?$(t)?t:rW(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ib(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=f({},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),a={};return ib(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return a[nn(t.toString())]=nn(i.toString())}),(s+=":")+ib(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(s=p[0])&&s.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},h&&"click"===n.type?{$external_click_url:h}:{},g)}}(r,{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.Os});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),i===no){var u,c=rX(null==t||null==(u=t.getSelection())?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;a.$selected_content=c,a.$copy_type=d}return this.instance.capture(i,a),!0}}}isBrowserSupported(){return I(null==r?void 0:r.querySelectorAll)}},historyAutocapture:class{constructor(e){var i;this._instance=e,this.Ns=(null==t||null==(i=t.location)?void 0:i.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tg.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.$s&&this.$s(),this.$s=void 0,tg.info("History API monitoring stopped")}monitorHistoryChanges(){var e,i;if(t&&t.history){var s=this;null!=(e=t.history.pushState)&&e.__posthog_wrapped__||nd(t.history,"pushState",e=>function(t,i,r){e.call(this,t,i,r),s.Ds("pushState")}),null!=(i=t.history.replaceState)&&i.__posthog_wrapped__||nd(t.history,"replaceState",e=>function(t,i,r){e.call(this,t,i,r),s.Ds("replaceState")}),this.qs()}}Ds(e){try{var i,s=null==t||null==(i=t.location)?void 0:i.pathname;if(!s)return;s!==this.Ns&&this.isEnabled&&this._instance.capture(ih,{navigation_type:e}),this.Ns=s}catch(t){tg.error("Error capturing "+e+" pageview",t)}}qs(){if(!this.$s){var e=()=>{this.Ds("popstate")};iS(t,"popstate",e),this.$s=()=>{t&&t.removeEventListener("popstate",e)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.js=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.js=!(null==(t=this.instance.persistence)||!t.props[tE]),this.rageclicks=new na(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return M(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return L(this.qt.capture_heatmaps)?L(this.qt.enable_heatmaps)?this.js:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}
1startIfEnabled(){if(this.isEnabled)this.Ps||(nb.info("starting..."),this.Us(),this.At());else{var e;clearInterval(null!=(e=this.Hs)?e:void 0),this.Bs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tE]:t}),this.js=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}zs(e){this.Mt(e.originalEvent,"deadclick")}At(){this.Hs&&clearInterval(this.Hs),this.Hs="visible"===(null==r?void 0:r.visibilityState)?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Us(){t&&r&&(this.Vs=this.Zr.bind(this),iS(t,id,this.Vs),this.Ws=e=>this.Mt(e||(null==t?void 0:t.event)),iS(r,"click",this.Ws,{capture:!0}),this.Zs=e=>this.Gs(e||(null==t?void 0:t.event)),iS(r,"mousemove",this.Zs,{capture:!0}),this.Qs=new iY(this.instance,iW,this.zs.bind(this)),this.Qs.startIfEnabledOrStop(),this.Js=this.At.bind(this),iS(r,ic,this.Js),this.Ps=!0)}Bs(){var e;t&&r&&(this.Vs&&t.removeEventListener(id,this.Vs),this.Ws&&r.removeEventListener("click",this.Ws,{capture:!0}),this.Zs&&r.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Js&&r.removeEventListener(ic,this.Js),clearTimeout(this.Ks),null==(e=this.Qs)||e.stop(),this.Ps=!1)}Ys(e,i){var s=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,i,s){for(var r=e;r&&rH(r)&&!rB(r,"body")&&r!==s;){if(w(i,null==t?void 0:t.getComputedStyle(r).position))return!0;r=r0(r)}return!1}(rJ(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:s),target_fixed:a,type:i}}Mt(e,t){var i;if(void 0===t&&(t="click"),!rz(e.target)&&nx(e)){var s=this.Ys(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Xs(f({},s,{type:"rageclick"})),this.Xs(s)}}Gs(e){!rz(e.target)&&nx(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout(()=>{this.Xs(this.Ys(e,"mousemove"))},500))}Xs(e){if(t){var i=t.location.href,s=this.qt.custom_personal_data_properties,r=i3(i,this.qt.mask_personal_data_properties?[...i6,...s||[]]:[],i9);this.M=this.M||{},this.M[r]||(this.M[r]=[]),this.M[r].push(e)}}Zr(){this.M&&!C(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:iY,webVitalsAutocapture:class{constructor(e){var t;this.js=!1,this.Ps=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((e,t)=>f({},e,{["$web_vitals_"+t.name+"_event"]:f({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(T(i))np.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.io();T(s)||(L(null==e?void 0:e.name)||L(null==e?void 0:e.value)?np.error("Invalid metric received",e):!this.no||this.no>e.value?(this.M.url!==s&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),T(this.M.url)&&(this.M.url=s),this.M.firstMetricTimestamp=T(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.M.metrics.push(f({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.eo()):np.error("Ignoring metric with value >= "+this.no,e))}},this.so=()=>{if(!this.Ps){var e,t,i,s,r=d.__PosthogExtensions__;T(r)||T(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(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&&s(this.ht.bind(this)),this.Ps=!0):np.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.js=!(null==(t=this._instance.persistence)||!t.props[tF]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=M(this.oo)?null==(e=this.oo)?void 0:e.web_vitals_allowed_metrics:void 0;return L(i)?(null==(t=this._instance.persistence)?void 0:t.props[tM])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(M(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=M(this.oo)?this.oo.web_vitals_attribution:void 0;return null!=e&&e}get no(){var e=M(this.oo)&&q(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==n?void 0:n.protocol;if("http:"!==e&&"https:"!==e)return np.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=M(this.oo)?this.oo.web_vitals:D(this.oo)?this.oo:void 0;return D(t)?t:this.js}startIfEnabled(){this.isEnabled&&!this.Ps&&(np.info("enabled, starting..."),this.lr(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=M(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=M(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tF]:t}),this._instance.persistence.register({[tM]:i}
1)),this.js=t,this.startIfEnabled()}}lr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?np.error("failed to load script",t):e()})}io(){var e=t?t.location.href:void 0;if(e){var i=this._instance.config.custom_personal_data_properties;return i3(e,this._instance.config.mask_personal_data_properties?[...i6,...i||[]]:[],i9)}np.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var i,s,r;this.so=()=>{var e;if(t&&this.isEnabled&&null!=(e=d.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=d.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=d.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=d.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.qt.capture_unhandled_errors&&(this.ao=i(this.captureException.bind(this))),!this.uo&&this.qt.capture_unhandled_rejections&&(this.uo=s(this.captureException.bind(this))),!this.lo&&this.qt.capture_console_errors&&(this.lo=r(this.captureException.bind(this)))}catch(e){nc.error("failed to start",e),this.ho()}}},this._instance=e,this.co=!(null==(i=this._instance.persistence)||!i.props[tk]),this.do=new G({refillRate:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?s:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4,Gt:nc}),this.qt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return M(e)?t=f({},t,e):(T(e)?this.co:e)&&(t=f({},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?(nc.info("enabled"),this.ho(),this.lr(this.so)):this.ho()}lr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return nc.error("failed to load script",t);e()})}ho(){var e,t,i;null==(e=this.ao)||e.call(this),this.ao=void 0,null==(t=this.uo)||t.call(this),this.uo=void 0,null==(i=this.lo)||i.call(this),this.lo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[tk]:this.co}),this.qt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.vo()}captureException(e){var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.do.consumeRateLimit(r)?nc.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.fo=[],this.po=new eX([new e8,new ta,new e7,new e6,new tr,new ts,new te,new tn],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=e4.test(o)?o.replace(e4,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){r.push(c);break}}if(r.length>=50)break}}}if(!r.length)return[];var d=Array.from(r);return d.reverse(),d.slice(0,50).map(e=>f({},e,{filename:e.filename||(d[d.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",e1,e3)),this._instance=e,this.fo=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(tS))?t:[],this.mo=td(this.yo()),this.bo=new th(this.mo)}onConfigChange(){this.mo=td(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,i,s;if("errorTracking"in e){var r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.fo=r,this._instance.persistence&&this._instance.persistence.register({[tS]:this.fo,[tP]:n})}}get _o(){var e,t=!!this._instance.get_property(tP),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!R(e)||0===e.trim().length)return void nj.warn("Ignoring exception step because message must be a non-empty string");var i=this.wo(t),{sanitizedProperties:s,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tu.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(i);r.length>0&&nj.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.bo.add(f({[to]:e,[tl]:(new Date).toISOString()}
1,s))}catch(e){nj.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.xo(t)){if(this.So(t))return this.ko("Exception dropped: matched a suppression rule"),void nj.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.Co(t))return this.ko("Exception dropped: thrown by a browser extension"),void nj.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Io(t))return this.ko("Exception dropped: thrown by the PostHog SDK"),void nj.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.mo.enabled&&L(e.$exception_steps)?this.To(e):e;try{var s=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return s&&this.bo.clear(),s}catch(e){return nj.error("Failed to capture exception event. Dropping this exception.",e),void this.bo.clear()}}catch(e){return void nj.error("Failed to process exception event. Ignoring this exception.",e)}}To(e){try{var t=this.bo.getAttachable();return 0===t.length?e:f({},e,{$exception_steps:t})}catch(t){return nj.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ko(e){this.mo.enabled&&this.bo.add({[to]:e,[tl]:(new Date).toISOString()})}wo(e){return M(e)?f({},e):{}}yo(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}So(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:s}=t;return R(i)&&i.length>0&&e.$exception_types.push(i),R(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.fo.some(e=>{var i=e.values.map(e=>{var i,s=rd[e.operator],r=$(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Co(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://"))}Io(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}xo(e){return!L(e)&&$(e)}}},nG,{siteApps:class{constructor(e){this._instance=e,this.Ro=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Oo(e,t){if(t){var i=this.globalsForEvent(t);this.Ro.push(i),this.Ro.length>1e3&&(this.Ro=this.Ro.slice(10))}}get siteAppLoaders(){var e;return null==(e=d._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Oo.bind(this));this.Lo=()=>{e(),this.Ro=[],this.Lo=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,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:f({},_(e,nE),{properties:f({},e.properties,p?{$set:f({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},h?{$set_once:f({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},h)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.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.Ro.length&&(nk.info("Processing "+this.Ro.length+" events for site app with id "+e.id),this.Ro.forEach(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.Lo)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,nk.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback(e){r(e)}});n&&(t.processEvent=n),s=!0}catch(t){nk.error(nS+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){nk.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Fo(){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)}Ao(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){nk.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Fo(),void this._instance.on("eventCaptured",e=>this.Ao(e))):void nk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Lo)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;d["__$$ph_site_app_"+e]=r._instance,null==(t=d.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,o,t=>{if(t)return nk.error(nS+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else nk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},nY,{tracingHeaders:class{constructor(e){this.No=void 0,this.$o=void 0,this.so=()=>{var e,t,i=this.Do()||[];
1T(this.No)&&(null==(e=d.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(i,this._instance.get_distinct_id(),this._instance.sessionManager)),T(this.$o)&&(null==(t=d.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(i,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}lr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return nh.error("failed to load script",t);e()})}Do(){var e;return null!=(e=this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Do()?this.lr(this.so):(null==(e=this.No)||e.call(this),null==(t=this.$o)||t.call(this),this.No=void 0,this.$o=void 0)}}},{toolbar:class{constructor(e){this.instance=e}Go(e){d.ph_toolbar_state=e}Qo(){var e;return null!=(e=d.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,s){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===s&&(s=void 0),iP(this.instance.config)||!t||!r)return!1;e=null!=e?e:t.location,s=null!=s?s:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(e){return!1}i=null==t?void 0:t.localStorage}var n,a=nT||i4(e.hash,"__posthog")||i4(e.hash,"state"),o=a?ix(()=>JSON.parse(atob(decodeURIComponent(a))))||ix(()=>JSON.parse(decodeURIComponent(a))):null;return o&&"ph_authorize"===o.action?((n=o).source="url",n&&Object.keys(n).length>0&&(o.desiredHash?e.hash=o.desiredHash:s?s.replaceState(s.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(i.getItem(nR)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch(e){return!1}}Jo(e){var t=d.ph_load_toolbar||d.ph_load_editor;!L(t)&&I(t)?t(e,this.instance):nO.warn("No toolbar load function found")}loadToolbar(e){var i,s=!(null==r||!r.getElementById(t7));if(!t||s)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,a=f({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});return(t.localStorage.setItem(nR,JSON.stringify(f({},a,{source:void 0}))),2===this.Qo())?this.Jo(a):0===this.Qo()&&(this.Go(1),null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"toolbar",e=>{e?(nO.error("[Toolbar] Failed to load",e),this.Go(0)):(this.Go(2),this.Jo(a))}),iS(t,"turbolinks:load",()=>{this.Go(0),this.loadToolbar(a)})),!0}Ko(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)}}},nX,{conversations:class{constructor(e){this.Yo=void 0,this._conversationsManager=null,this.Xo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;L(t)||(D(t)?this.Yo=t:(this.Yo=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Yo=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Xo||this._instance.config.disable_conversations||iP(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==d?void 0:d.__PosthogExtensions__;if(e&&!T(this.Yo)&&this.Yo)if(this.ea&&this.ea.token){this.Xo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Xo=!1);var i=e.loadExternalDependency;if(!i)return void this.ra(is);i(this._instance,"conversations",t=>{t||!e.initConversations?this.ra("Could not load conversations script",t):this.ta(e.initConversations),this.Xo=!1})}catch(e){this.ra("Error initializing conversations",e),this.Xo=!1}}else nU.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),nU.info("Conversations loaded successfully")}catch(e){this.ra("Error completing conversations initialization",e)}else nU.error("Cannot complete initialization: remote config is null")}ra(e,t){nU.error(e,t),this._conversationsManager=null,this.Xo=!1}show(){this._conversationsManager?this._conversationsManager.show():nU.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Yo&&!A(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return v(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(nU.warn(nV),null)})()}getMessages(e,t){var i=this;return v(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(nU.warn(nV),null)})()}markAsRead(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(nU.warn(nV),null)})()}getTickets(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(nU.warn(nV),null)})()}requestRestoreLink(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(nU.warn(nV),null)})()}restoreFromToken(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(nU.warn(nV),null)})()}restoreFromUrlToken(){var e=this;return v(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(nU.warn(nV),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}ln(){var e;null==(e=this._conversationsManager)||e.setIdentity()}hn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=tv("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.ua=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!L(i)&&i&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.oa=0,this.aa=0,this.ua=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=null==d?void 0:d.__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.na=!0)}):this.Gt.error(is)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,i,s,r,n,a;if(this._instance.is_capturing())if(e&&e.body){var o=null!=(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)?t:3e3,l=null!=(s=null==(r=this._instance.config.logs)?void 0:r.maxLogsPerInterval)?s:1e3,u=Date.now();if(o>u-this.aa||(this.aa=u,this.oa=0,this.ua=!1),l>this.oa){this.oa++;var c=function(e,t){var{text:i,number:s}=eW[e.level||"info"]||eG,r=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 a=f({},n,e.attributes||{}),o={timeUnixNano:r,observedTimeUnixNano:r,severityNumber:s,severityText:i,body:{stringValue:e.body},attributes:eY(a)};return e.trace_id&&(o.traceId=e.trace_id),e.span_id&&(o.spanId=e.span_id),T(e.trace_flags)||(o.flags=e.trace_flags),o}(e,this.la());this.sa.push({record:c}),(null!=(n=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)?n:100)>this.sa.length?this.ha():this.flushLogs()}else this.ua||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+o+"ms"),this.ua=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),0!==this.sa.length){var t,i,s,r=this.sa;this.sa=[];var n=this._instance.config.logs,a=f({"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),o=(t=r.map(e=>e.record),i=p.LIB_NAME,s=p.LIB_VERSION,{resourceLogs:[{resource:{attributes:eY(a)},scopeLogs:[{scope:{name:i,version:s},logRecords:t}]}]}),l=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Bi({method:"POST",url:l,data:o,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.qr||(this.qr=setTimeout(()=>{this.qr=void 0,this.flushLogs()},null!=(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)?e:3e3))}la(){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!=d&&null!=(e=d.location)&&e.href&&(t.currentUrl=d.location.href),this._instance.featureFlags){var s=this._instance.featureFlags.getFlags();s&&s.length>0&&(t.activeFeatureFlags=s)}return t}}});rj.__defaultExtensionClasses=f({},nK);var nJ,nZ=(nJ=rF[rO]=new rj,function(){function e(){e.done||(e.done=!0,rA=!1,im(rF,function(e){e._dom_loaded()}))}null!=r&&r.addEventListener?"complete"===r.readyState?e():iS(r,"DOMContentLoaded",e,{capture:!1}):t&&tg.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nJ);e.s(["default",0,nZ])},54855,e=>{"use strict";var t=e.i(10907),i=e.i(44666),s=e.i(3572);e.s(["PostHogInit",0,function(){return(0,s.useEffect)(()=>{"rejected"!==localStorage.getItem("pc_cookie_notice_v1")&&i.default.init("phc_wxPrDsSLMw2Dyo9aeAvF5oNRvJ3isDCzvLyAiVVe4c4W",{api_host:t.default.env.NEXT_PUBLIC_POSTHOG_HOST??"https://us.i.posthog.com",capture_pageview:!0,respect_dnt:!0})},[]),null}])},8016,e=>{"use strict";var t=e.i(2452),i=e.i(3572),s=e.i(44666);e.s(["CookieNotice",0,function(){let[e,r]=(0,i.useState)(!1);return((0,i.useEffect)(()=>{let e=localStorage.getItem("pc_cookie_notice_v1");"dismissed"!==e&&"rejected"!==e&&r(!0)},[]),e)?(0,t.jsx)("div",{"data-testid":"cookie-notice",className:"fixed bottom-0 inset-x-0 z-50 bg-card border-t-2 border-foreground pb-[env(safe-area-inset-bottom)]",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-3 flex flex-col sm:flex-row sm:items-center gap-3",children:[(0,t.jsxs)("p",{className:"font-mono text-xs flex-1",children:["ðª We use cookies for analytics to learn what's working on this site, not to track you across the web."," ",(0,t.jsx)("a",{href:"/cookie-policy","data-testid":"cookie-notice-learn-more",children:"Learn more â"})]}),(0,t.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,t.jsx)("button",{className:"punk-button !bg-foreground","data-testid":"cookie-notice-reject",onClick:function(){localStorage.setItem("pc_cookie_notice_v1","rejected");try{s.default.opt_out_capturing(),s.default.reset()}catch{}r(!1)},children:"Reject"}),(0,t.jsx)("button",{className:"punk-button","data-testid":"cookie-notice-dismiss",onClick:function(){localStorage.setItem("pc_cookie_notice_v1","dismissed"),r(!1)},children:"Got it"})]})]})}):null}])}]);
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.